From 8548f1ee5f22b94ac0ae3094d8a66aa124e0b5b8 Mon Sep 17 00:00:00 2001 From: Neil Trodden Date: Sun, 6 Nov 2016 15:56:50 +0000 Subject: [PATCH 001/101] expose mock property --- velocity-animate/index.d.ts | 1 + velocity-animate/velocity-animate-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/velocity-animate/index.d.ts b/velocity-animate/index.d.ts index 5549b97e45..9fcdfd2bf4 100644 --- a/velocity-animate/index.d.ts +++ b/velocity-animate/index.d.ts @@ -79,6 +79,7 @@ declare namespace jquery.velocity { interface VelocityStatic { Sequences: any; + mock: any; animate(options: {elements: NodeListOf; properties: Properties; options: Options}): any; animate(elements: HTMLElement|NodeListOf, properties: Properties, options: Options): any; RegisterEffect(name: string, options: RegisterEffectOptions): VelocityStatic; diff --git a/velocity-animate/velocity-animate-tests.ts b/velocity-animate/velocity-animate-tests.ts index fcd31c1983..db92fb0b70 100644 --- a/velocity-animate/velocity-animate-tests.ts +++ b/velocity-animate/velocity-animate-tests.ts @@ -23,6 +23,7 @@ function basics_arguments() { $el.velocity({ top: 50 }, 1000, "swing"); $el.velocity({ top: 50 }, "swing"); $el.velocity({ top: 50 }, 1000, function() { alert("Hi"); }); + $.Velocity.mock = 1; $el.velocity({ properties: { opacity: 1 }, From 460a2e2103d7cb722d3c5c8f6778b0809a935ec0 Mon Sep 17 00:00:00 2001 From: Richard Rout Date: Thu, 24 Nov 2016 08:05:42 -0700 Subject: [PATCH 002/101] select2 templateSelection method signature A JQuery container is also passed in as the 2nd parameter. https://select2.github.io/options.html#templateSelection --- select2/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select2/index.d.ts b/select2/index.d.ts index ebab4086aa..2f6fea9063 100644 --- a/select2/index.d.ts +++ b/select2/index.d.ts @@ -76,7 +76,7 @@ interface Select2Options { /** * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML */ - templateSelection?: (object: Select2SelectionObject) => any; + templateSelection?: (object: Select2SelectionObject, container: JQuery) => any; templateResult?: (object: Select2SelectionObject) => any; language?: string | string[] | {}; selectOnClose?: boolean; From 16842558c2b62b48527ecccd1edc7642ff05f1ea Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 30 Nov 2016 11:30:45 +0000 Subject: [PATCH 003/101] base-64 typings --- base-64/index.d.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 base-64/index.d.ts diff --git a/base-64/index.d.ts b/base-64/index.d.ts new file mode 100644 index 0000000000..bd44e9239c --- /dev/null +++ b/base-64/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for base-64 0.1.0 +// Project: https://github.com/mathiasbynens/base64 +// Definitions by: Dolan Miu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'base-64' { +interface base64static { + /** + * A string representing the semantic version number. + */ + version: string; + + /** + * This function takes a byte string (the input parameter) and encodes it according to base64. + * The input data must be in the form of a string containing only characters + * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.encode() function is designed to be fully compatible + * with btoa() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa + */ + encode(input: string): string; + + /** + * This function takes a base64-encoded string (the input parameter) and decodes it. + * The return value is in the form of a string containing only characters in + * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.decode() function is designed to be fully compatible + * with atob() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob + */ + decode(input: string): string; +} + +var base64: base64static; + +export = base64; +} From 47623d23102c51f0b40caa6e0363bc1c8f61a89c Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 30 Nov 2016 11:50:58 +0000 Subject: [PATCH 004/101] formatting and indenting --- base-64/index.d.ts | 56 +++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/base-64/index.d.ts b/base-64/index.d.ts index bd44e9239c..5265a07594 100644 --- a/base-64/index.d.ts +++ b/base-64/index.d.ts @@ -4,34 +4,34 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'base-64' { -interface base64static { - /** - * A string representing the semantic version number. - */ - version: string; - - /** - * This function takes a byte string (the input parameter) and encodes it according to base64. - * The input data must be in the form of a string containing only characters - * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.encode() function is designed to be fully compatible - * with btoa() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa - */ - encode(input: string): string; - - /** - * This function takes a base64-encoded string (the input parameter) and decodes it. - * The return value is in the form of a string containing only characters in - * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.decode() function is designed to be fully compatible - * with atob() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob - */ - decode(input: string): string; -} + interface base64static { + /** + * A string representing the semantic version number. + */ + version: string; -var base64: base64static; + /** + * This function takes a byte string (the input parameter) and encodes it according to base64. + * The input data must be in the form of a string containing only characters + * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.encode() function is designed to be fully compatible + * with btoa() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa + */ + encode(input: string): string; -export = base64; + /** + * This function takes a base64-encoded string (the input parameter) and decodes it. + * The return value is in the form of a string containing only characters in + * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.decode() function is designed to be fully compatible + * with atob() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob + */ + decode(input: string): string; + } + + var base64: base64static; + + export = base64; } From 72e4a88a3dd7c8d810212ee2649b916cda3fce95 Mon Sep 17 00:00:00 2001 From: Diogo Franco Date: Mon, 21 Nov 2016 15:05:17 +0900 Subject: [PATCH 005/101] Webpack plugins are Tapable plugins --- webpack/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 468634d825..c10a4b2234 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -4,8 +4,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +/// import * as UglifyJS from 'uglify-js'; +import * as tapable from 'tapable'; declare namespace webpack { interface Configuration { @@ -345,7 +347,7 @@ declare namespace webpack { } type Rule = LoaderRule | UseRule | RulesRule | OneOfRule; - interface Plugin { } + interface Plugin extends tapable.Plugin {} interface Webpack { (config: Configuration, callback?: compiler.CompilerCallback): compiler.Compiler; From 1f921fb60c344809f31b6090e5cef2672559f58c Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 21 Nov 2016 15:26:04 +0900 Subject: [PATCH 006/101] Add missing types --- webpack/index.d.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index c10a4b2234..6de2ca7128 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -347,7 +347,9 @@ declare namespace webpack { } type Rule = LoaderRule | UseRule | RulesRule | OneOfRule; - interface Plugin extends tapable.Plugin {} + interface Plugin extends tapable.Plugin { + apply (thisArg: Webpack, ...args: any[]): void + } interface Webpack { (config: Configuration, callback?: compiler.CompilerCallback): compiler.Compiler; @@ -403,6 +405,11 @@ declare namespace webpack { * Adds SourceMaps for assets. */ SourceMapDevToolPlugin: SourceMapDevToolPluginStatic; + /** + * Adds SourceMaps for assets, but wrapped inside eval statements. + * Much faster incremental build speed, but harder to debug. + */ + EvalSourceMapDevToolPlugin: SourceMapDevToolPluginStatic; /** * Enables Hot Module Replacement. (This requires records data if not in dev-server mode, recordsPath) * Generates Hot Update Chunks of each chunk in the records. @@ -422,6 +429,11 @@ declare namespace webpack { * Does not watch specified files matching provided paths or RegExps. */ WatchIgnorePlugin: WatchIgnorePluginStatic; + /** + * Uses the module name as the module id inside the bundle, instead of a number. + * Helps with debugging, but increases bundle size. + */ + NamedModulesPlugin: NamedModulesPluginStatic; } interface Optimize { @@ -535,6 +547,10 @@ declare namespace webpack { new (paths: RegExp[]): Plugin; } + interface NamedModulesPluginStatic { + new (): Plugin; + } + namespace optimize { interface DedupePluginStatic { new (): Plugin; From 63e51c20e00e4c4505b9f38a96e84b8ab2d2afca Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 21 Nov 2016 15:26:12 +0900 Subject: [PATCH 007/101] Trim trailing whitespace --- webpack/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 6de2ca7128..a062cf15f2 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -247,7 +247,7 @@ declare namespace webpack { } type ConditionSpec = TestConditionSpec | OrConditionSpec | AndConditionSpec | NotConditionSpec; - interface ConditionArray extends Array {} + interface ConditionArray extends Array {} type Condition = string | RegExp | ((absPath: string) => boolean) | ConditionSpec | ConditionArray; interface OldLoader { @@ -260,26 +260,26 @@ declare namespace webpack { } type Loader = string | OldLoader | NewLoader; - /** + /** * There are direct and delegate rules. Direct Rules need a test, Delegate rules delegate to subrules bringing their own. * Direct rules can optionally contain delegate keys (oneOf, rules). - * + * * These types exist to enforce that a rule has the keys `((loader XOR loaders) AND test) OR oneOf OR rules` */ interface BaseRule { /** * Specifies the category of the loader. No value means normal loader. - * + * * There is also an additional category "inlined loader" which are loaders applied inline of the import/require. - * + * * All loaders are sorted in the order post, inline, normal, pre and used in this order. - * + * * All normal loaders can be omitted (overridden) by prefixing ! in the request. - * + * * All normal and pre loaders can be omitted (overridden) by prefixing -! in the request. - * + * * All normal, post and pre loaders can be omitted (overridden) by prefixing !! in the request. - * + * * Inline loaders and ! prefixes should not be used as they are non-standard. They may be use by loader generated code. */ enforce?: 'pre' | 'post'; @@ -295,7 +295,7 @@ declare namespace webpack { issuer?: Condition | Condition[]; /** * An object with parser options. All applied parser options are merged. - * + * * For each different parser options object a new parser is created and plugins can apply plugins depending on the parser options. Many of the default plugins apply their parser plugins only if a property in the parser options is not set or true. */ parser?: { [optName: string]: any }; @@ -336,7 +336,7 @@ declare namespace webpack { use: Loader | Loader[]; } type UseRule = OldUseRule | NewUseRule; - + // Delegate Rules interface RulesRule extends BaseRule { /** An array of Rules that is also used when the Rule matches. */ From 0d539ec56f10bb091593b14f7f610cc58c736b70 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 21 Nov 2016 15:38:40 +0900 Subject: [PATCH 008/101] More accurate {Eval,}SourceMapDevToolPluginStatic definitions --- webpack/index.d.ts | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index a062cf15f2..b366fc1647 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -409,7 +409,7 @@ declare namespace webpack { * Adds SourceMaps for assets, but wrapped inside eval statements. * Much faster incremental build speed, but harder to debug. */ - EvalSourceMapDevToolPlugin: SourceMapDevToolPluginStatic; + EvalSourceMapDevToolPlugin: EvalSourceMapDevToolPluginStatic; /** * Enables Hot Module Replacement. (This requires records data if not in dev-server mode, recordsPath) * Generates Hot Update Chunks of each chunk in the records. @@ -528,7 +528,31 @@ declare namespace webpack { } interface SourceMapDevToolPluginStatic { - new (options: any): Plugin; + new (options?: string | false | null | { + filename?: string | false | null, + append?: false | string, + moduleFilenameTemplate?: string, + fallbackModuleFilenameTemplate?: string, + test?: RegExp, + noSources?: boolean, + module?: boolean, + lineToLine?: boolean | { + test?: Condition | Condition[], + include?: Condition | Condition[], + exclude?: Condition | Condition[] + } + }): Plugin; + } + + interface EvalSourceMapDevToolPluginStatic { + new (options?: { + module?: boolean, + lineToLine?: boolean | { + test?: Condition | Condition[], + include?: Condition | Condition[], + exclude?: Condition | Condition[] + } + }): Plugin; } interface HotModuleReplacementPluginStatic { From 952199d4db91b186017d24fc5188857894baaeb7 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 21 Nov 2016 15:42:15 +0900 Subject: [PATCH 009/101] Simplify plugins declaration (all functions can apply) --- webpack/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index b366fc1647..7dd58de9aa 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -63,7 +63,7 @@ declare namespace webpack { /** Store compiler state to a json file. */ recordsOutputPath?: string; /** Add additional plugins to the compiler. */ - plugins?: (Plugin | Function)[]; + plugins?: Plugin[]; /** Stats options for logging */ stats?: compiler.StatsToStringOptions; } From 290d0984f84cb695f01d955db96464713bce5078 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 21 Nov 2016 17:23:37 +0900 Subject: [PATCH 010/101] Improve tests and documentation --- webpack/index.d.ts | 68 +++++++++++++++++++++++++++------------- webpack/webpack-tests.ts | 20 ++++++------ 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 7dd58de9aa..1528a00279 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -528,31 +528,55 @@ declare namespace webpack { } interface SourceMapDevToolPluginStatic { - new (options?: string | false | null | { - filename?: string | false | null, - append?: false | string, - moduleFilenameTemplate?: string, - fallbackModuleFilenameTemplate?: string, - test?: RegExp, - noSources?: boolean, - module?: boolean, - lineToLine?: boolean | { - test?: Condition | Condition[], - include?: Condition | Condition[], - exclude?: Condition | Condition[] - } - }): Plugin; + new (options?: SourceMapDevToolPluginOptions): Plugin; + } + + // if string | false | null, maps to the filename option + type SourceMapDevToolPluginOptions = string | false | null | { + // output filename pattern (false/null to append) + filename?: string | false | null, + // source map comment pattern (false to not append) + append?: false | string, + // template for the module filename inside the source map + moduleFilenameTemplate?: string, + // fallback used when the moduleFilenameTemplate produces a collision + fallbackModuleFilenameTemplate?: string, + // test/include/exclude files + test?: Condition | Condition[], + include?: Condition | Condition[], + exclude?: Condition | Condition[] + // whether to include the footer comment with source information + noSources?: boolean, + // the source map sourceRoot ("The URL root from which all sources are relative.") + sourceRoot?: string | null, + // whether to generate per-module source map + module?: boolean, + // whether to include column information in the source map + columns?: boolean, + // whether to preserve line numbers between source and source map + lineToLine?: boolean | { + test?: Condition | Condition[], + include?: Condition | Condition[], + exclude?: Condition | Condition[] + } } interface EvalSourceMapDevToolPluginStatic { - new (options?: { - module?: boolean, - lineToLine?: boolean | { - test?: Condition | Condition[], - include?: Condition | Condition[], - exclude?: Condition | Condition[] - } - }): Plugin; + new (options?: EvalSourceMapDevToolPluginOptions): Plugin; + } + + // if string | false, maps to the append option + type EvalSourceMapDevToolPluginOptions = string | false | { + append?: false | string, + moduleFilenameTemplate?: string, + sourceRoot?: string, + module?: boolean, + columns?: boolean, + lineToLine?: boolean | { + test?: Condition | Condition[], + include?: Condition | Condition[], + exclude?: Condition | Condition[] + } } interface HotModuleReplacementPluginStatic { diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index e51a539b24..da3cbf2ced 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -341,23 +341,25 @@ plugin = new webpack.ProvidePlugin({ }); plugin = new webpack.SourceMapDevToolPlugin({ //// asset matching - //test: string | RegExp | Array, - //include: string | RegExp | Array, - //exclude: string | RegExp | Array, + test: /\.js$/, + //include: Condition | Condition[], + exclude: [ + /node_modules/ + ], // //// file and reference - //filename: string, - //append: bool | string, - // + filename: null, // | string + //append: false | string, //// sources naming //moduleFilenameTemplate: string, //fallbackModuleFilenameTemplate: string, // //// quality/performance - //module: bool, - //columns: bool, - //lineToLine: bool | object + module: true, + columns: true, + lineToLine: false // | { test?: Condition | Condition[], ... } }); +plugin = new webpack.EvalSourceMapDevToolPlugin(false); plugin = new webpack.HotModuleReplacementPlugin(); plugin = new webpack.ExtendedAPIPlugin(); plugin = new webpack.NoErrorsPlugin(); From 404687e0b75db1ae3dfb294dedc256f956cb38b7 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Mon, 21 Nov 2016 17:24:07 +0900 Subject: [PATCH 011/101] Give more specific definition to DefinePlugin and ProvidePlugin --- webpack/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 1528a00279..ba0fb9cfc4 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -520,11 +520,11 @@ declare namespace webpack { } interface DefinePluginStatic { - new (definitions: any): Plugin; + new (definitions: {[key: string]: any}): Plugin; } interface ProvidePluginStatic { - new (definitions: any): Plugin; + new (definitions: {[key: string]: any}): Plugin; } interface SourceMapDevToolPluginStatic { From a4418754d29d73b59612c67e32b924ce0dcddcdc Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Tue, 22 Nov 2016 09:40:53 +0900 Subject: [PATCH 012/101] Use interface instead of object type alias --- webpack/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index ba0fb9cfc4..8928cf6c29 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -528,11 +528,11 @@ declare namespace webpack { } interface SourceMapDevToolPluginStatic { - new (options?: SourceMapDevToolPluginOptions): Plugin; + // if string | false | null, maps to the filename option + new (options?: string | false | null | SourceMapDevToolPluginOptions): Plugin; } - // if string | false | null, maps to the filename option - type SourceMapDevToolPluginOptions = string | false | null | { + interface SourceMapDevToolPluginOptions { // output filename pattern (false/null to append) filename?: string | false | null, // source map comment pattern (false to not append) @@ -562,11 +562,11 @@ declare namespace webpack { } interface EvalSourceMapDevToolPluginStatic { - new (options?: EvalSourceMapDevToolPluginOptions): Plugin; + // if string | false, maps to the append option + new (options?: string | false | EvalSourceMapDevToolPluginOptions): Plugin; } - // if string | false, maps to the append option - type EvalSourceMapDevToolPluginOptions = string | false | { + interface EvalSourceMapDevToolPluginOptions { append?: false | string, moduleFilenameTemplate?: string, sourceRoot?: string, From b1b7a21628d009afa928f88e64559699bcf35f3f Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Thu, 1 Dec 2016 11:18:04 +0900 Subject: [PATCH 013/101] Add webpack 2 resolve options --- webpack/index.d.ts | 133 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 126 insertions(+), 7 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 8928cf6c29..de9e2c89a2 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for webpack 2.0.0 +// Type definitions for webpack 2.1 // Project: https://github.com/webpack/webpack // Definitions by: Qubo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -155,23 +155,115 @@ declare namespace webpack { } type Module = OldModule | NewModule; - interface Resolve { + interface NewResolve { + /** + * A list of directories to resolve modules from. + * + * Absolute paths will be searched once. + * + * If an entry is relative, will be resolved using node's resolution algorithm + * relative to the requested file. + * + * Defaults to `["node_modules"]` + */ + modules?: string[]; + + /** + * A list of package description files to search for. + * + * Defaults to `["package.json"]` + */ + descriptionFiles?: string[]; + + /** + * A list of fields in a package description object to use for finding + * the entry point. + * + * Defaults to `["browser", "module", "main"]` or `["module", "main"]`, + * depending on the value of the `target` `Configuration` value. + */ + mainFields?: string[]; + + /** + * A list of fields in a package description object to try to parse + * in the same format as the `alias` resolve option. + * + * Defaults to `["browser"]` or `[]`, depending on the value of the + * `target` `Configuration` value. + * + * @see alias + */ + aliasFields?: string[]; + + /** + * A list of file names to search for when requiring directories that + * don't contain a package description file. + * + * Defaults to `["index"]`. + */ + mainFiles?: string[]; + + /** + * A list of file extensions to try when requesting files. + * + * An empty string is considered invalid. + */ + extensions?: string[]; + + /** + * If true, requires that all requested paths must use an extension + * from `extensions`. + */ + enforceExtension?: boolean; + + /** + * Replace the given module requests with other modules or paths. + * + * @see aliasFields + */ + alias?: { [key: string]: string; }; + + /** + * Whether to use a cache for resolving, or the specific object + * to use for caching. Sharing objects may be useful when running + * multiple webpack compilers. + * + * Defaults to `true`. + */ + unsafeCache?: {} | boolean; + + /** + * A function used to decide whether to cache the given resolve request. + * + * Defaults to `() => true`. + */ + cachePredicate?: (data: { path: string, request: string }) => boolean; + } + + interface OldResolve { /** Replace modules by other modules or paths. */ alias?: { [key: string]: string; }; /** * The directory (absolute path) that contains your modules. * May also be an array of directories. - * This setting should be used to add individual directories to the search path. */ + * This setting should be used to add individual directories to the search path. + * + * @deprecated Replaced by `modules` in webpack 2. + */ root?: string | string[]; /** * An array of directory names to be resolved to the current directory as well as its ancestors, and searched for modules. * This functions similarly to how node finds “node_modules” directories. * For example, if the value is ["mydir"], webpack will look in “./mydir”, “../mydir”, “../../mydir”, etc. + * + * @deprecated Replaced by `modules` in webpack 2. */ modulesDirectories?: string[]; /** * A directory (or array of directories absolute paths), * in which webpack should look for modules that weren’t found in resolve.root or resolve.modulesDirectories. + * + * @deprecated Replaced by `modules` in webpack 2. */ fallback?: string | string[]; /** @@ -179,23 +271,50 @@ declare namespace webpack { * For example, in order to discover CoffeeScript files, your array should contain the string ".coffee". */ extensions?: string[]; - /** Check these fields in the package.json for suitable files. */ + /** + * Check these fields in the package.json for suitable files. + * + * @deprecated Replaced by `mainFields` in webpack 2. + */ packageMains?: (string | string[])[]; - /** Check this field in the package.json for an object. Key-value-pairs are threaded as aliasing according to this spec */ + + /** + * Check this field in the package.json for an object. Key-value-pairs are threaded as aliasing according to this spec + * + * @deprecated Replaced by `aliasFields` in webpack 2. + */ packageAlias?: (string | string[])[]; + /** * Enable aggressive but unsafe caching for the resolving of a part of your files. * Changes to cached paths may cause failure (in rare cases). An array of RegExps, only a RegExp or true (all files) is expected. * If the resolved path matches, it’ll be cached. + * + * @deprecated Split into `unsafeCache` and `cachePredicate` in webpack 2. */ unsafeCache?: RegExp | RegExp[] | boolean; } - interface ResolveLoader extends Resolve { - /** It describes alternatives for the module name that are tried. */ + type Resolve = OldResolve | NewResolve; + + interface OldResolveLoader extends OldResolve { + /** It describes alternatives for the module name that are tried. + * @deprecated Replaced by `moduleExtensions` in webpack 2. + */ moduleTemplates?: string[]; } + interface NewResolveLoader extends NewResolve { + /** + * List of strings to append to a loader's name when trying to resolve it. + */ + moduleExtensions?: string[]; + + enforceModuleExtension?: boolean; + } + + type ResolveLoader = OldResolveLoader | NewResolveLoader; + type ExternalsElement = string | RegExp | ExternalsObjectElement | ExternalsFunctionElement; interface ExternalsObjectElement { From 8657cad7f2b354d03ec4bdc52f1539b12d7a0018 Mon Sep 17 00:00:00 2001 From: "Diogo Franco (Kovensky)" Date: Thu, 1 Dec 2016 11:50:28 +0900 Subject: [PATCH 014/101] Add test --- webpack/webpack-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index da3cbf2ced..770f96aec7 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -482,3 +482,7 @@ configuration = { ] } } + +const resolve: webpack.Resolve = { + cachePredicate: 'boo' // why does this test _not_ fail!? +} From f2731469da8e84f964dc335ab56c8f8ff7175049 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Fri, 2 Dec 2016 15:07:56 +0800 Subject: [PATCH 015/101] feat: add typings for watchpack --- watchpack/DirectoryWatcher.d.ts | 59 +++++++++++++++++++++++++++++++++ watchpack/Watcher.d.ts | 18 ++++++++++ watchpack/index.d.ts | 54 ++++++++++++++++++++++++++++++ watchpack/tsconfig.json | 21 ++++++++++++ watchpack/tslint.json | 1 + watchpack/watchpack-tests.ts | 7 ++++ 6 files changed, 160 insertions(+) create mode 100644 watchpack/DirectoryWatcher.d.ts create mode 100644 watchpack/Watcher.d.ts create mode 100644 watchpack/index.d.ts create mode 100644 watchpack/tsconfig.json create mode 100644 watchpack/tslint.json create mode 100644 watchpack/watchpack-tests.ts diff --git a/watchpack/DirectoryWatcher.d.ts b/watchpack/DirectoryWatcher.d.ts new file mode 100644 index 0000000000..0fac7ebeff --- /dev/null +++ b/watchpack/DirectoryWatcher.d.ts @@ -0,0 +1,59 @@ +/// +/// +import { EventEmitter } from 'events'; +import fs = require('graceful-fs'); +import Watcher = require('./Watcher'); +import Watchpack = require('watchpack'); + +declare class DirectoryWatcher extends EventEmitter { + options: Watchpack.WatcherOptions; + directories: { + [path: string]: Watcher | true; + }; + files: { + [path: string]: [number, number]; + }; + initialScan: boolean; + initialScanRemoved: string[]; + nestedWatching: boolean; + path: string; + refs: number; + watcher: fs.FSWatcher; + watchers: { + [path: string]: Watcher[]; + }; + + constructor(directoryPath: string, options: Watchpack.WatcherOptions); + + setFileTime(filePath: string, mtime: number, initial: boolean, type?: string | boolean): void; + + setDirectory(directoryPath: string, exist: boolean, initial: boolean): void; + + createNestedWatcher(directoryPath: string): void; + + setNestedWatching(flag: boolean): void; + + watch(filePath: string, startTime: number): Watcher; + + onFileAdded(filePath: string, stat: fs.Stats): void; + + onDirectoryAdded(directoryPath: string): void; + + onChange(filePath: string, stat: fs.Stats): void; + + onFileUnlinked(filePath: string): void; + + onDirectoryUnlinked(directoryPath: string): void; + + onWatcherError(): void; + + doInitialScan(): void; + + getTimes(): { + [path: string]: number; + }; + + close(): void; +} + +export = DirectoryWatcher; diff --git a/watchpack/Watcher.d.ts b/watchpack/Watcher.d.ts new file mode 100644 index 0000000000..041b693da8 --- /dev/null +++ b/watchpack/Watcher.d.ts @@ -0,0 +1,18 @@ +/// +import { EventEmitter } from 'events'; +import DirectoryWatcher = require('./DirectoryWatcher'); + +declare class Watcher extends EventEmitter { + data: number; + directoryWatcher: DirectoryWatcher; + path: string; + startTime: number; + + constructor(directoryWatcher: DirectoryWatcher, filePath: string, startTime: number); + + checkStartTime(mtime: number, initial: boolean): boolean; + + close(): void; +} + +export = Watcher; diff --git a/watchpack/index.d.ts b/watchpack/index.d.ts new file mode 100644 index 0000000000..9a987be3da --- /dev/null +++ b/watchpack/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for watchpack 1.1 +// Project: https://github.com/webpack/watchpack +// Definitions by: e-cloud +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; +import Watcher = require('./Watcher'); + +declare class Watchpack extends EventEmitter { + aggregatedChanges: string[]; + aggregateTimeout: NodeJS.Timer; + dirWatchers: Watcher[]; + fileWatchers: Watcher[]; + mtimes: { + [path: string]: number; + }; + options: Watchpack.WatchOptions; + paused: boolean; + watcherOptions: Watchpack.WatcherOptions; + + constructor(options: Watchpack.WatchOptions); + + watch(files: string[], directories: string[], startTime: number): void; + + close(): void; + + pause(): void; + + getTimes(): { + [path: string]: number; + }; + + _fileWatcher(file: string, watcher: Watcher): Watcher; + + _dirWatcher(item: string, watcher: Watcher): Watcher; + + _onChange(item: string, mtime: number, file?: string): void; + + _onTimeout(): void; +} + +declare namespace Watchpack { + interface WatcherOptions { + ignored?: string[] | string | RegExp | ((path: string) => boolean); + poll?: boolean | number; + } + interface WatchOptions extends WatcherOptions { + aggregateTimeout?: number; + } +} + +export = Watchpack; diff --git a/watchpack/tsconfig.json b/watchpack/tsconfig.json new file mode 100644 index 0000000000..d492948f55 --- /dev/null +++ b/watchpack/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "DirectoryWatcher.d.ts", + "Watcher.d.ts", + "watchpack-tests.ts" + ] +} diff --git a/watchpack/tslint.json b/watchpack/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/watchpack/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/watchpack/watchpack-tests.ts b/watchpack/watchpack-tests.ts new file mode 100644 index 0000000000..77b78d8c23 --- /dev/null +++ b/watchpack/watchpack-tests.ts @@ -0,0 +1,7 @@ +import Watchpack = require('watchpack'); +const watch = new Watchpack({}); + +watch.watch(['test.js'], ['lib/'], 1000); + +let time: number +time = watch.getTimes()['test.js'] From 0cfe2d6234f9760d6fe303cb4efa28d2547c8329 Mon Sep 17 00:00:00 2001 From: David Deutsch Date: Fri, 2 Dec 2016 15:11:09 -0500 Subject: [PATCH 016/101] Moving lodash-3.10 to legacy directory --- lodash/{ => legacy}/lodash-3.10-tests.ts | 0 lodash/{ => legacy}/lodash-3.10.d.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename lodash/{ => legacy}/lodash-3.10-tests.ts (100%) rename lodash/{ => legacy}/lodash-3.10.d.ts (100%) diff --git a/lodash/lodash-3.10-tests.ts b/lodash/legacy/lodash-3.10-tests.ts similarity index 100% rename from lodash/lodash-3.10-tests.ts rename to lodash/legacy/lodash-3.10-tests.ts diff --git a/lodash/lodash-3.10.d.ts b/lodash/legacy/lodash-3.10.d.ts similarity index 100% rename from lodash/lodash-3.10.d.ts rename to lodash/legacy/lodash-3.10.d.ts From f9387518fad9906cf2ec0c0ff67408317a4aca0e Mon Sep 17 00:00:00 2001 From: e-cloud Date: Sat, 3 Dec 2016 16:01:09 +0800 Subject: [PATCH 017/101] fix: improve missing typings --- loader-runner/index.d.ts | 49 ++++++++++++++++++++++++---- loader-runner/loader-runner-tests.ts | 15 +++++++-- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/loader-runner/index.d.ts b/loader-runner/index.d.ts index f0b34ec600..826fcdcb2a 100644 --- a/loader-runner/index.d.ts +++ b/loader-runner/index.d.ts @@ -10,26 +10,63 @@ export interface Loader { query: string; request: string; options: any; - normal: any; - pitch: any; + normal: null | ((request: string) => string); + pitch: null | ((request: string) => string); raw: string; data: any; pitchExecuted: boolean; normalExecuted: boolean; } -export function getContext(resource: string): string; - export interface RunLoaderOption { resource: string; loaders: any[]; context: any; - readResource: (filename: string, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void) => void; + readResource: ( + filename: string, + callback: (err: NodeJS.ErrnoException | null, data: Buffer | null) => void + ) => void; } +export interface RunLoaderResult { + result?: (Buffer | null)[]; + resourceBuffer?: Buffer | null; + cacheable: boolean; + fileDependencies: string[]; + contextDependencies: string[]; +} + +export interface ExtendedLoaderContext { + context: string | null; + loaderIndex: number; + loaders: Loader[]; + resourcePath: string | undefined; + resourceQuery: string | undefined; + async: (() => (() => void) | undefined) | null; + callback: (() => void) | null; + cacheable: (flag: boolean) => void; + dependency: (file: string) => void; + addDependency: (file: string) => void; + addContextDependency: (context: string) => void; + getDependencies: () => string[]; + getContextDependencies: () => string[]; + clearDependencies: () => void; + resource: string; + request: string; + remainingRequest: string; + currentRequest: string; + previousRequest: string; + query: { + [key: string]: any; + } | string; + data: any; +} + +export function getContext(resource: string): string; + export function runLoaders( options: RunLoaderOption, - callback: (err: NodeJS.ErrnoException | null, result: any) => any + callback: (err: NodeJS.ErrnoException | null, result: RunLoaderResult) => any ): void; diff --git a/loader-runner/loader-runner-tests.ts b/loader-runner/loader-runner-tests.ts index 38661b60ec..3157b44aa2 100644 --- a/loader-runner/loader-runner-tests.ts +++ b/loader-runner/loader-runner-tests.ts @@ -1,10 +1,19 @@ -import { runLoaders, getContext, Loader, RunLoaderOption } from 'loader-runner'; +import { runLoaders, getContext } from 'loader-runner'; -const option = {} as RunLoaderOption; +const option = { + resource: 'test.js', + loaders: [{ + request: 'test.js' + }], + context: './lib/', + readResource: function () { + } +}; runLoaders(option, function (err, result) { - if(err) + if (err) { console.log(err, result); + } }); getContext('sdlfkjaldfjiojsdf'); From 5c2bd14949fff5dbefa43375a8df74b8afb86868 Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Mon, 5 Dec 2016 14:49:36 +0100 Subject: [PATCH 018/101] Redefine `TerminalModes` index type property to `number|undefined` --- ssh2/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh2/index.d.ts b/ssh2/index.d.ts index 72b6200f21..c8df971ce8 100644 --- a/ssh2/index.d.ts +++ b/ssh2/index.d.ts @@ -1087,7 +1087,7 @@ export interface PseudoTtyInfo { } export interface TerminalModes { - [mode: string]: number; + [mode: string]: number|undefined; /** Interrupt character; `255` if none. Not all of these characters are supported on all systems. */ VINTR?: number; /** The quit character (sends `SIGQUIT` signal on POSIX systems). */ @@ -1555,4 +1555,4 @@ export interface SFTPWrapper extends events.EventEmitter { on(event: "continue", listener: () => void): this; on(event: string | symbol, listener: Function): this; -} \ No newline at end of file +} From 5c4462fc362a04452924395110b8a726bd657386 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 5 Dec 2016 10:49:08 -0800 Subject: [PATCH 019/101] Remove unnecessary import --- angular-ui-router-default/angular-ui-router-default-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/angular-ui-router-default/angular-ui-router-default-tests.ts b/angular-ui-router-default/angular-ui-router-default-tests.ts index 95229f68cd..39e792e3a1 100644 --- a/angular-ui-router-default/angular-ui-router-default-tests.ts +++ b/angular-ui-router-default/angular-ui-router-default-tests.ts @@ -1,11 +1,10 @@ import * as angular from "angular"; -import { ui } from "angular"; angular.module("test", [ "ui.router", "ui.router.default" ]) - .config(function($stateProvider: ui.IStateProvider) { + .config(function($stateProvider: angular.ui.IStateProvider) { $stateProvider .state('concrete', { // no abstract or default From beb8ed8d531f478a7d8d841884c6998ee1b61462 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Dec 2016 16:28:47 +0000 Subject: [PATCH 020/101] added tsconfig and tslint --- base-64/tsconfig.json | 18 ++++++++++++++++++ base-64/tslint.json | 1 + 2 files changed, 19 insertions(+) create mode 100644 base-64/tsconfig.json create mode 100644 base-64/tslint.json diff --git a/base-64/tsconfig.json b/base-64/tsconfig.json new file mode 100644 index 0000000000..0f2be78cfb --- /dev/null +++ b/base-64/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} \ No newline at end of file diff --git a/base-64/tslint.json b/base-64/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/base-64/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 100752ac635f3e1ccb74d7dd3b8fc8af23bca81d Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Dec 2016 16:43:14 +0000 Subject: [PATCH 021/101] removed patch number --- base-64/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-64/index.d.ts b/base-64/index.d.ts index 5265a07594..17537ac371 100644 --- a/base-64/index.d.ts +++ b/base-64/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for base-64 0.1.0 +// Type definitions for base-64 0.1 // Project: https://github.com/mathiasbynens/base64 // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 11e3fea84f703087d4cb99dd665c9e70cc7e2798 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Dec 2016 16:45:25 +0000 Subject: [PATCH 022/101] added tests --- base-64/base-64-tests.ts | 11 +++++++++++ base-64/tsconfig.json | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 base-64/base-64-tests.ts diff --git a/base-64/base-64-tests.ts b/base-64/base-64-tests.ts new file mode 100644 index 0000000000..0f33ff9700 --- /dev/null +++ b/base-64/base-64-tests.ts @@ -0,0 +1,11 @@ +import * as base64 from 'base-64'; +import * as utf8 from 'utf8'; + +let text = 'foo © bar 𝌆 baz'; +let bytes = utf8.encode(text); +let encoded = base64.encode(bytes); +// → 'Zm9vIMKpIGJhciDwnYyGIGJheg==' + +encoded = 'Zm9vIMKpIGJhciDwnYyGIGJheg=='; +bytes = base64.decode(encoded); +text = utf8.decode(bytes); diff --git a/base-64/tsconfig.json b/base-64/tsconfig.json index 0f2be78cfb..e12b07da98 100644 --- a/base-64/tsconfig.json +++ b/base-64/tsconfig.json @@ -13,6 +13,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "base-64-tests.ts" ] } \ No newline at end of file From 0925cd553519072d6d1124ce96043feffba5de87 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Dec 2016 16:53:12 +0000 Subject: [PATCH 023/101] made it export like base64-js --- base-64/base-64-tests.ts | 2 ++ base-64/index.d.ts | 55 ++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 27 deletions(-) diff --git a/base-64/base-64-tests.ts b/base-64/base-64-tests.ts index 0f33ff9700..a0f85f09aa 100644 --- a/base-64/base-64-tests.ts +++ b/base-64/base-64-tests.ts @@ -9,3 +9,5 @@ let encoded = base64.encode(bytes); encoded = 'Zm9vIMKpIGJhciDwnYyGIGJheg=='; bytes = base64.decode(encoded); text = utf8.decode(bytes); + +let version = base64.version; diff --git a/base-64/index.d.ts b/base-64/index.d.ts index 17537ac371..ba72735406 100644 --- a/base-64/index.d.ts +++ b/base-64/index.d.ts @@ -3,35 +3,36 @@ // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module 'base-64' { - interface base64static { - /** - * A string representing the semantic version number. - */ - version: string; +export interface base64static { + /** + * A string representing the semantic version number. + */ + version: string; - /** - * This function takes a byte string (the input parameter) and encodes it according to base64. - * The input data must be in the form of a string containing only characters - * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.encode() function is designed to be fully compatible - * with btoa() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa - */ - encode(input: string): string; - /** - * This function takes a base64-encoded string (the input parameter) and decodes it. - * The return value is in the form of a string containing only characters in - * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.decode() function is designed to be fully compatible - * with atob() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob - */ - decode(input: string): string; - } + encode(input: string): string; - var base64: base64static; - export = base64; + decode(input: string): string; } + +export const version: string; + + /** + * This function takes a byte string (the input parameter) and encodes it according to base64. + * The input data must be in the form of a string containing only characters + * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.encode() function is designed to be fully compatible + * with btoa() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa + */ +export function encode(input: string): string; + /** + * This function takes a base64-encoded string (the input parameter) and decodes it. + * The return value is in the form of a string containing only characters in + * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.decode() function is designed to be fully compatible + * with atob() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob + */ +export function decode(input: string): string; \ No newline at end of file From 90147825b9c2d0782c42b2e40e6802d456ef6827 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Dec 2016 16:53:35 +0000 Subject: [PATCH 024/101] removed old code --- base-64/index.d.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/base-64/index.d.ts b/base-64/index.d.ts index ba72735406..d78ef47761 100644 --- a/base-64/index.d.ts +++ b/base-64/index.d.ts @@ -3,19 +3,6 @@ // Definitions by: Dolan Miu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export interface base64static { - /** - * A string representing the semantic version number. - */ - version: string; - - - encode(input: string): string; - - - decode(input: string): string; -} - export const version: string; /** From cd60261ec8791a6e89c3054099ab58f054f87dcb Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 6 Dec 2016 16:53:49 +0000 Subject: [PATCH 025/101] formatted code --- base-64/index.d.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/base-64/index.d.ts b/base-64/index.d.ts index d78ef47761..3d6fd885d2 100644 --- a/base-64/index.d.ts +++ b/base-64/index.d.ts @@ -5,21 +5,21 @@ export const version: string; - /** - * This function takes a byte string (the input parameter) and encodes it according to base64. - * The input data must be in the form of a string containing only characters - * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.encode() function is designed to be fully compatible - * with btoa() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa - */ +/** + * This function takes a byte string (the input parameter) and encodes it according to base64. + * The input data must be in the form of a string containing only characters + * in the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.encode() function is designed to be fully compatible + * with btoa() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-btoa + */ export function encode(input: string): string; - /** - * This function takes a base64-encoded string (the input parameter) and decodes it. - * The return value is in the form of a string containing only characters in - * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. - * The base64.decode() function is designed to be fully compatible - * with atob() as described in the HTML Standard. - * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob - */ +/** + * This function takes a base64-encoded string (the input parameter) and decodes it. + * The return value is in the form of a string containing only characters in + * the range from U+0000 to U+00FF, each representing a binary byte with values 0x00 to 0xFF. + * The base64.decode() function is designed to be fully compatible + * with atob() as described in the HTML Standard. + * see: https://html.spec.whatwg.org/multipage/webappapis.html#dom-windowbase64-atob + */ export function decode(input: string): string; \ No newline at end of file From 9b367091bda0ed1302f8684c5911fa2777e0adf5 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Fri, 2 Dec 2016 11:36:32 +0800 Subject: [PATCH 026/101] fix: add files field in tsconfig.json for expected publishment --- enhanced-resolve/tsconfig.json | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/enhanced-resolve/tsconfig.json b/enhanced-resolve/tsconfig.json index 96a70f3bf2..ffa80fe4b2 100644 --- a/enhanced-resolve/tsconfig.json +++ b/enhanced-resolve/tsconfig.json @@ -12,9 +12,41 @@ "noEmit": true, "forceConsistentCasingInFileNames": true }, - "include": [ + "files": [ "index.d.ts", "enhanced-resolve-tests.ts", - "lib/*.ts" + "./lib/AliasFieldPlugin.d.ts", + "./lib/AliasPlugin.d.ts", + "./lib/AppendPlugin.d.ts", + "./lib/CloneBasenamePlugin.d.ts", + "./lib/common-types.d.ts", + "./lib/concord.d.ts", + "./lib/ConcordExtensionsPlugin.d.ts", + "./lib/ConcordMainPlugin.d.ts", + "./lib/ConcordModulesPlugin.d.ts", + "./lib/DescriptionFilePlugin.d.ts", + "./lib/DescriptionFileUtils.d.ts", + "./lib/DirectoryExistsPlugin.d.ts", + "./lib/FileExistsPlugin.d.ts", + "./lib/FileKindPlugin.d.ts", + "./lib/getPaths.d.ts", + "./lib/globToRegExp.d.ts", + "./lib/JoinRequestPlugin.d.ts", + "./lib/lib-tests.ts", + "./lib/LogInfoPlugin.d.ts", + "./lib/MainFieldPlugin.d.ts", + "./lib/ModuleAppendPlugin.d.ts", + "./lib/ModuleKindPlugin.d.ts", + "./lib/ModulesInHierachicDirectoriesPlugin.d.ts", + "./lib/ModulesInRootPlugin.d.ts", + "./lib/NextPlugin.d.ts", + "./lib/ParsePlugin.d.ts", + "./lib/Resolver.d.ts", + "./lib/ResultPlugin.d.ts", + "./lib/Storage.d.ts", + "./lib/SymlinkPlugin.d.ts", + "./lib/TryNextPlugin.d.ts", + "./lib/UnsafeCachePlugin.d.ts", + "./lib/UseFilePlugin.d.ts" ] } From 9e6214dde6cd92a31c7f96f5a18dc056542cdf7e Mon Sep 17 00:00:00 2001 From: e-cloud Date: Sun, 4 Dec 2016 17:43:12 +0800 Subject: [PATCH 027/101] fix: improve most missing typings --- enhanced-resolve/enhanced-resolve-tests.ts | 7 +- enhanced-resolve/index.d.ts | 138 +++++++++++------- enhanced-resolve/lib/AliasFieldPlugin.d.ts | 2 +- enhanced-resolve/lib/AliasPlugin.d.ts | 10 +- enhanced-resolve/lib/AppendPlugin.d.ts | 2 +- .../lib/ConcordExtensionsPlugin.d.ts | 6 +- enhanced-resolve/lib/ConcordMainPlugin.d.ts | 6 +- .../lib/ConcordModulesPlugin.d.ts | 6 +- .../lib/DescriptionFilePlugin.d.ts | 4 +- .../lib/DescriptionFileUtils.d.ts | 22 ++- .../ModulesInHierachicDirectoriesPlugin.d.ts | 2 +- enhanced-resolve/lib/ModulesInRootPlugin.d.ts | 2 +- enhanced-resolve/lib/Resolver.d.ts | 20 ++- enhanced-resolve/lib/Storage.d.ts | 9 +- enhanced-resolve/lib/UnsafeCachePlugin.d.ts | 13 +- enhanced-resolve/lib/common-types.d.ts | 59 ++++---- enhanced-resolve/lib/concord.d.ts | 54 ++++--- enhanced-resolve/lib/lib-tests.ts | 12 +- 18 files changed, 228 insertions(+), 146 deletions(-) diff --git a/enhanced-resolve/enhanced-resolve-tests.ts b/enhanced-resolve/enhanced-resolve-tests.ts index 6588bb125b..d456872bfa 100644 --- a/enhanced-resolve/enhanced-resolve-tests.ts +++ b/enhanced-resolve/enhanced-resolve-tests.ts @@ -1,12 +1,11 @@ import resolve = require('enhanced-resolve'); -import { Context } from 'enhanced-resolve/lib/concord'; import { ResolveResult } from 'enhanced-resolve/lib/common-types' import Resolver = require('enhanced-resolve/lib/Resolver') resolve('lib', 'string', function (err) { }); -let context: Context = { - referrer: 'hi' +let context = { + issuer: 'hi' }; resolve(context, 'path', 'string', function () { }); @@ -14,7 +13,7 @@ resolve(context, 'path', 'string', function () { }); let resolver: Resolver resolver = resolve.ResolverFactory.createResolver({ extensions: ['.js'], - fileSystem: {} + fileSystem: {} as resolve.CachedInputFileSystem }); const nfs = new resolve.NodeJsInputFileSystem(); diff --git a/enhanced-resolve/index.d.ts b/enhanced-resolve/index.d.ts index 142e644bd1..06ccd64604 100644 --- a/enhanced-resolve/index.d.ts +++ b/enhanced-resolve/index.d.ts @@ -10,79 +10,94 @@ import fs = require('fs'); import { ResolveResult, LoggingCallbackWrapper, - ErrorCallback, CommonFileSystemMethod, - BaseFileSystem, - ResolverRequest -} from './lib/common-types'; -import { Context } from './lib/concord'; + ResolverRequest, + ResolveContext, + AbstractInputFileSystem +} from './lib/common-types' +import { Dictionary } from './lib/concord' import Resolver = require('./lib/Resolver'); +import Tapable = require('tapable') declare namespace Resolve { function sync(path: string, request: string): ResolveResult; - function sync(context: Context, path: string, request: string): ResolveResult; + function sync(context: ResolveContext, path: string, request: string): ResolveResult; function context(path: string, request: string, callback: LoggingCallbackWrapper): void; - function context(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + function context(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; namespace context { function sync(path: string, request: string): ResolveResult; - function sync(context: Context, path: string, request: string): ResolveResult; + function sync(context: ResolveContext, path: string, request: string): ResolveResult; } function loader(path: string, request: string, callback: LoggingCallbackWrapper): void; - function loader(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + function loader(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; namespace context { function sync(path: string, request: string): ResolveResult; - function sync(context: Context, path: string, request: string): ResolveResult; + function sync(context: ResolveContext, path: string, request: string): ResolveResult; } function create(path: string, request: string, callback: LoggingCallbackWrapper): void; - function create(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; + function create(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): void; export namespace create { function sync(path: string, request: string): ResolveResult; - function sync(context: Context, path: string, request: string): ResolveResult; + function sync(context: ResolveContext, path: string, request: string): ResolveResult; } export namespace ResolverFactory { interface ResolverOption { - modules?: string[]; - descriptionFiles?: string[]; - plugins?: any[]; - mainFields?: string[]; + alias?: AliasItem[] | Dictionary; aliasFields?: string[]; - mainFiles?: string[]; - extensions: string[]; - enforceExtension?: boolean; - moduleExtensions?: string[]; - enforceModuleExtension?: boolean; - alias?: AliasItem[] | {}; - symlinks?: string[] | boolean; - resolveToContext?: boolean; - unsafeCache?: boolean | {}; cachePredicate?: (val: ResolverRequest) => boolean; - fileSystem: any; + descriptionFiles?: string[]; + enforceExtension?: boolean; + enforceModuleExtension?: boolean; + extensions: string[]; + fileSystem: AbstractInputFileSystem; + mainFields?: string[]; + mainFiles?: string[]; + moduleExtensions?: string[]; + modules?: string[]; + plugins?: Tapable.Plugin[]; resolver?: Resolver; + resolveToContext?: boolean; + symlinks?: string[] | boolean; + unsafeCache?: boolean | Dictionary; } interface AliasItem { - name: string; alias: string; + name: string; onlyModule: boolean; } function createResolver(options: ResolverOption): Resolver; } class NodeJsInputFileSystem { - readdir(path: string, callback: (err: Error, files: string[]) => void): void; - isSync(): boolean; + readdir(path: string, callback: (err: Error, files: string[]) => void): void; + stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; - readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; - readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + readFile( + filename: string, encoding: string, + callback: (err: NodeJS.ErrnoException, data: string) => void + ): void; + readFile( + filename: string, options: { + encoding: string; + flag?: string; + }, callback: (err: NodeJS.ErrnoException, data: string) => void + ): void; + readFile( + filename: string, options: { + flag?: string; + }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void + ): void; + readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; } @@ -92,43 +107,54 @@ declare namespace Resolve { stat: CommonFileSystemMethod; readdir: CommonFileSystemMethod; - readFile(path: string, encoding?: string, callback?: (err: NodeJS.ErrnoException, result: Buffer) => void): void; - readFile(path: string, callback?: (err: NodeJS.ErrnoException, result: Buffer) => void): void; + + readFile( + filename: string, encoding: string, + callback: (err: NodeJS.ErrnoException, data: string) => void + ): void; + readFile( + filename: string, options: { + encoding: string; + flag?: string; + }, callback: (err: NodeJS.ErrnoException, data: string) => void + ): void; + readFile( + filename: string, options: { + flag?: string; + }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void + ): void; + readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + readlink: CommonFileSystemMethod; } class CachedInputFileSystem { - fileSystem: BaseFileSystem; - _statStorage: Storage; - _readdirStorage: Storage; - _readFileStorage: Storage; - _readJsonStorage: Storage; - _readlinkStorage: Storage; - _stat: CommonFileSystemMethod; - _readdir: CommonFileSystemMethod; - _readFile: CommonFileSystemMethod; - _readJson: CommonFileSystemMethod; - _readlink: CommonFileSystemMethod; + fileSystem: AbstractInputFileSystem; - constructor(fileSystem: BaseFileSystem, duration: number); + constructor(fileSystem: AbstractInputFileSystem, duration: number); isSync(): boolean; - stat(path: string, callback: ErrorCallback): void; - - readdir(path: string, callback: ErrorCallback): void; - - readFile(path: string, callback: ErrorCallback): void; - - readJson(path: string, callback: ErrorCallback): void; - - readlink(path: string, callback: ErrorCallback): void; - purge(what?: string | string[]): void; + + readdir(path: string, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + readFile(path: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + readJson(path: string, callback: (err: NodeJS.ErrnoException, data: any) => void): void; + + readlink(path: string, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + stat(path: string, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void; } } declare function Resolve(path: string, request: string, callback: LoggingCallbackWrapper): void; -declare function Resolve(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): void; +declare function Resolve( + context: ResolveContext, + path: string, + request: string, + callback: LoggingCallbackWrapper +): void; export = Resolve; diff --git a/enhanced-resolve/lib/AliasFieldPlugin.d.ts b/enhanced-resolve/lib/AliasFieldPlugin.d.ts index d49ba745b8..14ff6c0777 100644 --- a/enhanced-resolve/lib/AliasFieldPlugin.d.ts +++ b/enhanced-resolve/lib/AliasFieldPlugin.d.ts @@ -1,7 +1,7 @@ import Resolver = require('./Resolver'); declare class AliasFieldPlugin { - source: string; field: string; + source: string; target: string; constructor(source: string, field: string, target: string); diff --git a/enhanced-resolve/lib/AliasPlugin.d.ts b/enhanced-resolve/lib/AliasPlugin.d.ts index 4d9635f1c5..982760f16e 100644 --- a/enhanced-resolve/lib/AliasPlugin.d.ts +++ b/enhanced-resolve/lib/AliasPlugin.d.ts @@ -1,13 +1,13 @@ import Resolver = require('./Resolver'); -import Resolve = require('../'); +import Resolve = require('enhanced-resolve'); declare class AliasPlugin { - source: string; - options: Resolve.ResolverFactory.AliasItem; - target: string; - name: string; alias: string; + name: string; onlyModule: boolean; + options: Resolve.ResolverFactory.AliasItem; + source: string; + target: string; constructor(source: string, options: Resolve.ResolverFactory.AliasItem, target: string); diff --git a/enhanced-resolve/lib/AppendPlugin.d.ts b/enhanced-resolve/lib/AppendPlugin.d.ts index 7a5f7e1a62..eb5a8a486d 100644 --- a/enhanced-resolve/lib/AppendPlugin.d.ts +++ b/enhanced-resolve/lib/AppendPlugin.d.ts @@ -1,7 +1,7 @@ import Resolver = require('./Resolver'); declare class AppendPlugin { - source: string; appending: string; + source: string; target: string; constructor(source: string, appending: string, target: string); diff --git a/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts b/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts index 89d0880350..27309410a2 100644 --- a/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts +++ b/enhanced-resolve/lib/ConcordExtensionsPlugin.d.ts @@ -1,10 +1,12 @@ import Resolver = require('./Resolver'); +import { Dictionary } from './concord'; + declare class ConcordExtensionsPlugin { + options: Dictionary; source: string; - options: {}; target: string; - constructor(source: string, options: {}, target: string); + constructor(source: string, options: Dictionary, target: string); apply(resolver: Resolver): void; } diff --git a/enhanced-resolve/lib/ConcordMainPlugin.d.ts b/enhanced-resolve/lib/ConcordMainPlugin.d.ts index 9d2fdf3d44..d413eb0d7a 100644 --- a/enhanced-resolve/lib/ConcordMainPlugin.d.ts +++ b/enhanced-resolve/lib/ConcordMainPlugin.d.ts @@ -1,10 +1,12 @@ import Resolver = require('./Resolver'); +import { Dictionary } from './concord'; + declare class ConcordMainPlugin { + options: Dictionary; source: string; - options: {}; target: string; - constructor(source: string, options: {}, target: string); + constructor(source: string, options: Dictionary, target: string); apply(resolver: Resolver): void; } diff --git a/enhanced-resolve/lib/ConcordModulesPlugin.d.ts b/enhanced-resolve/lib/ConcordModulesPlugin.d.ts index 3afbd32a9c..094ed343b9 100644 --- a/enhanced-resolve/lib/ConcordModulesPlugin.d.ts +++ b/enhanced-resolve/lib/ConcordModulesPlugin.d.ts @@ -1,10 +1,12 @@ import Resolver = require('./Resolver'); +import { Dictionary } from './concord'; + declare class ConcordModulesPlugin { + options: Dictionary; source: string; - options: {}; target: string; - constructor(source: string, options: {}, target: string); + constructor(source: string, options: Dictionary, target: string); apply(resolver: Resolver): void; } diff --git a/enhanced-resolve/lib/DescriptionFilePlugin.d.ts b/enhanced-resolve/lib/DescriptionFilePlugin.d.ts index f9f560de46..d753ae3ef6 100644 --- a/enhanced-resolve/lib/DescriptionFilePlugin.d.ts +++ b/enhanced-resolve/lib/DescriptionFilePlugin.d.ts @@ -1,11 +1,13 @@ import Resolver = require('./Resolver'); + declare class DescriptionFilePlugin { + filenames: string[]; source: string; target: string; - filenames: string[]; constructor(source: string, filenames: string[] | string, target: string); apply(resolver: Resolver): void; } + export = DescriptionFilePlugin; diff --git a/enhanced-resolve/lib/DescriptionFileUtils.d.ts b/enhanced-resolve/lib/DescriptionFileUtils.d.ts index db7cd77723..a630e4a03b 100644 --- a/enhanced-resolve/lib/DescriptionFileUtils.d.ts +++ b/enhanced-resolve/lib/DescriptionFileUtils.d.ts @@ -1,8 +1,24 @@ import Resolver = require('./Resolver'); +import { Dictionary, Concord } from './concord'; + +export interface DescriptionFileData { + concord?: Concord; + browser?: Dictionary; +} + +export interface LoadDescriptionFileResult { + content: DescriptionFileData + directory: string + path: string +} + declare function loadDescriptionFile( - resolver: Resolver, directory: string, filenames: string[], - callback: (...args: any[]) => any + resolver: Resolver, + directory: string, + filenames: string[], + callback: (err?: Error | null, result?: LoadDescriptionFileResult) => any ): void; -declare function getField(content: any, field: string): any; + +declare function getField(content: Dictionary | null, field: string): any; declare function cdUp(directory: string): string | null; export { loadDescriptionFile, getField, cdUp }; diff --git a/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts b/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts index d744870022..449ef7cf31 100644 --- a/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts +++ b/enhanced-resolve/lib/ModulesInHierachicDirectoriesPlugin.d.ts @@ -1,8 +1,8 @@ import Resolver = require('./Resolver'); declare class ModulesInHierachicDirectoriesPlugin { + directories: string[]; source: string; target: string; - directories: string[]; constructor(source: string, directories: string[], target: string); diff --git a/enhanced-resolve/lib/ModulesInRootPlugin.d.ts b/enhanced-resolve/lib/ModulesInRootPlugin.d.ts index 87654ce919..fe171dcb0b 100644 --- a/enhanced-resolve/lib/ModulesInRootPlugin.d.ts +++ b/enhanced-resolve/lib/ModulesInRootPlugin.d.ts @@ -1,7 +1,7 @@ import Resolver = require('./Resolver'); declare class ModulesInRootPlugin { - source: string; path: string; + source: string; target: string; constructor(source: string, path: string, target: string); diff --git a/enhanced-resolve/lib/Resolver.d.ts b/enhanced-resolve/lib/Resolver.d.ts index 4d2f3ee477..20fc1c0914 100644 --- a/enhanced-resolve/lib/Resolver.d.ts +++ b/enhanced-resolve/lib/Resolver.d.ts @@ -1,15 +1,22 @@ /// import Tapable = require('tapable'); -import { ResolveParseResult, ResolverRequest, LoggingCallbackWrapper, BaseFileSystem } from './common-types'; -import { Context } from './concord'; +import { + ResolveParseResult, + ResolveResult, + ResolverRequest, + LoggingCallbackWrapper, + AbstractInputFileSystem, + ResolveContext +} from './common-types'; + declare class Resolver extends Tapable { - fileSystem: BaseFileSystem; + fileSystem: AbstractInputFileSystem; - constructor(fileSystem: BaseFileSystem); + constructor(fileSystem: AbstractInputFileSystem); - resolveSync(context: Context, path: string, request: string): null; + resolveSync(context: ResolveContext, path: string, request: string): ResolveResult; - resolve(context: Context, path: string, request: string, callback: LoggingCallbackWrapper): any; + resolve(context: ResolveContext, path: string, request: string, callback: LoggingCallbackWrapper): any; doResolve(type: string, request: ResolverRequest, message: string | null, callback: LoggingCallbackWrapper): any; @@ -23,4 +30,5 @@ declare class Resolver extends Tapable { normalize(path: string): string; } + export = Resolver; diff --git a/enhanced-resolve/lib/Storage.d.ts b/enhanced-resolve/lib/Storage.d.ts index 4260b42ee7..cc4790d200 100644 --- a/enhanced-resolve/lib/Storage.d.ts +++ b/enhanced-resolve/lib/Storage.d.ts @@ -1,14 +1,11 @@ /// import { CommonFileSystemMethod } from './common-types'; +import { Dictionary } from './concord'; declare class Storage { duration: number; - running: { - [name: string]: ((...args: any[]) => any)[] - }; - data: { - [name: string]: any[] - }; + running: Dictionary; + data: Dictionary; levels: string[][]; count: number; interval: NodeJS.Timer | null; diff --git a/enhanced-resolve/lib/UnsafeCachePlugin.d.ts b/enhanced-resolve/lib/UnsafeCachePlugin.d.ts index 8b8c8f5f09..9ce470e8f8 100644 --- a/enhanced-resolve/lib/UnsafeCachePlugin.d.ts +++ b/enhanced-resolve/lib/UnsafeCachePlugin.d.ts @@ -1,12 +1,19 @@ import Resolver = require('./Resolver'); import { ResolverRequest } from './common-types'; +import { Dictionary } from './concord'; + declare class UnsafeCachePlugin { source: string; - filterPredicate: (str: ResolverRequest) => boolean; - cache: {}; + filterPredicate: (request: ResolverRequest) => boolean; + cache: Dictionary; target: string; - constructor(source: string, filterPredicate: (str: ResolverRequest) => boolean, cache: {}, target: string); + constructor( + source: string, + filterPredicate: (request: ResolverRequest) => boolean, + cache: Dictionary, + target: string + ); apply(resolver: Resolver): void; } diff --git a/enhanced-resolve/lib/common-types.d.ts b/enhanced-resolve/lib/common-types.d.ts index 30c39d1210..ff764ad67d 100644 --- a/enhanced-resolve/lib/common-types.d.ts +++ b/enhanced-resolve/lib/common-types.d.ts @@ -1,5 +1,10 @@ -import { Context } from './concord'; +/// +import { DescriptionFileData } from './DescriptionFileUtils'; +import fs = require('fs'); +/** + * Created by cloud on 16-11-4. + */ export interface ResolveError extends Error { details: string; missing: string[]; @@ -7,11 +12,15 @@ export interface ResolveError extends Error { } export interface ResolveParseResult { - request: string; - query: string; - module: boolean; directory: boolean; file: boolean; + module: boolean; + query: string; + request: string; +} + +export interface ResolveContext { + issuer?: string; } export interface ResolveResult { @@ -20,21 +29,21 @@ export interface ResolveResult { } export interface ResolverRequest { - request: string; - relativePath?: string; - descriptionFileData?: any; - descriptionFileRoot?: string; + context: ResolveContext; + descriptionFileData?: DescriptionFileData; descriptionFilePath?: string; - context: Context; - path: string; - query?: string; + descriptionFileRoot?: string; directory?: boolean; module?: boolean; + path: string; + query?: string; + relativePath?: string; + request: string; } export interface LoggingCallbackTools { log?(msg: string): void; - stack?: string[]; + stack?: string[] | undefined; missing?: string[] | { push: (item: string) => void; }; @@ -44,20 +53,20 @@ export interface LoggingCallbackWrapper extends LoggingCallbackTools { (err?: Error | null, ...args: any[]): any; } -export interface ErrorCallback { - (err: Error | null, ...args: any[]): any; +export interface ErrorCallback { + (err: T | null, ...args: any[]): any; +} + +export interface AbstractInputFileSystem { + isSync(): boolean; + purge?(what?: string | string[]): void; + readdir(path: string, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + readJson?(path: string, callback: (err: NodeJS.ErrnoException, data: any) => void): void; + readlink(path: string, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + stat(path: string, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void; } export interface CommonFileSystemMethod { - (name: string, callback: (err: Error | null, ...args: any[]) => void): void; -} - -export interface BaseFileSystem { - stat: CommonFileSystemMethod; - readdir?: CommonFileSystemMethod; - readFile?(path: string, encoding: string, callback: ErrorCallback): void; - readFile?(path: string, callback: ErrorCallback): void; - readJson?: CommonFileSystemMethod; - readlink?: CommonFileSystemMethod; - isSync: () => boolean; + (name: string, callback: (err: NodeJS.ErrnoException | null, ...args: any[]) => void): void; } diff --git a/enhanced-resolve/lib/concord.d.ts b/enhanced-resolve/lib/concord.d.ts index d11f1047df..e0c9efe8ed 100644 --- a/enhanced-resolve/lib/concord.d.ts +++ b/enhanced-resolve/lib/concord.d.ts @@ -1,38 +1,50 @@ +export interface Dictionary { + [key: string]: T; +} + +export interface Concord { + '[server] main': string; + extensions: string[]; + main: string; + modules: Dictionary; + types: Dictionary; +} + export interface Type { type: string | null | undefined; features: string[]; } -export interface Context { - supportedResourceTypes?: string[]; +export interface ConcordContext { environments?: string[]; - referrer: string; + referrer?: string; + supportedResourceTypes?: string[]; } declare function parseType(type: string): Type; declare function isTypeMatched(baseType: string | Type, testedType: string | Type): boolean; -declare function isResourceTypeSupported(context: Context, type: string): boolean | undefined; -declare function isEnvironment(context: Context, env: string | Type): boolean | undefined; +declare function isResourceTypeSupported(context: ConcordContext, type: string): boolean; +declare function isEnvironment(context: ConcordContext, env: string | Type): boolean; declare function isGlobMatched(glob: string, relativePath: string): boolean; -declare function isConditionMatched(context: Context, condition: string): boolean; -declare function isKeyMatched(context: Context, key: string): string | boolean; -declare function getField(context: Context, configuration: any, field: string): undefined; -declare function getMain(context: Context, configuration: any): undefined; -declare function getExtensions(context: Context, configuration: any): undefined; -declare function matchModule(context: Context, configuration: any, request: string): any; -declare function matchType(context: Context, configuration: any, relativePath: string): undefined; +declare function isConditionMatched(context: ConcordContext, condition: string): boolean; +declare function isKeyMatched(context: ConcordContext, key: string): string | boolean; +declare function getField(context: ConcordContext, configuration: Concord, field: string): any; +declare function getMain(context: ConcordContext, configuration: Concord): any; +declare function getExtensions(context: ConcordContext, configuration: Concord): any; +declare function matchModule(context: ConcordContext, configuration: Concord, request: string): any; +declare function matchType(context: ConcordContext, configuration: Concord, relativePath: string): string | undefined; export { - parseType, - isTypeMatched, - isResourceTypeSupported, - isEnvironment, - isGlobMatched, - isConditionMatched, - isKeyMatched, + getExtensions, getField, getMain, - getExtensions, + isConditionMatched, + isEnvironment, + isGlobMatched, + isKeyMatched, + isResourceTypeSupported, + isTypeMatched, matchModule, - matchType + matchType, + parseType }; diff --git a/enhanced-resolve/lib/lib-tests.ts b/enhanced-resolve/lib/lib-tests.ts index a41e5d9aeb..b5b0d9a266 100644 --- a/enhanced-resolve/lib/lib-tests.ts +++ b/enhanced-resolve/lib/lib-tests.ts @@ -26,6 +26,10 @@ import getPaths, { basename } from 'enhanced-resolve/lib/getPaths'; import { globToRegExp } from 'enhanced-resolve/lib/globToRegExp'; +import Storage from 'enhanced-resolve/lib/Storage'; + +import { AbstractInputFileSystem } from 'enhanced-resolve/lib/common-types'; + import JoinRequestPlugin = require('enhanced-resolve/lib/JoinRequestPlugin'); import LogInfoPlugin = require('enhanced-resolve/lib/LogInfoPlugin'); @@ -48,8 +52,6 @@ import Resolver = require('enhanced-resolve/lib/Resolver'); import ResultPlugin = require('enhanced-resolve/lib/ResultPlugin'); -import Storage from 'enhanced-resolve/lib/Storage' - import SymlinkPlugin = require('enhanced-resolve/lib/SymlinkPlugin'); import TryNextPlugin = require('enhanced-resolve/lib/TryNextPlugin'); @@ -60,8 +62,6 @@ import UseFilePlugin = require('enhanced-resolve/lib/UseFilePlugin'); import resolve = require('../'); -import { BaseFileSystem } from 'enhanced-resolve/lib/common-types' - const aplugin = new AliasFieldPlugin('a', 'b', 'c'); const aplugin2 = new AliasPlugin('a', { @@ -95,7 +95,7 @@ DescriptionFileUtils.cdUp('./lib'); DescriptionFileUtils.getField({}, 'hi'); DescriptionFileUtils.loadDescriptionFile(resolve.ResolverFactory.createResolver({ extensions: [''], - fileSystem: {} + fileSystem: {} as AbstractInputFileSystem }), './lib', ['file'], function () { }); const dplugin1 = new DirectoryExistsPlugin('string', 'string'); @@ -131,7 +131,7 @@ const nplugin = new NextPlugin('string', 'ap'); const pplugin = new ParsePlugin('string', 'ap'); -const resolver = new Resolver({} as BaseFileSystem); +const resolver = new Resolver({} as AbstractInputFileSystem); const rplugin = new ResultPlugin('string'); From cfd7b3fa220368b215a58a2b428a3b46a7d2a353 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Thu, 8 Dec 2016 21:03:41 +0800 Subject: [PATCH 028/101] feat: upgrade to v3.0.0 --- enhanced-resolve/enhanced-resolve-tests.ts | 7 +- enhanced-resolve/index.d.ts | 70 +++++++++---------- enhanced-resolve/lib/Storage.d.ts | 19 ++--- .../lib/SyncAsyncFileSystemDecorator.d.ts | 21 ++++++ enhanced-resolve/lib/common-types.d.ts | 21 +++++- 5 files changed, 88 insertions(+), 50 deletions(-) create mode 100644 enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts diff --git a/enhanced-resolve/enhanced-resolve-tests.ts b/enhanced-resolve/enhanced-resolve-tests.ts index d456872bfa..dfd5087be4 100644 --- a/enhanced-resolve/enhanced-resolve-tests.ts +++ b/enhanced-resolve/enhanced-resolve-tests.ts @@ -1,5 +1,5 @@ import resolve = require('enhanced-resolve'); -import { ResolveResult } from 'enhanced-resolve/lib/common-types' +import { ResolveResult, AbstractInputFileSystem } from 'enhanced-resolve/lib/common-types' import Resolver = require('enhanced-resolve/lib/Resolver') resolve('lib', 'string', function (err) { }); @@ -13,15 +13,12 @@ resolve(context, 'path', 'string', function () { }); let resolver: Resolver resolver = resolve.ResolverFactory.createResolver({ extensions: ['.js'], - fileSystem: {} as resolve.CachedInputFileSystem + fileSystem: {} as AbstractInputFileSystem }); const nfs = new resolve.NodeJsInputFileSystem(); -const snfs = new resolve.SyncNodeJsInputFileSystem(); - const cfs = new resolve.CachedInputFileSystem(nfs, 4); -const cfs2 = new resolve.CachedInputFileSystem(snfs, 4); let result: ResolveResult diff --git a/enhanced-resolve/index.d.ts b/enhanced-resolve/index.d.ts index 06ccd64604..d773f52b16 100644 --- a/enhanced-resolve/index.d.ts +++ b/enhanced-resolve/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for enhanced-resolve v2.3.0 +// Type definitions for enhanced-resolve v3.0.0 // Project: http://github.com/webpack/enhanced-resolve.git // Definitions by: e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,14 +10,13 @@ import fs = require('fs'); import { ResolveResult, LoggingCallbackWrapper, - CommonFileSystemMethod, ResolverRequest, ResolveContext, AbstractInputFileSystem } from './lib/common-types' import { Dictionary } from './lib/concord' import Resolver = require('./lib/Resolver'); -import Tapable = require('tapable') +import Tapable = require('tapable'); declare namespace Resolve { function sync(path: string, request: string): ResolveResult; @@ -66,6 +65,7 @@ declare namespace Resolve { resolveToContext?: boolean; symlinks?: string[] | boolean; unsafeCache?: boolean | Dictionary; + useSyncFileSystemCalls?: boolean; } interface AliasItem { alias: string; @@ -76,12 +76,9 @@ declare namespace Resolve { } class NodeJsInputFileSystem { - isSync(): boolean; - - readdir(path: string, callback: (err: Error, files: string[]) => void): void; - stat(path: string, callback?: (err: NodeJS.ErrnoException, stats: fs.Stats) => any): void; + readdir(path: string, callback: (err: Error, files: string[]) => void): void readFile( filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void @@ -100,32 +97,25 @@ declare namespace Resolve { readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; readlink(path: string, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void; - } - class SyncNodeJsInputFileSystem { - isSync(): boolean; + statSync(path: string | Buffer): fs.Stats; - stat: CommonFileSystemMethod; - readdir: CommonFileSystemMethod; + readdirSync(path: string): string[]; - readFile( - filename: string, encoding: string, - callback: (err: NodeJS.ErrnoException, data: string) => void - ): void; - readFile( + readFileSync(filename: string, encoding: string): string; + readFileSync( filename: string, options: { encoding: string; flag?: string; - }, callback: (err: NodeJS.ErrnoException, data: string) => void - ): void; - readFile( - filename: string, options: { + } + ): string; + readFileSync( + filename: string, options?: { flag?: string; - }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void - ): void; - readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + } + ): Buffer; - readlink: CommonFileSystemMethod; + readlinkSync(path: string | Buffer): string; } class CachedInputFileSystem { @@ -133,19 +123,27 @@ declare namespace Resolve { constructor(fileSystem: AbstractInputFileSystem, duration: number); - isSync(): boolean; + stat?(path: string, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void; + + readdir?(path: string, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + readFile?(path: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + readJson?(path: string, callback: (err: NodeJS.ErrnoException, data: any) => void): void; + + readlink?(path: string, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + statSync?(path: string | Buffer): fs.Stats; + + readdirSync?(path: string): string[]; + + readFileSync?(filename: string, options?: { flag?: string; }): Buffer; + + readlinkSync?(path: string | Buffer): string; + + readJsonSync?(path: string): any; purge(what?: string | string[]): void; - - readdir(path: string, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; - - readFile(path: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; - - readJson(path: string, callback: (err: NodeJS.ErrnoException, data: any) => void): void; - - readlink(path: string, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; - - stat(path: string, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void; } } diff --git a/enhanced-resolve/lib/Storage.d.ts b/enhanced-resolve/lib/Storage.d.ts index cc4790d200..b9512825fa 100644 --- a/enhanced-resolve/lib/Storage.d.ts +++ b/enhanced-resolve/lib/Storage.d.ts @@ -1,26 +1,29 @@ /// -import { CommonFileSystemMethod } from './common-types'; -import { Dictionary } from './concord'; - +import { CommonFileSystemMethod } from './common-types' +import { Dictionary } from './concord' declare class Storage { - duration: number; - running: Dictionary; - data: Dictionary; - levels: string[][]; count: number; + data: Dictionary; + duration: number; interval: NodeJS.Timer | null; + levels: string[][]; needTickCheck: boolean; nextTick: number | null; passive: boolean; + running: Dictionary; constructor(duration: number); ensureTick(): void; - finished(name: string): void; + finished(name: string, err: NodeJS.ErrnoException | null, result: any): void; + + finishedSync(name: string, err: NodeJS.ErrnoException | null, result?: any): void; provide(name: string, provider: CommonFileSystemMethod, callback: (...args: any[]) => any): any; + provideSync(name: string, provider: (name: string) => any): any; + tick(): true | undefined; checkTicks(): void; diff --git a/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts b/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts new file mode 100644 index 0000000000..f7956dcead --- /dev/null +++ b/enhanced-resolve/lib/SyncAsyncFileSystemDecorator.d.ts @@ -0,0 +1,21 @@ +/// +import fs = require('fs'); +import { AbstractInputFileSystem } from './common-types'; + +declare class SyncAsyncFileSystemDecorator { + fs: AbstractInputFileSystem; + + readdir?(path: string, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void; + + readFile?(filename: string, callback: (err: NodeJS.ErrnoException | null, data?: Buffer) => void): void; + + readJson?(path: string, callback: (err: NodeJS.ErrnoException | null, data?: any) => void): void; + + readlink?(path: string, callback: (err: NodeJS.ErrnoException | null, linkString?: string) => void): void; + + stat?(path: string, callback: (err: NodeJS.ErrnoException | null, stats?: fs.Stats) => void): void; + + constructor(fs: AbstractInputFileSystem); +} + +export = SyncAsyncFileSystemDecorator; diff --git a/enhanced-resolve/lib/common-types.d.ts b/enhanced-resolve/lib/common-types.d.ts index ff764ad67d..6607dee64f 100644 --- a/enhanced-resolve/lib/common-types.d.ts +++ b/enhanced-resolve/lib/common-types.d.ts @@ -39,6 +39,9 @@ export interface ResolverRequest { query?: string; relativePath?: string; request: string; + __innerRequest?: string; + __innerRequest_request?: string; + __innerRequest_relativePath?: string; } export interface LoggingCallbackTools { @@ -58,13 +61,29 @@ export interface ErrorCallback { } export interface AbstractInputFileSystem { - isSync(): boolean; purge?(what?: string | string[]): void; readdir(path: string, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + readdirSync?(path: string): string[]; + readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + readFile( + filename: string, options: { + encoding: string; + flag?: string; + }, callback: (err: NodeJS.ErrnoException, data: string) => void + ): void; + readFile( + filename: string, options: { + flag?: string; + }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void + ): void; readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + readFileSync?(filename: string): Buffer; readJson?(path: string, callback: (err: NodeJS.ErrnoException, data: any) => void): void; + readJsonSync?(path: string): any; readlink(path: string, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + readlinkSync?(path: string): string; stat(path: string, callback: (err: NodeJS.ErrnoException, stats: fs.Stats) => void): void; + statSync?(path: string): fs.Stats; } export interface CommonFileSystemMethod { From 666bff50137ba3d7a67fee95fbdde78517f026b3 Mon Sep 17 00:00:00 2001 From: e-cloud Date: Thu, 8 Dec 2016 21:33:05 +0800 Subject: [PATCH 029/101] feat: upgrade to tapbale v0.2.5 --- tapable/index.d.ts | 12 ++++++++++-- tapable/tapable-tests.ts | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tapable/index.d.ts b/tapable/index.d.ts index 01df2aa803..4fd56603ca 100644 --- a/tapable/index.d.ts +++ b/tapable/index.d.ts @@ -1,11 +1,11 @@ -// Type definitions for tapable v0.2.4 +// Type definitions for tapable v0.2.5 // Project: http://github.com/webpack/tapable.git // Definitions by: e-cloud // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare abstract class Tapable { private _plugins: { - [index: string]: Tapable.Handler[] + [propName: string]: Tapable.Handler[] } /** @@ -37,6 +37,12 @@ declare abstract class Tapable { */ applyPlugins(name: string, ...args: any[]): void; + applyPlugins0(name: string): void; + + applyPlugins1(name: string, param: any): void; + + applyPlugins2(name: string, param1: any, param2: any): void; + /** * synchronously applies all registered handlers for target name(event id). * @@ -103,6 +109,8 @@ declare abstract class Tapable { */ applyPluginsAsyncSeries(name: string, ...args: any[]): void; + applyPluginsAsyncSeries1(name: string, param: any, callback: Tapable.CallbackFunction): void + /** * asynchronously applies all registered handlers for target name(event id). * diff --git a/tapable/tapable-tests.ts b/tapable/tapable-tests.ts index eca641655c..fce410defa 100644 --- a/tapable/tapable-tests.ts +++ b/tapable/tapable-tests.ts @@ -29,12 +29,16 @@ let callback: Tapable.CallbackFunction = function () { compiler.apply(new DllPlugin()); compiler.applyPlugins('doSomething', 'a', 'b'); +compiler.applyPlugins0('doSomething'); +compiler.applyPlugins1('doSomething', 'a'); +compiler.applyPlugins2('doSomething', 'a', 'b'); compiler.applyPluginsWaterfall('doSomething', 'a', 'b'); compiler.applyPluginsWaterfall0('doSomething', 'a'); compiler.applyPluginsBailResult('doSomething', 'a', 'b'); compiler.applyPluginsBailResult1('doSomething', ['a', 'b']); compiler.applyPluginsAsync('doSomething', 'a', 'b'); compiler.applyPluginsAsyncSeries('doSomething', 'a', 'b'); +compiler.applyPluginsAsyncSeries1('doSomething', 'a', callback); compiler.applyPluginsAsyncSeriesBailResult('doSomething', 'a', 'b'); compiler.applyPluginsAsyncSeriesBailResult1('doSomething', 'a', callback); compiler.applyPluginsAsyncWaterfall('doSomething', 'a', callback); From 31e4220dde5dce6d282bb70eb786f03e70eba0b3 Mon Sep 17 00:00:00 2001 From: cailenmusselman Date: Tue, 13 Dec 2016 18:15:28 -0600 Subject: [PATCH 030/101] ModalProperties should be optional These properties should be optional. https://github.com/facebook/react-native/blob/master/Libraries/Modal/Modal.js#L113-L124 i.e. they are PropTypes.func / PropTypes.arrayOf not PropTypes.func.required / PropTypes.arrayOf().required --- react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 195015b09e..a300a266ca 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -3772,13 +3772,13 @@ declare module "react" { * On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field. * @platform ios */ - supportedOrientations: ('portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right')[] + supportedOrientations?: ('portrait' | 'portrait-upside-down' | 'landscape' | 'landscape-left' | 'landscape-right')[] /** * The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. * The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation. * @platform ios */ - onOrientationChange: () => void, + onOrientationChange?: () => void } export interface ModalStatic extends React.ComponentClass { From bf82d81f6bbf9c70789d10c8435ca5d5c8c9015a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Essig?= Date: Sun, 18 Dec 2016 18:31:44 +0100 Subject: [PATCH 031/101] Types 2.0 (#13261) * updating typing of the latest 7.0 react-autosuggest * updating typing of react-autosuggest 7.0 * update typings for react-autosuggest 7.0 --- react-autosuggest/index.d.ts | 36 ++++++++----------- react-autosuggest/react-autosuggest-tests.tsx | 18 +++++----- react-autosuggest/tslint.json | 3 ++ 3 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 react-autosuggest/tslint.json diff --git a/react-autosuggest/index.d.ts b/react-autosuggest/index.d.ts index 739509bdef..ed12888833 100644 --- a/react-autosuggest/index.d.ts +++ b/react-autosuggest/index.d.ts @@ -1,12 +1,11 @@ -// Type definitions for react-autosuggest v3.7.3 +// Type definitions for react-autosuggest 7.0 // Project: http://react-autosuggest.js.org/ -// Definitions by: Nicolas Schmitt , Philip Ottesen +// Definitions by: Nicolas Schmitt , Philip Ottesen , Robert Essig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import * as React from 'react'; -declare namespace ReactAutosuggest { - interface SuggestionUpdateRequest { + interface SuggestionsFetchRequest { value: string; reason: string; } @@ -31,16 +30,13 @@ declare namespace ReactAutosuggest { onBlur?: (event: React.FormEvent, params?: BlurEvent) => void; } - interface ExplicitSuggestionSelectedEventData { + export interface SuggestionSelectedEventData { method: 'click' | 'enter'; sectionIndex: number | null; suggestion: TSuggestion; suggestionValue: string; } - interface SuggestionSelectedEventData extends ExplicitSuggestionSelectedEventData { - } - interface Theme { container?: string; containerOpen?: string; @@ -55,25 +51,23 @@ declare namespace ReactAutosuggest { interface AutosuggestProps extends React.Props { suggestions: any[]; - onSuggestionsUpdateRequested?: (request: SuggestionUpdateRequest) => void; - getSuggestionValue: (suggestion: any) => string; + onSuggestionsFetchRequested: (request: SuggestionsFetchRequest) => void; + onSuggestionsClearRequested?: () => void; + getSuggestionValue: (suggestion: any) => any; renderSuggestion: (suggestion: any, inputValues: InputValues) => JSX.Element; inputProps: InputProps; - alwaysRenderSuggestions?: boolean; + onSuggestionSelected?: (event: React.FormEvent, data: SuggestionSelectedEventData) => void; shouldRenderSuggestions?: (value: string) => boolean; + alwaysRenderSuggestions?: boolean; + focusFirstSuggestion?: boolean; + focusInputOnSuggestionClick?: boolean; multiSection?: boolean; renderSectionTitle?: (section: any, inputValues: InputValues) => JSX.Element; getSectionSuggestions?: (section: any) => any[]; - onSuggestionSelected?: (event: React.FormEvent, data: SuggestionSelectedEventData | ExplicitSuggestionSelectedEventData) => void; - focusInputOnSuggestionClick?: boolean; + renderInputComponent?: () => JSX.Element; + renderSuggestionsContainer?: (children: any) => JSX.Element; theme?: Theme; id?: string; } - class Autosuggest extends React.Component {} -} - -declare module 'react-autosuggest' { - import Autosuggest = ReactAutosuggest.Autosuggest; - export = Autosuggest; -} + export class Autosuggest extends React.Component {} diff --git a/react-autosuggest/react-autosuggest-tests.tsx b/react-autosuggest/react-autosuggest-tests.tsx index d3d4278829..0e1a5f922b 100644 --- a/react-autosuggest/react-autosuggest-tests.tsx +++ b/react-autosuggest/react-autosuggest-tests.tsx @@ -1,7 +1,7 @@ //region Imports import React = require('react'); import ReactDOM = require('react-dom'); -import Autosuggest = require('react-autosuggest'); +import { Autosuggest, SuggestionSelectedEventData } from 'react-autosuggest'; //endregion interface Language { @@ -62,7 +62,7 @@ export class ReactAutosuggestBasicTest extends React.Component { } return { />; } - protected onSuggestionsSelected(event: React.FormEvent, data: ReactAutosuggest.ExplicitSuggestionSelectedEventData): void { + protected onSuggestionsSelected(event: React.FormEvent, data: SuggestionSelectedEventData): void { alert(`Selected language is ${data.suggestion.name} (${data.suggestion.year}).`); } @@ -88,7 +88,7 @@ export class ReactAutosuggestBasicTest extends React.Component { }); } - protected onSuggestionsUpdateRequested({ value }: any): void { + protected onSuggestionsFetchRequested({ value }: any): void { this.setState({ suggestions: this.getSuggestions(value) }); @@ -188,7 +188,7 @@ export class ReactAutosuggestMultipleTest extends React.Component { return { inputProps={inputProps} />; } - protected onSuggestionSelected(event: React.FormEvent, data: ReactAutosuggest.SuggestionSelectedEventData): void { + protected onSuggestionSelected(event: React.FormEvent, data: SuggestionSelectedEventData): void { const language = data.suggestion as Language; alert(`Selected language is ${language.name} (${language.year}).`); @@ -219,7 +219,7 @@ export class ReactAutosuggestMultipleTest extends React.Component { }); } - protected onSuggestionsUpdateRequested({ value }: any): void { + protected onSuggestionsFetchRequested({ value }: any): void { this.setState({ suggestions: this.getSuggestions(value) }); @@ -295,7 +295,7 @@ export class ReactAutosuggestCustomTest extends React.Component { }; return ; @@ -332,7 +332,7 @@ export class ReactAutosuggestCustomTest extends React.Component { }); } - protected onSuggestionsUpdateRequested({ value }: any): void { + protected onSuggestionsFetchRequested({ value }: any): void { this.setState({ suggestions: this.getSuggestions(value) }); diff --git a/react-autosuggest/tslint.json b/react-autosuggest/tslint.json new file mode 100644 index 0000000000..192203ab54 --- /dev/null +++ b/react-autosuggest/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From 027cdcc4f4443328800542d41c7fad4391f65bf8 Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 18 Dec 2016 10:12:35 -0800 Subject: [PATCH 032/101] Remove '+' from header versions, so they can be parsed (#13239) --- angular-material/index.d.ts | 2 +- angular-ui-router-default/index.d.ts | 2 +- angular-ui-router-uib-modal/index.d.ts | 2 +- angular-ui-router/index.d.ts | 2 +- angular-ui-scroll/index.d.ts | 2 +- angular-ui-sortable/index.d.ts | 2 +- imagesloaded/index.d.ts | 2 +- jsnlog/index.d.ts | 16 ++++++++-------- jsuri/index.d.ts | 2 +- localforage-cordovasqlitedriver/index.d.ts | 2 +- mailcheck/index.d.ts | 2 +- ui-router-extras/index.d.ts | 2 +- yfiles/index.d.ts | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/angular-material/index.d.ts b/angular-material/index.d.ts index e3804acbc8..4c62a248a8 100644 --- a/angular-material/index.d.ts +++ b/angular-material/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Material 1.1.0-rc5+ (angular.material module) +// Type definitions for Angular Material (angular.material module) 1.1 // Project: https://github.com/angular/material // Definitions by: Blake Bigelow , Peter Hajdu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-ui-router-default/index.d.ts b/angular-ui-router-default/index.d.ts index 76e4db23e0..0b62245406 100644 --- a/angular-ui-router-default/index.d.ts +++ b/angular-ui-router-default/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-ui-router-default 0.5+ +// Type definitions for angular-ui-router-default 0.5 // Project: https://github.com/nonplus/angular-ui-router-default // Definitions by: Stepan Riha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-ui-router-uib-modal/index.d.ts b/angular-ui-router-uib-modal/index.d.ts index 29e963fc6e..931a2cbd29 100644 --- a/angular-ui-router-uib-modal/index.d.ts +++ b/angular-ui-router-uib-modal/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular-ui-uib-modal 0.11+ (ui.router module) +// Type definitions for angular-ui-uib-modal (ui.router module) 0.11 // Project: https://github.com/nonplus/angular-ui-router-uib-modal // Definitions by: Stepan Riha // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-ui-router/index.d.ts b/angular-ui-router/index.d.ts index 035dc93430..5cf718c1fd 100644 --- a/angular-ui-router/index.d.ts +++ b/angular-ui-router/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.1.5+ (ui.router module) +// Type definitions for Angular JS (ui.router module) 1.1.5 // Project: https://github.com/angular-ui/ui-router // Definitions by: Michel Salib // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-ui-scroll/index.d.ts b/angular-ui-scroll/index.d.ts index 99639eccf4..b1510f1b06 100644 --- a/angular-ui-scroll/index.d.ts +++ b/angular-ui-scroll/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular JS 1.3.1+ (ui.scroll module) +// Type definitions for Angular JS (ui.scroll module) 1.3.1 // Project: https://github.com/angular-ui/ui-scroll // Definitions by: Mark Nadig // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/angular-ui-sortable/index.d.ts b/angular-ui-sortable/index.d.ts index 0a7a86754a..fa27cf9b49 100644 --- a/angular-ui-sortable/index.d.ts +++ b/angular-ui-sortable/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for angular.ui.sortable module v0.13+ +// Type definitions for angular.ui.sortable module 0.13 // Project: https://github.com/angular-ui/ui-sortable // Definitions by: Thodoris Greasidis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/imagesloaded/index.d.ts b/imagesloaded/index.d.ts index 24ab26d3cd..507f082367 100644 --- a/imagesloaded/index.d.ts +++ b/imagesloaded/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for imagesLoaded 3.1.8+ +// Type definitions for imagesLoaded 3.1.8 // Project: https://github.com/desandro/imagesloaded // Definitions by: Chris Charabaruk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/jsnlog/index.d.ts b/jsnlog/index.d.ts index 40daf96b24..4b525c75af 100644 --- a/jsnlog/index.d.ts +++ b/jsnlog/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for JSNLog v2.17.3+ +// Type definitions for JSNLog 2.17.3 // Project: https://github.com/mperdeck/jsnlog.js // Definitions by: Mattijs Perdeck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // ------------------------------- -// Full documentation is at +// Full documentation is at // http://jsnlog.com // ------------------------------- @@ -12,17 +12,17 @@ * Copyright 2016 Mattijs Perdeck. * * This project is licensed under the MIT license. -* +* * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -* +* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Declarations of all interfaces and ambient objects, except for JL itself. -// Provides strong typing in both jsnlog.ts itself and in TypeScript programs that use -// JSNLog. +// Provides strong typing in both jsnlog.ts itself and in TypeScript programs that use +// JSNLog. declare namespace JL { @@ -92,7 +92,7 @@ declare function __jsnlog_configure(jsnlog: any): void; declare function JL(loggerName?: string): JL.JSNLogLogger; // Definitions that need to be kept out of the main namespace definition, -// because otherwise during compilation of jsnlog.ts it complains that you can't +// because otherwise during compilation of jsnlog.ts it complains that you can't // overload ambient declarations with non-ambient declarations. declare namespace JL { @@ -103,7 +103,7 @@ declare namespace JL { export class Exception { constructor(data: any, inner?: any); } - + export function getOffLevel(): number; export function getTraceLevel(): number; export function getDebugLevel(): number; diff --git a/jsuri/index.d.ts b/jsuri/index.d.ts index cb2bb319c4..30031ac045 100644 --- a/jsuri/index.d.ts +++ b/jsuri/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsUri 1.3+ +// Type definitions for jsUri 1.3 // Project: https://github.com/derek-watson/jsUri // Definitions by: Chris Charabaruk , Florian Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/localforage-cordovasqlitedriver/index.d.ts b/localforage-cordovasqlitedriver/index.d.ts index 901713ba37..676bea8cfa 100644 --- a/localforage-cordovasqlitedriver/index.d.ts +++ b/localforage-cordovasqlitedriver/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for localforage-cordovasqlitedriver module v1.0+ +// Type definitions for localforage-cordovasqlitedriver module 1.0 // Project: https://github.com/thgreasi/localForage-cordovaSQLiteDriver // Definitions by: Thodoris Greasidis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/mailcheck/index.d.ts b/mailcheck/index.d.ts index e1d60653f3..ab85b6cf6d 100644 --- a/mailcheck/index.d.ts +++ b/mailcheck/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mailcheck 1.1+ +// Type definitions for Mailcheck 1.1 // Project: https://github.com/mailcheck/mailcheck // Definitions by: Paulo Cesar // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/ui-router-extras/index.d.ts b/ui-router-extras/index.d.ts index 13dcfaed6e..0758058c50 100644 --- a/ui-router-extras/index.d.ts +++ b/ui-router-extras/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for UI-Router Extras 0.0.14+ (ct.ui.router.extras module) +// Type definitions for UI-Router Extras (ct.ui.router.extras module) 0.0 // Project: https://github.com/christopherthielen/ui-router-extras // Definitions by: Michael Putters , Marcel van de Kamp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/yfiles/index.d.ts b/yfiles/index.d.ts index e32f228863..dbeb5d3f48 100644 --- a/yfiles/index.d.ts +++ b/yfiles/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for yFiles for HTML 1.3+ +// 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 From 59ce85c4aa21099f51dd22ac295a3ee1617b49b4 Mon Sep 17 00:00:00 2001 From: Fabian Meul Date: Sun, 18 Dec 2016 19:13:55 +0100 Subject: [PATCH 033/101] Updated masonry-layout to fix linting errors (#13272) * Updated masonry-layout to fix linting errors * Fixed the tests I could fix. * Removed patch version --- masonry-layout/index.d.ts | 34 +++++++++++------------ masonry-layout/masonry-layout-tests.ts | 37 +++++++++++++++----------- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/masonry-layout/index.d.ts b/masonry-layout/index.d.ts index 41753358c9..4517606ce7 100644 --- a/masonry-layout/index.d.ts +++ b/masonry-layout/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Masonry 4.0.0 +// Type definitions for Masonry 4.0 // Project: https://github.com/desandro/masonry // Definitions by: Mark Wilson // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,28 +8,28 @@ // Modified from original definitions by: // Travis Brown < https://github.com/warriorrocker> -declare module Masonry { +declare namespace Masonry { - class Masonry implements MasonryGrid { + class Masonry implements MasonryGrid { constructor(options?: MasonryOptions); constructor(selector: string, options?: MasonryOptions); } - interface MasonryGrid { + interface MasonryGrid { masonry?(): void; masonry?(eventName: string, listener: any): void; // layout layout?(): void; - layoutItems?(items: Array, isStill?: boolean): void; - stamp?(elements: Array): void; - unstamp?(elements: Array): void; + layoutItems?(items: any[], isStill?: boolean): void; + stamp?(elements: any[]): void; + unstamp?(elements: any[]): void; // add and remove items - appended?(elements: Array): void; - prepended?(elements: Array): void; - addItems?(elements: Array): void; - remove?(elements: Array): void; + appended?(elements: any[]): void; + prepended?(elements: any[]): void; + addItems?(elements: any[]): void; + remove?(elements: any[]): void; // events on?(eventName: string, listener: any): void; @@ -39,11 +39,11 @@ declare module Masonry { // utilities reloadItems?(): void; destroy?(): void; - getItemElements?(): Array; + getItemElements?(): any[]; data?(element: Element): Masonry; } - interface MasonryOptions { + interface MasonryOptions { // layout itemSelector?: string; @@ -56,15 +56,15 @@ declare module Masonry { originTop?: boolean; // setup - containerStyle?: Object; + containerStyle?: {}; transitionDuration?: any; resize?: boolean; initLayout?: boolean; } } +export = Masonry; + interface JQuery { - masonry(options?: Masonry.MasonryOptions): JQuery; + masonry(options?: Masonry.MasonryOptions): JQuery; } - - diff --git a/masonry-layout/masonry-layout-tests.ts b/masonry-layout/masonry-layout-tests.ts index ac25f08db2..7a4f023fae 100644 --- a/masonry-layout/masonry-layout-tests.ts +++ b/masonry-layout/masonry-layout-tests.ts @@ -1,31 +1,36 @@ // test file for masonry-layout.d.ts -//import {Masonry} from "./masonry-layout.d.ts"; +import * as $ from "jquery"; +import { Masonry } from "./index"; // responsive layouts -function testResponsiveLayouts() { - $('.grid').masonry({ - itemSelector: '.grid-item', - columnWidth: '.grid-sizer', - percentPosition: true - }); -} +// function testResponsiveLayouts() { +// $(document).ready(function () { +// $('.grid').masonry({ +// itemSelector: '.grid-item', +// columnWidth: '.grid-sizer', +// percentPosition: true +// }); +// }); +// }; // recommended Options function testRecommendedOptions() { - $('.grid').masonry({ - columnWidth: 200, - itemSelector: '.grid-item' - }); + // $(document).ready(function () { + // $('.grid').masonry({ + // columnWidth: 200, + // itemSelector: '.grid-item' + // }); + // }); - var msnry = new Masonry.Masonry('.grid', { + var msnry = new Masonry('.grid', { columnWidth: 200, itemSelector: '.grid-item' }); -} +}; // extended Options function testExtendedOptions() { - var msnry = new Masonry.Masonry('.grid', { + var msnry = new Masonry('.grid', { itemSelector: '.grid-item', columnWidth: '.grid-sizer', percentPosition: true, @@ -41,4 +46,4 @@ function testExtendedOptions() { resize: true, initLayout: true }); -} +}; From de2e7e96d74634b039fe4fc87703d428fabb447e Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Mon, 19 Dec 2016 09:36:29 +0900 Subject: [PATCH 034/101] Add redux-persist and basic transformers (#13389) * Add definitions for redux-persist * Add missin generic types * Add definitions for filter transformer * Add definitions for encrypt transformer * Fix header * Add definitions for compress transformer * Delete unnecessary linter configs * Change way of importing, fix tests --- redux-persist-transform-compress/index.d.ts | 9 +++ redux-persist-transform-compress/package.json | 5 ++ .../redux-persist-transform-compress-tests.ts | 11 ++++ .../tsconfig.json | 19 ++++++ redux-persist-transform-encrypt/index.d.ts | 18 +++++ redux-persist-transform-encrypt/package.json | 5 ++ .../redux-persist-transform-encrypt-tests.ts | 13 ++++ redux-persist-transform-encrypt/tsconfig.json | 19 ++++++ redux-persist-transform-filter/index.d.ts | 8 +++ redux-persist-transform-filter/package.json | 5 ++ .../redux-persist-transform-filter-tests.ts | 15 +++++ redux-persist-transform-filter/tsconfig.json | 19 ++++++ redux-persist/constants.d.ts | 2 + redux-persist/index.d.ts | 66 +++++++++++++++++++ redux-persist/package.json | 5 ++ redux-persist/redux-persist-tests.ts | 53 +++++++++++++++ redux-persist/storages.d.ts | 4 ++ redux-persist/tsconfig.json | 21 ++++++ 18 files changed, 297 insertions(+) create mode 100644 redux-persist-transform-compress/index.d.ts create mode 100644 redux-persist-transform-compress/package.json create mode 100644 redux-persist-transform-compress/redux-persist-transform-compress-tests.ts create mode 100644 redux-persist-transform-compress/tsconfig.json create mode 100644 redux-persist-transform-encrypt/index.d.ts create mode 100644 redux-persist-transform-encrypt/package.json create mode 100644 redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts create mode 100644 redux-persist-transform-encrypt/tsconfig.json create mode 100644 redux-persist-transform-filter/index.d.ts create mode 100644 redux-persist-transform-filter/package.json create mode 100644 redux-persist-transform-filter/redux-persist-transform-filter-tests.ts create mode 100644 redux-persist-transform-filter/tsconfig.json create mode 100644 redux-persist/constants.d.ts create mode 100644 redux-persist/index.d.ts create mode 100644 redux-persist/package.json create mode 100644 redux-persist/redux-persist-tests.ts create mode 100644 redux-persist/storages.d.ts create mode 100644 redux-persist/tsconfig.json diff --git a/redux-persist-transform-compress/index.d.ts b/redux-persist-transform-compress/index.d.ts new file mode 100644 index 0000000000..2f8fb7f366 --- /dev/null +++ b/redux-persist-transform-compress/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for redux-persist-transform-compress 4.1 +// Project: https://github.com/rt2zz/redux-persist-transform-compress +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { PersistConfig, PersistTransformer } from "redux-persist"; + +export = createCompressor; +declare function createCompressor (config?: PersistConfig): PersistTransformer; diff --git a/redux-persist-transform-compress/package.json b/redux-persist-transform-compress/package.json new file mode 100644 index 0000000000..36ce503807 --- /dev/null +++ b/redux-persist-transform-compress/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} diff --git a/redux-persist-transform-compress/redux-persist-transform-compress-tests.ts b/redux-persist-transform-compress/redux-persist-transform-compress-tests.ts new file mode 100644 index 0000000000..b445171cb9 --- /dev/null +++ b/redux-persist-transform-compress/redux-persist-transform-compress-tests.ts @@ -0,0 +1,11 @@ +import { createStore, Reducer, Store } from "redux" +import { createPersistor, Persistor, PersistTransformer } from "redux-persist" +import createCompressor = require("redux-persist-transform-compress") + +const reducer: Reducer = (state: any, action: any) => ({}) + +const compressor: PersistTransformer = createCompressor({ whitelist : ["foo"] }) + +const store: Store = createStore(reducer) + +const persistor: Persistor = createPersistor(store, { transforms : [compressor] }) diff --git a/redux-persist-transform-compress/tsconfig.json b/redux-persist-transform-compress/tsconfig.json new file mode 100644 index 0000000000..d2d6a9f248 --- /dev/null +++ b/redux-persist-transform-compress/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-persist-transform-compress-tests.ts" + ] +} diff --git a/redux-persist-transform-encrypt/index.d.ts b/redux-persist-transform-encrypt/index.d.ts new file mode 100644 index 0000000000..048f02221f --- /dev/null +++ b/redux-persist-transform-encrypt/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for redux-persist-transform-encrypt 0.1 +// Project: https://github.com/maxdeviant/redux-persist-transform-encrypt#readme +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { PersistTransformer } from "redux-persist"; + +export as namespace ReduxPersistEncryptor; + +export = createEncryptor; + +declare function createEncryptor (config: createEncryptor.EncryptorConfig): PersistTransformer; + +declare namespace createEncryptor { + export interface EncryptorConfig { + secretKey: string; + } +} diff --git a/redux-persist-transform-encrypt/package.json b/redux-persist-transform-encrypt/package.json new file mode 100644 index 0000000000..36ce503807 --- /dev/null +++ b/redux-persist-transform-encrypt/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} diff --git a/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts b/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts new file mode 100644 index 0000000000..b3a70dc776 --- /dev/null +++ b/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts @@ -0,0 +1,13 @@ +import { createStore, Reducer, Store } from "redux" +import { createPersistor, Persistor, PersistTransformer } from "redux-persist" +import { EncryptorConfig } from "redux-persist-transform-encrypt" +import * as createEncryptor from "redux-persist-transform-encrypt" + +const reducer: Reducer = (state: any, action: any) => ({}) + +const config: EncryptorConfig = { secretKey : "foo" } +const encryptor: PersistTransformer = createEncryptor(config) + +const store: Store = createStore(reducer) + +const persistor: Persistor = createPersistor(store, { transforms : [encryptor] }) diff --git a/redux-persist-transform-encrypt/tsconfig.json b/redux-persist-transform-encrypt/tsconfig.json new file mode 100644 index 0000000000..bd7d84ac1d --- /dev/null +++ b/redux-persist-transform-encrypt/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-persist-transform-encrypt-tests.ts" + ] +} diff --git a/redux-persist-transform-filter/index.d.ts b/redux-persist-transform-filter/index.d.ts new file mode 100644 index 0000000000..19e7779bbd --- /dev/null +++ b/redux-persist-transform-filter/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for redux-persist-transform-filter 0.0 +// Project: https://github.com/edy/redux-persist-transform-filter +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { PersistTransformer } from "redux-persist"; + +export default function createFilter (reducerName: string, inboundPaths?: string[], outboundPaths?: string[]): PersistTransformer; diff --git a/redux-persist-transform-filter/package.json b/redux-persist-transform-filter/package.json new file mode 100644 index 0000000000..36ce503807 --- /dev/null +++ b/redux-persist-transform-filter/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} diff --git a/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts b/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts new file mode 100644 index 0000000000..a19f7610e4 --- /dev/null +++ b/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts @@ -0,0 +1,15 @@ +import { createStore, Reducer, Store } from "redux" +import { createPersistor, Persistor, PersistTransformer } from "redux-persist" +import createFilter from "redux-persist-transform-filter" + +const reducer: Reducer = (state: any, action: any) => ({}) + +const filter: PersistTransformer = createFilter( + "foo", + ["foo.bar"], + ["fizz.buzz"] +) + +const store: Store = createStore(reducer) + +const persistor: Persistor = createPersistor(store, { transforms : [filter] }) diff --git a/redux-persist-transform-filter/tsconfig.json b/redux-persist-transform-filter/tsconfig.json new file mode 100644 index 0000000000..9743fa6b7d --- /dev/null +++ b/redux-persist-transform-filter/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-persist-transform-filter-tests.ts" + ] +} diff --git a/redux-persist/constants.d.ts b/redux-persist/constants.d.ts new file mode 100644 index 0000000000..93d3249dda --- /dev/null +++ b/redux-persist/constants.d.ts @@ -0,0 +1,2 @@ +export const KEY_PREFIX: string; +export const REHYDRATE: string; diff --git a/redux-persist/index.d.ts b/redux-persist/index.d.ts new file mode 100644 index 0000000000..c8d099d5e6 --- /dev/null +++ b/redux-persist/index.d.ts @@ -0,0 +1,66 @@ +// Type definitions for redux-persist 4.0 +// Project: https://github.com/rt2zz/redux-persist +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Action, GenericStoreEnhancer, Store } from "redux"; + +export interface PersistAction extends Action { + payload?: S; + error?: any; +} + +export interface PersistorRehydrateOptions { + serial?: boolean; +} + +export interface Persistor { + purge(keys?: string[]): void; + rehydrate(incoming: A, options?: PersistorRehydrateOptions): A; + pause(): void; + resume(): void; +} + +export type PersistCallback = (err: any, response?: A) => void; + +export interface PersistTransformer { + in(state: any, key: string): any; + out(state: any, key: string): any; +} + +export interface PersistStorage { + setItem(key: string, value: any, callback?: PersistCallback): Promise; + getItem(key: string, callback?: PersistCallback): Promise; + removeItem(key: string, callback?: PersistCallback): Promise; + getAllKeys(callback?: PersistCallback): Promise; + [key: string]: any; +} + +export type PersistStateReconciler = (state: A, inboundState: B, reducedState: C, log?: boolean) => C; + +export interface PersistAutoRehydrateConfig { + stateReconcile?: PersistStateReconciler; +} + +export interface PersistConfig { + whitelist?: string[]; + blacklist?: string[]; + transforms?: PersistTransformer[]; + storage?: PersistStorage; + debounce?: number; + keyPrefix?: string; + serialize?: (data: any) => string; + deserialize?: (data: string) => any; +} + +export function autoRehydrate (config?: PersistAutoRehydrateConfig): GenericStoreEnhancer; + +export function createPersistor (store: Store, config?: PersistConfig): Persistor; + +export function createTransform (inbound: any, outbound: any, config?: PersistConfig): PersistTransformer; + +export function getStoredState(config?: PersistConfig, callback?: PersistCallback): Promise; + +export function persistStore (store: Store, config?: PersistConfig, callback?: PersistCallback): Persistor; + +export function purgeStoredState (config?: PersistConfig, keys?: string[]): Promise; diff --git a/redux-persist/package.json b/redux-persist/package.json new file mode 100644 index 0000000000..36ce503807 --- /dev/null +++ b/redux-persist/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} diff --git a/redux-persist/redux-persist-tests.ts b/redux-persist/redux-persist-tests.ts new file mode 100644 index 0000000000..59885a292a --- /dev/null +++ b/redux-persist/redux-persist-tests.ts @@ -0,0 +1,53 @@ +import { createStore, Store, Reducer } from "redux" +import { + autoRehydrate, + createPersistor, + createTransform, + getStoredState, + persistStore, + purgeStoredState, + PersistConfig, + PersistAutoRehydrateConfig, + PersistCallback, + Persistor, + PersistorRehydrateOptions, + PersistTransformer +} from "redux-persist" +import { KEY_PREFIX, REHYDRATE } from "redux-persist/constants" +import { asyncLocalStorage, asyncSessionStorage } from "redux-persist/storages" + +const reducer: Reducer = (state: any, action: any) => ({}) + +const persistCallback: PersistCallback = (err: any, response: any) => {} + +const transform: PersistTransformer = createTransform({}, {}, { whitelist : ["foo"] }) + +const persistConfig: PersistConfig = { + blacklist : ["foo"], + whitelist : ["bar"], + storage : asyncLocalStorage, + transforms : [transform], + debounce : 1000, + keyPrefix : KEY_PREFIX +} + +const rehydrateOptions: PersistorRehydrateOptions = { serial : true } + +const autoRehydrateConfig: PersistAutoRehydrateConfig = { + stateReconcile: (state: any, inboundState: any, reducedState: any, log: boolean) => ({}) +} + +const store: Store = createStore(reducer, autoRehydrate(autoRehydrateConfig)) +const persistor: Persistor = persistStore(store, persistConfig, persistCallback) + +purgeStoredState({ whitelist : ["foo"] }, ["bar"]) + +getStoredState(persistConfig, (err: any, restoredState: any) => { + const store: Store = createStore(reducer, restoredState) + const persistor: Persistor = createPersistor(store, persistConfig) + const secondaryPersistor: Persistor = createPersistor(store, { storage : asyncSessionStorage }) + persistor.pause() + persistor.resume() + persistor.purge(["foo", "bar"]) + persistor.rehydrate(restoredState, rehydrateOptions) +}) diff --git a/redux-persist/storages.d.ts b/redux-persist/storages.d.ts new file mode 100644 index 0000000000..b798ed2664 --- /dev/null +++ b/redux-persist/storages.d.ts @@ -0,0 +1,4 @@ +import { PersistStorage } from "redux-persist"; + +export const asyncLocalStorage: PersistStorage; +export const asyncSessionStorage: PersistStorage; diff --git a/redux-persist/tsconfig.json b/redux-persist/tsconfig.json new file mode 100644 index 0000000000..f7f8a60693 --- /dev/null +++ b/redux-persist/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "constants.d.ts", + "storages.d.ts", + "redux-persist-tests.ts" + ] +} From 5c3e49174b0614893228ae8c0abc4e0946af25e0 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Mon, 19 Dec 2016 17:36:14 +0900 Subject: [PATCH 035/101] fix: angulartics type definition for ES6 import --- angulartics/angulartics-tests.ts | 4 ++++ angulartics/index.d.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/angulartics/angulartics-tests.ts b/angulartics/angulartics-tests.ts index 02888b0cc5..5a5660a3f8 100644 --- a/angulartics/angulartics-tests.ts +++ b/angulartics/angulartics-tests.ts @@ -1,3 +1,6 @@ +import * as angular from 'angular'; +import { angulartics } from 'angulartics'; + namespace Analytics { angular.module("angulartics.app", ["angulartics"]) .config(["$analyticsProvider", ($analyticsProvider:angulartics.IAnalyticsServiceProvider) => { @@ -36,3 +39,4 @@ namespace Analytics { $analytics.setSuperProperties({ role: 'admin' }); }); } + diff --git a/angulartics/index.d.ts b/angulartics/index.d.ts index 561da3cfad..89ccb81c80 100644 --- a/angulartics/index.d.ts +++ b/angulartics/index.d.ts @@ -4,6 +4,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// + +import * as angular from 'angular'; + declare namespace angulartics { interface IAngularticsStatic { From 505fdd218388817379a5f59af509f6296c338ff4 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Mon, 19 Dec 2016 17:42:37 +0900 Subject: [PATCH 036/101] fix: lint error --- angulartics/index.d.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/angulartics/index.d.ts b/angulartics/index.d.ts index 89ccb81c80..c7bc860ebd 100644 --- a/angulartics/index.d.ts +++ b/angulartics/index.d.ts @@ -1,22 +1,20 @@ -// Type definitions for Angulartics v1.3.0 +// Type definitions for Angulartics 1.3 // Project: http://luisfarzati.github.io/angulartics/ // Definitions by: Steven Fan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - import * as angular from 'angular'; declare namespace angulartics { interface IAngularticsStatic { - waitForVendorApi(objectName:string, delay:number, containsField?:any, registerFn?:any, onTimeout?:boolean): void; + waitForVendorApi(objectName: string, delay: number, containsField?: any, registerFn?: any, onTimeout?: boolean): void; } interface IAnalyticsService { eventTrack(eventName: string, properties?: any): any; getOptOut(): boolean; - pageTrack(path:string, location?:angular.ILocationService): any; + pageTrack(path: string, location?: angular.ILocationService): any; setAlias(alias: string): any; setOptOut(value: boolean): void; setUsername(username: string): any; @@ -35,7 +33,7 @@ declare namespace angulartics { trackRoutes(value: boolean): void; trackStates(value: boolean): void; - registerPageTrack(callback:(path:string, location?:angular.ILocationService) => any): void; + registerPageTrack(callback: (path: string, location?: angular.ILocationService) => any): void; registerEventTrack(callback: (eventName: string, properties?: any) => any): void; registerSetAlias(callback: (alias: string) => any): void; registerSetUsername(callback: (username: string) => any): void; @@ -50,8 +48,8 @@ declare namespace angulartics { autoBasePath: boolean }, developerMode: boolean - } + }; } } -declare var angulartics:angulartics.IAngularticsStatic; +declare var angulartics: angulartics.IAngularticsStatic; From 398e713c2076769a82083e384c66b044424a0e37 Mon Sep 17 00:00:00 2001 From: Caleb Meredith Date: Mon, 19 Dec 2016 09:42:29 -0500 Subject: [PATCH 037/101] fix scalar type config (#13398) The `GraphQLScalarTypeConfig` interface had incorrect types. Correct types may be seen here: https://github.com/graphql/graphql-js/blob/379a3084392179d2cae92c211a4559f9836299c6/src/type/definition.js#L348-L350 --- graphql/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphql/index.d.ts b/graphql/index.d.ts index 14b29144eb..a865687eb1 100644 --- a/graphql/index.d.ts +++ b/graphql/index.d.ts @@ -1185,9 +1185,9 @@ declare module "graphql/type/definition" { export interface GraphQLScalarTypeConfig { name: string; description?: string; - serialize: (value: any) => TInternal; - parseValue?: (value: any) => TExternal; - parseLiteral?: (valueNode: ValueNode) => TInternal; + serialize: (value: any) => TExternal | null | undefined; + parseValue?: (value: any) => TInternal | null | undefined; + parseLiteral?: (valueNode: ValueNode) => TInternal | null | undefined; } /** From dd4f32047b7d7d1e3f9c6024980fb59ba1d253fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Kov=C3=A1cs?= Date: Mon, 19 Dec 2016 17:42:13 +0100 Subject: [PATCH 038/101] [interact.js] Update module names (#13316) Update CommonJS module name as it was changed in version 1.2.7. AMD module name is also different from both new and old CommonJS module names, so a separate declaration was created for that as well. --- interact.js/index.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/interact.js/index.d.ts b/interact.js/index.d.ts index c9d15a2a5f..866ced2216 100644 --- a/interact.js/index.d.ts +++ b/interact.js/index.d.ts @@ -243,6 +243,17 @@ declare namespace Interact { declare var interact: Interact.InteractStatic; -declare module "interact.js" { +// CommonJS module name until version 1.2.6 is "interact.js" + declare module "interact.js" { + export = interact; + } + +// CommonJS module name from version 1.2.7 onward is "interactjs" +declare module "interactjs" { + export = interact; +} + +// AMD module name is "interact" +declare module "interact" { export = interact; } From fb1cf61bcadc3b8ac9c09c376d01e6b4c28dd97c Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Tue, 20 Dec 2016 07:41:47 +0900 Subject: [PATCH 039/101] Add definitions for redux-recycle (#13424) * Add definitions for redux-recycle * Fix linter errors --- redux-recycle/index.d.ts | 9 +++++++++ redux-recycle/package.json | 5 +++++ redux-recycle/redux-recycle-tests.ts | 8 ++++++++ redux-recycle/tsconfig.json | 19 +++++++++++++++++++ 4 files changed, 41 insertions(+) create mode 100644 redux-recycle/index.d.ts create mode 100644 redux-recycle/package.json create mode 100644 redux-recycle/redux-recycle-tests.ts create mode 100644 redux-recycle/tsconfig.json diff --git a/redux-recycle/index.d.ts b/redux-recycle/index.d.ts new file mode 100644 index 0000000000..4405e53e48 --- /dev/null +++ b/redux-recycle/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for redux-recycle 1.2 +// Project: https://github.com/omnidan/redux-recycle +// Definitions by: Karol Janyst +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Reducer } from "redux"; + +export default function recycleState (reducer: Reducer, actions: string[], initialState?: A | Reducer): Reducer; + diff --git a/redux-recycle/package.json b/redux-recycle/package.json new file mode 100644 index 0000000000..e52256ea90 --- /dev/null +++ b/redux-recycle/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-recycle/redux-recycle-tests.ts b/redux-recycle/redux-recycle-tests.ts new file mode 100644 index 0000000000..c831102d5a --- /dev/null +++ b/redux-recycle/redux-recycle-tests.ts @@ -0,0 +1,8 @@ +import { Reducer } from "redux"; +import recycleState from "redux-recycle"; + +const reducer: Reducer = (state: any, action: any) => ({}); +const otherReducer: Reducer = (state: any, action: any) => ({}); + +const resetReducer: Reducer = recycleState(reducer, ["reset"], {}); +const resetToOtherReducer: Reducer = recycleState(reducer, ["reset"], otherReducer); diff --git a/redux-recycle/tsconfig.json b/redux-recycle/tsconfig.json new file mode 100644 index 0000000000..e5bf4e4310 --- /dev/null +++ b/redux-recycle/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-recycle-tests.ts" + ] +} From 06274277de84cc9e775301bdbf4bde322c54eaf9 Mon Sep 17 00:00:00 2001 From: Fedor Nezhivoi Date: Tue, 20 Dec 2016 14:12:53 +0200 Subject: [PATCH 040/101] [jest] add type definition for toHaveBeenLastCalledWith (#13038) --- jest/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jest/index.d.ts b/jest/index.d.ts index cf50596d55..d36d5517cc 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -134,6 +134,7 @@ declare namespace jest { toHaveBeenCalled(): boolean; toHaveBeenCalledTimes(expected: number): boolean; toHaveBeenCalledWith(...params: any[]): boolean; + toHaveBeenLastCalledWith(...params: any[]): boolean; toMatch(expected: string | RegExp): void; toMatchSnapshot(): void; toThrow(): void; From 5771822d9c18db4a3de23b2e493bf2eebab758cd Mon Sep 17 00:00:00 2001 From: York Yao Date: Tue, 20 Dec 2016 08:11:51 -0600 Subject: [PATCH 041/101] remove ajv because the package bundles its own types (#13028) --- ajv/ajv-tests.ts | 74 -------------------------- ajv/index.d.ts | 114 ----------------------------------------- ajv/tsconfig.json | 19 ------- notNeededPackages.json | 6 +++ 4 files changed, 6 insertions(+), 207 deletions(-) delete mode 100644 ajv/ajv-tests.ts delete mode 100644 ajv/index.d.ts delete mode 100644 ajv/tsconfig.json diff --git a/ajv/ajv-tests.ts b/ajv/ajv-tests.ts deleted file mode 100644 index 133a198db4..0000000000 --- a/ajv/ajv-tests.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// - -import * as Ajv from 'ajv'; -var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} -var validate = ajv.compile({}); -var valid = validate({}); -if (!valid) console.log(validate.errors); - -var valid = ajv.validate({}, {}); -if (!valid) console.log(ajv.errors); - -ajv.addSchema({}, 'mySchema'); -var valid = ajv.validate('mySchema', {}); -if (!valid) console.log(ajv.errorsText()); - -ajv.addKeyword('range', { - type: 'number', compile: function (sch, parentSchema) { - var min: any = sch[0]; - var max: any = sch[1]; - - return parentSchema.exclusiveRange === true - ? function (data) { return data > min && data < max; } - : function (data) { return data >= min && data <= max; } - } -}); - -var schema = { "range": [2, 4], "exclusiveRange": true }; -var validate = ajv.compile(schema); -console.log(validate(2.01)); // true -console.log(validate(3.99)); // true -console.log(validate(2)); // false -console.log(validate(4)); // false - -declare var request: any; -function loadSchema(uri: any, callback: any) { - request.json(uri, function (err: any, res: any, body: any) { - if (err || res.statusCode >= 400) - callback(err || new Error('Loading error: ' + res.statusCode)); - else - callback(null, body); - }); -} -var ajv = new Ajv({ loadSchema: loadSchema }); - -ajv.compileAsync(schema, function (err, validate) { - if (err) return; - var valid = validate({}); -}); - -declare var knex: any; -function checkIdExists(schema: any, data: any) { - return knex(schema.table) - .select('id') - .where('id', data) - .then(function (rows: any) { - return true; - }); -} - -var validate = ajv.compile(schema); - -(validate({ userId: 1, postId: 19 }) as PromiseLike) - .then(function (valid) { - // "valid" is always true here - console.log('Data is valid'); - }, function (err) { - if (!(err instanceof Ajv.ValidationError)) throw err; - // data is invalid - console.log('Validation errors:', err.errors); - }); - -var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' }); -var validate = ajv.compile(schema); // transpiled es7 async function -(validate({}) as PromiseLike).then(() => { }, () => { }); diff --git a/ajv/index.d.ts b/ajv/index.d.ts deleted file mode 100644 index 94d0055551..0000000000 --- a/ajv/index.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -// Type definitions for ajv -// Project: https://github.com/epoberezkin/ajv -// Definitions by: York Yao -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare class Ajv { - /** - * Create Ajv instance. - */ - constructor(options?: Ajv.AjvOptions); - /** - * Generate validating function and cache the compiled schema for future use. - */ - compile(schema: any): Ajv.AjvValidate; - /** - * Asyncronous version of compile method that loads missing remote schemas using asynchronous function in options.loadSchema. - */ - compileAsync(schema: any, callback: (error: Error, validate: Ajv.AjvValidate) => void): void; - /** - * Validate data using passed schema (it will be compiled and cached). - */ - validate(schema: any, data: any): boolean | PromiseLike; - errors: Ajv.ValidationError[]; - /** - * Add schema(s) to validator instance. - */ - addSchema(schema: any, key: string): void; - /** - * Adds meta schema(s) that can be used to validate other schemas. - * That function should be used instead of addSchema because there may be instance options that would compile a meta schema incorrectly (at the moment it is removeAdditional option). - */ - addMetaSchema(schema: any, key: string): void; - /** - * Validates schema. - * This method should be used to validate schemas rather than validate due to the inconsistency of uri format in JSON-Schema standard. - */ - validateSchema(schema: any): Boolean; - /** - * Retrieve compiled schema previously added with addSchema by the key passed to addSchema or by its full reference (id). - * Returned validating function has schema property with the reference to the original schema. - */ - getSchema(key: string): Ajv.AjvValidate; - /** - * Remove added/cached schema. - * Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. - */ - removeSchema(schema: any): void; - /** - * Add custom format to validate strings. It can also be used to replace pre-defined formats for Ajv instance. - */ - addFormat(name: string, format: any): void; - /** - * Add custom validation keyword to Ajv instance. - */ - addKeyword(keyword: string, definition: Ajv.AjxKeywordDefinition): void; - errorsText(): any; - static ValidationError: Function; -} -declare namespace Ajv { - type AjvOptions = { - v5?: boolean; - allErrors?: boolean; - verbose?: boolean; - jsonPointers?: boolean; - uniqueItems?: boolean; - unicode?: boolean; - format?: string; - formats?: any; - unknownFormats?: true | string[] | "ignore"; - schemas?: any; - missingRefs?: true | "ignore" | "fail"; - extendRefs?: true | "ignore" | "fail"; - loadSchema?(uri: string, callback: (error: Error, body: any) => void): void; - removeAdditional?: boolean | "all" | "failing"; - useDefaults?: boolean | "shared"; - coerceTypes?: boolean | "array"; - async?: any; - transpile?: string; - meta?: boolean; - validateSchema?: boolean | "log"; - addUsedSchema?: boolean; - inlineRefs?: boolean | number; - passContext?: boolean; - loopRequired?: number; - ownProperties?: boolean; - multipleOfPrecision?: boolean | number; - errorDataPath?: string, - messages?: boolean; - beautify?: boolean; - cache?: any; - } - type AjvValidate = ((data: any) => boolean | PromiseLike) & { - errors: ValidationError[]; - } - type AjxKeywordDefinition = { - async?: boolean; - type: string; - compile?: (schema: any, parentsSchema: any) => ((data: any) => boolean | PromiseLike); - validate?: (schema: any, data: any) => boolean; - } - type ValidationError = { - keyword: string; - dataPath: string; - schemaPath: string; - params: any; - message: string; - schema: any; - parentSchema: any; - data: any; - } -} - -export = Ajv; - diff --git a/ajv/tsconfig.json b/ajv/tsconfig.json deleted file mode 100644 index 01bf5ed1da..0000000000 --- a/ajv/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "noImplicitAny": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "ajv-tests.ts" - ] -} \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index 472a3881ca..2566a6fac6 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -94,6 +94,12 @@ "typingsPackageName": "normalizr", "sourceRepoURL": "https://github.com/paularmstrong/normalizr", "asOfVersion": "2.0.18" + }, + { + "libraryName": "ajv", + "typingsPackageName": "ajv", + "sourceRepoURL": "https://github.com/epoberezkin/ajv", + "asOfVersion": "1.0.0" } ] } From 82c28ae8654ce835060d125e0d3c42c450953a64 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 20 Dec 2016 15:15:33 +0100 Subject: [PATCH 042/101] Updated type definitions to yfiles for HTML 2.0. (#13332) * Updated type definitions to yFiles for HTML 2.0. * Updated type definitions to yfiles for HTML 2.0. * Added contact in yfiles .d.ts header. --- yfiles/index.d.ts | 249201 ++++++++++++++++++-------------------- yfiles/yfiles-tests.ts | 142 +- 2 files changed, 115869 insertions(+), 133474 deletions(-) diff --git a/yfiles/index.d.ts b/yfiles/index.d.ts index dbeb5d3f48..dafc4e8e2a 100644 --- a/yfiles/index.d.ts +++ b/yfiles/index.d.ts @@ -1,10481 +1,878 @@ -// Type definitions for yFiles for HTML 1.3 +// Type definitions for yFiles for HTML 2.0 // Project: http://www.yworks.com/products/yfiles-for-html -// Definitions by: yWorks GmbH +// Definitions by: yWorks GmbH HTML Team // Definitions: https://github.com/yWorks/DefinitelyTyped -/* ************************************************************************** - ** - ** This file is part of yFiles for HTML 1.3. +/**************************************************************************** ** + ** This file is part of yFiles for HTML 2.0. + ** ** yWorks proprietary/confidential. Use is subject to license terms. ** - ** Copyright (c) 2015 by yWorks GmbH, Vor dem Kreuzberg 28, + ** Copyright (c) 2015 by yWorks GmbH, Vor dem Kreuzberg 28, ** 72070 Tuebingen, Germany. All rights reserved. ** ***************************************************************************/ -declare module system{ + +declare namespace yfiles{ + namespace lang{ + interface ClassConstructor { + new ():T; + } + function BaseClass(...base:any[]):yfiles.lang.ClassConstructor; + } } -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; + +declare namespace system{ +}declare namespace yfiles{ + export namespace lang{ + /** + * 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. + *

+ * @class yfiles.lang.Object_Interface + */ + export interface Object_Interface extends Object{} + export class Object_Interface { + /** + * Tests whether this object and the other object are equal. + * @param {Object} other The tested object. + * @returns {boolean} true, if the objects are equal; false otherwise. + */ equals(other:Object):boolean; + /** + * 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. + * @returns {boolean} true, if the objects are equal; false otherwise. + * @static + */ + static equals(a:Object,b:Object):boolean; + /** + * Returns the type of this object. + * @returns {yfiles.lang.Class} The type of this object. + */ + getClass():yfiles.lang.Class; + /** + * 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. + * @returns {Object} An object with a get and/or set method that reads/writes to the specified field. + */ + getOwnProperty(name:string,bound:boolean):Object; + /** + * 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. + * @returns {Object} The most recently defined property descriptor in the prototype chain of the given object. + * @static + */ + static getPropertyDescriptor(o:Object,name:string):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. + *

+ * @returns {number} The hash code of this object. + */ 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; + * Shallow clones an object. + *

+ * It will also clone any value types. + *

+ * @returns {Object} A cloned instance of the same type. + */ + memberwiseClone():Object; /** - * Creates an empty doubly linked list. - */ - new ():yfiles.algorithms.YList; + * Tests if two objects are identical. + * @param {Object} a One of the objects. + * @param {Object} b One of the objects. + * @returns {boolean} true, if the objects are the identical; false otherwise. + * @static + */ + static referenceEquals(a:Object,b:Object):boolean; /** - * 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; + * Displays the textual representation of the object. + * @returns {string} The textual representation of this object. + */ toString():string; + static $class:yfiles.lang.Class; } - 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{ + * This type represents an abstract value, that is a function that is not implemented. + * @class yfiles.lang.Abstract + */ + export interface Abstract extends Object{} + export class Abstract { /** - * 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; + * Tests whether the given object or property descriptor is a representation of an abstract value. + * @param {Object} o The object to test. + * @returns {boolean} true, if the object is abstract; false otherwise. + * @static + */ + static isAbstract(o:Object):boolean; + static $class:yfiles.lang.Class; } - 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{ + * 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.
  • + *
+ * @class yfiles.lang.Class + */ + export interface Class extends Object{} + export class Class { /** - * 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; + * Returns the class object for the given name, or null if no such class exists. + * @param {string} name The name of the requested class. + * @returns {yfiles.lang.Class} The class object or null, if no such class exists. + * @static + */ + static forName(name:string):yfiles.lang.Class; /** - * 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; + * Returns all attributes that belong to this type. + * @param {boolean} [inherited=true] If true, then the attributes of the parent types are also added to the list. Default value is false. + * @returns {Array.} An array of attributes that belong to this type. + */ + getAttributes(inherited?:boolean):yfiles.lang.Attribute[]; /** - * 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; + * Returns an array of all properties of the type. + * @param {boolean} [inherited=true] + * @param {boolean} [staticProperties=false] + * @returns {Array.} An array of properties. + */ + getProperties(inherited?:boolean,staticProperties?:boolean):yfiles.lang.PropertyInfo[]; /** - * He node with smallest priority in this queue. - * Precondition: !isEmpty() - * @see Specified by {@link yfiles.algorithms.INodePQ#min}. - */ - min:yfiles.algorithms.Node; + * Returns an array of all properties of the type. + * @param {Object} options The parameters to pass. + * @param {boolean} [options.inherited=true] + * @param {boolean} [options.staticProperties=false] + * @returns {Array.} An array of properties. + */ + getProperties(options:{inherited?:boolean,staticProperties?:boolean}):yfiles.lang.PropertyInfo[]; /** - * Makes this queue the empty queue. - * in this queue. - * @see Specified by {@link yfiles.algorithms.INodePQ#clear}. - */ - clear():void; + * 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. + * @static + */ + static injectInterfaces(obj:Object,...traits:Object[]):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; + * 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. + * @returns {boolean} true, if the object is an instance of this type; false otherwise. + */ + isInstance(o:Object):boolean; /** - * Returns the current priority of the given node. - * @see Specified by {@link yfiles.algorithms.INodePQ#getPriority}. - */ - getPriority(v:yfiles.algorithms.Node):Object; + * Creates a new instance of this type using its default constructor. + * @returns {Object} A new instance of this type using its default constructor. + */ + newInstance():Object; /** - * Specifies whether or not this queue is empty. - * @see Specified by {@link yfiles.algorithms.INodePQ#empty}. - */ - empty:boolean; + * true, if this type represents an enum; false otherwise. + * @type {boolean} + */ + isEnum:boolean; /** - * Returns the number of nodes currently in this queue. - * @see Specified by {@link yfiles.algorithms.INodePQ#size}. - */ - size():number; + * true, if this type represents a primitive type; false otherwise. + *

+ * The primitive types are: number, string and boolean. + *

+ * @type {boolean} + */ + isPrimitive: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}. + *

+ * @type {boolean} + */ + isValueType:boolean; + /** + * true, if this type represents a regular class; false otherwise. + * @type {boolean} + */ + isClass:boolean; + /** + * The short name of this class. + * @type {string} + */ + name:string; + static $class:yfiles.lang.Class; } - var INodePQ:{ + /** + * Wrapper class for the JavaScript number primitive type. + * @class yfiles.lang.Number + * @implements {yfiles.lang.IComparable} + */ + export interface Number extends Object,yfiles.lang.IComparable{} + export class Number { + /** + * Compares this number with another one. + * @param {Object} obj The other number to compare with. + * @returns {number} 0 if both numbers are equal, -1 if this number is smaller than the other one, 1 otherwise. + */ + compareTo(obj:Object):number; + static $class:yfiles.lang.Class; + } + /** + * Wrapper class for the JavaScript string primitive type. + * @class yfiles.lang.String + * @implements {yfiles.lang.IComparable} + */ + export interface String extends Object,yfiles.lang.IComparable{} + export class String { + /** + * Compares this string with another one. + * @param {Object} obj The other string to compare with. + * @returns {number} 0 if both strings are equal, -1 if this string comes before the other one in lexicographic sort order, 1 otherwise. + */ + compareTo(obj:Object):number; + static $class:yfiles.lang.Class; + } + /** + * Wrapper class for the JavaScript boolean primitive type. + * @class yfiles.lang.Boolean + * @implements {yfiles.lang.IComparable} + */ + export interface Boolean extends Object,yfiles.lang.IComparable{} + export class Boolean { + /** + * Compares this boolean with another one. + * @param {Object} obj The other boolean to compare with. + * @returns {number} 0 if both booleans are equal, -1 if this boolean is false and the other is true, 1 otherwise. + */ + compareTo(obj:Object):number; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.lang.Struct#createDefault + * @class yfiles.lang.Struct + */ + export interface Struct extends Object{} + export class Struct { + /** + * 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. + * @returns {Object} + * @static + */ + static createDefault():Object; + /** + * Tests whether another object is equal to this struct. + *

+ * As opposed to the implementation of + * {@link yfiles.lang.Object_Interface#equals}, this implementation tests the members of both objects to determine equality. + *

+ * @param {Object} other The other struct. + * @returns {boolean} true, if both objects are equal; false otherwise. + */ + equals(other:Object):boolean; + /** + * Calculates the hash code of this struct based on its members. + * @returns {number} The hash code. + */ + hashCode():number; + static $class:yfiles.lang.Class; + } + /** + * 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) { ... }
+     * 
+ * + * @class yfiles.lang.Enum + */ + export interface Enum extends Object{} + export class 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. + * @returns {string} The name of the field. + * @static + */ + static getName(type:yfiles.lang.Class,value:yfiles.lang.Enum):string; + /** + * Returns a list of all field names that represent an enum value. + * @param {yfiles.lang.Class} type The type of the enum. + * @returns {yfiles.collections.IEnumerable.} A list of all field names that represent an enum value. + * @static + */ + static getValueNames(type:yfiles.lang.Class):yfiles.collections.IEnumerable; + /** + * Returns a list of all numeric values. + * @param {yfiles.lang.Class} type The type of the enum. + * @returns {yfiles.collections.IEnumerable.} A list of all numeric values. + * @static + */ + static getValues(type:yfiles.lang.Class):yfiles.collections.IEnumerable; + /** + * 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. + * @returns {yfiles.lang.Enum} The value of the field with the given ID. + * @static + */ + static parse(type:yfiles.lang.Class,id:string,ignoreCase:boolean):yfiles.lang.Enum; + static $class:yfiles.lang.Class; + } + /** + * 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.
  • + *
+ * @class yfiles.lang.delegate + */ + export interface delegate extends Object{} + export class 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. + * @returns {yfiles.lang.delegate} A delegate that combines both original delegates. + * @static + */ + static combine(d1:Function,d2:Function):Function; + /** + * 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 {Array.} functions The functions from which the delegate should be created. + * @param {Object} target The target object on which the functions should be applied. + * @returns {yfiles.lang.delegate} A new delegate. + * @static + */ + static createDelegate(functions:Function[],target:Object):Function; + /** + * Apply function in the current execution context. + * @param {yfiles.lang.delegate} function2 The function to execute. + * @param {...Object} args Optional function arguments. + * @returns {Object} The result from invoking function. + * @static + */ + static dynamicInvoke(function2:Function,...args:Object[]):Object; + /** + * Return a list of all delegates that are combined into del. + * @param {yfiles.lang.delegate} del The delegate to test. + * @returns {Array.} A list of all delegates that are combined into del. + * @static + */ + static getInvocationList(del:Function):Function[]; + /** + * 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. + * @returns {yfiles.lang.delegate} The modified delegate d1. + * @static + */ + static remove(d1:Function,d2:Function):Function; + /** + * 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. + * @returns {yfiles.lang.delegate} The modified delegate d1. + * @static + */ + static removeAll(d1:Function,d2:Function):Function; + static $class:yfiles.lang.Class; + } + /** + * 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 and the traits are implemented at the same level, then the method is abstract.
  • + *
  • + * If both method definitions are concrete and 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. + *

+ * @class yfiles.lang.Trait + */ + export interface Trait extends Object{} + export class Trait { + /** + * 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. + * @returns {boolean} true, if the object is a trait; false otherwise. + * @static + */ + static isTrait(o:Object):boolean; + static $class:yfiles.lang.Class; + } + /** + * 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 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. + *

+ * @class yfiles.lang.Attribute + */ + export interface Attribute extends Object{} + export class Attribute { + static $class:yfiles.lang.Class; + } + /** + * A lazy class type which delays the creation of the class until it is used. + * @class yfiles.lang.ClassDefinition + */ + export interface ClassDefinition extends Object{} + export class ClassDefinition { + /** + * 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}. + * @constructor + */ + constructor(callback:()=>Object); + static $class:yfiles.lang.Class; + } + /** + * A lazy interface type which delays the creation of the interface until it is used. + * @class yfiles.lang.InterfaceDefinition + */ + export interface InterfaceDefinition extends Object{} + export class InterfaceDefinition { + /** + * 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}. + * @constructor + */ + constructor(callback:()=>Object); + static $class:yfiles.lang.Class; + } + /** + * A lazy struct type which delays the creation of the struct until it is used. + * @class yfiles.lang.StructDefinition + */ + export interface StructDefinition extends Object{} + export class StructDefinition { + /** + * 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}. + * @constructor + */ + constructor(callback:()=>Object); + static $class:yfiles.lang.Class; + } + /** + * A lazy enum type which delays the creation of the enum until it is used. + * @class yfiles.lang.EnumDefinition + */ + export interface EnumDefinition extends Object{} + export class EnumDefinition { + /** + * 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}. + * @constructor + */ + constructor(callback:()=>Object); + static $class:yfiles.lang.Class; + } + /** + * A lazy attribute definition which delays the creation of the attribute until it is used. + * @class yfiles.lang.AttributeDefinition + */ + export interface AttributeDefinition extends Object{} + export class AttributeDefinition { + /** + * 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}. + * @constructor + */ + constructor(callback:()=>Object); + static $class:yfiles.lang.Class; + } + /** + * Subclasses of {@link yfiles.lang.EventArgs} are passed to event handlers to provide the information they need to handle an + * event. + * @class yfiles.lang.EventArgs + */ + export interface EventArgs extends Object{} + export class EventArgs { + /** + * An empty {@link yfiles.lang.EventArgs} object that can be used when no information needs to be passed to the event handler. + * @const + * @static + * @type {yfiles.lang.EventArgs} + */ + static EMPTY:yfiles.lang.EventArgs; + static $class:yfiles.lang.Class; + } + /** + * Event arguments which contain information for a {@link yfiles.lang.IPropertyObservable#addPropertyChangedListener PropertyChanged} + * event. + * @class yfiles.lang.PropertyChangedEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface PropertyChangedEventArgs extends yfiles.lang.EventArgs{} + export class PropertyChangedEventArgs { + /** + * Creates a new instance. + * @param {string} propertyName The name of the changed property. + * @constructor + */ + constructor(propertyName:string); + /** + * The name of the changed property. + * @type {string} + */ + propertyName:string; + static $class:yfiles.lang.Class; + } + /** + * Defines an event which is dispatched when a property changes. + * @interface + */ + export interface IPropertyObservable extends Object{ + /** + * Adds the given listener for the PropertyChanged event that occurs when a property changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.lang.IPropertyObservable#removePropertyChangedListener + * @abstract + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when a property changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.lang.IPropertyObservable#addPropertyChangedListener + * @abstract + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + } + var IPropertyObservable:{ $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{ + * Contains information about a property. + * @class yfiles.lang.PropertyInfo + * @final + */ + export interface PropertyInfo extends Object{} + export class PropertyInfo { /** - * Adds the given node with with given priority to this queue. - * Precondition: !contains(v) - * Complexity: O(log(size())) - */ - add(o:Object,priority:number):void; + * Gets the attributes associated with this property. + * @param {boolean} [inherit=true] if set to true inherited attributes will also be returned. + * @returns {Array.} The attributes or an empty array. + */ + getAttributes(inherit?:boolean):yfiles.lang.Attribute[]; /** - * 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; + * Gets the value of the property from the given object. + * @param {Object} obj The object which has the property, null for static properties. + * @returns {Object} The value of the property from the given object. + */ + getValue(obj:Object):Object; /** - * 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; + * Sets the value of the property on the given object. + * @param {Object} obj The object whose property should be written, null for static properties. + * @param {Object} value + */ + setValue(obj:Object,value:Object):void; /** - * Changes the priority value of the given node. - * Precondition: contains(v) - * Complexity: O(log(size())) - */ - changePriority(o:Object,p:number):void; + * Gets a value indicating whether the property can be read. + * @type {boolean} + */ + canRead:boolean; /** - * 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; + * Gets a value indicating whether the property can be written. + * @type {boolean} + */ + canWrite:boolean; /** - * He node with smallest priority in this queue. - * Precondition: !isEmpty() - */ - min:Object; + * Gets a value indicating whether the property is a static property, rather than declared on an instance. + * @type {boolean} + */ + isStatic:boolean; /** - * The minimum priority value in this queue. - */ - minPriority:number; + * Gets the type of the property. + * @type {yfiles.lang.Class} + */ + propertyType:yfiles.lang.Class; /** - * Returns whether or not the given node is contained - * in this queue. - * Complexity: O(1) - */ - contains(o:Object):boolean; + * Gets the declaring type, i.e. the type where the member was declared. + * @type {yfiles.lang.Class} + */ + declaringType:yfiles.lang.Class; /** - * 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; + * Gets the name of the member. + * @type {string} + */ + name:string; + static $class:yfiles.lang.Class; } - 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{ + * Provides a method by which implementors can be compared to each other. + * @interface + */ + export interface IComparable extends Object{ /** - * The object's data. - * @see Specified by {@link yfiles.algorithms.IIntValueSettable#value}. - */ - value:number; + * Compares this object to the given object of the same type. + * @param {Object} obj The object to compare this to. + * @returns {number} + *
    + *
  • -1: this is less than obj
  • + *
  • 0: this is equal to obj
  • + *
  • 1: this is greater than obj
  • + *
+ * @abstract + */ + compareTo(obj:Object):number; } - var IIntValueSettable:{ + var IComparable:{ $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. - */ + * Implemented by objects which can create a clone of themselves. + * @interface + */ 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}. - */ + * Create a clone of this object. + * @returns {Object} A clone of this object. + * @abstract + */ clone():Object; } var ICloneable:{ @@ -10483,54330 +880,4931 @@ declare module yfiles{ 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. - */ + * A structure which represents a time span. + * @class yfiles.lang.TimeSpan + * @implements {yfiles.lang.IComparable} + * @final + */ + export interface TimeSpan extends yfiles.lang.Struct,yfiles.lang.IComparable{} + export class 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. + * @constructor + */ + constructor(days:number,hours:number,minutes:number,seconds:number,millis:number); + /** + * Creates a new time span which is ticks milliseconds long. + * @param {number} ticks The length of the time span in milliseconds. + * @constructor + */ + constructor(ticks:number); + /** + * + * @param {Object} obj + * @returns {number} + */ + compareTo(obj:Object):number; + /** + * Creates a new time span with the given length in milliseconds. + * @param {number} milliseconds The length of the time span in milliseconds. + * @returns {yfiles.lang.TimeSpan} A newly created time span. + * @static + */ + static fromMilliseconds(milliseconds:number):yfiles.lang.TimeSpan; + /** + * Creates a new time span with the given length in minutes. + * @param {number} minutes The length of the time span in minutes. + * @returns {yfiles.lang.TimeSpan} A newly created time span. + * @static + */ + static fromMinutes(minutes:number):yfiles.lang.TimeSpan; + /** + * Creates a new time span with the given length in seconds. + * @param {number} seconds The length of the time span in seconds. + * @returns {yfiles.lang.TimeSpan} A newly created time span. + * @static + */ + static fromSeconds(seconds:number):yfiles.lang.TimeSpan; + /** + * Empty time span. + * @const + * @static + * @type {yfiles.lang.TimeSpan} + */ + static ZERO:yfiles.lang.TimeSpan; + /** + * The total milliseconds (ticks) of this time span. + * @type {number} + */ + totalMilliseconds:number; + /** + * The total seconds of this time span. + * @type {number} + */ + totalSeconds:number; + /** + * The total seconds of this time span. + * @type {number} + */ + totalMinutes:number; + static $class:yfiles.lang.Class; + } + /** + * Extension of the native JavaScript Error type that includes a stack trace. + *

+ * yFiles includes the following specialized exception types indicated by the {@link yfiles.lang.Exception#name}: + *

+ *
    + *
  • ArgumentError � Indicates that the value of a parameter of the current method is illegal.
  • + *
  • ArgumentNullError � Indicates that the value of a parameter of the current method is null but a non-null value was expected.
  • + *
  • ArgumentOutOfRangeError � Indicates that the value of a parameter of the current method is not in the legal range of values.
  • + *
  • IndexOutOfRangeError � Indicates that an array index is not in the legal range.
  • + *
  • NullReferenceError � Indicates that a value is null when it shouldn't.
  • + *
  • InvalidOperationError � Indicates that the current operation is not valid in the instances's current state.
  • + *
  • NotImplementedError � Indicates that the called method is not implemented.
  • + *
  • NotSupportedError � Indicates that the operation is not supported.
  • + *
  • ArithmeticError � Indicates an error in an arithmetic operation.
  • + *
  • IOError � Indicates an error during an IO operation.
  • + *
  • KeyNotFoundError � Indicates that a mapping does not contain the given key.
  • + *
  • AlgorithmAbortedError � Indicates that an immediate termination request was detected by an algorithm.
  • + *
  • + * InvalidGraphStructureError � Indicates that a graph cannot be used with a certain algorithm. Some graph algorithms require a specific graph + * structure, for example trees or planar graph. These algorithms throw this error if a non-matching graph is used. + *
  • + *
+ *

+ * This type also provides the static {@link yfiles.lang.Exception#catchErrors} property, which when enabled, causes most entry points (e.g. event listeners) to use + * try/catch blocks to catch possible errors that could be thrown during event handling. The errors are handled by the {@link yfiles.lang.Exception#handleError} + * function, which calls the {@link yfiles.lang.Exception#handler} function, if it has been set. Note that for some browsers/plugins, try/catch blocks prevent + * error debugging functionality. Hence, {@link yfiles.lang.Exception#catchErrors} should be turned off while debugging. + *

+ * @class yfiles.lang.Exception + * @extends {Error} + */ + export interface Exception extends Error{} + export class Exception { + /** + * Creates a new exception with the given {@link yfiles.lang.Exception#message} and an optional error {@link yfiles.lang.Exception#name}. + * @param {string} [message=null] The exception message. + * @param {string} [name=null] The exception name. This name can be used in try...catch statements to distinguish between different types of errors. + * @see yfiles.lang.Exception#message + * @constructor + */ + constructor(message?:string,name?:string); + /** + * Creates a new exception with the given {@link yfiles.lang.Exception#message} and an optional error {@link yfiles.lang.Exception#name}. + * @param {Object} options The parameters to pass. + * @param {string} [options.message=null] The exception message. + * @param {string} [options.name=null] The exception name. This name can be used in try...catch statements to distinguish between different types of errors. + * @see yfiles.lang.Exception#message + * @constructor + */ + constructor(options:{message?:string,name?:string}); + /** + * This function is called in catch blocks in the library if {@link yfiles.lang.Exception#catchErrors} is enabled. + *

+ * If a {@link yfiles.lang.Exception#handler} is registered, the error is passed to the error handler, otherwise if {@link yfiles.lang.Exception#catchErrors} is set to true the error is logged to the + * console using console.warn if available. + *

+ * @param {Object} error The error object that has been caught + * @static + */ + static handleError(error:Object):void; + /** + * Gets the exception message. + * @type {string} + */ + message:string; + /** + * Gets the exception name. + * @type {string} + */ 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; + * 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. If this property is set, + * but no {@link yfiles.lang.Exception#handler} is registered, a warning will be logged to the console instead. + *

+ * @static + * @type {boolean} + */ + static catchErrors:boolean; /** - * 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; + * If {@link yfiles.lang.Exception#catchErrors} is enabled, any caught errors are passed to this function. + *

+ * Setting a handler via this property automatically turns on the {@link yfiles.lang.Exception#catchErrors} flag! + *

+ * @static + * @type {function(Object): void} + */ + static handler:(obj:Object)=>void; + static $class:yfiles.lang.Class; } - var GraphMLAttribute:{ - $class:yfiles.lang.Class; - new ():yfiles.graphml.GraphMLAttribute; - }; - export enum KeyType{ + }export namespace graphml{ + export enum GraphMLMemberVisibility{ /** - * Identifier for attribute of type int. - */ - INT, + * The member is ignored by GraphML. + */ + HIDDEN, /** - * Identifier for attribute of type long. - */ - LONG, + * The member is treated according to the normal XAML serialization rules + */ + VISIBLE, /** - * 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 + * Only the content of a member value is read or written, without an enclosing excplicit container object. + *

+ * This only makes a difference when the member value is a container object, such as a collection or map. + *

+ */ + CONTENT } - export enum KeyScope{ + export interface XmlName extends Object{} + export class XmlName { /** - * Unscoped for key definition. - */ - ALL, + * Initializes a new instance of the {@link yfiles.graphml.XmlName} class. + * @param {string} localName The local name of the element. + * @param {string} ns The namespace it belongs to. + * @constructor + */ + constructor(localName:string,ns:string); /** - * Node-Scope for key definition. - */ - NODE, + * Performs a conversion from {@link string} to {@link yfiles.graphml.XmlName}. + *

+ * The name is made up of at most two parts: the namespace and the local name. When given an input like "http://www.w3.org/2000/xmlns/}local" + * it will be split at the "}" character and the first part will be used as the namespace URI, the second part as the local + * name. If no "}" character is used in the input then it will be assumed that the input consists of the local name only. + *

+ * @param {string} expandedName Name of the expanded. + * @returns {yfiles.graphml.XmlName} The result of the conversion. + * @static + */ + static convertFrom(expandedName:string):yfiles.graphml.XmlName; /** - * Edge-Scope for key definition. - */ - EDGE, + * Gets or sets the local name. + * @type {string} + */ + localName:string; /** - * Graph-Scope for key definition. - */ - GRAPH, - /** - * Port-Scope for key definition. - */ - PORT, - /** - * Graphml-Scope for key definition. - */ - GRAPHML + * Gets the namespace. + * @type {string} + */ + namespace:string; + static $class:yfiles.lang.Class; } - 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. - */ + export enum XamlAttributeWritePolicy{ + /** + * Specifies that the write mode of a member should be determined automatically according to the current property value and + * the presence of {@link yfiles.support.TypeConverter}s, {@link yfiles.graphml.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 share the object. - */ + * Never write as a XML attribute, even if a possible conversion exists. + */ NEVER, /** - * Always share the object. - */ + * 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 } - export enum GraphMLSerializationMode{ + export enum GraphMLSharingPolicy{ /** - * The framework decides itself whether a property is to be written. - */ + * Specifies that the share mode of a member should be determined automatically according to the current property value. + */ AUTO, /** - * Never write the property. - */ + * Never share the object. + */ 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 share the object. + *

+ * This will also always place the object in the resources section, even if it only occurs once in the document. + *

+ */ ALWAYS } export enum UndefinedHandling{ /** - * Explicitly read and write undefined values. - */ + * Explicitly read and write undefined values. + */ EXPLICIT, /** - * Throw an exception when undefined values are encountered. - */ + * Throw an exception when undefined values are encountered. + */ THROW, /** - * Treat undefined values like null values. - */ + * Treat undefined values like null values. + */ AS_NULL, /** - * Treat undefined values as default values. - * Default values are never written. - */ + * Treat undefined values as default values. + *

+ * Default values are never written. + *

+ */ AS_DEFAULT } - export enum XamlAttributeWriteMode{ + /** + * 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 yfiles.graphml.XamlSerializer + * @class yfiles.graphml.GraphMLAttribute + * @extends {yfiles.lang.Attribute} + */ + export interface GraphMLAttribute extends yfiles.lang.Attribute{} + export class GraphMLAttribute { + constructor(); /** - * 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, + * 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. + *

+ *

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

+ * @type {string} + */ + name:string; /** - * Never write as a XML attribute, even if a possible conversion exists. - */ - NEVER, + * Gets or sets the XML namespace URI for the member where this attribute is used. + *

+ * This will be used as the XML namespace URI for the XML element or XML attribute. + *

+ *

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

+ * @type {string} + */ + xmlNamespace:string; /** - * 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 + * 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. + *

+ * @type {boolean} + */ + 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.XamlAttributeWritePolicy#AUTO}. + *

+ *

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

+ * @see yfiles.graphml.XamlAttributeWritePolicy + * @type {yfiles.graphml.XamlAttributeWritePolicy} + */ + writeAsAttribute:yfiles.graphml.XamlAttributeWritePolicy; + /** + * Gets or sets whether the object reference identity of the property values should be kept intact. + *

+ * Default value is {@link yfiles.graphml.GraphMLSharingPolicy#AUTO}. + *

+ *

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

+ * @type {yfiles.graphml.GraphMLSharingPolicy} + */ + shareable:yfiles.graphml.GraphMLSharingPolicy; + /** + * Gets or sets how a member should be visible to GraphML. + *

+ * Default value is {@link yfiles.graphml.GraphMLMemberVisibility#VISIBLE}. + *

+ *

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

+ * @type {yfiles.graphml.GraphMLMemberVisibility} + */ + visibility:yfiles.graphml.GraphMLMemberVisibility; + /** + * Specifies the property of a class that is used as the content property in XAML. + *

+ * The value of the content property can appear in XAML as a direct child of the class element, without the need to wrap it + * into a <Class.Property> element. + *

+ *

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

+ * @type {string} + */ + contentProperty:string; + /** + * Gets or sets the type of the value serializer implementation. + * @type {yfiles.lang.Class} + */ + valueSerializer:yfiles.lang.Class; + /** + * Gets or sets a custom {@link yfiles.graphml.IMarkupExtensionConverter} for attribute serialization. + *

+ * The specified type must implement {@link yfiles.graphml.IMarkupExtensionConverter}. + *

+ * @see yfiles.graphml.XamlSerializer + * @see yfiles.graphml.IMarkupExtensionConverter + * @type {yfiles.lang.Class} + */ + markupExtensionConverter:yfiles.lang.Class; + /** + * Types that should be searched for static field or property members of the annotated type. + *

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

+ * @type {Array.} + */ + singletonContainers:yfiles.lang.Class[]; + /** + * Gets or sets the default value of the property this attribute is bound to. + *

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

+ * @type {Object} + */ + defaultValue:Object; + static $class:yfiles.lang.Class; } /** - * 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{ + * A helper holder class that can contain a {@link yfiles.graphml.Future.#value} of a specific type. + *

+ * Typically {@link yfiles.graphml.Future.#hasValue} will be false until at a later point in time {@link yfiles.graphml.Future.#onValueDetermined} is called and the {@link yfiles.graphml.Future.#value} and {@link yfiles.graphml.Future.#hasValue} properties are being + * updated and the {@link yfiles.graphml.Future.#addPropertyChangedListener PropertyChanged} event is triggered. + *

+ * Type parameter T: The type of the {@link yfiles.graphml.Future.#value} + * @class yfiles.graphml.Future. + * @implements {yfiles.lang.IPropertyObservable} + * @template T + * @final + */ + export interface Future extends Object,yfiles.lang.IPropertyObservable{} + export class Future { /** - * Gets the context that is being used for parsing. - * Value: The context. - */ - context:yfiles.graphml.IParseContext; + * Called when the {@link yfiles.graphml.Future.#value} property of this future has been determined. + *

+ * This will set the {@link yfiles.graphml.Future.#hasValue} property to true and assign the {@link yfiles.graphml.Future.#value} property. Also the corresponding {@link yfiles.graphml.Future.#addPropertyChangedListener PropertyChanged} events + * will be triggered if necessary. + *

+ * @param {T} value The value. + */ + onValueDetermined(value:T):void; /** - * Gets the XML element that is currently parsed. - * Value: XML element that is currently parsed. - */ - element:Element; + * The value of this future, which may only be queried if {@link yfiles.graphml.Future.#hasValue} yields true. + * @throws {Stubs.Exceptions.InvalidOperationError} If this property is queried although {@link yfiles.graphml.Future.#hasValue} returns false. + * @type {T} + */ + value:T; + /** + * Gets a value indicating whether this instance has been {@link yfiles.graphml.Future.#onValueDetermined assigned} a {@link yfiles.graphml.Future.#value}. + * @type {boolean} + */ + hasValue:boolean; + /** + * Adds the given listener for the PropertyChanged event that occurs when a property value changes. + *

+ * This event will be triggered for {@link yfiles.graphml.Future.#hasValue} changes and changes of the {@link yfiles.graphml.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.graphml.Future.#hasValue} property. + *

+ * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.graphml.Future.#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when a property value changes. + *

+ * This event will be triggered for {@link yfiles.graphml.Future.#hasValue} changes and changes of the {@link yfiles.graphml.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.graphml.Future.#hasValue} property. + *

+ * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.Future.#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + static $class:yfiles.lang.Class; } - var ParseEventArgs:{ - $class:yfiles.lang.Class; + /** + * Support interface used by {@link yfiles.graphml.ValueSerializer}. + * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface IValueSerializerContext extends Object,yfiles.graph.ILookup{ /** - * 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; + * Gets the value serializer for a specific {@link yfiles.graphml.Property}. + * @param {yfiles.graphml.Property} property The descriptor of the property. + * @returns {yfiles.graphml.ValueSerializer} A serializer or null. + * @abstract + */ + getValueSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; + /** + * Gets the value serializer for a specific type. + * @param {yfiles.lang.Class} type The type to obtain a serializer for. + * @returns {yfiles.graphml.ValueSerializer} A serializer or null. + * @abstract + */ + getValueSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; + } + var IValueSerializerContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; /** - * 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{ + * 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. + *

+ * @class yfiles.graphml.MarkupExtension + */ + export interface MarkupExtension extends Object{} + export class MarkupExtension { /** - * 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; + * Returns an object that is set as the value of the target property for this markup extension. + * @param {yfiles.graph.ILookup} serviceProvider Object that can provide services for the markup extension. + * @returns {Object} The object value to set on the property where the extension is applied. + * @abstract + */ + provideValue(serviceProvider:yfiles.graph.ILookup):Object; + static $class:yfiles.lang.Class; } - 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{ + * Helper classes used during the XAML serialization of instances. + *

+ * Using this class instances can be written in xml attributes as strings. + *

+ * @class yfiles.graphml.ValueSerializer + */ + export interface ValueSerializer extends Object{} + export class ValueSerializer { /** - * Gets the local name of the attribute. - * Value: The local name. - */ - localName:string; + * Determines whether this instance can convert the specified value from the given string. + * @param {string} value The string value to convert. + * @param {yfiles.graphml.IValueSerializerContext} context The context. + * @returns {boolean} true if this instance can convert the specified value from the string; otherwise, false. + */ + canConvertFromString(value:string,context:yfiles.graphml.IValueSerializerContext):boolean; /** - * Gets the namespace for the attribute to use or null. - * Value: The namespace to use. - */ - namespace1:string; + * Determines whether this instance can convert the specified value to a string. + * @param {Object} value The value. + * @param {yfiles.graphml.IValueSerializerContext} context The context. + * @returns {boolean} true if this instance can convert the specified value to a string; otherwise, false. + */ + canConvertToString(value:Object,context:yfiles.graphml.IValueSerializerContext):boolean; /** - * Gets the value of the attribute. - * Value: The value. - */ - value:string; + * Converts the string to an appropriate instance. + * @param {string} value The value to convert to an object. + * @param {yfiles.graphml.IValueSerializerContext} context The context. + * @returns {Object} The converted object + */ + convertFromString(value:string,context:yfiles.graphml.IValueSerializerContext):Object; + /** + * Converts the given value to string. + * @param {Object} o The value. + * @param {yfiles.graphml.IValueSerializerContext} context The context. + * @returns {string} The value as string representation. + */ + convertToString(o:Object,context:yfiles.graphml.IValueSerializerContext):string; + /** + * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given type. + * @param {yfiles.lang.Class} type The type. + * @param {yfiles.graphml.IValueSerializerContext} context The context. + * @returns {yfiles.graphml.ValueSerializer} The serializer to use for the type. + * @static + */ + static getSerializerFor(type:yfiles.lang.Class,context:yfiles.graphml.IValueSerializerContext):yfiles.graphml.ValueSerializer; + /** + * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given descriptor. + * @param {yfiles.graphml.Property} property The descriptor. + * @param {yfiles.graphml.IValueSerializerContext} context The context. + * @returns {yfiles.graphml.ValueSerializer} The serializer to use for the descriptor. + * @static + */ + static getSerializerFor(property:yfiles.graphml.Property,context:yfiles.graphml.IValueSerializerContext):yfiles.graphml.ValueSerializer; + /** + * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given descriptor. + * @param {yfiles.graphml.Property} property The descriptor. + * @returns {yfiles.graphml.ValueSerializer} The serializer to use for the type. + * @static + */ + static getSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; + /** + * Gets the {@link yfiles.graphml.ValueSerializer} implementation for the given type. + * @param {yfiles.lang.Class} type The type. + * @returns {yfiles.graphml.ValueSerializer} The serializer to use for the type. + * @static + */ + static getSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; + static $class:yfiles.lang.Class; } - var GraphMLXmlAttribute:{ - $class:yfiles.lang.Class; + export enum KeyType{ /** - * 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; - }; + * 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 + } /** - * 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{ + * 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. + *

+ * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface IParseContext extends Object,yfiles.graph.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; + * Deserialize the object representation in targetNode. + *

+ * This method calls {@link yfiles.graphml.IParseContext#deserializeCore} with context as first argument and should be used in + * virtually all cases. + *

+ * Type parameter T: The desired target type. + * @param {yfiles.lang.Class} targetType The desired target type. + * @param {Node} targetNode The XML node that should be deserialized. + * @returns {T} an instance of T or null. + * @throws {yfiles.graphml.DeserializationNotSupportedError} + * @see yfiles.graphml.IParseContext#deserializeCore + * @template T + */ + deserialize?(targetType:yfiles.lang.Class,targetNode:Node):T; /** - * 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; + * Deserialize the object representation in targetNode + *

+ * Client code should usually use the extension method {@link yfiles.graphml.IParseContext#deserialize} instead to ensure the the + * correct context instance is used. + *

+ * Type parameter T: The expected return type. + * @param {yfiles.lang.Class} targetType The expected return type. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} targetNode The XML node that should be deserialized. + * @returns {T} The deserialized object from targetNode or an {@link yfiles.graphml.DeserializationNotSupportedError} if targetNode could not be + * deserialized. + * @see yfiles.graphml.IParseContext#deserialize + * @template T + * @abstract + */ + deserializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; /** - * 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}. - */ + * Returns the most current (the last element) within the container hierarchy as it is returned by {@link yfiles.graphml.IParseContext#objectStack} or default(T) if the + * most current element is not of the desired target type. + * Type parameter T: The desired target type. + * @param {yfiles.lang.Class} itemType The desired target type. + * @returns {T} the most current element within the container hierarchy or default(T). + * @template T + * @abstract + */ + getCurrent(itemType:yfiles.lang.Class):T; + /** + * Get a property value that specifies information about how to handle specific cases. + * @param {string} key The identifier for the property + * @returns {Object} The property value, or null if no such property exists. + * @abstract + */ + getDeserializationProperty(key:string):Object; + /** + * 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. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + objectStack:yfiles.collections.IListEnumerable; + /** + * Returns an implementation of {@link yfiles.graphml.IParseEvents} that allows to subscribe to various events in the parse + * process. + * @abstract + * @type {yfiles.graphml.IParseEvents} + */ parseEvents:yfiles.graphml.IParseEvents; /** - * Returns the currently active graph object. - * @see Specified by {@link yfiles.graphml.IParseContext#graph}. - */ + * Returns the currently active graph object + * @abstract + * @type {yfiles.graph.IGraph} + */ 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} - */ + * 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 yfiles.graphml.ParseEventArgs + * @see yfiles.graphml.GraphMLParser + * @interface + */ 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; + * Adds the given listener for the DocumentParsing event that occurs when the document is about to be parsed. + *

+ * This event is triggered when the document element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeDocumentParsingListener + * @abstract + */ + addDocumentParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DocumentParsing event that occurs when the document is about to be parsed. + *

+ * This event is triggered when the document element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addDocumentParsingListener + * @abstract + */ + removeDocumentParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the DocumentParsed event that occurs when the document has been parsed. + *

+ * This event is triggered when the document has been fully parsed. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeDocumentParsedListener + * @abstract + */ + addDocumentParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DocumentParsed event that occurs when the document has been parsed. + *

+ * This event is triggered when the document has been fully parsed. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addDocumentParsedListener + * @abstract + */ + removeDocumentParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the NodeParsing event that occurs when a node element is about to be parsed. + *

+ * This event is triggered when a GraphML 'node' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeNodeParsingListener + * @abstract + */ + addNodeParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the NodeParsing event that occurs when a node element is about to be parsed. + *

+ * This event is triggered when a GraphML 'node' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addNodeParsingListener + * @abstract + */ + removeNodeParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the NodeParsed event that occurs after a node element has been fully parsed. + *

+ * This event is triggered when a GraphML 'node' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeNodeParsedListener + * @abstract + */ + addNodeParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the NodeParsed event that occurs after a node element has been fully parsed. + *

+ * This event is triggered when a GraphML 'node' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addNodeParsedListener + * @abstract + */ + removeNodeParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the EdgeParsing event that occurs when an edge element is about to be parsed. + *

+ * This event is triggered when a GraphML 'edge' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeEdgeParsingListener + * @abstract + */ + addEdgeParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the EdgeParsing event that occurs when an edge element is about to be parsed. + *

+ * This event is triggered when a GraphML 'edge' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addEdgeParsingListener + * @abstract + */ + removeEdgeParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the EdgeParsed event that occurs after a edge element has been fully parsed. + *

+ * This event is triggered when a GraphML 'edge' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeEdgeParsedListener + * @abstract + */ + addEdgeParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the EdgeParsed event that occurs after a edge element has been fully parsed. + *

+ * This event is triggered when a GraphML 'edge' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addEdgeParsedListener + * @abstract + */ + removeEdgeParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the PortParsing event that occurs when a port element is about to be parsed. + *

+ * This event is triggered when a GraphML 'port' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removePortParsingListener + * @abstract + */ + addPortParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the PortParsing event that occurs when a port element is about to be parsed. + *

+ * This event is triggered when a GraphML 'port' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addPortParsingListener + * @abstract + */ + removePortParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the PortParsed event that occurs after a port element has been fully parsed. + *

+ * This event is triggered when a GraphML 'port' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removePortParsedListener + * @abstract + */ + addPortParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the PortParsed event that occurs after a port element has been fully parsed. + *

+ * This event is triggered when a GraphML 'port' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addPortParsedListener + * @abstract + */ + removePortParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphParsing event that occurs when a graph element is about to be parsed. + *

+ * This event is triggered when a GraphML 'graph' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeGraphParsingListener + * @abstract + */ + addGraphParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphParsing event that occurs when a graph element is about to be parsed. + *

+ * This event is triggered when a GraphML 'graph' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addGraphParsingListener + * @abstract + */ + removeGraphParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphParsed event that occurs after a graph element has been fully parsed. + *

+ * This event is triggered when a GraphML 'graph' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeGraphParsedListener + * @abstract + */ + addGraphParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphParsed event that occurs after a graph element has been fully parsed. + *

+ * This event is triggered when a GraphML 'graph' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addGraphParsedListener + * @abstract + */ + removeGraphParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphMLParsing event that occurs when the graphml element is about to be parsed. + *

+ * This event is triggered when a GraphML 'graphml' root-element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeGraphMLParsingListener + * @abstract + */ + addGraphMLParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphMLParsing event that occurs when the graphml element is about to be parsed. + *

+ * This event is triggered when a GraphML 'graphml' root-element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addGraphMLParsingListener + * @abstract + */ + removeGraphMLParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphMLParsed event that occurs after the graphml element has been fully parsed. + *

+ * This event is triggered when a GraphML 'graphml' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeGraphMLParsedListener + * @abstract + */ + addGraphMLParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphMLParsed event that occurs after the graphml element has been fully parsed. + *

+ * This event is triggered when a GraphML 'graphml' closing tag has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addGraphMLParsedListener + * @abstract + */ + removeGraphMLParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the DataParsing event that occurs when a data element is about to be parsed. + *

+ * This event is triggered when a GraphML 'data' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeDataParsingListener + * @abstract + */ + addDataParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DataParsing event that occurs when a data element is about to be parsed. + *

+ * This event is triggered when a GraphML 'data' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addDataParsingListener + * @abstract + */ + removeDataParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the DataParsed event that occurs after a data element has been fully parsed. + *

+ * This event is triggered when a GraphML 'data' element has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeDataParsedListener + * @abstract + */ + addDataParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DataParsed event that occurs after a data element has been fully parsed. + *

+ * This event is triggered when a GraphML 'data' element has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addDataParsedListener + * @abstract + */ + removeDataParsedListener(listener:(sender:Object,evt: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; + * Adds the given listener for the KeyParsing event that occurs when a key element is about to be parsed. + *

+ * This event is triggered when a GraphML 'key' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeKeyParsingListener + * @abstract + */ + addKeyParsingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the KeyParsing event that occurs when a key element is about to be parsed. + *

+ * This event is triggered when a GraphML 'key' element has been encountered. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addKeyParsingListener + * @abstract + */ + removeKeyParsingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the KeyParsed event that occurs after a key element has been fully parsed. + *

+ * This event is triggered when a GraphML 'key' element has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IParseEvents#removeKeyParsedListener + * @abstract + */ + addKeyParsedListener(listener:(sender:Object,evt: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; + * Removes the given listener for the KeyParsed event that occurs after a key element has been fully parsed. + *

+ * This event is triggered when a GraphML 'key' element has been handled. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IParseEvents#addKeyParsedListener + * @abstract + */ + removeKeyParsedListener(listener:(sender:Object,evt: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. - */ + * 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. + *

+ * @class yfiles.graphml.ParseEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface ParseEventArgs extends yfiles.lang.EventArgs{} + export class ParseEventArgs { + /** + * 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}. + * @constructor + */ + constructor(context:yfiles.graphml.IParseContext,element:Element); + /** + * Gets the context that is being used for parsing. + * @type {yfiles.graphml.IParseContext} + */ + context:yfiles.graphml.IParseContext; + /** + * Gets the XML element that is currently parsed. + * @type {Element} + */ + element:Element; + static $class:yfiles.lang.Class; + } + /** + * A data holder for use in the {@link yfiles.graphml.IOutputHandler} interface that encapsulates an XML attribute. + * @class yfiles.graphml.GraphMLXmlAttribute + */ + export interface GraphMLXmlAttribute extends Object{} + export class GraphMLXmlAttribute { + /** + * Initializes a new instance of the {@link yfiles.graphml.GraphMLXmlAttribute} class. + * @param {yfiles.graphml.XmlName} name The attribute name. + * @param {string} value The value. + * @constructor + */ + constructor(name:yfiles.graphml.XmlName,value:string); + /** + * Gets the fully qualified name of the attribute. + * @type {yfiles.graphml.XmlName} + */ + name:yfiles.graphml.XmlName; + /** + * Gets the value of the attribute. + * @type {string} + */ + value:string; + static $class:yfiles.lang.Class; + } + /** + * The interface used by the {@link yfiles.graphml.GraphMLIOHandler} for writing data to the GraphML. + * @interface + */ 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}. - */ + * 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} context The context. + * @returns {boolean} true if for the current context the default value applies and therefore no data element needs to be written. + * @abstract + */ + isDefaultValue(context:yfiles.graphml.IWriteContext):boolean; + /** + * 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} context The context. + * @abstract + */ + writeKeyDefinitionContent(context:yfiles.graphml.IWriteContext):void; + /** + * 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} context The context. + * @abstract + */ + writeValue(context:yfiles.graphml.IWriteContext):void; + /** + * 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. + *

+ * @see yfiles.graphml.WritePrecedence + * @abstract + * @type {yfiles.graphml.WritePrecedence} + */ 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}. - */ + * Gets the XML attributes that should be added to the key definition in the GraphML key element. + * @abstract + * @type {yfiles.collections.IEnumerable.} + */ 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}. - */ + * Gets the XML attributes that should be added to the data element. + * @abstract + * @type {yfiles.collections.IEnumerable.} + */ 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. - */ + * 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 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. - */ + * 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{ + * 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. + *

+ * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface IWriteContext extends Object,yfiles.graph.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 (the last element) within the container hierarchy as it is returned by {@link yfiles.graphml.IWriteContext#objectStack} or default(T) if the + * most current element is not of the desired target type. + * Type parameter T: The desired target type. + * @param {yfiles.lang.Class} itemType The desired target type. + * @returns {T} the most current element within the container hierarchy or default(T). + * @template T + * @abstract + */ + getCurrent(itemType:yfiles.lang.Class):T; /** - * 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; + * Get a property value that specifies information about how to handle specific cases + * @param {string} key The identifier for the property + * @returns {Object} The property value, or null if no such property exists + * @abstract + */ + getSerializationProperty(key:string):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}. - */ + * 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#serializeCore}, using the correct type parameter. + *

+ * @param {Object} item The item to serialize. + * @param {yfiles.lang.Class} t The type the item is known to be of at deserialization time. + */ + serialize?(item:Object,t:yfiles.lang.Class):void; + /** + * Serialize the item. + *

+ * This method calls {@link yfiles.graphml.IWriteContext#serializeCore} with context as first argument and should be used in + * virtually all cases. + *

+ * Type parameter T: The type of the object that is serialized. + * @param {yfiles.lang.Class} targetType The type of the object that is serialized. + * @param {T} item The object that should be serialized. + * @throws {yfiles.graphml.SerializationNotSupportedError} + * @see yfiles.graphml.IWriteContext#serializeCore + * @template T + */ + serialize?(targetType:yfiles.lang.Class,item:T):void; + /** + * Serialize item to an XML representation. + *

+ * Client code should usually use the extension method {@link yfiles.graphml.IWriteContext#serialize} instead to ensure the the + * correct context instance is used. + *

+ * Type parameter T: The type of the object that is serialized. + * @param {yfiles.lang.Class} targetType The type of the object that is serialized. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {T} item The object that should be serialized. + * @throws {yfiles.graphml.SerializationNotSupportedError} + * @see yfiles.graphml.IWriteContext#serialize + * @template T + * @abstract + */ + serializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):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.graphml.MarkupExtension} + * or similar replacement mechanisms. + *

+ * Type parameter T: The type of the object that is serialized. + * @param {Object} originalItem The original object that should be serialized. + * @param {T} replacement The replacement object that will actually be serialized instead. + * @throws {yfiles.graphml.SerializationNotSupportedError} + * @see yfiles.graphml.IWriteContext#serializeCore + * @template T + */ + serializeReplacement?(targetType:yfiles.lang.Class,originalItem:Object,replacement:T):void; + /** + * Returns the current nesting of graphs and graph elements. + *

+ * The list contains the user objects which correspond to the GraphML elements. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + objectStack:yfiles.collections.IListEnumerable; + /** + * Returns an implementation of {@link yfiles.graphml.IWriteEvents} that allows to subscribe to various events in the write + * process. + * @abstract + * @type {yfiles.graphml.IWriteEvents} + */ writeEvents:yfiles.graphml.IWriteEvents; /** - * Returns the current {@link yfiles.graphml.IXmlWriter} implementation. - * @see Specified by {@link yfiles.graphml.IWriteContext#writer}. - */ + * Returns the current {@link yfiles.graphml.IXmlWriter} implementation. + * @abstract + * @type {yfiles.graphml.IXmlWriter} + */ writer:yfiles.graphml.IXmlWriter; /** - * Returns the currently active graph object. - * @see Specified by {@link yfiles.graphml.IWriteContext#graph}. - */ + * Returns the currently active graph object + * @abstract + * @type {yfiles.graph.IGraph} + */ 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} - */ + * 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 yfiles.graphml.WriteEventArgs + * @see yfiles.graphml.GraphMLWriter + * @interface + */ 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; + * Adds the given listener for the DocumentWriting event that occurs just after the {@link yfiles.graphml.IXmlWriter#writeStartDocument} + * has been called. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeDocumentWritingListener + * @abstract + */ + addDocumentWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DocumentWriting event that occurs just after the {@link yfiles.graphml.IXmlWriter#writeStartDocument} + * has been called. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addDocumentWritingListener + * @abstract + */ + removeDocumentWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the DocumentWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndDocument} + * will be called. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeDocumentWrittenListener + * @abstract + */ + addDocumentWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DocumentWritten event that occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndDocument} + * will be called. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addDocumentWrittenListener + * @abstract + */ + removeDocumentWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the NodeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'node' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeNodeWritingListener + * @abstract + */ + addNodeWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the NodeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'node' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addNodeWritingListener + * @abstract + */ + removeNodeWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the NodeWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeNodeWrittenListener + * @abstract + */ + addNodeWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the NodeWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addNodeWrittenListener + * @abstract + */ + removeNodeWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the EdgeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'edge' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeEdgeWritingListener + * @abstract + */ + addEdgeWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the EdgeWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'edge' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addEdgeWritingListener + * @abstract + */ + removeEdgeWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the EdgeWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeEdgeWrittenListener + * @abstract + */ + addEdgeWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the EdgeWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addEdgeWrittenListener + * @abstract + */ + removeEdgeWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the PortWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'port' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removePortWritingListener + * @abstract + */ + addPortWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the PortWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'port' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addPortWritingListener + * @abstract + */ + removePortWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the PortWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removePortWrittenListener + * @abstract + */ + addPortWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the PortWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addPortWrittenListener + * @abstract + */ + removePortWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'graph' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeGraphWritingListener + * @abstract + */ + addGraphWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'graph' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addGraphWritingListener + * @abstract + */ + removeGraphWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeGraphWrittenListener + * @abstract + */ + addGraphWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addGraphWrittenListener + * @abstract + */ + removeGraphWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphMLWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'graphml' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeGraphMLWritingListener + * @abstract + */ + addGraphMLWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphMLWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'graphml' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addGraphMLWritingListener + * @abstract + */ + removeGraphMLWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the GraphMLWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeGraphMLWrittenListener + * @abstract + */ + addGraphMLWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the GraphMLWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addGraphMLWrittenListener + * @abstract + */ + removeGraphMLWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the DataWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'data' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeDataWritingListener + * @abstract + */ + addDataWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DataWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'data' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addDataWritingListener + * @abstract + */ + removeDataWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the DataWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeDataWrittenListener + * @abstract + */ + addDataWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the DataWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addDataWrittenListener + * @abstract + */ + removeDataWrittenListener(listener:(sender:Object,evt: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; + * Adds the given listener for the KeyWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'key' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeKeyWritingListener + * @abstract + */ + addKeyWritingListener(listener:(sender:Object,evt: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; + * Removes the given listener for the KeyWriting event that occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElement} + * method for writing a GraphMl 'key' element has been called. + *

+ * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeNS} methods to add custom attributes to the + * XML element or write a first custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElement} + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addKeyWritingListener + * @abstract + */ + removeKeyWritingListener(listener:(sender:Object,evt: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; + * Adds the given listener for the KeyWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.IWriteEvents#removeKeyWrittenListener + * @abstract + */ + addKeyWrittenListener(listener:(sender:Object,evt: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; + * Removes the given listener for the KeyWritten event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.IWriteEvents#addKeyWrittenListener + * @abstract + */ + removeKeyWrittenListener(listener:(sender:Object,evt: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. - */ + * Abstraction of XML output classes that provide a consistent way to write XML elements to some output + * @interface + */ + export interface IXmlWriter extends Object{ + /** + * Close the document. + *

+ * This is typically used to actually flush the document to an output stream + *

+ * @abstract + */ + flushDocument():void; + /** + * Gets a text representation of all content that has been written so far. + * @returns {string} + * @abstract + */ + getXmlString():string; + /** + * Write an XML attribute with the given parameters. + *

+ * The attribute is not bound to a XML namespace. + *

+ * @param {string} localName The name of the attribute. + * @param {string} value The value of the attribute. + * @returns {yfiles.graphml.IXmlWriter} The writer instance writer for writer chaining. + */ + writeAttribute?(localName:string,value: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#writeStartElement}. 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 + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeAttributeNS(prefix:string,localName:string,ns:string,value:string):yfiles.graphml.IXmlWriter; + /** + * Write a CDATA section. + * @param {string} content The content of the CDATA section + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeCData(content:string):yfiles.graphml.IXmlWriter; + /** + * Write a XML comment node + * @param {string} comment The content of the comment + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeComment(comment:string):yfiles.graphml.IXmlWriter; + /** + * Write a document fragment + * @param {Document} fragment + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; + /** + * Close the output. + *

+ * Attempts to write after this method has been called will have undefined results. + *

+ * @abstract + */ + writeEndDocument():void; + /** + * Close a XML element previously opened with {@link yfiles.graphml.IXmlWriter#writeStartElement} or + * {@link yfiles.graphml.IXmlWriter#writeStartElement}. + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeEndElement():yfiles.graphml.IXmlWriter; + /** + * Write an XML attribute from the given attribute struct. + * @param {yfiles.graphml.GraphMLXmlAttribute} attribute Encapsulates the current attribute values. + * @returns {yfiles.graphml.IXmlWriter} The writer instance writer for writer chaining. + */ + writeGraphMLXmlAttribute?(attribute:yfiles.graphml.GraphMLXmlAttribute):yfiles.graphml.IXmlWriter; + /** + * Write a xml processing instruction. + * @param {string} target The target of the PI + * @param {string} data The data of the PI + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; + /** + * Begin the output process + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeStartDocument():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 + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeStartElement(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#writeStartElement}, 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 + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeStartElement(localName:string,ns:string):yfiles.graphml.IXmlWriter; + /** + * Write a text node. + *

+ * The string value of s will be correctly escaped + *

+ * @param {string} s The string that gets written as XML text + * @returns {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @abstract + */ + writeString(s:string):yfiles.graphml.IXmlWriter; + /** + * Gets the namespace manager associated with this writer. + * @abstract + * @type {yfiles.graphml.IXmlNamespaceManager} + */ + namespaceManager:yfiles.graphml.IXmlNamespaceManager; + } + var IXmlWriter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class to facilitate namespace handling together with {@link yfiles.graphml.IXmlWriter} instances. + * @interface + */ + export interface IXmlNamespaceManager extends Object{ + /** + * Returns a unique namespace prefix, or creates and registeres one. + * @param {string} ns The namespace URI for which a prefix is searched. + * @returns {string} a unique namespace prefix for ns. + * @abstract + */ + getOrCreateUniqueMapping(ns:string):string; + /** + * Pops a current declaration scope. + * @abstract + */ + popScope():void; + /** + * Pushes a current declaration scope. + * @abstract + */ + pushScope():void; + /** + * Register a local namespace/prefix mapping + * @param {string} nsUri The namespace URI + * @param {string} prefix The preferred namespace prefix or null if any prefix may be used. + * @returns {string} The prefix that finally has been used for the namespace URI. + * @abstract + */ + registerLocalMapping(nsUri:string,prefix:string):string; + /** + * Seals the current declaration scope. + *

+ * No further namespace mappings may be added to a sealed scope. + *

+ * @abstract + */ + sealScope():void; + /** + * Return a list of all namespace declarations that should be declared at the document's root element. + * @abstract + * @type {yfiles.collections.IMap.} + */ + globalNamespaces:yfiles.collections.IMap; + } + var IXmlNamespaceManager:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Constant class for common serialization properties. + * @see yfiles.graphml.IWriteContext#getSerializationProperty + * @class yfiles.graphml.SerializationProperties + * @static + */ + export interface SerializationProperties extends Object{} + export class SerializationProperties { + /** + * Property key to control user tag serialization and deserialization + *

+ * This property has a value of type {@link yfiles.graph.GraphItemTypes}. + *

+ *

+ * Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property} disables tag serialization for all of the provided + * {@link yfiles.graph.GraphItemTypes}. Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property} disables tag deserialization only for + * nodes, edges and/or ports. By default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE} + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_USER_TAGS:string; + /** + * Property key to control graph element style serialization and deserialization + *

+ * This property has a value of type {@link yfiles.graph.GraphItemTypes}. + *

+ *

+ * Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property} disables style serialization for all of the provided + * {@link yfiles.graph.GraphItemTypes}. Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property} disables style deserialization only for + * nodes, edges and/or ports. By default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE} + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_STYLES:string; + /** + * Property key to control graph elements serialization and deserialization + *

+ * This property has a value of type {@link yfiles.graph.GraphItemTypes}. + *

+ *

+ * Setting this property disables serialization and deserialization for the provided {@link yfiles.graph.GraphItemTypes}. By + * default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE}. + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_ITEMS:string; + /** + * Property key to control graph element geometry serialization and deserialization + *

+ * This property has a value of type {@link yfiles.graph.GraphItemTypes}. + *

+ *

+ * Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property} disables style serialization for all of the provided + * {@link yfiles.graph.GraphItemTypes}. Setting this property as a {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property} disables style deserialization only for + * nodes, edges and/or ports. By default, this property is set to {@link yfiles.graph.GraphItemTypes#NONE}. + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_GEOMETRY:string; + /** + * Property key to control user tag serialization and deserialization of {@link yfiles.graph.IStripe}s. + *

+ * This property has a value of type {@link yfiles.graph.StripeTypes}. + *

+ *

+ * Setting this property disables tag serialization for the provided {@link yfiles.graph.StripeTypes}. By default, this property is + * set to {@link yfiles.graph.StripeTypes#NONE}. + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_STRIPE_USER_TAGS:string; + /** + * Property key to control style serialization and deserialization of {@link yfiles.graph.IStripe}s. + *

+ * This property has a value of type {@link yfiles.graph.StripeTypes}. + *

+ *

+ * Setting this property disables style serialization for the provided {@link yfiles.graph.StripeTypes}. By default, this property + * is set to {@link yfiles.graph.StripeTypes#NONE}. + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_STRIPE_STYLES:string; + /** + * Property key to control label serialization of {@link yfiles.graph.IStripe}s. + *

+ * This property has a value of type {@link yfiles.graph.StripeTypes}. + *

+ *

+ * Setting this property disables label serialization for the provided {@link yfiles.graph.StripeTypes}. By default, this property + * is set to {@link yfiles.graph.StripeTypes#NONE}. + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_STRIPE_LABELS:string; + /** + * Property key to omit serialization and deserialization of the {@link yfiles.graph.IGraph}'s default settings. + *

+ * This property has a boolean value. + *

+ *

+ * If this property is set to true in {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides} or the write context, the current graph defaults are not written. + *

+ *

+ * If this property is set to true in {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides} or the parse context, any graph defaults present in the input are not parsed and + * applied to the current graph. + *

+ *

+ * Default for this property is true for writing and false for parsing. + *

+ * @const + * @static + * @type {string} + */ + static DISABLE_GRAPH_SETTINGS:string; + /** + * Property key for case-insensitive parsing of property names during XAML deserialization. + *

+ * This property has a boolean value. + *

+ *

+ * Default for this property is false. + *

+ * @const + * @static + * @type {string} + */ + static IGNORE_PROPERTY_CASE:string; + /** + * Property key to control how undefined values are serialized. + *

+ * This property has a value of type {@link yfiles.graphml.UndefinedHandling}. + *

+ *

+ * The default for this property is {@link yfiles.graphml.UndefinedHandling#EXPLICIT }. + *

+ * @const + * @static + * @type {string} + */ + static UNDEFINED_HANDLING:string; + /** + * Property key whether the XML output should be properly indented. + *

+ * This property has a boolean values. + *

+ *

+ * Default for this property is true + *

+ * @const + * @static + * @type {string} + */ + static INDENT_OUTPUT:string; + /** + * The current {@link yfiles.graphml.KeyScope} in which an {@link yfiles.graphml.IOutputHandler}, + * {@link yfiles.graphml.IInputHandler}, or custom serialization code is called. + *

+ * This property has a value of type {@link yfiles.graphml.KeyScope} + *

+ * @const + * @static + * @type {string} + */ + static CURRENT_KEY_SCOPE:string; + /** + * The edge that is currently being represented by the dummy edge that is written instead. + *

+ * This property has a value of type {@link yfiles.graph.IEdge}. + *

+ *

+ * If this value is set, then the edge currently being serialized represents the given edge in reality. + *

+ * @const + * @static + * @type {string} + */ + static REPRESENTED_EDGE:string; + /** + * Property key to specify whether to write the default node style in the <default> element of the key definition. + *

+ * This property has a boolean value. + *

+ *

+ * Default value is false. + *

+ * @const + * @static + * @type {string} + */ + static WRITE_NODE_STYLE_DEFAULT:string; + /** + * Property key to specify whether to write the default edge style in the <default> element of the key definition. + *

+ * This property has a boolean value. + *

+ *

+ * Default value is false. + *

+ * @const + * @static + * @type {string} + */ + static WRITE_EDGE_STYLE_DEFAULT:string; + /** + * Property key to specify whether to write the default port style in the <default> element of the key definition. + *

+ * This property has a boolean value. + *

+ *

+ * Default value is false. + *

+ * @const + * @static + * @type {string} + */ + static WRITE_PORT_STYLE_DEFAULT:string; + /** + * Property key to specify whether the stripe defaults of a table should be written. + *

+ * This property has a boolean value. + *

+ *

+ * If set to true the {@link yfiles.graph.ITable#columnDefaults} and {@link yfiles.graph.ITable#rowDefaults} will be written. Default value is true. + *

+ * @const + * @static + * @type {string} + */ + static WRITE_STRIPE_DEFAULTS:string; + /** + * Property key to provide a 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. + *

+ * @const + * @static + * @type {string} + */ + static WRITE_LABEL_SIZE_PREDICATE:string; + /** + * Property key to specify whether the preferred size of labels should be parsed. + *

+ * This property has a boolean value. + *

+ *

+ * If this property is set to true, the preferred size provided by GraphML is used, otherwise, the preferred size is + * determined automatically. This property is mainly meant for interoperability usecases where the text size calculations + * can be quite different for different platforms. Default value is true + *

+ * @const + * @static + * @type {string} + */ + static PARSE_LABEL_SIZE:string; + /** + * The current {@link string} base URI which is used for the GraphML file being parsed or written. + *

+ * This property has a string value. + *

+ *

+ * If set, this can be used to resolve or create relative paths. + *

+ * @const + * @static + * @type {string} + */ + static BASE_URI:string; + /** + * Property key to specify whether to rewrite relative URIs relative to the current document location. + *

+ * This property has a boolean value. + *

+ *

+ * 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. + *

+ * @const + * @static + * @type {string} + */ + static REWRITE_RELATIVE_RESOURCE_URIS:string; + /** + * Property key to specify whether to ignore errors during XAML deserialization will be ignored and instead return null. + *

+ * This property has a boolean value. + *

+ *

+ * Default value is false. + *

+ * @const + * @static + * @type {string} + */ + static IGNORE_XAML_DESERIALIZATION_ERRORS:string; + /** + * Property key to control caching for external references. + *

+ * This property has a boolean value. + *

+ *

+ * If this property is set to false in the write context, the writer will not cache remember external reference ids provided via + * {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId}, 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. + *

+ * @const + * @static + * @type {string} + */ + static CACHE_EXTERNAL_REFERENCES:string; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.graphml.WriteEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface WriteEventArgs extends yfiles.lang.EventArgs{} + export class WriteEventArgs { + /** + * 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}. + * @constructor + */ + constructor(context:yfiles.graphml.IWriteContext,item:Object); + /** + * Gets the context that is being used for writing. + * @type {yfiles.graphml.IWriteContext} + */ + context:yfiles.graphml.IWriteContext; + /** + * Gets the item that is currently being written or null if nothing is applicable. + * @type {Object} + */ + item:Object; + static $class:yfiles.lang.Class; + } + /** + * An interface for converters that can convert an object to a corresponding {@link yfiles.graphml.MarkupExtension}. + *

+ * This interface is only used for GraphML serialiaztion. + *

+ * @interface + */ + export interface IMarkupExtensionConverter extends Object{ + /** + * Returns if the converter can convert the value to a {@link yfiles.graphml.MarkupExtension} in the current write context. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} value The object to convert. + * @returns {boolean} Whether the converter can convert the passed value. + * @abstract + */ + canConvert(context:yfiles.graphml.IWriteContext,value:Object):boolean; + /** + * Converts the value to a {@link yfiles.graphml.MarkupExtension} using the current write context. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} value The object to convert. + * @returns {yfiles.graphml.MarkupExtension} The {@link yfiles.graphml.MarkupExtension} the value was converted to. + * @abstract + */ + convert(context:yfiles.graphml.IWriteContext,value:Object):yfiles.graphml.MarkupExtension; + } + var IMarkupExtensionConverter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Utility class that facilitates determining type information from XML elements and writing of markup extensions as + * attributes. + * @interface + */ + export interface IXamlNameMapper extends Object{ + /** + * Returns a {@link yfiles.lang.Class} that matches the given fqTagName of an XML element. + *

+ * fqTagName must follow the usual XAML naming rules. + *

+ * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.graphml.XmlName} fqTagName The fully qualified XML element name that must describe a valid type in this CLR namespace. + * @returns {yfiles.lang.Class} The first matching type, if any. + * @abstract + */ + getClassForName(context:yfiles.graphml.IParseContext,fqTagName:yfiles.graphml.XmlName):yfiles.lang.Class; + /** + * Returns the XML tag name that belongs to type type + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {yfiles.lang.Class} type The type for which an XML namespace mapping is searched. + * @returns {yfiles.graphml.XmlName} the XML tag name that belongs to type type + * @abstract + */ + getNameForClass(context:yfiles.graphml.IWriteContext,type:yfiles.lang.Class):yfiles.graphml.XmlName; + } + var IXamlNameMapper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Wraps a property together with default values and meta data. + * @class yfiles.graphml.Property + */ + export interface Property extends Object{} + export class Property { + /** + * Returns true iff the property has a public getter. + * @type {boolean} + */ + canRead:boolean; + /** + * Returns true iff the property has a public setter. + * @type {boolean} + */ + canWrite:boolean; + /** + * Returns true iff this is a static property. + * @type {boolean} + */ + isStatic:boolean; + /** + * Gets the serialization visibility. + * @type {yfiles.graphml.GraphMLMemberVisibility} + */ + serializationVisibility:yfiles.graphml.GraphMLMemberVisibility; + /** + * Gets the {@link yfiles.graphml.Property#valueSerializer}. + * @type {yfiles.graphml.ValueSerializer} + */ + valueSerializer:yfiles.graphml.ValueSerializer; + /** + * Gets the MarkupExtensionConverter. + * @type {yfiles.graphml.IMarkupExtensionConverter} + */ + markupExtensionConverter:yfiles.graphml.IMarkupExtensionConverter; + /** + * Gets the {@link yfiles.graphml.Property#graphMLAttribute}. + * @type {yfiles.graphml.GraphMLAttribute} + */ + graphMLAttribute:yfiles.graphml.GraphMLAttribute; + /** + * Gets a value indicating whether this instance is the one defined in the {@link yfiles.graphml.GraphMLAttribute}'s {@link yfiles.graphml.GraphMLAttribute#contentProperty}. + * @type {boolean} + */ + isContentProperty:boolean; + /** + * Gets the type of the property. + * @type {yfiles.lang.Class} + */ + propertyType:yfiles.lang.Class; + /** + * Gets the type of the owner. + * @type {yfiles.lang.Class} + */ + ownerType:yfiles.lang.Class; + /** + * Gets the owner instance. + * @type {Object} + */ + ownerInstance:Object; + /** + * Gets the default value. + * @type {Object} + */ + defaultValue:Object; + /** + * Gets a value indicating whether this instance has a default value. + * @type {boolean} + */ + hasDefaultValue:boolean; + /** + * Gets or sets the value. + * @type {Object} + */ + value:Object; + /** + * Gets the name of the property, as it will appear in GraphML. + * @type {string} + */ + name:string; + static $class:yfiles.lang.Class; + } + 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, + /** + * "Center" segment. + */ + CENTER + } + /** + * Class for reading/writing graphs from/to GraphML format. + *

+ * For more information about the GraphML file format please refer to the GraphML Primer. + *

+ * @class yfiles.graphml.GraphMLIOHandler + */ + export interface GraphMLIOHandler extends Object{} + export class GraphMLIOHandler { + /** + * Creates a new instance of {@link yfiles.graphml.GraphMLIOHandler}. + * @constructor + */ + constructor(); + /** + * Create a {@link yfiles.graphml.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.graphml.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. + * @returns {yfiles.graphml.Future.} A {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.graphml.IInputHandler} that actually parses the data. + */ + addInputHandlerFactory(keyDefinitionPredicate:(obj:Element)=>boolean,factory:yfiles.graphml.IGenericInputHandlerFactory):yfiles.graphml.Future; + /** + * Register a {@link yfiles.collections.IMapper.} instance for use as an input data target. + *

+ * This method uses a custom event handler for the actual deserialization. + *

+ *

+ * This methods creates and configures the necessary handler itself. + *

+ * Type parameter TKey: The type of the mapper keys + * Type parameter TData: The type of the mapper values + * @param {yfiles.lang.Class} dataType The type of the mapper values + * @param {yfiles.lang.Class} keyType The type of the mapper keys + * @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.collections.IMapper.} mapper the mapper that serves as data source + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} deserializationCallback custom deserialization callback. + * @template TKey,TData + */ + addInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,mapper:yfiles.collections.IMapper,deserializationCallback:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; + /** + * Register a {@link yfiles.collections.IMapper.} instance for use as an input data target. + *

+ * This methods creates and configures the necessary handler itself. + *

+ * Type parameter TKey: The type of the mapper keys + * Type parameter TData: The type of the mapper values + * @param {yfiles.lang.Class} dataType The type of the mapper values + * @param {yfiles.lang.Class} keyType The type of the mapper keys + * @param {string} name The name of the attribute + * @param {yfiles.collections.IMapper.} mapper the mapper that serves as data source + * @template TKey,TData + */ + addInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.collections.IMapper):void; + /** + * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.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.graphml.Future.#hasValue} + * This methods creates and configures the necessary handler itself. + *

+ * Type parameter TKey: The type of the mapper keys + * Type parameter TData: The type of the mapper values + * @param {yfiles.lang.Class} dataType The type of the mapper values + * @param {yfiles.lang.Class} keyType The type of the mapper keys + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} 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. + * @returns {yfiles.graphml.Future.>} A {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.IMapper.} that actually holds the data. + * @template TKey,TData + */ + addInputMapperFuture(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,deserializationCallback:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):yfiles.graphml.Future>; + /** + * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.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.graphml.Future.#hasValue} + * This methods creates and configures the necessary handler itself. + *

+ * Type parameter TKey: The type of the mapper keys + * Type parameter TData: The type of the mapper values + * @param {yfiles.lang.Class} dataType The type of the mapper values + * @param {yfiles.lang.Class} keyType The type of the mapper keys + * @param {string} name The name of the attribute + * @returns {yfiles.graphml.Future.>} A {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.IMapper.} that actually holds the data. + * @template TKey,TData + */ + addInputMapperFuture(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string):yfiles.graphml.Future>; + /** + * 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; + /** + * Register a {@link yfiles.collections.IMapper.} instance for use as an output data source. + *

+ * This method uses a custom event handler for the actual serialization. + *

+ *

+ * This methods creates and configures the necessary handler itself. + *

+ * Type parameter TModelItem: The type of the mapper keys + * Type parameter TValue: The type of the mapper values + * @param {yfiles.lang.Class} dataType The type of the mapper values + * @param {yfiles.lang.Class} modelItemType The type of the mapper keys + * @param {string} name The name of the attribute + * @param {string} uri The URI to add to the key definition to disambiguate keys. + * @param {yfiles.collections.IMapper.} mapper the mapper that serves as data source + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} serializationCallback custom serialization callback. + * @param {yfiles.graphml.KeyType} declaredKeyType The key type to write in the declaration. + * @template TModelItem,TValue + */ + addOutputMapper(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,uri:string,mapper:yfiles.collections.IMapper,serializationCallback:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void,declaredKeyType:yfiles.graphml.KeyType):void; + /** + * Register a {@link yfiles.collections.IMapper.} instance for use as an output data source + *

+ * This methods creates and configures the necessary handler itself + *

+ * Type parameter TModelItem: The type of the mapper keys + * Type parameter TValue: The type of the mapper values + * @param {yfiles.lang.Class} dataType The type of the mapper values + * @param {yfiles.lang.Class} modelItemType The type of the mapper keys + * @param {string} name The name of the attribute + * @param {yfiles.collections.IMapper.} mapper the mapper that serves as data source + * @template TModelItem,TValue + */ + addOutputMapper(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.collections.IMapper):void; + /** + * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an {@link yfiles.collections.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.graphml.Future.#hasValue}. + * This methods creates and configures the necessary handler itself and {@link yfiles.graphml.GraphMLIOHandler#createMapper creates} an {@link yfiles.collections.IMapper.} in the {@link yfiles.graph.IMapperRegistry} + * with name tag. + *

+ * Type parameter TKey. + * Type parameter TData. + * @param {yfiles.lang.Class} dataType + * @param {yfiles.lang.Class} keyType + * @param {Object} tag The name of 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): void} deserializationCallback The custom deserialization callback, can be null which will result in default deserialization. + * @returns {yfiles.graphml.Future.>} A {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.IMapper.} that actually holds the data. + * @template TKey,TData + */ + addRegistryInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,tag:Object,keyDefinitionPredicate:(obj:Element)=>boolean,deserializationCallback:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):yfiles.graphml.Future>; + /** + * Create a {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an {@link yfiles.collections.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.graphml.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.collections.IMapper.} in the {@link yfiles.graph.IMapperRegistry} with name name. + *

+ * Type parameter TKey. + * Type parameter TData. + * @param {yfiles.lang.Class} dataType + * @param {yfiles.lang.Class} keyType + * @param {string} name The name of the GraphML attribute and the key in the {@link yfiles.graph.IMapperRegistry}. + * @returns {yfiles.graphml.Future.>} A {@link yfiles.graphml.Future.} instance that wraps an {@link yfiles.collections.IMapper.} that actually holds the data. + * @template TKey,TData + */ + addRegistryInputMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string):yfiles.graphml.Future>; + /** + * Use a registered {@link yfiles.collections.IMapper.} instance as source for the given GraphML attribute. + * Type parameter TModelItem. + * Type parameter TValue. + * @param {yfiles.lang.Class} valueType + * @param {yfiles.lang.Class} modelItemType + * @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} tag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} serializationCallback custom serialization callback. + * @param {yfiles.graphml.KeyType} declaredKeyType The key type to write in the declaration. + * @template TModelItem,TValue + */ + addRegistryOutputMapper(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,uri:string,tag:Object,serializationCallback:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void,declaredKeyType:yfiles.graphml.KeyType):void; + /** + * Use a registered {@link yfiles.collections.IMapper.} instance as source for the given GraphML attribute. + * Type parameter TModelItem. + * Type parameter TValue. + * @param {yfiles.lang.Class} valueType + * @param {yfiles.lang.Class} modelItemType + * @param {string} name The GraphML name of the attribute + * @param {Object} tag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + * @template TModelItem,TValue + */ + addRegistryOutputMapper(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,tag:Object):void; + /** + * Use a registered {@link yfiles.collections.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 {string} uri The optional URI of the attribute + * @param {Object} tag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} serializationCallback An optional serialization handler + */ + addRegistryOutputMapper(name:string,uri:string,tag:Object,serializationCallback:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; + /** + * Use a registered {@link yfiles.collections.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} + */ + addRegistryOutputMapper(name:string,tag:Object):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; + /** + * Add a namespace mapping between a fully qualified xml name (consisting of xmlNamespace and tagName and a type. + *

+ * Either of xmlNamespace or tagName may be null, meaning that the default rules for determining the namespace and/or tag + * name of type are used. + *

+ *

+ * This is used both for writing and parsing objects. + *

+ * @param {string} xmlNamespace The XML namespace that corresponds to type. If null, the namespace will be determined based on the JavaScript module + * that contains type + * @param {string} tagName The XML tag name that corresponds to type. If null, the name will be determined from the type name automatically. + * @param {yfiles.lang.Class} type The type that is mapped to the fully qualified XML name. + * @see yfiles.graphml.IXamlNameMapper + * @see yfiles.graphml.GraphMLIOHandler#createXamlNameMapper + * @see yfiles.graphml.GraphMLIOHandler#addXamlNamespaceMapping + */ + addXamlNamespaceMapping(xmlNamespace:string,tagName:string,type:yfiles.lang.Class):void; + /** + * Add a namespace mapping between a xml namespace and a JavaScript module. + *

+ * This is used both for writing and parsing objects. + *

+ * @param {string} xmlNamespace The XML namespace that corresponds to module. + * @param {Object} module The module that is mapped to the namespace. + * @see yfiles.graphml.IXamlNameMapper + * @see yfiles.graphml.GraphMLIOHandler#createXamlNameMapper + * @see yfiles.graphml.GraphMLIOHandler#addXamlNamespaceMapping + */ + addXamlNamespaceMapping(xmlNamespace:string,module:Object):void; + /** + * Configure the predefined handlers for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + * event. + *

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

+ *

+ * 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 yfiles.graphml.GraphMLIOHandler#handlePrimitivesDeserialization + * @see yfiles.graphml.GraphMLIOHandler#handleXamlDeserialization + * @see yfiles.graphml.GraphMLIOHandler#handleTextNodeDeserialization + * @protected + */ + configureDeserializationHandlers(graph:yfiles.graph.IGraph,parser:yfiles.graphml.GraphMLParser):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. + * @protected + */ + configureDeserializationPropertyOverrides(parser:yfiles.graphml.GraphMLParser):void; + /** + * Configures a given instance of {@link yfiles.graphml.GraphMLParser} that can handle the given graph. + *

+ * This method is called by {@link yfiles.graphml.GraphMLIOHandler#createGraphMLParser}. + *

+ * @param {yfiles.graphml.GraphMLParser} parser The parser to configure + * @param {yfiles.graph.IGraph} graph The graph that should be filled by the parser + * @protected + */ + configureGraphMLParser(parser:yfiles.graphml.GraphMLParser,graph:yfiles.graph.IGraph):void; + /** + * Configures a given {@link yfiles.graphml.GraphMLWriter} that is used for writing graph. + *

+ * This method is called by {@link yfiles.graphml.GraphMLIOHandler#createGraphMLWriter}. + *

+ * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure + * @param {yfiles.graph.IGraph} graph The graph that will be written. + * @protected + */ + configureGraphMLWriter(writer:yfiles.graphml.GraphMLWriter,graph:yfiles.graph.IGraph):void; + /** + * Configures default event handlers for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} + * event. + *

+ * This implementation configures several input handlers for the standard yFiles for HTML 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. + * @protected + */ + configureInputHandlers(parser:yfiles.graphml.GraphMLParser):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. + * @protected + */ + 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 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. + * @protected + */ + configureOutputHandlers(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):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. + * @protected + */ + configureParserLookup(parser:yfiles.graphml.GraphMLParser):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. + * @protected + */ + configureSchemaLocations(writer:yfiles.graphml.GraphMLWriter):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. + * @protected + */ + configureSerializationHandlers(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 yfiles.graphml.GraphMLWriter#setSerializationProperty + * @protected + */ + 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. + * @protected + */ + configureSerializationPropertyOverrides(writer:yfiles.graphml.GraphMLWriter):void; + /** + * 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 yfiles.graphml.GraphMLWriter#setLookup + * @protected + */ + configureWriterLookup(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; + /** + * Configure writer. + *

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

+ *

+ * This implementation does nothing. + *

+ * @param {yfiles.graphml.IXmlWriter} writer The writer to configure. + * @protected + */ + configureXMLWriter(writer:yfiles.graphml.IXmlWriter):void; + /** + * Creates the default value serializer context and returns it. + *

+ * This factory method can be used to provide custom {@link yfiles.graphml.ValueSerializer}s in cases where no {@link yfiles.graphml.GraphMLAttribute} + * can be used. + *

+ * @returns {yfiles.graphml.IValueSerializerContext} An implementation of the {@link yfiles.graphml.IValueSerializerContext} interface. + */ + createDefaultValueSerializerContext():yfiles.graphml.IValueSerializerContext; + /** + * 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. + * @returns {yfiles.graphml.IGraphElementFactory} An {@link yfiles.graphml.IGraphElementFactory} instance that is configured for the given parameters. + * @protected + */ + 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. + *

+ *

+ * It delegates the configuration of the parser to {@link yfiles.graphml.GraphMLIOHandler#configureGraphMLParser}. + *

+ * @param {yfiles.graph.IGraph} graph The graph that should be filled by this instance + * @returns {yfiles.graphml.GraphMLParser} a suitable instance of {@link yfiles.graphml.GraphMLParser} that can handle the given graph + * @protected + */ + createGraphMLParser(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLParser; + /** + * Create and configure a new {@link yfiles.graphml.GraphMLWriter} that is used for writing graph. + *

+ * This method is called for each write process. It delegates the configuration of the writer to + * {@link yfiles.graphml.GraphMLIOHandler#configureGraphMLWriter}. + *

+ * @param {yfiles.graph.IGraph} graph The graph that will be written. + * @returns {yfiles.graphml.GraphMLWriter} A new {@link yfiles.graphml.GraphMLWriter} instance that is configured for graph. + * @protected + */ + createGraphMLWriter(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLWriter; + /** + * 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 and returned. If a mapper is + * already registered with the same registryTag but wrong types, it will be replaced. + *

+ * Type parameter TKey: The type of the keys. + * Type parameter TData: The type of the data. + * @param {yfiles.lang.Class} dataType The type of the data. + * @param {yfiles.lang.Class} keyType The type of the keys. + * @param {yfiles.graphml.IParseContext} context + * @param {Object} registryTag The tag for the mapper in the registry. + * @returns {yfiles.collections.IMapper.} The mapper instance to use. + * @protected + * @template TKey,TData + */ + createMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,registryTag:Object):yfiles.collections.IMapper; + /** + * Convenience factory method that can create an instance of several predefined {@link yfiles.graphml.IInputHandler} + * implementations that match the provided TKey and TData. + * Type parameter TKey: The type of the mapper keys + * Type parameter TData: The type of the mapper entries + * @param {yfiles.lang.Class} dataType The type of the mapper entries + * @param {yfiles.lang.Class} modelItemType The type of the mapper keys + * @param {yfiles.collections.IMapper.} mapper The mapper to use. + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} deserializationCallback Optional deserialization callback for complex data. + * @returns {yfiles.graphml.MapperInputHandler.} A suitable {@link yfiles.graphml.MapperInputHandler.} implementation + * @template TKey,TData + * @static + */ + static createMapperInputHandler(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,mapper:yfiles.collections.IMapper,deserializationCallback:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):yfiles.graphml.MapperInputHandler; + /** + * Convenience factory method that can create an instance of several predefined {@link yfiles.graphml.IOutputHandler} + * implementations that match the provided TKey and TData. + * Type parameter TKey: The type of the mapper keys + * Type parameter TData: The type of the mapper entries + * @param {yfiles.lang.Class} dataType The type of the mapper entries + * @param {yfiles.lang.Class} modelItemType The type of the mapper keys + * @param {string} name The name of the graphml attribute + * @param {yfiles.collections.IMapper.} mapper The mapper to use. + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} serializationCallback Optional serialization callback for complex data. + * @returns {yfiles.graphml.MapperOutputHandler.} A suitable {@link yfiles.graphml.MapperOutputHandler.} implementation + * @template TKey,TData + * @static + */ + static createMapperOutputHandler(modelItemType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.collections.IMapper,serializationCallback:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):yfiles.graphml.MapperOutputHandler; + /** + * Configure mappings from CLR to XML names. + *

+ * This implementation scans all loaded assemblies for XmlnsDefinitionAttributes and returns a suitable instance of + * {@link yfiles.graphml.IXamlNameMapper}. + *

+ *

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

+ * @returns {yfiles.graphml.IXamlNameMapper} + * @protected + */ + createXamlNameMapper():yfiles.graphml.IXamlNameMapper; + /** + * Configure mappings from XML namespaces to prefixes. + *

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

+ * @returns {yfiles.graphml.IXamlPrefixMapper} + * @protected + */ + createXamlPrefixMapper():yfiles.graphml.IXamlPrefixMapper; + /** + * Factory method that creates and configures a suitable {@link yfiles.graphml.IXmlWriter} implementation. + *

+ * This method is called for each write process. The {@link yfiles.graphml.IXmlWriter} implementation is used by default for all + * low-level write operations. + *

+ * @returns {yfiles.graphml.IXmlWriter} A suitable {@link yfiles.graphml.IXmlWriter} instance for the serialization + * @see yfiles.graphml.IWriteContext#writer + * @protected + */ + createXMLWriter():yfiles.graphml.IXmlWriter; + /** + * 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} evt The event handler arguments. + * @protected + */ + handleArraySerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of wrapped enums. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} evt The event handler arguments. + * @protected + */ + handleEnumSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of types that extend FrameworkTemplate. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} evt The event handler arguments. + * @protected + */ + handleJSONDeserialization(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs):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} evt The event handler arguments. + * @protected + */ + handleJSONSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of {@link yfiles.collections.IEnumerable.} instances. + *

+ * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff {@link yfiles.graphml.HandleSerializationEventArgs#item} is an IEnumerable instance. This handler is registered by default. + *

+ * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} evt The event handler arguments. + * @protected + */ + handleListSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of {@link yfiles.graphml.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.graphml.MarkupExtension} instance. This handler is registered by + * default. + *

+ * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} evt The event handler arguments. + * @protected + */ + handleMarkupExtensionBasedSerialization(sender:Object,evt: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} evt The event handler arguments. + * @protected + */ + handleNullSerialization(sender:Object,evt: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} evt The event handler arguments. + * @protected + */ + handlePrimitivesDeserialization(sender:Object,evt: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} evt The event handler arguments. + * @protected + */ + handlePrimitivesSerialization(sender:Object,evt: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} evt The event handler arguments. + * @protected + */ + handleReferenceHandleSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of instances that can be serialized through a {@link yfiles.graphml.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.graphml.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} evt The event handler arguments. + * @protected + */ + handleTextConvertibleSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Callback for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {Object} source The source of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} evt The event arguments. + * @see yfiles.graphml.HandleDeserializationEventArgs + * @protected + */ + handleTextNodeDeserialization(source:Object,evt:yfiles.graphml.HandleDeserializationEventArgs):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} evt The event handler arguments. + * @protected + */ + handleTypeExtensionSerialization(sender:Object,evt: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} evt The event handler arguments. + * @protected + */ + handleTypeSerialization(sender:Object,evt: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 an 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} evt The event handler arguments. + * @protected + */ + handleUndefinedSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Callback for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {Object} source The source of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} evt The event arguments. + * @see yfiles.graphml.HandleDeserializationEventArgs + * @protected + */ + handleXamlDeserialization(source:Object,evt:yfiles.graphml.HandleDeserializationEventArgs):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} evt The event handler arguments. + * @protected + */ + handleXamlSerialization(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Checks whether the name attribute in definition matches name + * @param {Element} definition The key definition to check + * @param {string} name The name that should be matched + * @returns {boolean} true if the name attribute in definition matches name + * @static + */ + static matchesName(definition:Element,name:string):boolean; + /** + * Checks whether the scope attribute in definition matches scope + * @param {Element} definition The key definition to check + * @param {yfiles.graphml.KeyScope} scope The scope that should be matched + * @returns {boolean} true if the scope attribute in definition matches scope + * @static + */ + static matchesScope(definition:Element,scope:yfiles.graphml.KeyScope):boolean; + /** + * Checks whether the type attribute in definition matches type + * @param {Element} definition The key definition to check + * @param {yfiles.graphml.KeyType} type The type that should be matched + * @returns {boolean} true if the type attribute in definition matches type + * @static + */ + static matchesType(definition:Element,type:yfiles.graphml.KeyType):boolean; + /** + * Checks whether the uri attribute in definition matches uri + * @param {Element} definition The key definition to check + * @param {string} uri The uri that should be matched + * @returns {boolean} true if the uri attribute in definition matches uri + * @static + */ + static matchesUri(definition:Element,uri:string):boolean; + /** + * 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} evt + * @protected + */ + onGraphMLParserHandleDeserialization(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs):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} evt + * @protected + */ + onGraphMLParserQueryInputHandlers(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + onGraphMLWriterHandleSerialization(sender:Object,evt: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} evt + * @protected + */ + onGraphMLWriterQueryOutputHandlers(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} evt The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} + * event. + * @protected + */ + onHandleDeserialization(evt:yfiles.graphml.HandleDeserializationEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} event. + * @param {yfiles.graphml.HandleSerializationEventArgs} evt The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} + * event. + * @protected + */ + onHandleSerialization(evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} event. + * @param {yfiles.graphml.ResolveReferenceEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} + * event. + * @protected + */ + onOverrideResolveReference(evt:yfiles.graphml.ResolveReferenceEventArgs):void; + /** + * 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} evt The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLIOHandler#addParsedListener + * @protected + */ + onParsed(evt:yfiles.graphml.ParseEventArgs):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} evt The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLIOHandler#addParsingListener + * @protected + */ + onParsing(evt:yfiles.graphml.ParseEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} event. + * @param {yfiles.graphml.QueryInputHandlersEventArgs} evt The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} + * event. + * @protected + */ + onQueryInputHandlers(evt:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} evt The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} + * event. + * @protected + */ + onQueryOutputHandlers(evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} event. + * @param {yfiles.graphml.QueryReferenceIdEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} + * event. + * @throws {Stubs.Exceptions.ArgumentError} args is null. + * @see yfiles.graphml.GraphMLWriter#onQueryReferenceId + * @protected + */ + onQueryReferenceId(evt:yfiles.graphml.QueryReferenceIdEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. + * @param {yfiles.graphml.ResolveReferenceEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} + * event. + * @protected + */ + onResolveReference(evt:yfiles.graphml.ResolveReferenceEventArgs):void; + /** + * 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} evt The {@link yfiles.graphml.WriteEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLIOHandler#addWritingListener + * @protected + */ + onWriting(evt:yfiles.graphml.WriteEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addWrittenListener Written} event. + *

+ * This method is called just after the writing finishes and after {@link yfiles.graphml.IWriteEvents#addDocumentWrittenListener DocumentWritten} + * is called. + *

+ * @param {yfiles.graphml.WriteEventArgs} evt The {@link yfiles.graphml.WriteEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLIOHandler#addWrittenListener + * @protected + */ + onWritten(evt:yfiles.graphml.WriteEventArgs):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} document + * @returns {Promise.} + * @throws {Stubs.Exceptions.ArgumentError} document is null. + * @throws {Stubs.Exceptions.ArgumentError} graph is null. + */ + readFromDocument(graph:yfiles.graph.IGraph,document:Document):Promise; + /** + * 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. + * @returns {Promise.} + */ + readFromGraphMLText(graph:yfiles.graph.IGraph,data:string):Promise; + /** + * Reads a GraphML file from the given GraphML file and populates the Graph object. + *

+ * Note that this is an asynchronous method that returns immediately. Use the returned Promise to get 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 {string} url The url of the file to be read. + * @returns {Promise.} + * @throws {Stubs.Exceptions.ArgumentError} url is null. + * @throws {Stubs.Exceptions.ArgumentError} graph is null. + */ + readFromURL(graph:yfiles.graph.IGraph,url:string):Promise; + /** + * 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} evt + * @protected + */ + registerEdgeBendsInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerEdgeBendsOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerEdgeLabelsInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerEdgeLabelsOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerEdgeStyleInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerEdgeStyleOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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 + *

+ * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} evt + * @protected + */ + registerGraphSettingsInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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. + *

+ * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} evt + * @see yfiles.graphml.SerializationProperties#DISABLE_GRAPH_SETTINGS + * @protected + */ + registerGraphSettingsOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerNodeLabelsInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerNodeLabelsOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerNodeLayoutInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerNodeLayoutOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerNodeStyleInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerNodeStyleOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerPortLocationInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerPortLocationOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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} evt + * @protected + */ + registerPortStyleInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):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} evt + * @protected + */ + registerPortStyleOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined input handler that reads {@link yfiles.graph.ITagOwner} tags. + *

+ * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} + * event + *

+ * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} evt + * @protected + */ + registerTagInputHandler(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined output handler that writes {@link yfiles.graph.ITagOwner} tags. + *

+ * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} + * event + *

+ * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} evt + * @protected + */ + registerTagOutputHandler(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs):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. + * @returns {Promise.} A string containing the GraphML data. + */ + write(graph:yfiles.graph.IGraph):Promise; + /** + * true if schema descriptions should be written. + * @type {boolean} + */ + 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 + *

+ * @type {boolean} + */ + 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. + *

+ * @type {boolean} + */ + clearGraphBeforeRead:boolean; + /** + * Adds the given listener for the OverrideResolveReference event that occurs 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. + *

+ * @param {function(Object, yfiles.graphml.ResolveReferenceEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener + * @see yfiles.graphml.GraphMLIOHandler#removeOverrideResolveReferenceListener + */ + addOverrideResolveReferenceListener(listener:(sender:Object,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; + /** + * Removes the given listener for the OverrideResolveReference event that occurs 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. + *

+ * @param {function(Object, yfiles.graphml.ResolveReferenceEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener + * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener + */ + removeOverrideResolveReferenceListener(listener:(sender:Object,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; + /** + * Adds the given listener for the ResolveReference event that occurs 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. + *

+ * @param {function(Object, yfiles.graphml.ResolveReferenceEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener + * @see yfiles.graphml.GraphMLIOHandler#removeResolveReferenceListener + */ + addResolveReferenceListener(listener:(sender:Object,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; + /** + * Removes the given listener for the ResolveReference event that occurs 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. + *

+ * @param {function(Object, yfiles.graphml.ResolveReferenceEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener + * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener + */ + removeResolveReferenceListener(listener:(sender:Object,evt:yfiles.graphml.ResolveReferenceEventArgs)=>void):void; + /** + * Adds the given listener for the QueryReferenceId event that occurs when a reference is queried. + *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.QueryReferenceIdEventArgs): void} listener The listener to add. + * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId + * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceType + * @see yfiles.graphml.GraphMLIOHandler#removeQueryReferenceIdListener + */ + addQueryReferenceIdListener(listener:(sender:Object,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; + /** + * Removes the given listener for the QueryReferenceId event that occurs when a reference is queried. + *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.QueryReferenceIdEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId + * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceType + * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener + */ + removeQueryReferenceIdListener(listener:(sender:Object,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; + /** + * Adds the given listener for the Written event that occurs when the writing of a document has been finished. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#onWritten + * @see yfiles.graphml.GraphMLWriter#addWrittenListener + * @see yfiles.graphml.GraphMLIOHandler#removeWrittenListener + */ + addWrittenListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + /** + * Removes the given listener for the Written event that occurs when the writing of a document has been finished. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#onWritten + * @see yfiles.graphml.GraphMLWriter#addWrittenListener + * @see yfiles.graphml.GraphMLIOHandler#addWrittenListener + */ + removeWrittenListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + /** + * Adds the given listener for the Writing event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#onWriting + * @see yfiles.graphml.GraphMLWriter#addWritingListener + * @see yfiles.graphml.GraphMLIOHandler#removeWritingListener + */ + addWritingListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + /** + * Removes the given listener for the Writing event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#onWriting + * @see yfiles.graphml.GraphMLWriter#addWritingListener + * @see yfiles.graphml.GraphMLIOHandler#addWritingListener + */ + removeWritingListener(listener:(sender:Object,evt: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 yfiles.graphml.GraphMLIOHandler#configureSerializationPropertyOverrides + * @type {yfiles.collections.IMap.} + */ + serializationPropertyOverrides:yfiles.collections.IMap; + /** + * Gets the mapper for the overrides of the deserialization properties. + *

+ * Using this mapper {@link yfiles.graphml.IParseContext#getDeserializationProperty deserialization properties} can be specified. + *

+ * @see yfiles.graphml.GraphMLIOHandler#configureDeserializationPropertyOverrides + * @type {yfiles.collections.IMap.} + */ + deserializationPropertyOverrides:yfiles.collections.IMap; + /** + * Adds the given listener for the QueryType event that occurs when a type is queried. + *

+ * This event can be used to override type resolution for XML names in XAML. + *

+ * @param {function(Object, yfiles.graphml.QueryTypeEventArgs): void} listener The listener to add. + * @see yfiles.graphml.QueryTypeEventArgs + * @see yfiles.graphml.GraphMLIOHandler#removeQueryTypeListener + */ + addQueryTypeListener(listener:(sender:Object,evt:yfiles.graphml.QueryTypeEventArgs)=>void):void; + /** + * Removes the given listener for the QueryType event that occurs when a type is queried. + *

+ * This event can be used to override type resolution for XML names in XAML. + *

+ * @param {function(Object, yfiles.graphml.QueryTypeEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.QueryTypeEventArgs + * @see yfiles.graphml.GraphMLIOHandler#addQueryTypeListener + */ + removeQueryTypeListener(listener:(sender:Object,evt:yfiles.graphml.QueryTypeEventArgs)=>void):void; + /** + * Adds the given listener for the QueryName event that occurs when a name is queried. + *

+ * This event can be used to override name mappings to XML names in XAML. + *

+ *

+ * If the event handler determines that it map resolve {@link yfiles.graphml.QueryNameEventArgs#type} to a xml name, it should place the result into the {@link yfiles.graphml.QueryNameEventArgs#result} property and + * thus mark the event as {@link yfiles.graphml.QueryNameEventArgs#handled}. + *

+ *

+ * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name + * determination rules are used for that part. + *

+ * @param {function(Object, yfiles.graphml.QueryNameEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#removeQueryNameListener + */ + addQueryNameListener(listener:(sender:Object,evt:yfiles.graphml.QueryNameEventArgs)=>void):void; + /** + * Removes the given listener for the QueryName event that occurs when a name is queried. + *

+ * This event can be used to override name mappings to XML names in XAML. + *

+ *

+ * If the event handler determines that it map resolve {@link yfiles.graphml.QueryNameEventArgs#type} to a xml name, it should place the result into the {@link yfiles.graphml.QueryNameEventArgs#result} property and + * thus mark the event as {@link yfiles.graphml.QueryNameEventArgs#handled}. + *

+ *

+ * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name + * determination rules are used for that part. + *

+ * @param {function(Object, yfiles.graphml.QueryNameEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addQueryNameListener + */ + removeQueryNameListener(listener:(sender:Object,evt:yfiles.graphml.QueryNameEventArgs)=>void):void; + /** + * Adds the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. + *

+ * Subscribe to this event to provide custom serialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + *

+ * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#removeHandleSerializationListener + */ + addHandleSerializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; + /** + * Removes the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. + *

+ * Subscribe to this event to provide custom serialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + *

+ * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener + */ + removeHandleSerializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; + /** + * Adds the given listener for the QueryOutputHandlers event that occurs when a GraphML attribute is about to be written. + *

+ * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given + * GraphML attribute key definition. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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}. + *

+ * @param {function(Object, yfiles.graphml.QueryOutputHandlersEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#removeQueryOutputHandlersListener + */ + addQueryOutputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; + /** + * Removes the given listener for the QueryOutputHandlers event that occurs when a GraphML attribute is about to be + * written. + *

+ * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given + * GraphML attribute key definition. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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}. + *

+ * @param {function(Object, yfiles.graphml.QueryOutputHandlersEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener + */ + removeQueryOutputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; + /** + * Adds the given listener for the Parsed event that occurs when the the document has been parsed. + * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#onParsed + * @see yfiles.graphml.GraphMLParser#addParsedListener + * @see yfiles.graphml.GraphMLIOHandler#removeParsedListener + */ + addParsedListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Removes the given listener for the Parsed event that occurs when the the document has been parsed. + * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#onParsed + * @see yfiles.graphml.GraphMLParser#addParsedListener + * @see yfiles.graphml.GraphMLIOHandler#addParsedListener + */ + removeParsedListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Adds the given listener for the Parsing event that 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. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#onParsing + * @see yfiles.graphml.GraphMLParser#addParsingListener + * @see yfiles.graphml.GraphMLIOHandler#removeParsingListener + */ + addParsingListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Removes the given listener for the Parsing event that 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. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#onParsing + * @see yfiles.graphml.GraphMLParser#addParsingListener + * @see yfiles.graphml.GraphMLIOHandler#addParsingListener + */ + removeParsingListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Adds the given listener for the QueryInputHandlers event that occurs when a GraphML attribute is about to be read. + *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.QueryInputHandlersEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener + * @see yfiles.graphml.GraphMLIOHandler#removeQueryInputHandlersListener + */ + addQueryInputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; + /** + * Removes the given listener for the QueryInputHandlers event that occurs when a GraphML attribute is about to be read. + *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.QueryInputHandlersEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener + * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener + */ + removeQueryInputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; + /** + * Adds the given listener for the HandleDeserialization event that occurs when XML content is about to be deserialized. + *

+ * Subscribe to this event to provide custom deserialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener + * @see yfiles.graphml.GraphMLIOHandler#removeHandleDeserializationListener + */ + addHandleDeserializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; + /** + * Removes the given listener for the HandleDeserialization event that occurs when XML content is about to be + * deserialized. + *

+ * Subscribe to this event to provide custom deserialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener + * @see yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener + */ + removeHandleDeserializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Interface for factory classes for {@link yfiles.graphml.IInputHandler} creation. + * @interface + */ 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; + * Create an {@link yfiles.graphml.IInputHandler} instance based on the given args. + * @param {yfiles.lang.Class} keyType The key type as inferred by the caller from the GraphML contents. + * @param {yfiles.lang.Class} valueType The type of the value as inferred by the caller from the GraphML contents. + * @param {yfiles.graphml.QueryInputHandlersEventArgs} evt The event argument that is used like in + * {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} + * @returns {yfiles.graphml.IInputHandler} The specific input handler to use. + * @abstract + */ + createInputHandler(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,evt: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{ + * + * @class yfiles.graphml.GraphMLSupport + */ + export interface GraphMLSupport extends Object{} + export class GraphMLSupport { /** - * 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; + * Creates a new instance of this class. + *

+ * Optionally calls {@link yfiles.graphml.GraphMLSupport#registerCommands}, if graphControl is given. + *

+ * @param {yfiles.view.GraphComponent} [graphComponent=null] The {@link yfiles.view.GraphComponent} that the {@link yfiles.input.ICommand#OPEN} and {@link yfiles.input.ICommand#SAVE} commands are + * registered on. + * @constructor + */ + constructor(graphComponent?:yfiles.view.GraphComponent); /** - * 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; + * Creates a new instance of this class. + *

+ * Optionally calls {@link yfiles.graphml.GraphMLSupport#registerCommands}, if graphControl is given. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.GraphComponent} [options.graphComponent=null] The {@link yfiles.view.GraphComponent} that the {@link yfiles.input.ICommand#OPEN} and {@link yfiles.input.ICommand#SAVE} commands are + * registered on. + * @param {yfiles.graphml.StorageLocation} options.storageLocation A value indicating the type of storage used by the commands Open/Save/Save As. + *

+ * This option sets the {@link yfiles.graphml.GraphMLSupport#storageLocation} property on the created object. + *

+ * @param {yfiles.graphml.GraphMLIOHandler} options.graphMLIOHandler The {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} to use for the various I/O methods in this instance. + *

+ * This option sets the {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} property on the created object. + *

+ * @constructor + */ + constructor(options:{graphComponent?:yfiles.view.GraphComponent,storageLocation?:yfiles.graphml.StorageLocation,graphMLIOHandler?:yfiles.graphml.GraphMLIOHandler}); /** - * 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. - */ + * Helper callback method that creates the {@link HTMLInputElement} for use in the handling of the {@link yfiles.input.ICommand#OPEN} + * command. + *

+ * The open command that is enabled if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from {@link yfiles.graphml.StorageLocation#NONE} will use this + * method to create the input element for opening the files. + *

+ * @returns {HTMLInputElement} The preconfigured element to use. + * @protected + */ + createOpenFileInputElement():HTMLInputElement; + /** + * Helper callback method that creates the {@link HTMLElement} for use in the handling of the + * {@link yfiles.input.ICommand#SAVE}and SaveAs commands. + *

+ * If {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to {@link yfiles.graphml.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. + *

+ * @returns {HTMLElement} The preconfigured element to use. Null if element creation failed. + * @protected + */ + createSaveFileTextElement():HTMLElement; + /** + * Gets the {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} to use for the various I/O methods in this instance. + *

+ * This method will first query the {@link yfiles.graph.ILookup#lookup} of the graph, + *

+ * @param {yfiles.graph.IGraph} graph + * @returns {yfiles.graphml.GraphMLIOHandler} The instance to use for IO. + * @protected + */ + getGraphMLIOHandler(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLIOHandler; + /** + * Default implementation of {@link yfiles.input.ICommand#OPEN} that shows a {@link yfiles.graphml.GraphMLSupport#createOpenFileInputElement open file dialog} and imports the GraphML. + *

+ * This method is called in response to the {@link yfiles.input.ICommand#OPEN} command if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from + * {@link yfiles.graphml.StorageLocation#NONE}. + *

+ *

+ * Any exception thrown during loading of the GraphML file will reject the promise. + *

+ * @param {yfiles.view.GraphComponent} graphComponent + * @param {yfiles.graphml.StorageLocation} [storageLocation=null] + * @returns {Promise.} A promise that will resolve to the loaded graph instance or reject upon exceptions during loading. Note that if the file + * open dialog is cancelled by the user, the promise will stay unresolved because there is no API available that can be + * used to determine whether the user has pressed cancel. Depending on the UA implementation it may be possible to listen + * to focus or other input device events on the page to detect when the user has closed the file open dialog. + * @see yfiles.graphml.GraphMLSupport#storageLocation + * @see yfiles.graphml.GraphMLSupport#saveFile + */ + openFile(graphComponent:yfiles.view.GraphComponent,storageLocation?:yfiles.graphml.StorageLocation):Promise; + /** + * Default implementation of {@link yfiles.input.ICommand#OPEN} that shows a {@link yfiles.graphml.GraphMLSupport#createOpenFileInputElement open file dialog} and imports the GraphML. + *

+ * This method is called in response to the {@link yfiles.input.ICommand#OPEN} command if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from + * {@link yfiles.graphml.StorageLocation#NONE}. + *

+ *

+ * Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For + * more control over error behaviour it is recommended to use {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} directly, e.g. from a custom command handler. + *

+ * @param {yfiles.graph.IGraph} graph + * @param {yfiles.graphml.StorageLocation} [storageLocation=null] + * @returns {Promise.} A promise that will resolve to the loaded graph instance or reject upon exceptions during loading. Note that if the file + * open dialog is cancelled by the user, the promise will stay unresolved because there is no API available that can be + * used to determine whether the user has pressed cancel. Depending on the UA implementation it may be possible to listen + * to focus or other input device events on the page to detect when the user has closed the file open dialog. + * @see yfiles.graphml.GraphMLSupport#storageLocation + * @see yfiles.graphml.GraphMLSupport#saveFile + */ + openFile(graph:yfiles.graph.IGraph,storageLocation?:yfiles.graphml.StorageLocation):Promise; + /** + * Registers bindings for {@link yfiles.input.ICommand#OPEN} and {@link yfiles.input.ICommand#SAVE} on the given graphControl. + * @param {yfiles.view.GraphComponent} graphComponent The {@link yfiles.view.GraphComponent} to register the command bindings on. + */ + registerCommands(graphComponent:yfiles.view.GraphComponent):void; + /** + * Convenience method that exports the graph as GraphML and saves it to a storage location. + *

+ * This method is called in response to the {@link yfiles.input.ICommand#SAVE} command if {@link yfiles.graphml.GraphMLSupport#storageLocation} is set to a value different from + * {@link yfiles.graphml.StorageLocation#NONE}. + *

+ *

+ * Any exception thrown during loading of the GraphML file will be caught and an error message displayed to the user. For + * more control over error behaviour it is recommended to use {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} directly, e.g. from a custom command handler. + *

+ * @param {yfiles.graph.IGraph} graph + * @param {yfiles.graphml.StorageLocation} [storageLocation=null] + * @returns {Promise.} A promise that will resolve to the saved string representation of the graph or reject upon exceptions during the save + * operation. + * @see yfiles.graphml.GraphMLSupport#storageLocation + * @see yfiles.graphml.GraphMLSupport#saveFile + * @see yfiles.graphml.GraphMLSupport#openFile + */ + saveFile(graph:yfiles.graph.IGraph,storageLocation?:yfiles.graphml.StorageLocation):Promise; + /** + * The {@link yfiles.graphml.GraphMLSupport#graphMLIOHandler} to use for the various I/O methods in this instance. + * @type {yfiles.graphml.GraphMLIOHandler} + */ + graphMLIOHandler:yfiles.graphml.GraphMLIOHandler; + /** + * 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.graphml.StorageLocation#NONE}. + *

+ *

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

+ *
    + *
  • {@link yfiles.input.ICommand#OPEN GraphCommands.Open}
  • + *
  • {@link yfiles.input.ICommand#SAVE GraphCommands.Save}
  • + *
  • GraphCommands.SaveAs
  • + *
+ *

+ * Note that this doesn't affect the convenience methods ImportFromGraphML(string,EventHandler), + * ExportToGraphML(TextWriter) and their variants. + *

+ *

+ * The default implementations delegate to OpenFile, {@link yfiles.graphml.GraphMLSupport#saveFile} and {@link yfiles.graphml.GraphMLSupport#saveFile} + * methods respectively. + *

+ * @see yfiles.graphml.GraphMLSupport#createOpenFileInputElement + * @see yfiles.graphml.GraphMLSupport#createSaveFileTextElement + * @see yfiles.graphml.GraphMLSupport#saveFile + * @see yfiles.graphml.GraphMLSupport#saveFile + * @type {yfiles.graphml.StorageLocation} + */ + storageLocation:yfiles.graphml.StorageLocation; + static $class:yfiles.lang.Class; + } + 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 + } + /** + * 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 yfiles.graphml.ChildParseContext#setDeserializationProperty + * @see yfiles.graphml.ChildParseContext#setLookup + * @class yfiles.graphml.ChildParseContext + * @implements {yfiles.graphml.IParseContext} + */ + export interface ChildParseContext extends Object,yfiles.graphml.IParseContext{} + export class ChildParseContext { + /** + * 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 return in {@link yfiles.graphml.ChildParseContext#getCurrent}. + * @constructor + */ + constructor(parentContext:yfiles.graphml.IParseContext,currentObject:Object); + /** + * 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. + * @constructor + */ + constructor(parentContext:yfiles.graphml.IParseContext); + /** + * + * Type parameter T. + * @param {yfiles.lang.Class} targetType + * @param {yfiles.graphml.IParseContext} context + * @param {Node} targetNode + * @returns {T} + * @template T + */ + deserializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; + /** + * + * Type parameter T. + * @param {yfiles.lang.Class} itemType + * @returns {T} + * @template T + */ + getCurrent(itemType:yfiles.lang.Class):T; + /** + * + * @param {string} key + * @returns {Object} + */ + getDeserializationProperty(key:string):Object; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Removes a previously locally {@link yfiles.graphml.ChildParseContext#setDeserializationProperty set} deserialization property. + * @param {string} key The key for which the local property override should be removed. + */ + removeDeserializationProperty(key:string):void; + /** + * Removes a local lookup override that has been added using {@link yfiles.graphml.ChildParseContext#setLookup} + * Type parameter T: The type key to remove. + * @param {yfiles.lang.Class} tType The type key to remove. + * @template T + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Sets the local deserialization property for the given key to the value. + * @param {string} key The key to override. + * @param {Object} value The value. + */ + setDeserializationProperty(key:string,value:Object):void; + /** + * Adds another lookup result to the local lookup override. + * Type parameter T: The type to use as a key for the lookup. + * @param {yfiles.lang.Class} tType The type to use as a key for the lookup. + * @param {T} value The value to provide for queries to T. + * @see yfiles.graphml.ChildParseContext#removeLookup + * @template T + */ + setLookup(tType:yfiles.lang.Class,value:T):void; + /** + * Gets the parent context. + * @type {yfiles.graphml.IParseContext} + */ + parentContext:yfiles.graphml.IParseContext; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + objectStack:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.graphml.IParseEvents} + */ + parseEvents:yfiles.graphml.IParseEvents; + /** + * + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + /** + * A simple mutable implementation of {@link yfiles.collections.IMapper.} 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.graph.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 yfiles.graphml.IGraphElementFactory + * @see yfiles.graphml.GraphMLParser + * @class yfiles.graphml.CreationProperties + * @implements {yfiles.collections.IMapper.} + */ + export interface CreationProperties extends Object,yfiles.collections.IMapper{} + export class CreationProperties { + constructor(); + /** + * Clears all entries from this property store. + */ + clear():void; + /** + * Gets the value associated with the specified key. + * @param {Object} key The key. + * @returns {Object} The value stored for the key. + * @see yfiles.graphml.CreationProperties#set + */ + get(key:Object):Object; + /** + * Removes the associated entry for the given key + * @param {Object} key The entry key to remove. + */ + removeValue(key:Object):void; + /** + * Sets the value associated with the specified key. + * @param {Object} key The key. + * @param value The value stored for the key. + * @see yfiles.graphml.CreationProperties#get + */ + set(key:Object,value:Object):void; + /** + * Creation property key that tags group node information. + *

+ * Stores values of type {@link boolean}. + *

+ * @see yfiles.graphml.IGraphElementFactory#createNode + * @const + * @static + * @type {string} + */ + static IS_GROUP_NODE:string; + /** + * Creation property key that tags label information. + *

+ * Stores values of type {@link yfiles.collections.IEnumerable.} with {@link yfiles.graph.ILabel} template instances. + *

+ * @see yfiles.graphml.IGraphElementFactory + * @const + * @static + * @type {string} + */ + static LABELS:string; + /** + * Creation property key that tags node layout information. + *

+ * Stores values of type {@link yfiles.geometry.Rect}. + *

+ * @see yfiles.graphml.IGraphElementFactory#createNode + * @const + * @static + * @type {string} + */ + static LAYOUT:string; + /** + * Creation property key that tags style information. + *

+ * Stores values of type {@link yfiles.styles.INodeStyle}, {@link yfiles.styles.IEdgeStyle}, and {@link yfiles.styles.IPortStyle} respectively. + *

+ * @see yfiles.graphml.IGraphElementFactory + * @const + * @static + * @type {string} + */ + static STYLE:string; + /** + * Creation property key that tags {@link yfiles.graph.ITagOwner#tag tag} object information. + *

+ * Stores values of type {@link Object}. + *

+ * @see yfiles.graphml.IGraphElementFactory + * @const + * @static + * @type {string} + */ + static TAG:string; + /** + * Creation property key that tags bend information. + *

+ * Stores values of type {@link yfiles.collections.IEnumerable.} with {@link yfiles.graph.IBend} template instances. + *

+ * @see yfiles.graphml.IGraphElementFactory#createEdge + * @const + * @static + * @type {string} + */ + static BENDS:string; + /** + * Creation property key that tags {@link yfiles.graph.IPortLocationModelParameter port location} information. + *

+ * Stores values of type {@link yfiles.graph.IPortLocationModelParameter}. + *

+ * @see yfiles.graphml.IGraphElementFactory#addPort + * @const + * @static + * @type {string} + */ + static PORT_LOCATION_MODEL_PARAMETER:string; + /** + * Gets all the entries stored by this instance. + * @type {yfiles.collections.IEnumerable.>} + */ + entries:yfiles.collections.IEnumerable>; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.graphml.GraphMLIOHandler + * @class yfiles.graphml.GraphMLParser + */ + export interface GraphMLParser extends Object{} + export class GraphMLParser { + constructor(); + /** + * Create the initial {@link yfiles.graphml.IParseContext} instance. + * @param {yfiles.graph.IGraph} graph The graph that is parsed. + * @returns {yfiles.graphml.IParseContext} An {@link yfiles.graphml.IParseContext} instance that is suitable for graph. + * @protected + */ + createParseContext(graph:yfiles.graph.IGraph):yfiles.graphml.IParseContext; + /** + * Deserialize the content of element. + *

+ * Typically, this method is called only indirectly by calls to {@link yfiles.graphml.IParseContext#deserializeCore}. This + * implementation calls {@link yfiles.graphml.GraphMLParser#onHandleDeserialization}, which in turn raises the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + * event. + *

+ * Type parameter T: The desired type of the result. + * @param {yfiles.lang.Class} targetType The desired type of the result. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} element The XML content that should be deserialized. + * @returns {T} An instance of T that is represented by element. + * @see yfiles.graphml.IParseContext#deserializeCore + * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener + * @template T + */ + deserialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,element:Node):T; + /** + * Retrieve a deserialization property that has been set by {@link yfiles.graphml.GraphMLParser#setDeserializationProperty}. + * @param {string} key The key for the property. + * @returns {Object} + * @see yfiles.graphml.IParseContext#getDeserializationProperty + */ + getDeserializationProperty(key:string):Object; + /** + * 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. + * @returns {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; + /** + * Dynamically retrieve an instance of type. + * @param {yfiles.lang.Class} type The type for which an implementation is needed. + * @returns {Object} An implementation of type, or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Fires the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + * event. + * @see yfiles.graphml.GraphMLIOHandler#onHandleDeserialization + * @protected + */ + onHandleDeserialization(evt:yfiles.graphml.HandleDeserializationEventArgs):void; + /** + * 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} evt The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLParser#addParsedListener + * @protected + */ + onParsed(evt:yfiles.graphml.ParseEventArgs):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} evt The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLParser#addParsingListener + * @protected + */ + onParsing(evt:yfiles.graphml.ParseEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + * @param {yfiles.graphml.QueryInputHandlersEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} + * event. + * @see yfiles.graphml.GraphMLIOHandler#onQueryInputHandlers + * @protected + */ + onQueryInputHandlers(evt:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * 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 {@link http://msdn.microsoft.com/en-us/library/ie/hh180177.aspx}. + * @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. + * @returns {Promise.} + * @see yfiles.graphml.GraphMLIOHandler#readFromDocument + */ + parseFromDocument(graph:yfiles.graph.IGraph,document:Document,elementFactory:yfiles.graphml.IGraphElementFactory):Promise; + /** + * 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#readFromURL}. + *

+ * @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. + * @returns {Promise.} + * @see yfiles.graphml.GraphMLIOHandler#readFromGraphMLText + */ + parseFromURL(graph:yfiles.graph.IGraph,url:string,elementFactory:yfiles.graphml.IGraphElementFactory):Promise; + /** + * Remove a deserialization property that has been set by {@link yfiles.graphml.GraphMLParser#setDeserializationProperty}. + * @param {string} key The key for the property. + * @see yfiles.graphml.IParseContext#getDeserializationProperty + */ + removeDeserializationProperty(key:string):void; + /** + * Remove an implementation of T that has been set with {@link yfiles.graphml.GraphMLParser#setLookup}. + * Type parameter T. + * @param {yfiles.lang.Class} tType + * @template T + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Set a deserialization property that allows to fine tune the parsing process. + * @param {string} key The key for the property. + * @param {Object} value The property value. + * @see yfiles.graphml.IParseContext#getDeserializationProperty + */ + setDeserializationProperty(key:string,value:Object):void; + /** + * Register an implementation of T for use with {@link yfiles.graphml.GraphMLParser#lookup}. + * Type parameter T: The type of instance. + * @param {yfiles.lang.Class} tType The type of instance. + * @param {T} instance The implementation of T for lookup retrieval. + * @template T + */ + setLookup(tType:yfiles.lang.Class,instance:T):void; + /** + * Adds the given listener for the QueryInputHandlers event that occurs when {@link yfiles.graphml.IInputHandler}s are queried. + *

+ * 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}. + *

+ * @param {function(Object, yfiles.graphml.QueryInputHandlersEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener + * @see yfiles.graphml.GraphMLParser#removeQueryInputHandlersListener + */ + addQueryInputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; + /** + * Removes the given listener for the QueryInputHandlers event that occurs when {@link yfiles.graphml.IInputHandler}s are queried. + *

+ * 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}. + *

+ * @param {function(Object, yfiles.graphml.QueryInputHandlersEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener + * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener + */ + removeQueryInputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryInputHandlersEventArgs)=>void):void; + /** + * Adds the given listener for the HandleDeserialization event that occurs when XML content is about to be deserialized. + *

+ * Subscribe to this event to provide custom deserialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener + * @see yfiles.graphml.GraphMLParser#removeHandleDeserializationListener + */ + addHandleDeserializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; + /** + * Removes the given listener for the HandleDeserialization event that occurs when XML content is about to be + * deserialized. + *

+ * Subscribe to this event to provide custom deserialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener + * @see yfiles.graphml.GraphMLParser#addHandleDeserializationListener + */ + removeHandleDeserializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void):void; + /** + * Adds the given listener for the Parsed event that occurs when the the document has been parsed. + * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLParser#onParsed + * @see yfiles.graphml.GraphMLParser#removeParsedListener + */ + addParsedListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Removes the given listener for the Parsed event that occurs when the the document has been parsed. + * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLParser#onParsed + * @see yfiles.graphml.GraphMLParser#addParsedListener + */ + removeParsedListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Adds the given listener for the Parsing event that 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. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLParser#onParsing + * @see yfiles.graphml.GraphMLParser#removeParsingListener + */ + addParsingListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + /** + * Removes the given listener for the Parsing event that 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. + *

+ * @param {function(Object, yfiles.graphml.ParseEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLParser#onParsing + * @see yfiles.graphml.GraphMLParser#addParsingListener + */ + removeParsingListener(listener:(sender:Object,evt:yfiles.graphml.ParseEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * 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}. + *

+ * @class yfiles.graphml.HandleDeserializationEventArgs + * @extends {yfiles.lang.EventArgs} + * @final + */ + export interface HandleDeserializationEventArgs extends yfiles.lang.EventArgs{} + export class 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}. + * @constructor + */ + constructor(context:yfiles.graphml.IParseContext,xmlNode:Node,targetType:yfiles.lang.Class); + /** + * 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. + * @see yfiles.graphml.IParseContext#deserializeCore + * @type {yfiles.lang.Class} + */ + 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 {Stubs.Exceptions.ArgumentError} If the value is not assignable to {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} + * @type {Object} + */ + 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. + *

+ * @type {boolean} + */ handled:boolean; /** - * The {@link yfiles.graphml.IParseContext} instance that can queried for further information. - */ + * Gets the context in which the {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode} shall be deserialized. + * @type {yfiles.graphml.IParseContext} + */ 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; + * Gets the XML node that contains the data to deserialize. + * @type {Node} + */ + xmlNode:Node; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.graphml.GraphMLIOHandler#createGraphElementFactory + * @interface + */ + export interface IGraphElementFactory extends Object{ + /** + * 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} owner The owner of the port. + * @returns {yfiles.graph.IPort} A newly created port. + * @abstract + */ + addPort(context:yfiles.graphml.IParseContext,owner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * 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. + * @returns {yfiles.graph.IEdge} A newly created edge. + * @abstract + */ + 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 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. + * @returns {yfiles.graph.INode} A newly created node + * @abstract + */ + createNode(context:yfiles.graphml.IParseContext):yfiles.graph.INode; + } + var IGraphElementFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; /** - * 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{ + * Interface for classes that can store the GraphML id attribute of GraphML core elements + * @interface + */ + export interface IGraphElementIdAcceptor extends Object{ /** - * Gets or sets the mapper metadata to serialize to the key definition. - * Value: The mapper metadata. - */ - mapperMetadata:yfiles.graph.IMapperMetadata; + * Store the value of the id attribute for the given edge. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.graph.IEdge} edge The current edge element + * @param {string} id The id of the edge's XML representation + * @abstract + */ + storeEdgeId(context:yfiles.graphml.IParseContext,edge:yfiles.graph.IEdge,id:string):void; /** - * 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; + * Store the value of the id attribute for the given graph. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.graph.IGraph} graph The current graph element + * @param {string} id The id of the graph's XML representation + * @abstract + */ + storeGraphId(context:yfiles.graphml.IParseContext,graph:yfiles.graph.IGraph,id:string):void; /** - * Gets or sets the mapper to use for querying the data for each item. - * Value: The mapper. - */ - mapper:yfiles.model.IMapper; + * Store the value of the id attribute for the given node. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.graph.INode} node The current node element + * @param {string} id The id of the node's XML representation + * @abstract + */ + storeNodeId(context:yfiles.graphml.IParseContext,node:yfiles.graph.INode,id:string):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 using the {@link yfiles.graphml.AbstractMapperOutputHandler#mapper}. - * @see Overrides {@link yfiles.graphml.AbstractOutputHandler#getValue} - */ - getValue(context:yfiles.graphml.IWriteContext,key:TKey):TData; + * Store the value of the id attribute for the given port. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.graph.IPort} port The current port element + * @param {string} id The id of the port's XML representation + * @abstract + */ + storePortId(context:yfiles.graphml.IParseContext,port:yfiles.graph.IPort,id:string):void; } - var AbstractMapperOutputHandler:{ + var IGraphElementIdAcceptor:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * This class defines a handler for key/data elements. - */ + * Simple implementation of {@link yfiles.graphml.IGraphElementIdAcceptor} and {@link yfiles.graphml.IGraphElementIdProvider} that stores + * all ids in {@link yfiles.collections.IMapper.} instances. + * @class yfiles.graphml.GraphElementIdAcceptor + * @implements {yfiles.graphml.IGraphElementIdAcceptor} + * @implements {yfiles.graphml.IGraphElementResolver} + */ + export interface GraphElementIdAcceptor extends Object,yfiles.graphml.IGraphElementIdAcceptor,yfiles.graphml.IGraphElementResolver{} + export class GraphElementIdAcceptor { + constructor(); + /** + * 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. + * @returns {yfiles.graphml.IGraphElementIdProvider} + */ + createIdProvider(fallback:yfiles.graphml.IGraphElementIdProvider):yfiles.graphml.IGraphElementIdProvider; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {string} id + * @returns {yfiles.graph.IEdge} + */ + resolveEdge(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IEdge; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {string} id + * @returns {yfiles.graph.IGraph} + */ + resolveGraph(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IGraph; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {string} id + * @returns {yfiles.graph.INode} + */ + resolveNode(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.INode; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {string} ownerId + * @param {string} id + * @returns {yfiles.graph.IPort} + */ + resolvePort(context:yfiles.graphml.IParseContext,ownerId:string,id:string):yfiles.graph.IPort; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {yfiles.graph.IEdge} edge + * @param {string} id + */ + storeEdgeId(context:yfiles.graphml.IParseContext,edge:yfiles.graph.IEdge,id:string):void; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {yfiles.graph.IGraph} graph + * @param {string} id + */ + storeGraphId(context:yfiles.graphml.IParseContext,graph:yfiles.graph.IGraph,id:string):void; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {yfiles.graph.INode} node + * @param {string} id + */ + storeNodeId(context:yfiles.graphml.IParseContext,node:yfiles.graph.INode,id:string):void; + /** + * + * @param {yfiles.graphml.IParseContext} context + * @param {yfiles.graph.IPort} port + * @param {string} id + */ + storePortId(context:yfiles.graphml.IParseContext,port:yfiles.graph.IPort,id:string):void; + /** + * Return a mapping between all GraphML ids for <graph> elements and the corresponding {@link yfiles.graph.IGraph} instances + * @type {yfiles.collections.IMap.} + */ + graphIds:yfiles.collections.IMap; + /** + * Return a mapping between all GraphML ids for <node> elements and the corresponding {@link yfiles.graph.INode} instances + * @type {yfiles.collections.IMap.} + */ + nodeIds:yfiles.collections.IMap; + /** + * Return a mapping between all GraphML ids for <edge> elements and the corresponding {@link yfiles.graph.IEdge} instances + * @type {yfiles.collections.IMap.} + */ + edgeIds:yfiles.collections.IMap; + /** + * Return a mapping between all GraphML ids for <port> elements and the corresponding {@link yfiles.graph.IPort} instances + * @type {yfiles.collections.IMap.} + */ + portIds:yfiles.collections.IMap; + static $class:yfiles.lang.Class; + } + /** + * Interface for classes can resolve graph elements based on their GraphML id attribute(s). + * @interface + */ + export interface IGraphElementResolver extends Object{ + /** + * 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. + * @returns {yfiles.graph.IEdge} The {@link yfiles.graph.IEdge} that is defined by this GraphML id, or null if no such edge exists yet. + * @abstract + */ + resolveEdge(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IEdge; + /** + * 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. + * @returns {yfiles.graph.IGraph} The {@link yfiles.graph.IGraph} that is defined by this GraphML id, or null if no such graph exists yet. + * @abstract + */ + resolveGraph(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IGraph; + /** + * 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. + * @returns {yfiles.graph.INode} The {@link yfiles.graph.INode} that is defined by this GraphML id, or null if no such node exists yet. + * @abstract + */ + resolveNode(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.INode; + /** + * 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. + * @returns {yfiles.graph.IPort} The {@link yfiles.graph.IPort} that is defined by the GraphML ids, or null if no such port exists yet. + * @abstract + */ + resolvePort(context:yfiles.graphml.IParseContext,ownerId:string,id:string):yfiles.graph.IPort; + } + var IGraphElementResolver:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class defines a handler for key/data elements. + * @interface + */ 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 when no data tag is defined, and the default value should be applied. + * @param {yfiles.graphml.IParseContext} context the current parse context. + * @abstract + */ + applyDefault(context:yfiles.graphml.IParseContext):void; /** - * 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}. - */ + * 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. + * @abstract + */ 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; + * Gets the parse precedence that is associated with this instance. + * @abstract + * @type {yfiles.graphml.ParsePrecedence} + */ + precedence:yfiles.graphml.ParsePrecedence; } var IInputHandler:{ $class:yfiles.lang.Class; @@ -64814,10997 +5812,10695 @@ declare module yfiles{ }; export enum ParsePrecedence{ /** - * The data is parsed as early as possible. - */ + * The data is parsed as early as possible. + */ FIRST, /** - * The data is parsed before its owner GraphML element. - */ + * 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. - */ + * The data is parsed after its owner GraphML element, but before any non-data child content. + */ BEFORE_CHILDREN, /** - * Default parse priority. - */ + * Default parse priority. + */ DEFAULT, /** - * The data is parsed after any non-data child content, but before parsing the owner GraphML element is finished. - */ + * 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. - */ + * The data is parsed directly after parsing the owner GraphML element is finished. + */ AFTER_OWNER, /** - * The data is parsed as late as possible. - */ + * 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}. - */ + * An abstract convenience implementation of the {@link yfiles.graphml.IInputHandler} interface. + * Type parameter TKey: The type of the key, i.e. the items that are associated with the data in the GraphML. + * Type parameter TData: The type of the data that is associated with the keys. + * @class yfiles.graphml.InputHandlerBase. + * @implements {yfiles.graphml.IInputHandler} + * @template TKey,TData + */ + export interface InputHandlerBase extends Object,yfiles.graphml.IInputHandler{} + export class InputHandlerBase { + /** + * Initializes a new instance of the {@link yfiles.graphml.InputHandlerBase.} class. + *

+ * The {@link yfiles.graphml.InputHandlerBase.#precedence} gets the initial value assigned to precedence + *

+ * @param {yfiles.lang.Class} keyType1 The type of the key, i.e. the items that are associated with the data in the GraphML. + * @param {yfiles.lang.Class} dataType The type of the data that is associated with the keys. + * @param {yfiles.graphml.ParsePrecedence} precedence The precedence to assign to the {@link yfiles.graphml.InputHandlerBase.#precedence} property. + * @protected + * @constructor + */ + constructor(keyType1:yfiles.lang.Class,dataType:yfiles.lang.Class,precedence:yfiles.graphml.ParsePrecedence); + /** + * Initializes a new instance of the {@link yfiles.graphml.InputHandlerBase.} class. + *

+ * The {@link yfiles.graphml.InputHandlerBase.#precedence} has an initial value of {@link yfiles.graphml.ParsePrecedence#DEFAULT}. + *

+ * @param {yfiles.lang.Class} keyType1 The type of the key, i.e. the items that are associated with the data in the GraphML. + * @param {yfiles.lang.Class} dataType The type of the data that is associated with the keys. + * @protected + * @constructor + */ + constructor(keyType1:yfiles.lang.Class,dataType:yfiles.lang.Class); + /** + * This method is invoked when no data tag is defined, and the default value should be applied. + *

+ * This implementation delegates to {@link yfiles.graphml.InputHandlerBase.#setValue} if {@link yfiles.graphml.InputHandlerBase.#defaultExists a default exists} using the {@link yfiles.graphml.InputHandlerBase.#defaultValue}. + *

+ * @param {yfiles.graphml.IParseContext} context the current parse context. + */ 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. - */ + * Initializes this instance from the GraphML key definition. + *

+ * This implementation looks for the GraphML default element and delegates to {@link yfiles.graphml.InputHandlerBase.#parseDataCore} if a default is found to store + * the {@link yfiles.graphml.InputHandlerBase.#defaultValue}. + *

+ * @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. - */ + * This method is invoked each time a data element with matching key is processed. + *

+ * If the {@link yfiles.graphml.IParseContext#getCurrent current element} is of the same type as this TKey, this method delegates the actual parsing to {@link yfiles.graphml.InputHandlerBase.#parseDataCore} and + * {@link yfiles.graphml.InputHandlerBase.#setValue} + *

+ * @param {yfiles.graphml.IParseContext} context the current parse context. + * @param {Node} node the DOM node representing the data element. + */ + parseData(context:yfiles.graphml.IParseContext,node:Node):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. + * @returns {TData} The parsed data. + * @protected + * @abstract + */ 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. - */ + * 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. + * @protected + * @abstract + */ 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; + * Gets or sets a value indicating whether the default value in the key definition should be parsed. + * @type {boolean} + */ + parseDefaultValue:boolean; /** - * 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. - */ + * Gets or sets the default value that will be applied to the keys where the data attribute is missing. + *

+ * If any default value is set (including null), {@link yfiles.graphml.InputHandlerBase.#defaultExists} is automatically set to true. + *

+ * @type {TData} + */ 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. - */ + * Gets a value indicating whether a default value has been set, either through a key definition element or explicitly by + * assigning a value to the {@link yfiles.graphml.InputHandlerBase.#defaultValue} property. + *

+ * If this property is set to true, the {@link yfiles.graphml.InputHandlerBase.#applyDefault} method will call the {@link yfiles.graphml.InputHandlerBase.#setValue} method using the {@link yfiles.graphml.InputHandlerBase.#defaultValue} as the value + * parameter. + *

+ * @type {boolean} + */ 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 or sets the parse precedence that is associated with this handler. + * @type {yfiles.graphml.ParsePrecedence} + */ + precedence:yfiles.graphml.ParsePrecedence; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.graphml.IInputHandler} implementation that uses an {@link yfiles.collections.IMapper.} instance to associate the values with the keys. + *

+ * This implementation can be provided an + * {@link yfiles.graphml.HandleDeserializationEventArgs}-handler to perform the deserialization. If no such value is provided then + * the default deserialization is performed. + *

+ *

+ * The parsed values are stored in a {@link yfiles.collections.IMapper.}. + *

+ * Type parameter TKey: The type of the key. + * Type parameter TData: The type of the value. + * @class yfiles.graphml.MapperInputHandler. + * @extends {yfiles.graphml.InputHandlerBase.} + * @template TKey,TData + */ + export interface MapperInputHandler extends yfiles.graphml.InputHandlerBase{} + export class MapperInputHandler { /** - * 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; + * Initializes a new instance of the {@link yfiles.graphml.MapperInputHandler.} class that uses the event handler for deserialization and suggests the provided + * target type for the deserializer. + * @param {yfiles.lang.Class} keyType2 The type of the key. + * @param {yfiles.lang.Class} dataType1 The type of the value. + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} deserializer + * @param {yfiles.lang.Class} [deserializerTargetType=null] + * @see yfiles.graphml.MapperInputHandler.#deserializerTargetType + * @see yfiles.graphml.MapperInputHandler.#deserializer + * @constructor + */ + constructor(keyType2:yfiles.lang.Class,dataType1:yfiles.lang.Class,deserializer:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void,deserializerTargetType?:yfiles.lang.Class); /** - * 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; + * Initializes a new instance of the {@link yfiles.graphml.MapperInputHandler.} class that uses the {@link yfiles.graphml.IParseContext} for deserialization. + *

+ * The {@link yfiles.graphml.IInputHandler#precedence} has an initial value of {@link yfiles.graphml.ParsePrecedence#DEFAULT}. + *

+ * @param {yfiles.lang.Class} keyType2 The type of the key. + * @param {yfiles.lang.Class} dataType1 The type of the value. + * @constructor + */ + constructor(keyType2:yfiles.lang.Class,dataType1:yfiles.lang.Class); /** - * 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; + * Gets the node to pass to {@link yfiles.graphml.MapperInputHandler.#deserializer} or {@link yfiles.graphml.IParseContext#deserializeCore IParseContext.Deserialize} respectively, given the 'data' or 'default' element from the + * GraphML. + *

+ * This method is called by {@link yfiles.graphml.MapperInputHandler.#parseDataCore} to determine the node to pass to the deserialization mechanism. + *

+ *

+ * This implementation returns node iff {@link yfiles.graphml.MapperInputHandler.#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. + * @returns {Node} The node that should be deserialized. + * @see yfiles.graphml.MapperInputHandler.#useParentElementForDeserialization + * @protected + */ + getDeserializationXmlNode(context:yfiles.graphml.IParseContext,node:Node):Node; /** - * 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; + * Gets or sets the mapper to use for storing the data. + * @type {yfiles.collections.IMapper.} + */ + mapper:yfiles.collections.IMapper; /** - * 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; + * Gets or sets a value indicating whether values that are applied via the {@link yfiles.graphml.InputHandlerBase.#applyDefault} mechanism and are equal to the + * value that is already present in the mapper will explicitly be overridden in the mapper. + * @type {boolean} + */ + overrideDefaultValue:boolean; /** - * 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; + * Controls the behavior of {@link yfiles.graphml.MapperInputHandler.#getDeserializationXmlNode} to return either the 'data'/'default' element itself or its + * content. + *

+ * The default value is false, meaning that {@link yfiles.graphml.MapperInputHandler.#getDeserializationXmlNode} should return the content of the 'data'/'default' + * node. + *

+ * @see yfiles.graphml.MapperInputHandler.#getDeserializationXmlNode + * @type {boolean} + */ + useParentElementForDeserialization:boolean; /** - * 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; + * Gets or sets the deserializer. + * @type {function(Object, yfiles.graphml.HandleDeserializationEventArgs): void} + */ + deserializer:(sender:Object,evt:yfiles.graphml.HandleDeserializationEventArgs)=>void; /** - * Callback method that performs the actual writing of the data. - * @param {yfiles.graphml.IWriteContext} context The context. - * @param {TData} data The data. - */ + * Gets or sets the target deserialization type for the {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} property. + * @type {yfiles.lang.Class} + */ + deserializerTargetType:yfiles.lang.Class; + static $class:yfiles.lang.Class; + } + /** + * Specialized {@link yfiles.lang.EventArgs} that are used for dynamic {@link yfiles.graphml.IInputHandler} registration. + * @see yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener + * @see yfiles.graphml.GraphMLParser#addQueryInputHandlersListener + * @class yfiles.graphml.QueryInputHandlersEventArgs + * @extends {yfiles.lang.EventArgs} + * @final + */ + export interface QueryInputHandlersEventArgs extends yfiles.lang.EventArgs{} + export class QueryInputHandlersEventArgs { + /** + * 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. + * @constructor + */ + constructor(context:yfiles.graphml.IParseContext,keyDefinition:Element,handlers:yfiles.collections.IList); + /** + * 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} + *

+ * @type {Element} + */ + 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. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * The {@link yfiles.graphml.IParseContext} instance that can queried for further information. + * @type {yfiles.graphml.IParseContext} + */ + context:yfiles.graphml.IParseContext; + /** + * The {@link yfiles.graphml.IInputHandler}s that have been registered on this event argument instance so far. + * @type {yfiles.collections.IEnumerable.} + */ + handlers:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.graphml.ChildWriteContext + * @implements {yfiles.graphml.IWriteContext} + */ + export interface ChildWriteContext extends Object,yfiles.graphml.IWriteContext{} + export class ChildWriteContext { + /** + * Initializes a new instance of the {@link yfiles.graphml.ChildWriteContext} class that delegates to the provided context and + * returns the given value in {@link yfiles.graphml.ChildWriteContext#getCurrent}. + * @param {yfiles.graphml.IWriteContext} parentContext The parent context to delegate calls to. + * @param {Object} currentObject The current object to return in {@link yfiles.graphml.ChildWriteContext#getCurrent}. + * @constructor + */ + constructor(parentContext:yfiles.graphml.IWriteContext,currentObject:Object); + /** + * 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. + * @constructor + */ + constructor(parentContext:yfiles.graphml.IWriteContext); + /** + * + * Type parameter T. + * @param {yfiles.lang.Class} itemType + * @returns {T} + * @template T + */ + getCurrent(itemType:yfiles.lang.Class):T; + /** + * + * @param {string} key + * @returns {Object} + */ + getSerializationProperty(key:string):Object; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Removes a local lookup override that has been added using {@link yfiles.graphml.ChildWriteContext#setLookup} + * Type parameter T: The type key to remove. + * @param {yfiles.lang.Class} tType The type key to remove. + * @template T + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Removes a previously locally {@link yfiles.graphml.ChildWriteContext#setSerializationProperty set} serialization property. + * @param {string} key The key for which the local property override should be removed. + */ + removeSerializationProperty(key:string):void; + /** + * + * Type parameter T. + * @param {yfiles.lang.Class} targetType + * @param {yfiles.graphml.IWriteContext} context + * @param {T} item + * @template T + */ + serializeCore(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; + /** + * Adds another lookup result to the local lookup override. + * Type parameter T: The type to use as a key for the lookup. + * @param {yfiles.lang.Class} tType The type to use as a key for the lookup. + * @param {T} value The value to provide for queries to T. + * @see yfiles.graphml.ChildWriteContext#removeLookup + * @template T + */ + setLookup(tType:yfiles.lang.Class,value:T):void; + /** + * Sets the local serialization property for the given key to the value. + * @param {string} key The key to override. + * @param {Object} value The value. + */ + setSerializationProperty(key:string,value:Object):void; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + objectStack:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.graphml.IWriteEvents} + */ + writeEvents:yfiles.graphml.IWriteEvents; + /** + * Gets the parent context to which most calls are delegated. + * @type {yfiles.graphml.IWriteContext} + */ + 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}. + *

+ * @type {yfiles.graphml.IXmlWriter} + */ + writer:yfiles.graphml.IXmlWriter; + /** + * + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.graphml.GraphMLIOHandler + * @class yfiles.graphml.GraphMLWriter + */ + export interface GraphMLWriter extends Object{} + export class GraphMLWriter { + constructor(); + /** + * 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. + * @returns {yfiles.graphml.IWriteContext} An {@link yfiles.graphml.IWriteContext} instance that is suitable for graph. + * @protected + */ + createWriteContext(graph:yfiles.graph.IGraph,writer:yfiles.graphml.IXmlWriter):yfiles.graphml.IWriteContext; + /** + * 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. + * @param {yfiles.graphml.KeyScope} scope The scope to get output handlers for. + * @returns {yfiles.collections.IEnumerable.} A dictionary from handler definition ids to {@link yfiles.graphml.IOutputHandler IOutputHandlers}. + */ + getOutputHandlers(context:yfiles.graphml.IWriteContext,scope:yfiles.graphml.KeyScope):yfiles.collections.IEnumerable; + /** + * Retrieve a serialization property that has been set by {@link yfiles.graphml.GraphMLWriter#setSerializationProperty}. + * @param {string} key The key for the property. + * @returns {Object} + * @see yfiles.graphml.IWriteContext#getSerializationProperty + */ + getSerializationProperty(key:string):Object; + /** + * Dynamically retrieve an instance of type. + * @param {yfiles.lang.Class} type The type for which an implementation is needed. + * @returns {Object} An implementation of type, or null. + * @protected + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Fires the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + * @param {yfiles.graphml.HandleSerializationEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} + * event. + * @see yfiles.graphml.GraphMLIOHandler#onHandleSerialization + * @protected + */ + onHandleSerialization(evt:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} + * event. + * @see yfiles.graphml.GraphMLIOHandler#onQueryOutputHandlers + * @protected + */ + onQueryOutputHandlers(evt:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} event. + * @param {yfiles.graphml.QueryReferenceIdEventArgs} evt The arguments that get passed to the {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} + * event. + * @see yfiles.graphml.GraphMLIOHandler#onQueryReferenceId + * @protected + */ + onQueryReferenceId(evt:yfiles.graphml.QueryReferenceIdEventArgs):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} evt The {@link yfiles.graphml.WriteEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLWriter#addWritingListener + * @protected + */ + onWriting(evt:yfiles.graphml.WriteEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLWriter#addWrittenListener Written} event. + *

+ * This method is called just before the writing has been finished and after {@link yfiles.graphml.IWriteEvents#addDocumentWrittenListener DocumentWritten} + * is called for the last time. + *

+ * @param {yfiles.graphml.WriteEventArgs} evt The {@link yfiles.graphml.WriteEventArgs} instance containing the event data. + * @see yfiles.graphml.GraphMLWriter#addWrittenListener + * @protected + */ + onWritten(evt:yfiles.graphml.WriteEventArgs):void; + /** + * Remove an implementation of T that has been set with {@link yfiles.graphml.GraphMLWriter#setLookup}. + * Type parameter T. + * @param {yfiles.lang.Class} tType + * @template T + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Remove a serialization property that has been set by {@link yfiles.graphml.GraphMLWriter#setSerializationProperty}. + * @param {string} key The key for the property. + * @see yfiles.graphml.IWriteContext#getSerializationProperty + */ + removeSerializationProperty(key:string):void; + /** + * Serialize item. + *

+ * Typically, this method is called only indirectly by calls to {@link yfiles.graphml.IWriteContext#serializeCore}. This + * implementation calls {@link yfiles.graphml.GraphMLWriter#onHandleSerialization}, which in turn raises the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} + * event. + *

+ * Type parameter T: The desired type of the result. + * @param {yfiles.lang.Class} targetType The desired type of the result. + * @param {yfiles.graphml.IWriteContext} context The current parse context. + * @param {T} item The object that should be serialized. + * @throws {yfiles.graphml.SerializationNotSupportedError} SerializationNotSupportedException if item cannot be serialized. + * @see yfiles.graphml.IWriteContext#serializeCore + * @see yfiles.graphml.GraphMLWriter#addHandleSerializationListener + * @protected + * @template T + */ + serialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; + /** + * Register an implementation of T for use with {@link yfiles.graphml.GraphMLWriter#lookup}. + * Type parameter T: The type of instance. + * @param {yfiles.lang.Class} tType The type of instance. + * @param {T} instance The implementation of T for lookup retrieval. + * @template T + */ + setLookup(tType:yfiles.lang.Class,instance:T):void; + /** + * Set a serialization property that allows to fine tune the write process. + * @param {string} key The key for the property. + * @param {Object} value The property value. + * @see yfiles.graphml.IWriteContext#getSerializationProperty + */ + setSerializationProperty(key:string,value:Object):void; + /** + * 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 yfiles.graphml.GraphMLIOHandler#write + */ + write(graph:yfiles.graph.IGraph,writer:yfiles.graphml.IXmlWriter):void; + /** + * Adds the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. + *

+ * Subscribe to this event to provide custom serialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + *

+ * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener + * @see yfiles.graphml.GraphMLWriter#removeHandleSerializationListener + */ + addHandleSerializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; + /** + * Removes the given listener for the HandleSerialization event that occurs when XML content is about to be serialized. + *

+ * Subscribe to this event to provide custom serialization handling for XML content. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + *

+ * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener + * @see yfiles.graphml.GraphMLWriter#addHandleSerializationListener + */ + removeHandleSerializationListener(listener:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void):void; + /** + * Adds the given listener for the QueryOutputHandlers event that occurs when {@link yfiles.graphml.IOutputHandler}s are queried. + *

+ * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given + * GraphML attribute key definition. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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}. + *

+ * @param {function(Object, yfiles.graphml.QueryOutputHandlersEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener + * @see yfiles.graphml.GraphMLWriter#removeQueryOutputHandlersListener + */ + addQueryOutputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; + /** + * Removes the given listener for the QueryOutputHandlers event that occurs when + * {@link yfiles.graphml.IOutputHandler}s are queried. + *

+ * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for a given + * GraphML attribute key definition. + *

+ *

+ * The event handlers added to this event are called in inverse order, i.e. handlers that have been added later are called + * earlier. + *

+ *

+ * 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}. + *

+ * @param {function(Object, yfiles.graphml.QueryOutputHandlersEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener + * @see yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener + */ + removeQueryOutputHandlersListener(listener:(sender:Object,evt:yfiles.graphml.QueryOutputHandlersEventArgs)=>void):void; + /** + * Adds the given listener for the QueryReferenceId event that occurs when a reference is queried. + *

+ * This event can be used to provide names of external references for objects. + *

+ *

+ * These reference targets are not serialized to the GraphML file. + *

+ * @param {function(Object, yfiles.graphml.QueryReferenceIdEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener + * @see yfiles.graphml.GraphMLWriter#removeQueryReferenceIdListener + */ + addQueryReferenceIdListener(listener:(sender:Object,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; + /** + * Removes the given listener for the QueryReferenceId event that occurs when a reference is queried. + *

+ * This event can be used to provide names of external references for objects. + *

+ *

+ * These reference targets are not serialized to the GraphML file. + *

+ * @param {function(Object, yfiles.graphml.QueryReferenceIdEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener + * @see yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener + */ + removeQueryReferenceIdListener(listener:(sender:Object,evt:yfiles.graphml.QueryReferenceIdEventArgs)=>void):void; + /** + * 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 + *

+ * @type {yfiles.graphml.IWriteEvents} + */ + writeEvents:yfiles.graphml.IWriteEvents; + /** + * Adds the given listener for the Written event that occurs when the writing of a document has just been finished. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLWriter#onWritten + * @see yfiles.graphml.GraphMLWriter#removeWrittenListener + */ + addWrittenListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + /** + * Removes the given listener for the Written event that occurs when the writing of a document has just been finished. + * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLWriter#onWritten + * @see yfiles.graphml.GraphMLWriter#addWrittenListener + */ + removeWrittenListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + /** + * Adds the given listener for the Writing event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to add. + * @see yfiles.graphml.GraphMLWriter#onWriting + * @see yfiles.graphml.GraphMLWriter#removeWritingListener + */ + addWritingListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + /** + * Removes the given listener for the Writing event that 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. + *

+ * @param {function(Object, yfiles.graphml.WriteEventArgs): void} listener The listener to remove. + * @see yfiles.graphml.GraphMLWriter#onWriting + * @see yfiles.graphml.GraphMLWriter#addWritingListener + */ + removeWritingListener(listener:(sender:Object,evt:yfiles.graphml.WriteEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} + * and {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener 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. + *

+ * @class yfiles.graphml.HandleSerializationEventArgs + * @extends {yfiles.lang.EventArgs} + * @final + */ + export interface HandleSerializationEventArgs extends yfiles.lang.EventArgs{} + export class 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=null] The type that should be used for serialization, which needs to be a super type or interface of the item or null. + * @constructor + */ + constructor(context:yfiles.graphml.IWriteContext,item:Object,serializationType?:yfiles.lang.Class); + /** + * 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 item that should be serialized. + * @type {Object} + */ + item:Object; + /** + * Declares the type in the inheritance of the {@link yfiles.graphml.HandleSerializationEventArgs#item} that should be used for serialization. + * @type {yfiles.lang.Class} + */ + 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. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * Gets the context to be used for writing. + * @type {yfiles.graphml.IWriteContext} + */ + context:yfiles.graphml.IWriteContext; + /** + * Gets the writer for writing the xml output. + * @type {yfiles.graphml.IXmlWriter} + */ + writer:yfiles.graphml.IXmlWriter; + static $class:yfiles.lang.Class; + } + /** + * Interface for classes that provide custom id's for core GraphML elements + * @interface + */ + export interface IGraphElementIdProvider extends Object{ + /** + * Get an ID for the specified edge object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @param {yfiles.graph.IEdge} edge The current graph object + * @returns {string} an ID for the specified edge object + * @abstract + */ + getEdgeId(context:yfiles.graphml.IWriteContext,edge:yfiles.graph.IEdge):string; + /** + * Get an ID for the specified graph object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @param {yfiles.graph.IGraph} graph The current graph object + * @returns {string} an ID for the specified graph object + * @abstract + */ + getGraphId(context:yfiles.graphml.IWriteContext,graph:yfiles.graph.IGraph):string; + /** + * Get an ID for the specified node object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @param {yfiles.graph.INode} node The current graph object + * @returns {string} an ID for the specified graph object + * @abstract + */ + getNodeId(context:yfiles.graphml.IWriteContext,node:yfiles.graph.INode):string; + /** + * Get an ID for the specified port object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @param {yfiles.graph.IPort} port The current port object + * @returns {string} an ID for the specified port object + * @abstract + */ + getPortId(context:yfiles.graphml.IWriteContext,port:yfiles.graph.IPort):string; + } + var IGraphElementIdProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of the {@link yfiles.graphml.OutputHandlerBase.} class, that uses an {@link yfiles.collections.IMapper.} to retrieve the values to output for each item and a {@link yfiles.graphml.MapperOutputHandler.#serializer} callback for the + * serialization or delegates to the {@link yfiles.graphml.IWriteContext#serializeCore} callback. + * Type parameter TKey: The type of the keys. + * Type parameter TData: The type of the data. + * @class yfiles.graphml.MapperOutputHandler. + * @extends {yfiles.graphml.OutputHandlerBase.} + * @template TKey,TData + */ + export interface MapperOutputHandler extends yfiles.graphml.OutputHandlerBase{} + export class MapperOutputHandler { + /** + * Initializes a new instance of the {@link yfiles.graphml.MapperOutputHandler.} class using the provided key scope, the name, and the key type. + * @param {yfiles.lang.Class} keyType The type of the keys. + * @param {yfiles.lang.Class} dataType The type of the data. + * @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. + * @constructor + */ + constructor(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType); + /** + * Gets or sets the mapper metadata to serialize to the key definition. + * @type {yfiles.graph.MapperMetadata} + */ + mapperMetadata:yfiles.graph.MapperMetadata; + /** + * Gets or sets the mapper to use for querying the data for each item. + * @type {yfiles.collections.IMapper.} + */ + mapper:yfiles.collections.IMapper; + /** + * Gets or sets the serialization callback to use for serializing the value in {@link yfiles.graphml.MapperOutputHandler.#writeValueCore}. + * @see yfiles.graphml.MapperOutputHandler.#sourceType + * @type {function(Object, yfiles.graphml.HandleSerializationEventArgs): void} + */ + serializer:(sender:Object,evt:yfiles.graphml.HandleSerializationEventArgs)=>void; + /** + * Gets or sets the source type of the serialization. + *

+ * This type will be used as the {@link yfiles.graphml.HandleSerializationEventArgs#sourceType}. + *

+ * @see yfiles.graphml.MapperOutputHandler.#serializer + * @see yfiles.graphml.HandleSerializationEventArgs + * @type {yfiles.lang.Class} + */ + sourceType:yfiles.lang.Class; + static $class:yfiles.lang.Class; + } + /** + * Convenience abstract base implementation of the {@link yfiles.graphml.IOutputHandler} interface. + * Type parameter TKey: The type of the keys. + * Type parameter TData: The type of the data. + * @class yfiles.graphml.OutputHandlerBase. + * @implements {yfiles.graphml.IOutputHandler} + * @template TKey,TData + */ + export interface OutputHandlerBase extends Object,yfiles.graphml.IOutputHandler{} + export class OutputHandlerBase { + /** + * Initializes a new instance of the {@link yfiles.graphml.OutputHandlerBase.} class using the provided scope, name, and type for the key definition. + * @param {yfiles.lang.Class} keyType1 The type of the keys. + * @param {yfiles.lang.Class} dataType1 The type of the data. + * @param {yfiles.graphml.KeyScope} scope The 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 yfiles.graphml.OutputHandlerBase.#setKeyDefinitionUri + * @protected + * @constructor + */ + constructor(keyType1:yfiles.lang.Class,dataType1:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType); + /** + * Callback method that obtains the data for the given key. + * @param {yfiles.graphml.IWriteContext} context The context. + * @param {TKey} key The key. + * @returns {TData} The data that is associated with the key. + * @protected + * @abstract + */ + getValue(context:yfiles.graphml.IWriteContext,key:TKey):TData; + /** + * 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.OutputHandlerBase.#defaultExists default has been set}. Otherwise it will use {@link yfiles.graphml.OutputHandlerBase.#getValue} and compare the result + * with the {@link yfiles.graphml.OutputHandlerBase.#defaultValue} to determine whether they are equal and therefore no data needs to be written. + *

+ * @param {yfiles.graphml.IWriteContext} context The context. + * @returns {boolean} true if for the current context the default value applies and therefore no data element needs to be written. + */ + isDefaultValue(context:yfiles.graphml.IWriteContext):boolean; + /** + * Sets the name for the key definition. + * @param {string} name The name of the key element. + */ + setKeyDefinitionName(name:string):void; + /** + * Sets the scope for 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. + */ + setKeyDefinitionScope(scope:yfiles.graphml.KeyScope):void; + /** + * Sets the key type for the key definition. + * @param {yfiles.graphml.KeyType} type The type of the key element. + */ + setKeyDefinitionType(type:yfiles.graphml.KeyType):void; + /** + * Sets an optional URI for the key definition. + *

+ * By default, no URI is set. + *

+ * @param {string} uri The URI of the key element. + */ + setKeyDefinitionUri(uri:string):void; + /** + * Writes the contents of the key definition. + *

+ * Depending on whether {@link yfiles.graphml.OutputHandlerBase.#writeKeyDefault} is enabled and {@link yfiles.graphml.OutputHandlerBase.#defaultExists} is true, this method will write the GraphML 'default' element and use {@link yfiles.graphml.OutputHandlerBase.#writeValueCore} + * to serialize the {@link yfiles.graphml.OutputHandlerBase.#defaultValue}. + *

+ * @param {yfiles.graphml.IWriteContext} context The context. + */ + writeKeyDefinitionContent(context:yfiles.graphml.IWriteContext):void; + /** + * Actually writes the value for the current context. + *

+ * This method will use {@link yfiles.graphml.OutputHandlerBase.#getValue} to obtain the data and delegate to {@link yfiles.graphml.OutputHandlerBase.#writeValueCore} to perform the actual serialization. + *

+ * @param {yfiles.graphml.IWriteContext} context The context. + */ + writeValue(context:yfiles.graphml.IWriteContext):void; + /** + * Callback method that performs the actual writing of the data. + * @param {yfiles.graphml.IWriteContext} context The context. + * @param {TData} data The data. + * @protected + * @abstract + */ 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; + * Gets or sets the default value. + *

+ * Setting this value also sets the {@link yfiles.graphml.OutputHandlerBase.#defaultExists} property. + *

+ * @type {TData} + */ + defaultValue:TData; + /** + * Gets or sets a value indicating whether a default value has been assigned. + * @type {boolean} + */ + defaultExists:boolean; + /** + * Gets or sets the write precedence for the handler. + * @type {yfiles.graphml.WritePrecedence} + */ + precedence:yfiles.graphml.WritePrecedence; + /** + * + * @type {yfiles.collections.IEnumerable.} + */ + keyDefinitionAttributes:yfiles.collections.IEnumerable; + /** + * + * @type {yfiles.collections.IEnumerable.} + */ + dataTagAttributes:yfiles.collections.IEnumerable; + /** + * Gets or sets a value indicating whether to write the key default. + * @default true + * @type {boolean} + */ + writeKeyDefault:boolean; + static $class:yfiles.lang.Class; } - 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{ + * Event argument implementation that is used by the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} + * event. + *

+ * These event arguments can be used to add more {@link yfiles.graphml.IOutputHandler} implementations to the {@link yfiles.graphml.GraphMLWriter} + * dynamically at the time of writing, by adding them to the {@link yfiles.graphml.QueryOutputHandlersEventArgs#handlers} collection. + *

+ * @see yfiles.graphml.GraphMLIOHandler + * @class yfiles.graphml.QueryOutputHandlersEventArgs + * @extends {yfiles.lang.EventArgs} + * @final + */ + export interface QueryOutputHandlersEventArgs extends yfiles.lang.EventArgs{} + export class QueryOutputHandlersEventArgs { /** - * 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; + * 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.graphml.KeyScope} scope The scope where the handlers should be added. + * @constructor + */ + constructor(context:yfiles.graphml.IWriteContext,scope:yfiles.graphml.KeyScope); /** - * The currently set weight heuristic. - * By default {@link yfiles.hierarchic.WeightHeuristic#BARYCENTER} is set. - */ - weightHeuristic:yfiles.hierarchic.WeightHeuristic; + * 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. + */ + addOutputHandler(handler:yfiles.graphml.IOutputHandler):void; /** - * 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 scope where the handlers should be added. + * @type {yfiles.graphml.KeyScope} + */ + scope:yfiles.graphml.KeyScope; /** - * The proposed maximal duration for the calculation of the sequence. - */ - maximalDuration:number; + * The {@link yfiles.graphml.IOutputHandler}s that have been registered on this event argument instance so far. + * @type {yfiles.collections.IEnumerable.} + */ + handlers:yfiles.collections.IEnumerable; /** - * 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; + * Gets the context for which the handlers are queried. + * @type {yfiles.graphml.IWriteContext} + */ + context:yfiles.graphml.IWriteContext; + static $class:yfiles.lang.Class; } - 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{ + * Default implementation of {@link yfiles.graphml.IXmlWriter}. + *

+ * This writer does not support random access on the output document. + *

+ * @class yfiles.graphml.XmlWriter + * @implements {yfiles.graphml.IXmlWriter} + */ + export interface XmlWriter extends Object,yfiles.graphml.IXmlWriter{} + export class XmlWriter { /** - * 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; + * Create a new instance that writes on a {@link Root.NB} + * @constructor + */ + constructor(); /** - * 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; + * + * @param {boolean} addEndTag + * @protected + */ + closeCurrentElement(addEndTag:boolean):void; /** - * 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; + * Factory method that creates the namespace manager for this instance. + * @returns {yfiles.graphml.IXmlNamespaceManager} A new manager instance. + * @protected + */ + createNamespaceManager():yfiles.graphml.IXmlNamespaceManager; /** - * 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; + * + */ + flushDocument():void; /** - * 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; + * + * @returns {string} + */ + getXmlString():string; /** - * 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; + * + * @param {string} prefix + * @param {string} localName + * @param {string} ns + * @param {string} value + * @returns {yfiles.graphml.IXmlWriter} + */ + writeAttributeNS(prefix:string,localName:string,ns:string,value:string):yfiles.graphml.IXmlWriter; /** - * Specifies whether or not ComponentLayouter is enabled. - * By default it is disabled. - * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouterEnabled} - */ - componentLayouterEnabled:boolean; + * + * @param {string} content + * @returns {yfiles.graphml.IXmlWriter} + */ + writeCData(content:string):yfiles.graphml.IXmlWriter; /** - * Whether or not backloop routing should be applied. - * Note that port constraints and port candidates are still considered. - */ - backloopRouting:boolean; + * + * @param {string} comment + * @returns {yfiles.graphml.IXmlWriter} + */ + writeComment(comment:string):yfiles.graphml.IXmlWriter; /** - * 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; + * + * @param {Document} fragment + * @returns {yfiles.graphml.IXmlWriter} + */ + writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; /** - * 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; + * + */ + writeEndDocument():void; /** - * 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; + * + * @returns {yfiles.graphml.IXmlWriter} + */ + writeEndElement():yfiles.graphml.IXmlWriter; /** - * 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; + * + * @param {string} target + * @param {string} data + * @returns {yfiles.graphml.IXmlWriter} + */ + writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; /** - * 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; + * + * @returns {yfiles.graphml.IXmlWriter} + */ + writeStartDocument():yfiles.graphml.IXmlWriter; /** - * The minimum distance between two adjacent layers. - * The default is 20.0d. - */ - minimumLayerDistance:number; + * + * @param {string} prefix + * @param {string} localName + * @param {string} ns + * @returns {yfiles.graphml.IXmlWriter} + */ + writeStartElement(prefix:string,localName:string,ns:string):yfiles.graphml.IXmlWriter; /** - * 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; + * + * @param {string} localName + * @param {string} ns + * @returns {yfiles.graphml.IXmlWriter} + */ + writeStartElement(localName:string,ns:string):yfiles.graphml.IXmlWriter; /** - * 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; + * + * @param {string} s + * @returns {yfiles.graphml.IXmlWriter} + */ + writeString(s:string):yfiles.graphml.IXmlWriter; /** - * The minimum distance between two adjacent edges in one layer. - * See {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#minimumDistance} for related settings. - */ - edgeToEdgeDistance:number; + * This property controls whether the output should be properly indented. + * @type {boolean} + */ + indent:boolean; /** - * 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; + * Gets the namespace manager associated with this writer. + * @type {yfiles.graphml.IXmlNamespaceManager} + */ + namespaceManager:yfiles.graphml.IXmlNamespaceManager; + static $class:yfiles.lang.Class; } - 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{ + * Interface that allows a mark and identify shared resources. + * @see yfiles.graphml.IReferenceHandler + * @interface + */ + export interface IReferenceHandle extends Object{ /** - * The minimal distance between two nodes in the same layer. - */ - minimalNodeDistanceF:number; + * The type of a resource (external or internal) + * @abstract + * @type {yfiles.graphml.GraphMLReferenceType} + */ + referenceType:yfiles.graphml.GraphMLReferenceType; /** - * The minimal distance between two layers. - */ - minimalLayerDistanceF:number; + * The resource that is encapsulated by the handle. + * @abstract + * @type {Object} + */ + subject:Object; /** - * 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; + * The id that identifies the resource in the GraphML document. + *

+ * Note that this value is ignored for internal references. + *

+ * @abstract + * @type {string} + */ + id:string; } - var AbstractDrawer:{ + var IReferenceHandle:{ $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; + export enum SharingState{ + /** + * The registered object shall not be shared. + */ + UNSHARED, + /** + * The object has been registered the first time. + */ + FIRST_SEEN, + /** + * The object has been registered multiple times and will be shared. + */ + DUPLICATE + } /** - * 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{ + * 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. + *

+ * @interface + */ + export interface IReferenceHandler extends Object{ /** - * Modifies the given drawing by modifying the y-coordinates only. - */ - alignNodes(graph:yfiles.layout.LayoutGraph,lists:yfiles.algorithms.NodeList[]):void; + * Gets the reference handle for a given subject. + * @param {Object} subject The subject. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @returns {yfiles.graphml.IReferenceHandle} A handle for the resource subject, or null if the resource is not registered. + * @see yfiles.graphml.IReferenceHandle + * @see yfiles.graphml.IReferenceHandle#subject + * @abstract + */ + getHandle(context:yfiles.graphml.IWriteContext,subject:Object):yfiles.graphml.IReferenceHandle; /** - * 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; + * 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 yfiles.graphml.IReferenceHandler#registerResource + * @see yfiles.graphml.GraphMLAttribute#shareable + * @abstract + */ + markAsUnshared(context:yfiles.graphml.IWriteContext,subject:Object):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; + * Register a shared resource. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} subject The resource to register. + * @returns {yfiles.graphml.SharingState} 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. + * @abstract + */ + registerResource(context:yfiles.graphml.IWriteContext,subject:Object):yfiles.graphml.SharingState; /** - * 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; + * Return a collection of all registered reference handles that should be written to the GraphML shared data section. + * @see yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener + * @see yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener + * @abstract + * @type {yfiles.collections.IEnumerable.} + */ + internalHandles:yfiles.collections.IEnumerable; } - 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:{ + var IReferenceHandler:{ $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; - }; + isInstance(o:Object):boolean; }; - /** - * 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{ + export enum GraphMLReferenceType{ /** - * 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; + * Specifies an internal resource, that is the serialized form of the resource is stored in the GraphML document itself. + */ + INTERNAL, /** - * 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; + * Specifies an external resource, that is the resource description is not stored in the GraphML document itself. + */ + EXTERNAL } - 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{ + * Event arguments for calls to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} + * and {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} events. + * @see yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener + * @see yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener + * @class yfiles.graphml.ResolveReferenceEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface ResolveReferenceEventArgs extends yfiles.lang.EventArgs{} + export class ResolveReferenceEventArgs { /** - * the delegate. - */ - drawerDelegate:yfiles.hierarchic.IDrawer; + * 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. + * @constructor + */ + constructor(context:yfiles.graphml.IParseContext,referenceId:string); /** - * the dummyMap. - */ - dummy:yfiles.algorithms.INodeMap; + * The reference id that should evaluated by the event handler. + * @type {string} + */ + referenceId:string; /** - * 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; + * The reference value that is encapsulated by this instance. + *

+ * Setting this property automatically sets {@link yfiles.graphml.ResolveReferenceEventArgs#handled} to true. + *

+ * @see yfiles.graphml.ResolveReferenceEventArgs#handled + * @type {Object} + */ + value:Object; /** - * 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; + * Returns whether the last event handler invocation has actually handled the event. + *

+ * This property is set implicitly by {@link yfiles.graphml.ResolveReferenceEventArgs#value}. + *

+ * @see yfiles.graphml.ResolveReferenceEventArgs#value + * @type {boolean} + */ + handled:boolean; /** - * 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; + * The current parse context that can be used by the event handler for additional information. + * @type {yfiles.graphml.IParseContext} + */ + context:yfiles.graphml.IParseContext; + static $class:yfiles.lang.Class; } - 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{ + * 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 yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener + * @see yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener + * @class yfiles.graphml.QueryReferenceIdEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface QueryReferenceIdEventArgs extends yfiles.lang.EventArgs{} + export class QueryReferenceIdEventArgs { /** - * Performs coordinate assignment. - * @see Overrides {@link yfiles.hierarchic.AbstractDrawer#assignCoordinatesToNodes} - */ - assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],_layerID:yfiles.algorithms.IDataProvider):void; + * 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. + * @constructor + */ + constructor(context:yfiles.graphml.IWriteContext,value:Object); /** - * Initializes data structures for all runs. - */ - init(g:yfiles.algorithms.Graph,layerLists:yfiles.algorithms.NodeList[]):void; + * The reference id that should be evaluated by the event handler. + *

+ * Setting this property to a non-null string automatically sets {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} to true. + *

+ * @see yfiles.graphml.QueryReferenceIdEventArgs#handled + * @type {string} + */ + referenceId:string; /** - * 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; + * 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 yfiles.graphml.QueryReferenceIdEventArgs#referenceId + * @see yfiles.graphml.QueryReferenceIdEventArgs#handled + * @default 1 + * @type {yfiles.graphml.GraphMLReferenceType} + */ + referenceType:yfiles.graphml.GraphMLReferenceType; /** - * 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; + * The reference value that is encapsulated by this instance. + * @type {Object} + */ + value:Object; /** - * 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; + * Returns whether the last event handler invocation has actually handled the event. + *

+ * This property is set implicitly by {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId}. + *

+ * @see yfiles.graphml.QueryReferenceIdEventArgs#referenceId + * @type {boolean} + */ + handled:boolean; /** - * 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; + * The current write context that can be used by the event handler for additional information. + * @type {yfiles.graphml.IWriteContext} + */ + context:yfiles.graphml.IWriteContext; + static $class:yfiles.lang.Class; } - 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{ + * Special implementation of {@link yfiles.graphml.IValueSerializerContext} that should be used in a GraphML parse context. + * @class yfiles.graphml.GraphMLParseValueSerializerContext + * @implements {yfiles.graphml.IValueSerializerContext} + */ + export interface GraphMLParseValueSerializerContext extends Object,yfiles.graphml.IValueSerializerContext{} + export class GraphMLParseValueSerializerContext { /** - * Overwrite this method to assign the final coordinates to the - * objects of he graph. - */ - assignCoordinatesToNodes(layers:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + * Creates a new instance that wraps context + * @param {yfiles.graphml.IParseContext} context The current write context + * @constructor + */ + constructor(context:yfiles.graphml.IParseContext); + /** + * + * @param {yfiles.graphml.Property} property + * @returns {yfiles.graphml.ValueSerializer} + */ + getValueSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; + /** + * + * @param {yfiles.lang.Class} type + * @returns {yfiles.graphml.ValueSerializer} + */ + getValueSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; + /** + * Returns the wrapped {@link yfiles.graphml.IParseContext} for this serviceType, otherwise null + * @param {yfiles.lang.Class} serviceType The serviceType + * @returns {Object} the wrapped {@link yfiles.graphml.IParseContext} for this serviceType, otherwise null + */ + lookup(serviceType:yfiles.lang.Class):Object; + /** + * The parent object if such an object exists currently. + * @type {Object} + */ + owner:Object; + static $class:yfiles.lang.Class; } - 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; + * Special implementation of {@link yfiles.graphml.IValueSerializerContext} that should be used in a GraphML write context. + * @class yfiles.graphml.GraphMLWriteValueSerializerContext + * @implements {yfiles.graphml.IValueSerializerContext} + */ + export interface GraphMLWriteValueSerializerContext extends Object,yfiles.graphml.IValueSerializerContext{} + export class GraphMLWriteValueSerializerContext { /** - * 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; + * Creates a new instance that wraps context + * @param {yfiles.graphml.IWriteContext} context The current write context + * @constructor + */ + constructor(context:yfiles.graphml.IWriteContext); /** - * 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; + * + * @param {yfiles.graphml.Property} property + * @returns {yfiles.graphml.ValueSerializer} + */ + getValueSerializerFor(property:yfiles.graphml.Property):yfiles.graphml.ValueSerializer; + /** + * + * @param {yfiles.lang.Class} type + * @returns {yfiles.graphml.ValueSerializer} + */ + getValueSerializerFor(type:yfiles.lang.Class):yfiles.graphml.ValueSerializer; + /** + * Returns the wrapped {@link yfiles.graphml.IWriteContext} for this serviceType, otherwise null + * @param {yfiles.lang.Class} serviceType The serviceType + * @returns {Object} the wrapped {@link yfiles.graphml.IWriteContext} for this serviceType, otherwise null + */ + lookup(serviceType:yfiles.lang.Class):Object; + /** + * The parent object if such an object exists currently. + * @type {Object} + */ + owner:Object; + static $class:yfiles.lang.Class; } - 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{ + * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addQueryNameListener QueryName} to + * override automatic name determination in GraphML. + *

+ * If the event handler determines that it map resolve {@link yfiles.graphml.QueryNameEventArgs#type} to a xml name, it should place the result into the {@link yfiles.graphml.QueryNameEventArgs#result} property and + * thus mark the event as {@link yfiles.graphml.QueryNameEventArgs#handled}. + *

+ *

+ * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name + * determination rules are used for that part. + *

+ * @class yfiles.graphml.QueryNameEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface QueryNameEventArgs extends yfiles.lang.EventArgs{} + export class QueryNameEventArgs { /** - * map that maps the right node for each node in a layer or null if it is the rightmost. - */ - right:yfiles.algorithms.INodeMap; + * Initializes a new instance of the {@link yfiles.graphml.QueryNameEventArgs} class. + * @param {yfiles.graphml.IWriteContext} context The context in which the lookup shall take place. + * @param {yfiles.lang.Class} type The type that should be mapped. + * @constructor + */ + constructor(context:yfiles.graphml.IWriteContext,type:yfiles.lang.Class); /** - * map that maps the left node for each node in a layer or null if it is the leftmost. - */ - left:yfiles.algorithms.INodeMap; + * Holds the result of the name query, which is null initially. + *

+ * Setting this property will automatically set the {@link yfiles.graphml.QueryNameEventArgs#handled} property to true. + *

+ *

+ * It is valid to provide only part of the XML name by setting the other part to null. In that case, the default name + * determination rules are used for that part. + *

+ * @throws {Stubs.Exceptions.ArgumentError} If the value is not assignable to TargetType + * @type {yfiles.graphml.XmlName} + */ + result:yfiles.graphml.XmlName; /** - * 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; + * Gets or sets a value indicating whether this {@link yfiles.graphml.QueryNameEventArgs} is handled. + *

+ * Setting this property to true indicates to the event source that the {@link yfiles.graphml.QueryNameEventArgs#result} has been assigned and that the event should not be + * propagated to further listeners. + *

+ * @type {boolean} + */ + handled:boolean; /** - * 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; + * The fully qualified xml name that should be resolved to a type. + * @type {yfiles.lang.Class} + */ + type:yfiles.lang.Class; /** - * 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; + * Gets the context in which the {@link yfiles.graphml.QueryNameEventArgs#type} shall mapped. + * @type {yfiles.graphml.IWriteContext} + */ + context:yfiles.graphml.IWriteContext; + static $class:yfiles.lang.Class; } - 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{ + * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addQueryTypeListener QueryType} to + * override automatic type resolution in GraphML. + *

+ * If the event handler determines that it can resolve {@link yfiles.graphml.QueryTypeEventArgs#xmlName} to a type, it should place the result into the {@link yfiles.graphml.QueryTypeEventArgs#result} property and thus + * mark the event as {@link yfiles.graphml.QueryTypeEventArgs#handled}. + *

+ * @class yfiles.graphml.QueryTypeEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface QueryTypeEventArgs extends yfiles.lang.EventArgs{} + export class QueryTypeEventArgs { /** - * Overwrite this method to assign the final coordinates to the - * objects of he graph. - */ - assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + * Initializes a new instance of the {@link yfiles.graphml.QueryTypeEventArgs} class. + * @param {yfiles.graphml.IParseContext} context The context in the lookup should take place. + * @param {yfiles.graphml.XmlName} xName The type that should be mapped. + * @constructor + */ + constructor(context:yfiles.graphml.IParseContext,xName:yfiles.graphml.XmlName); + /** + * Holds the result of the type query, which is null initially. + *

+ * Setting this property will automatically set the {@link yfiles.graphml.QueryTypeEventArgs#handled} property to true. + *

+ * @type {yfiles.lang.Class} + */ + result:yfiles.lang.Class; + /** + * Gets or sets a value indicating whether this {@link yfiles.graphml.QueryTypeEventArgs} is handled. + *

+ * Setting this property to true indicates to the event source that the {@link yfiles.graphml.QueryTypeEventArgs#result} has been assigned and that the event should not be + * propagated to further listeners. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * The fully qualified xml name that should be resolved to a type. + * @type {yfiles.graphml.XmlName} + */ + xmlName:yfiles.graphml.XmlName; + /** + * Gets the context in which the {@link yfiles.lang.Class} shall mapped. + * @type {yfiles.graphml.IParseContext} + */ + context:yfiles.graphml.IParseContext; + static $class:yfiles.lang.Class; } - 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{ + * An implementation that can read (a subset of) XAML formatted XML content. + * @class yfiles.graphml.XamlReader + * @final + */ + export interface XamlReader extends Object{} + export class XamlReader { /** - * 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; + * Deserializes the specified element node in the context to an instance. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {Element} element The XML element node. + * @returns {Object} The instance that is described in the XML. + */ + deserialize(context:yfiles.graphml.IParseContext,element:Element):Object; /** - * 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; + * A singleton instance of this class. + * @const + * @static + * @type {yfiles.graphml.XamlReader} + */ + static INSTANCE:yfiles.graphml.XamlReader; + static $class:yfiles.lang.Class; } - 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{ + * Interface for mapping XAML namespaces to XML namespace prefixes and vice versa. + *

+ * This interface is only used to specify mappings between namespaces that are used for serialization or deserialization + * with classes {@link yfiles.graphml.XamlSerializer} and + * {@link yfiles.graphml.XamlReader}. If no prefix mapping is specified for a namespace, a default XML namespace/prefix mapping is + * used. + *

+ * @interface + */ + export interface IXamlPrefixMapper 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[]; + * Gets the namespace for the given prefix. + * @param {string} prefix The prefix. + * @returns {string} The namespace. + * @abstract + */ + getNamespaceOfPrefix(prefix:string):string; + /** + * Gets the prefix of namespace. + * @param {string} ns The namespace. + * @returns {string} The prefix to use. + * @abstract + */ + getPrefixOfNamespace(ns:string):string; } - var ILayerSequencer:{ + var IXamlPrefixMapper:{ $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{ + * Serializer 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 yfiles.graphml.GraphMLAttribute + * @class yfiles.graphml.XamlSerializer + * @final + */ + export interface XamlSerializer extends Object{} + export class XamlSerializer { /** - * 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; + * Serialize the given object to a {@link yfiles.graphml.IXmlWriter} + *

+ * This implementation already provides the toplevel XML element with an appropriate tag name. + *

+ * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {Object} subject The actual object + */ + serialize(context:yfiles.graphml.IWriteContext,subject:Object):void; + /** + * A singleton instance of this class. + * @const + * @static + * @type {yfiles.graphml.XamlSerializer} + */ + static INSTANCE:yfiles.graphml.XamlSerializer; + static $class:yfiles.lang.Class; } - var ILayerer:{ - $class:yfiles.lang.Class; - isInstance(o:Object):boolean; - }; + }export namespace collections{ /** - * 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. - */ + * The default implementation for {@link yfiles.collections.IMap.}. + * Type parameter TKey: The type of the key elements of this dictionary. + * Type parameter TValue: The type of the value elements of this dictionary. + * @class yfiles.collections.Map. + * @implements {yfiles.collections.IMap.} + * @implements {yfiles.collections.ICollection.>} + * @implements {yfiles.collections.IEnumerable.>} + * @template TKey,TValue + */ + export interface Map extends Object,yfiles.collections.IMap,yfiles.collections.ICollection>,yfiles.collections.IEnumerable>{} + export class Map { + /** + * Creates a new instance. + * @param {Object} [options=null] The parameters to pass. + * @param options.entries An array of items which are added to this map. Each item will be added via the {@link yfiles.collections.Map.#add} method. + * @constructor + */ + constructor(options?:{entries?:Array}); + /** + * + * @param {yfiles.collections.MapEntry.} item + */ + add(item:yfiles.collections.MapEntry):void; + /** + * + */ 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; + * Whether this dictionary contains the given value. + * @param {TValue} value The value to search for. + * @returns {boolean} true if this dictionary contains the given value. + */ + containsValue(value:TValue):boolean; /** - * Raises the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event. - * @param {yfiles.input.InputModeEventArgs} args The event arguments. - */ - onTextEdited(args:yfiles.input.InputModeEventArgs):void; + * + * @param {Array.>} array + * @param {number} arrayIndex + */ + copyTo(array:yfiles.collections.MapEntry[],arrayIndex:number):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; + * + * @param {TKey} key + * @returns {boolean} + */ + delete(key:TKey):boolean; /** - * Gets or sets the location of the text box in world coordinates. - */ - location:yfiles.geometry.IPoint; + * + * @param {TKey} key + * @returns {TValue} + */ + get(key:TKey):TValue; /** - * 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; + * + * @returns {yfiles.collections.IEnumerator.>} + */ + getEnumerator():yfiles.collections.IEnumerator>; /** - * 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; + * + * @param {TKey} key + * @returns {boolean} + */ + has(key:TKey):boolean; /** - * 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; + * + * @param {yfiles.collections.MapEntry.} item + * @returns {boolean} + */ + includes(item:yfiles.collections.MapEntry):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; + * + * @param {yfiles.collections.MapEntry.} item + * @returns {boolean} + */ + remove(item:yfiles.collections.MapEntry):boolean; /** - * Installs the text box in the canvas and puts focus into it. - */ - installTextBox():void; + * + * @param {TKey} key + * @param {TValue} value + */ + set(key:TKey,value:TValue):void; /** - * Adjusts the position of the text box in the canvas control. - */ - adjustPosition():void; + * + * @type {number} + */ + size:number; /** - * 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; + * + * @type {boolean} + */ + isReadOnly: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; + * + * @type {yfiles.collections.ICollection.} + */ + keys:yfiles.collections.ICollection; /** - * 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; + * + * @type {yfiles.collections.ICollection.} + */ + values:yfiles.collections.ICollection; + static $class:yfiles.lang.Class; } - var TextEditorInputMode:{ + /** + * Defines methods to manipulate a collection of objects with the same type. + * Type parameter T: The type of the elements in the collection. + * @interface + * @implements {yfiles.collections.IEnumerable.} + * @template T + */ + export interface ICollection extends Object,yfiles.collections.IEnumerable{ + /** + * Adds the given item to the collection. + * @param {T} item + * @abstract + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @abstract + */ + clear():void; + /** + * Copies all elements of this collection into the given array. + * @param {Array.} 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. + * @abstract + */ + copyTo(array:T[],arrayIndex:number):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @returns {boolean} true if the given item is contained in this collection. + * @abstract + */ + includes(item:T):boolean; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @returns {boolean} Whether the item was removed from the collection. + * @abstract + */ + remove(item:T):boolean; + /** + * The number of elements in this collection. + * @abstract + * @type {number} + */ + size:number; + /** + * Whether this collection is read-only. + * @abstract + * @type {boolean} + */ + isReadOnly:boolean; + } + var ICollection:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * 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{ + * 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. + *

+ * Type parameter TKey: The type of the keys. + * Type parameter TValue: The type of the values. + * @interface + * @implements {yfiles.collections.ICollection.>} + * @template TKey,TValue + */ + export interface IMap extends Object,yfiles.collections.ICollection>{ /** - * The last {@link yfiles.input.Mouse2DEventArgs} that have been delivered to this instance. - */ - lastMouse2DEventArgs1:yfiles.input.Mouse2DEventArgs; + * Removes the key/value pair which is represented by the given key. + * @param {TKey} key The key of the key/value pair to remove. + * @returns {boolean} true if a key/value pair with the given key was removed from this collection. + * @abstract + */ + delete(key:TKey):boolean; /** - * The last event arguments that have been delivered to this instance. - */ - lastEventArgs:yfiles.system.EventArgs; + * Gets 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 null will be returned. + *

+ * @param {TKey} key + * @returns {TValue} + * @see yfiles.collections.IMap.#set + * @abstract + */ + get(key:TKey):TValue; /** - * 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; + * Whether this dictionary's key collection contains the given key. + * @param {TKey} key The key to search for. + * @returns {boolean} true if this dictionary contains the given key. + * @abstract + */ + has(key:TKey):boolean; /** - * 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; + * 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 null will be returned. + *

+ * @param {TKey} key + * @param value + * @see yfiles.collections.IMap.#get + * @abstract + */ + set(key:TKey,value:TValue):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; + * A {@link yfiles.collections.ICollection.} of the keys of this dictionary. + * @abstract + * @type {yfiles.collections.ICollection.} + */ + keys:yfiles.collections.ICollection; /** - * 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; + * A {@link yfiles.collections.ICollection.} of the values of this dictionary. + * @abstract + * @type {yfiles.collections.ICollection.} + */ + values:yfiles.collections.ICollection; } - var StateMachineInputMode:{ + var IMap:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * A simple implementation of {@link yfiles.input.IEventRecognizer} - * that recognizes various {@link yfiles.input.CompoundKeyEventArgs}. - */ - export interface KeyEventRecognizer extends Object,yfiles.input.IEventRecognizer{ + * Defines ways to iterate over the items contained in this type by providing a method to get an {@link yfiles.collections.IEnumerator.}. + * Type parameter T: The type of the enumerable objects. + * @interface + * @template T + */ + export interface IEnumerable 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; - hashCode():number; - equals(obj:Object):boolean; + * + * @param {yfiles.collections.IEnumerable.} enumerable + * @returns {yfiles.collections.IEnumerable.} + */ + concat?(enumerable:yfiles.collections.IEnumerable):yfiles.collections.IEnumerable; + /** + * Returns the element at the given index in the enumerable. + * @param {number} index The index of the element to return. + * @returns {T} The element at the given index. + * @throws {Stubs.Exceptions.ArgumentError} If the index is not within the enumerable's range. + */ + elementAt?(index:number):T; + /** + * Whether all elements of the enumerable match the given predicate. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} predicate A function with the signature function(element):boolean which returns true if the element matches a condition. + * @param {Object} [thisArg=null] + * @returns {boolean} Whether all elements of the enumerable match the given predicate. + * @throws {Stubs.Exceptions.ArgumentError} e is null. + * @throws {Stubs.Exceptions.ArgumentError} predicate is null. + */ + every?(predicate:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object):boolean; + /** + * Returns an enumerable which only contains elements of the source enumerable which match a given predicate. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} predicate A function with the signature function(element):boolean which returns true if the given element should be included in + * the resulting enumerable. + * @param {Object} [thisArg=null] + * @returns {yfiles.collections.IEnumerable.} An enumerable which contains the elements of the source enumeration which match the given predicate. + */ + filter?(predicate:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object):yfiles.collections.IEnumerable; + /** + * Returns the first element of the enumerable which matches a given filter. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} [predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned + * @param {Object} [thisArg=null] + * @returns {T} The first matching element of the enumerable. + * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. + * @throws {Stubs.Exceptions.InvalidOperationError} If the enumerable does not contain a matching element. + */ + first?(predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object):T; + /** + * Returns the first element of the enumerable which matches a given filter. + * @param {Object} options The parameters to pass. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} [options.predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned + * @param {Object} [options.thisArg=null] + * @returns {T} The first matching element of the enumerable. + * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. + * @throws {Stubs.Exceptions.InvalidOperationError} If the enumerable does not contain a matching element. + */ + first?(options:{predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object}):T; + /** + * Returns the first element of the enumerable, the first element of the enumerable which matches a given filter if + * sepcified, or null if there is no such element. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} [predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned + * @param {Object} [thisArg=null] + * @returns {T} The first element of the enumerable or null. + * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. + */ + firstOrDefault?(predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object):T; + /** + * Returns the first element of the enumerable, the first element of the enumerable which matches a given filter if + * sepcified, or null if there is no such element. + * @param {Object} options The parameters to pass. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} [options.predicate=null] A function with the signature function(element):boolean which returns true if the given element should be returned + * @param {Object} [options.thisArg=null] + * @returns {T} The first element of the enumerable or null. + * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. + */ + firstOrDefault?(options:{predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object}):T; + /** + * Iterates over the enumerable and invokes the action for each element passing the value and index as arguments. + * @param {function(T, number, yfiles.collections.IEnumerable.): void} action The delegate to call. + * @param {Object} [thisArg=null] + */ + forEach?(action:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>void,thisArg?:Object):void; + /** + * Gets an {@link yfiles.collections.IEnumerator.} which can be used to iterate over the items in this instance + * @returns {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator.} which can be used to iterate over the items in this instance + * @abstract + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Whether the given value is contained in the enumerable. + *

+ * The {@link Root.U.#$p default equality comparer} is used to compare the enumerable's contents with the given value. + *

+ * @param {T} value The value to search for. + * @returns {boolean} true if the enumerable contains the given value. + */ + includes?(value:T):boolean; + /** + * Returns the last element of the enumerable. + * @returns {T} The last element of the enumerable. + * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. + * @throws {Stubs.Exceptions.InvalidOperationError} If the enumerable is empty. + */ + last?():T; + /** + * Returns the last element of the enumerable or null if the enumerable is empty. + * @returns {T} The last element of the enumerable or null. + * @throws {Stubs.Exceptions.ArgumentError} If the given enumerable is null. + */ + lastOrDefault?():T; + /** + * Maps each element of the enumerable into a new element in a new enumerable. + * Type parameter TResult: The type of the mapped elements. + * @param {function(T, number, yfiles.collections.IEnumerable.): 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. + * @param {Object} [thisArg=null] The optional value to use as this when executing the selector. + * @returns {yfiles.collections.IEnumerable.} A projection of the original enumerable. + * @template TResult + */ + map?(selector:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>TResult,thisArg?:Object):yfiles.collections.IEnumerable; + /** + * 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. + *

+ * Type parameter TResult. + * @returns {yfiles.collections.IEnumerable.} A typed enumerable. + * @template TResult + */ + ofType?(resultType:yfiles.lang.Class):yfiles.collections.IEnumerable; + /** + * Applies an func function over the enumerable's elements. + * Type parameter TAccumulate: The type of the accumulated value. + * @param {TAccumulate} seed The start value for the accumulator. + * @param {function(TAccumulate, T, number, yfiles.collections.IEnumerable.): 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. + * @returns {TAccumulate} The final value of the accumulator. + * @template TAccumulate + */ + reduce?(seed:TAccumulate,func:(arg1:TAccumulate,arg2:T,arg3:number,arg4:yfiles.collections.IEnumerable)=>TAccumulate):TAccumulate; + /** + * Creates a flattened view of a given enumerable using the given selector function which returns an enumerable for each + * element of the source enumerable. + * Type parameter TResult. + * @param {function(T, number, yfiles.collections.IEnumerable.): yfiles.collections.IEnumerable.} selector A function with the signature function(element):IEnumerable which returns an enumerable for each element of the source + * enumerable. + * @param {Object} [thisArg=null] + * @returns {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. + * @template TResult + */ + selectMany?(selector:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>yfiles.collections.IEnumerable,thisArg?:Object):yfiles.collections.IEnumerable; + /** + * Whether the enumerable contains any elements matching the given predicate. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} [predicate=null] A function with the signature function(element):boolean which returns true if the element matches a condition. + * @param {Object} [thisArg=null] + * @returns {boolean} Whether the enumerable contains any elements matching the given predicate. + * @throws {Stubs.Exceptions.ArgumentError} e is null. + */ + some?(predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object):boolean; + /** + * Whether the enumerable contains any elements matching the given predicate. + * @param {Object} options The parameters to pass. + * @param {function(T, number, yfiles.collections.IEnumerable.): boolean} [options.predicate=null] A function with the signature function(element):boolean which returns true if the element matches a condition. + * @param {Object} [options.thisArg=null] + * @returns {boolean} Whether the enumerable contains any elements matching the given predicate. + * @throws {Stubs.Exceptions.ArgumentError} e is null. + */ + some?(options:{predicate?:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object}):boolean; + /** + * Calculates the sum of the elements of the enumerable. + * @param {function(T, number, yfiles.collections.IEnumerable.): number} selector A function with the signature function(element):Number which returns a numeric value for the given element. + * @param {Object} [thisArg=null] + * @returns {number} The sum of the elements of the enumerable. + */ + sum?(selector:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>number,thisArg?:Object):number; + /** + * Returns elements from an enumerable as long as the given predicate is true. + * @param {function(T, number, yfiles.collections.IEnumerable.): 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. + * @param {Object} [thisArg=null] + * @returns {yfiles.collections.IEnumerable.} A subset of the original enumerable. + */ + takeWhile?(predicate:(arg1:T,arg2:number,arg3:yfiles.collections.IEnumerable)=>boolean,thisArg?:Object):yfiles.collections.IEnumerable; + /** + * Creates an array with the values of the enumerable. + * @returns {Array.} An array with the enumerable's elements. + */ + toArray?():T[]; + /** + * Creates a {@link yfiles.collections.List.} with the values of the enumerable. + * @returns {yfiles.collections.List.} An {@link yfiles.collections.List.} with the enumerable's elements. + */ + toList?():yfiles.collections.List; + /** + * Returns an enumerable which contains the elements of the original enumerable in reverse order. + * @returns {yfiles.collections.IEnumerable.} An enumerable which contains the elements of the original enumerable in reverse order. + */ + toReversed?():yfiles.collections.IEnumerable; + /** + * Returns the number of elements contained in the enumerable. + * @returns The number of elements contained in the enumerable. + * @type {number} + */ + size?:number; } - var KeyEventRecognizer:{ + var IEnumerable:{ $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; - }; + isInstance(o:Object):boolean; }; - export enum CompoundKeyEventType{ + /** + * Provides methods to iterate over a collection or list of elements of the same type. + *
+     * var e = someList.getEnumerator();
+     * // always move before you access
+     * while(e.moveNext()) {
+     *   // get the current element
+     *   var current = e.current;
+     * }
+     * 
+ * + * @interface + */ + export interface IEnumerator extends Object{ /** - * Neither Pressed, nor Typed, nor Released. - */ + * 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}. + *

+ * @returns {boolean} true if the enumerator was moved to a valid position + * @abstract + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + *

+ * In other words: sets the current position before the first element. + *

+ * @abstract + */ + 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. + *

+ * @abstract + * @type {T} + */ + current:T; + } + var IEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A read-write collection of objects of the same type. + * Type parameter T: The type of objects in the list. + * @interface + * @implements {yfiles.collections.ICollection.} + * @template T + */ + export interface IList extends Object,yfiles.collections.ICollection{ + /** + * Gets the item at the given index. + * @param {number} index The index of the item to access. + * @returns {T} The item at the given index. + * @see yfiles.collections.IList.#set + * @abstract + */ + get(index:number):T; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @returns {number} The index of the given item in the list. -1 if the item is not in the list. + * @abstract + */ + 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. + * @abstract + */ + 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. + * @abstract + */ + removeAt(index:number):void; + /** + * Sets the item at the given index. + * @param {number} index The index of the item to access. + * @param value The item at the given index. + * @see yfiles.collections.IList.#get + * @abstract + */ + set(index:number,value:T):void; + } + var IList:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The key/value pair of a {@link yfiles.collections.IMap.}. + * Type parameter TKey: The type of the key element. + * Type parameter TValue: The type of the value element. + * @class yfiles.collections.MapEntry. + * @template TKey,TValue + * @final + */ + export interface MapEntry extends Object{} + export class MapEntry { + /** + * 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. + * @constructor + */ + constructor(key:TKey,value:TValue); + /** + * The key for this key/value pair. + * @type {TKey} + */ + key:TKey; + /** + * The value for this key/value pair. + * @type {TValue} + */ + value:TValue; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * Type parameter T: The type of the list's elements. + * @class yfiles.collections.List. + * @implements {yfiles.collections.IList.} + * @template T + */ + export interface List extends Object,yfiles.collections.IList{} + export class 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. + * @constructor + */ + constructor(enumerable:yfiles.collections.IEnumerable); + /** + * Creates a new instance. + * @param {Object} [options=null] The parameters to pass. + * @param options.items An array of items which are added to this list. Each item will be added via the {@link yfiles.collections.List.#add} method. + * @constructor + */ + constructor(options?:{items?:Array}); + /** + * + * @param {T} item + */ + add(item:T):void; + /** + * Adds the elements of the given collection to this list. + * @param {yfiles.collections.IEnumerable.} enumerable The collection to add. + */ + addRange(enumerable:yfiles.collections.IEnumerable):void; + /** + * 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. + * @returns {number} The index of the item in the list. -1 if the item is not found. + */ + binarySearch(item:T,comparer:yfiles.collections.IComparer):number; + /** + * + */ + clear():void; + /** + * + * @param {Array.} array + * @param {number} arrayIndex + */ + copyTo(array:T[],arrayIndex:number):void; + /** + * 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. + * @returns {T} The first element for which match returns true or null 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. + * @returns {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; + /** + * Creates a new list with the given array used as the live backing store. + *

+ * Modifying the list or the array will modify both instances. + *

+ * @param {Array.} array The array to create a list view over from. + * @returns {yfiles.collections.List.} A list backed by the given array. + * @static + */ + static fromArray(array:T[]):yfiles.collections.List; + /** + * + * @param {number} index + * @returns {T} + */ + get(index:number):T; + /** + * + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * + * @param {T} item + * @returns {boolean} + */ + includes(item:T):boolean; + /** + * + * @param {T} item + * @returns {number} + */ + indexOf(item:T):number; + /** + * + * @param {number} index + * @param {T} item + */ + insert(index:number,item:T):void; + /** + * + * @param {T} item + * @returns {boolean} + */ + remove(item:T):boolean; + /** + * 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. + * @returns {number} The number of elements which were removed. + */ + removeAll(match:(obj:T)=>boolean):number; + /** + * + * @param {number} index + */ + removeAt(index:number):void; + /** + * 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; + /** + * + * @param {number} index + * @param {T} value + */ + set(index:number,value:T):void; + /** + * Sorts all elements in the list using the given comparison function. + * @param {function(Object, Object): number} comparison The comparison function to use. + */ + sort(comparison:(arg1:Object,arg2:Object)=>number):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; + /** + * Sorts all elements in list using the default comparer. + */ + sort():void; + /** + * Copies the elements of this list into an array. + * @returns {Array.} An array containing the elements of this list. + */ + toArray():T[]; + /** + * + * @type {number} + */ + size:number; + /** + * + * @type {boolean} + */ + isReadOnly:boolean; + capacity:number; + static $class:yfiles.lang.Class; + } + /** + * Provides a method to compare two objects of the same type. + * Type parameter T: The type of the objects to compare. + * @interface + * @template T + */ + export interface IComparer extends Object{ + /** + * Compares two objects of type T. + * @param {T} x The first object. + * @param {T} y The second object. + * @returns {number} + *
    + *
  • -1: x is less than y
  • + *
  • 0: x is equal to y
  • + *
  • 1: x is greater than y
  • + *
+ * @abstract + */ + compare(x:T,y:T):number; + } + var IComparer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple default implementation of an {@link yfiles.collections.IObservableCollection.} that is backed by an ordinary {@link yfiles.collections.ICollection.} + * Type parameter T: The type of the elements contained in this collection. + * @class yfiles.collections.ObservableCollection. + * @implements {yfiles.collections.IObservableCollection.} + * @template T + */ + export interface ObservableCollection extends Object,yfiles.collections.IObservableCollection{} + export class ObservableCollection { + /** + * Creates a new instance using a provided collection as the backing store. + * @param {yfiles.collections.ICollection.} [items=null] The collection to use as the backing store. If no collection is provided a {@link yfiles.collections.List.} will be used. + * @constructor + */ + constructor(items?:yfiles.collections.ICollection); + /** + * Adds the item the the collection and triggers the {@link yfiles.collections.ObservableCollection.#addItemAddedListener ItemAdded} event. + *

+ * This implementation calls the {@link yfiles.collections.ObservableCollection.#onItemAdded} method. + *

+ * @param {T} item The item to add to the collection. + */ + add(item:T):void; + /** + * Clears this collection, triggering an {@link yfiles.collections.ObservableCollection.#addItemRemovedListener ItemRemoved} event for each element removed. + * @see yfiles.collections.ObservableCollection.#onItemRemoved + */ + clear():void; + /** + * Copies the items to the given array. + * @param {Array.} array + * @param {number} arrayIndex + */ + copyTo(array:T[],arrayIndex:number):void; + /** + * Returns an enumerator over the elements in this collection. + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Checks for containment of the item in this collection. + * @param {T} item The item to check. + * @returns {boolean} Whether the item is contained in this collection. + */ + includes(item:T):boolean; + /** + * Callback method that will trigger the {@link yfiles.collections.ObservableCollection.#addItemAddedListener ItemAdded} event. + * @param {T} item The item that has just been added to the collection. + * @protected + */ + onItemAdded(item:T):void; + /** + * Callback method that will trigger the {@link yfiles.collections.ObservableCollection.#addItemChangedListener ItemChanged} event. + * @param {T} item The item that has changed. + * @protected + */ + onItemChanged(item:T):void; + /** + * Callback method that will trigger the {@link yfiles.collections.ObservableCollection.#addItemRemovedListener ItemRemoved} event. + * @param {T} item The item that has just been removed from the collection. + * @protected + */ + onItemRemoved(item:T):void; + /** + * Method that may be called by client code to trigger an {@link yfiles.collections.ObservableCollection.#addItemChangedListener ItemChanged} event. + * @param {T} item The item to trigger the change event for. + * @see yfiles.collections.ObservableCollection.#onItemChanged + */ + publishItemChanged(item:T):void; + /** + * Tries to remove the item from the collection and triggers the {@link yfiles.collections.ObservableCollection.#addItemRemovedListener ItemRemoved} event. + * @param {T} item The item to remove. + * @returns {boolean} Whether the item has been removed. + * @see yfiles.collections.ObservableCollection.#onItemRemoved + */ + remove(item:T):boolean; + /** + * Returns the number of elements in this collection. + * @type {number} + */ + size:number; + /** + * Checks whether this collection is read only. + * @type {boolean} + */ + isReadOnly:boolean; + /** + * Gets 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. + *

+ * @returns The backing store of this observable collection. + * @type {yfiles.collections.ICollection.} + */ + items:yfiles.collections.ICollection; + /** + * Adds the given listener for the ItemAdded event that occurs when an item has been added to this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.collections.ObservableCollection.#removeItemAddedListener + */ + addItemAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemAdded event that occurs when an item has been added to this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.collections.ObservableCollection.#addItemAddedListener + */ + removeItemAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.collections.ObservableCollection.#removeItemRemovedListener + */ + addItemRemovedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.collections.ObservableCollection.#addItemRemovedListener + */ + removeItemRemovedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the ItemChanged event that occurs when an item has been changed inside this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.collections.ObservableCollection.#removeItemChangedListener + */ + addItemChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemChanged event that occurs when an item has been changed inside this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.collections.ObservableCollection.#addItemChangedListener + */ + removeItemChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.collections.IMapper.} implementation backed by a {@link yfiles.collections.IMap.}. + *

+ * A {@link yfiles.collections.Mapper.#defaultValue} can be set that is returned for keys that don't have an explicit value set. + *

+ *

+ * It is legal to use null as key, which can be assigned a value just like other keys. + *

+ * @class yfiles.collections.Mapper. + * @implements {yfiles.collections.IMapper.} + * @final + */ + export interface Mapper extends Object,yfiles.collections.IMapper{} + export class Mapper { + /** + * Creates an instance using the provided {@link yfiles.collections.Map.} as the backing store. + *

+ * The value for the null item is stored separately. + *

+ * @param {yfiles.collections.IMap.} dictionary + * @constructor + */ + constructor(dictionary:yfiles.collections.IMap); + /** + * Creates an instance using the provided {@link yfiles.collections.Map.} as the backing store. + *

+ * The value for the null item is stored separately. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.collections.IMap.} options.dictionary + * @param {V} options.defaultValue The default value to return if no specific value has been set for a given key. + *

+ * This option sets the {@link yfiles.collections.Mapper.#defaultValue} property on the created object. + *

+ * @constructor + */ + constructor(options:{dictionary:yfiles.collections.IMap,defaultValue?:V}); + /** + * Creates an instance using a {@link yfiles.collections.Map.} as the backing store. + *

+ * The value for the null item is stored separately. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {V} options.defaultValue The default value to return if no specific value has been set for a given key. + *

+ * This option sets the {@link yfiles.collections.Mapper.#defaultValue} property on the created object. + *

+ * @constructor + */ + constructor(options?:{defaultValue?:V}); + /** + * Calls {@link yfiles.collections.Map.#clear} on the backing implementation. + */ + clear():void; + /** + * + * @param {K} key + */ + delete(key:K):void; + /** + * + * @param {K} key + * @returns {V} + */ + get(key:K):V; + /** + * + * @param {K} key + * @param {V} value + */ + set(key:K,value:V):void; + /** + * Gets an enumerable over all entries in this (dictionary based) mapper. + * @type {yfiles.collections.IEnumerable.>} + */ + entries:yfiles.collections.IEnumerable>; + /** + * Gets or sets the default value to return if no specific value has been set for a given key. + * @type {V} + */ + defaultValue:V; + static $class:yfiles.lang.Class; + } + /** + * The interface for a collection that will notify registered event handlers of changes to its contents. + * Type parameter T: The type of the items in the collection. + * @see yfiles.collections.ObservableCollection. + * @interface + * @implements {yfiles.collections.ICollection.} + * @template T + */ + export interface IObservableCollection extends Object,yfiles.collections.ICollection{ + /** + * Adds the given listener for the ItemAdded event that occurs when an item has been added to this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.collections.IObservableCollection.#removeItemAddedListener + * @abstract + */ + addItemAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemAdded event that occurs when an item has been added to this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.collections.IObservableCollection.#addItemAddedListener + * @abstract + */ + removeItemAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.collections.IObservableCollection.#removeItemRemovedListener + * @abstract + */ + addItemRemovedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemRemoved event that occurs when an item has been removed from this collection. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.collections.IObservableCollection.#addItemRemovedListener + * @abstract + */ + removeItemRemovedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the ItemChanged event that occurs when an item in this collection has changed + * significantly. + *

+ * It is up to the implementation whether and when to trigger this event. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.collections.IObservableCollection.#removeItemChangedListener + * @abstract + */ + addItemChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemChanged event that occurs when an item in this collection has changed + * significantly. + *

+ * It is up to the implementation whether and when to trigger this event. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.collections.IObservableCollection.#addItemChangedListener + * @abstract + */ + removeItemChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + } + var IObservableCollection:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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.} + *

+ * Type parameter T: The type of the contained elements. + * @interface + * @implements {yfiles.collections.IEnumerable.} + * @template T + */ + export interface IListEnumerable extends Object,yfiles.collections.IEnumerable{ + /** + * Gets the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @returns {T} the item for the given index + * @throws {Stubs.Exceptions.ArgumentError} i is not a valid index in the {@link yfiles.collections.IListEnumerable.}. + * @abstract + */ + get(i:number):T; + /** + * Gets the number of elements in this collection. + * @abstract + * @type {number} + */ + size:number; + } + var IListEnumerable:{ + /** + * An empty, immutable instance of {@link yfiles.collections.IListEnumerable.}. + * @const + * @static + * @type {yfiles.collections.IListEnumerable.} + */ + EMPTY?:yfiles.collections.IListEnumerable; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Wraps a simple {@link yfiles.collections.IEnumerable.} into a {@link yfiles.collections.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. + *

+ * Type parameter T: The type of the enumerable. + * @class yfiles.collections.ListEnumerable. + * @implements {yfiles.collections.IListEnumerable.} + * @template T + * @final + */ + export interface ListEnumerable extends Object,yfiles.collections.IListEnumerable{} + export class ListEnumerable { + /** + * Creates a new instance using the given backing enumerable. + * @param {yfiles.collections.IEnumerable.} backingEnumerable The enumerable to back this instance. + * @constructor + */ + constructor(backingEnumerable:yfiles.collections.IEnumerable); + /** + * Creates a new instance with a backing {@link yfiles.collections.List.} as the backing store. + * @constructor + */ + constructor(); + /** + * + * @param {number} i + * @returns {T} + */ + get(i:number):T; + /** + * + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets the backing enumerable. + * @type {yfiles.collections.IEnumerable.} + */ + backingEnumerable:yfiles.collections.IEnumerable; + /** + * + * @type {number} + */ + size:number; + static $class:yfiles.lang.Class; + } + /** + * Event argument class used by {@link yfiles.collections.IObservableCollection.} and similar that holds a specific item that is related to the event. + * Type parameter T: The type of the item contained in the event. + * @class yfiles.collections.ItemEventArgs. + * @extends {yfiles.lang.EventArgs} + * @template T + */ + export interface ItemEventArgs extends yfiles.lang.EventArgs{} + export class ItemEventArgs { + /** + * Creates a new event argument for the given item. + * @param {T} item The item which is the subject of the event. + * @constructor + */ + constructor(item:T); + /** + * Gets the item that is the subject of the event. + * @type {T} + */ + item:T; + static $class:yfiles.lang.Class; + } + /** + * An interface for simple typed dictionary-like implementations. + *

+ * {@link yfiles.collections.IMapper.}s are most prominently used when interfacing with {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and {@link yfiles.graphml.GraphMLIOHandler GraphML}. {@link yfiles.graph.IGraph} also provides the {@link yfiles.graph.IGraph#mapperRegistry} + * to add additional information to a graph. + *

+ * Type parameter K: The type of element this interface accepts as keys for the mapping. + * Type parameter V: The type of element this interface accepts as values for the mapping. + *

+ * Using {@link yfiles.collections.IMapper.} is described in the section {@link @DGUIDE_PREFIX@/customizing_graph-binding_data.html Associating Data with Graph Elements}. + *

+ *

Related demos:

+ *
    + *
  • Demo: DragAndDropForm, demo.yfiles.input.draganddrop
  • + *
+ * @see yfiles.collections.Mapper. + * @interface + * @template K,V + */ + export interface IMapper extends Object{ + /** + * Gets the value for a given key in the mapping. + *

+ * Setting a value for an already existing key overwrites the previous value. + *

+ *

+ * It depends on the specific implementation of the mapper whether a mapping can be removed. If an implementation provides + * a way to remove a mapping, that should be preferred over setting a null value. For example, {@link yfiles.collections.Mapper.} provides the {@link yfiles.collections.Mapper.#delete} + * method. + *

+ * @param {K} key The key of the mapping. + * @returns {V} The value. + * @see yfiles.collections.IMapper.#set + * @abstract + */ + get(key:K):V; + /** + * Sets the value for a given key in the mapping. + *

+ * Setting a value for an already existing key overwrites the previous value. + *

+ *

+ * It depends on the specific implementation of the mapper whether a mapping can be removed. If an implementation provides + * a way to remove a mapping, that should be preferred over setting a null value. For example, {@link yfiles.collections.Mapper.} provides the {@link yfiles.collections.Mapper.#delete} + * method. + *

+ * @param {K} key The key of the mapping. + * @param value The value. + * @see yfiles.collections.IMapper.#get + * @abstract + */ + set(key:K,value:V):void; + } + var IMapper:{ + /** + * Creates a constant mapper that will always return the constant. + * Type parameter K: The type of the key to use. + * Type parameter V: The type of the value to use. + * @param {V} constant The constant to return in {@link yfiles.collections.IMapper.#get} + * @returns {yfiles.collections.IMapper.} A new instance that will always return the same constant. + * @template K,V + * @static + */ + fromConstant?(constant:V):yfiles.collections.IMapper; + /** + * Create an implementation of {@link yfiles.collections.IMapper.} that delegates {@link yfiles.collections.IMapper.#get} getter calls to the provided handler. + *

+ * The implementation returned silently ignores calls to the {@link yfiles.collections.IMapper.#get} setter. + *

+ * Type parameter K: The type of the key to use. + * Type parameter V: The type of the value to use. + * @param {function(K): V} getter The delegate to delegate {@link yfiles.collections.IMapper.#get} getter calls to. + * @returns {yfiles.collections.IMapper.} An implementation that delegates to getter. + * @template K,V + * @static + */ + fromDelegate?(getter:(key:K)=>V):yfiles.collections.IMapper; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + }export namespace system{ + }export namespace view{ + export enum MouseButtons{ + /** + * No mouse button. + */ NONE, /** - * The key has been pressed. - */ - PRESSED, + * The left mouse button. + */ + LEFT, /** - * The character has been typed. - */ - TYPED, + * The right mouse button. + */ + RIGHT, /** - * The key has been released. - */ - RELEASED + * The middle mouse button. + */ + MIDDLE, + /** + * Extra mouse button 1. + */ + X1, + /** + * Extra mouse button 2. + */ + X2 + } + 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 + } + export enum MouseWheelBehaviors{ + /** + * 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.view.MouseWheelBehaviors#ZOOM} or {@link yfiles.view.MouseWheelBehaviors#SCROLL} to perform the + * action only when the control has focus. + */ + ONLY_WHEN_FOCUSED } /** - * 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{ + * The event arguments for the event handler used by {@link yfiles.view.CanvasComponent#raisePrepareRenderContextEvent} + *

+ * This event argument can be used to modify the {@link yfiles.view.PrepareRenderContextEventArgs#context} during {@link yfiles.view.CanvasComponent#exportContent} and + * {@link yfiles.view.CanvasComponent#invalidate} + *

+ * @see yfiles.view.CanvasComponent#addPrepareRenderContextListener + * @class yfiles.view.PrepareRenderContextEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface PrepareRenderContextEventArgs extends yfiles.lang.EventArgs{} + export class PrepareRenderContextEventArgs { + /** + * Initializes a new instance of the {@link yfiles.view.PrepareRenderContextEventArgs} class. + * @param {yfiles.view.IRenderContext} context The initial context which can be modified by the event handlers using the {@link yfiles.view.PrepareRenderContextEventArgs#context} property. + * @constructor + */ + constructor(context:yfiles.view.IRenderContext); + /** + * Gets or sets the context. + * @throws {Stubs.Exceptions.ArgumentError} If the argument is null. + * @type {yfiles.view.IRenderContext} + */ + context:yfiles.view.IRenderContext; + static $class:yfiles.lang.Class; } - 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; + export enum SizeChangedDetectionMode{ + /** + * No size change detection. + *

+ * Consequently, no {@link yfiles.view.CanvasComponent#addSizeChangedListener SizeChanged} events are fired. + *

+ */ + NONE, + /** + * Size change detection based on invisible sensor elements. + *

+ * This is the preferred mode since it provides + * {@link yfiles.view.CanvasComponent#addSizeChangedListener SizeChanged}events in real time. + *

+ */ + SENSOR, + /** + * Timer based size change detection. + *

+ * A timer periodically checks the current size with the previous one. Typically, this method is used as fall back in case + * the {@link yfiles.view.SizeChangedDetectionMode#SENSOR} mode is not available in a browser. + *

+ */ + TIMER, + /** + * This is the default mode which uses the preferred {@link yfiles.view.SizeChangedDetectionMode#SENSOR} mode if possible, + * otherwise the {@link yfiles.view.SizeChangedDetectionMode#TIMER} mode is used. + */ + AUTO } - 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{ + * This event occurs when the size of a control is changed. + * @class yfiles.view.SizeChangedEventArgs + * @extends {yfiles.lang.EventArgs} + * @final + */ + export interface SizeChangedEventArgs extends yfiles.lang.EventArgs{} + export class SizeChangedEventArgs { + /** + * Gets or sets the element whose size was changed. + * @type {HTMLElement} + */ + source:HTMLElement; + /** + * Gets or sets the old size of the control. + * @type {yfiles.geometry.Size} + */ + oldSize:yfiles.geometry.Size; + static $class:yfiles.lang.Class; } - 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{ + * The {@link yfiles.view.CanvasComponent} 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.view.ICanvasObject} elements. Multiple elements are grouped in {@link yfiles.view.ICanvasObjectGroup} + * elements. An {@link yfiles.view.ICanvasObject} consists of a {@link yfiles.view.ICanvasObject#userObject user-object} and an {@link yfiles.view.ICanvasObjectDescriptor} that is used + * by the rendering engine to query interfaces that perform the actual creation of the + * {@link yfiles.view.Visual}s, hit testing, and bounds calculation. + *

+ *

+ * This component handles the following commands by default: + *

+ *
    + *
  • {@link yfiles.input.ICommand#INCREASE_ZOOM}
  • + *
  • {@link yfiles.input.ICommand#DECREASE_ZOOM}
  • + *
  • {@link yfiles.input.ICommand#ZOOM}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_UP}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_LEFT}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_RIGHT}
  • + *
  • {@link yfiles.input.ICommand#FIT_CONTENT_COMMAND}
  • + *
+ *

+ * The handlers for {@link yfiles.input.ICommand#INCREASE_ZOOM} and {@link yfiles.input.ICommand#DECREASE_ZOOM} use the specified command + * parameter as the factor by which the {@link yfiles.view.CanvasComponent#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.input.ICommand#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.Rect}, {@link yfiles.geometry.Point} and {@link yfiles.graph.ILookup}. If a rectangle is specified as the + * parameter for the {@link yfiles.input.ICommand#ZOOM} command, the handler adjusts the {@link yfiles.view.CanvasComponent#viewport} such that the rectangle tightly fits into + * it. If a point is specified, the handler sets the {@link yfiles.view.CanvasComponent#center} to that point. If the parameter implements {@link yfiles.graph.ILookup}, then + * the handler tries to get a {@link yfiles.view.IBoundsProvider} from the lookup and uses the bounds obtained from the bounds + * provider as the rectangle to zoom to. + *

+ *

+ * {@link yfiles.view.CanvasComponent} is discussed in detail in the section {@link @DGUIDE_PREFIX@/view_graphcontrol.html The Component for Displaying Graphs}. + *

+ * @see yfiles.view.IVisualCreator + * @see yfiles.input.IHitTestable + * @see yfiles.view.IVisibilityTestable + * @class yfiles.view.CanvasComponent + * @implements {yfiles.graph.ILookup} + */ + export interface CanvasComponent extends Object,yfiles.graph.ILookup{} + export class CanvasComponent { /** - * Returns the center of the handle. - * @see Specified by {@link yfiles.input.IDragHandler#location}. - */ - location:yfiles.geometry.IPoint; + * Creates a new instance of {@link yfiles.view.CanvasComponent} using the div element that is specified by the selector. + *

+ * The canvas will be empty with no associated InputModes. + *

+ * @param {string} selector The CSS selector or id for an existing div element + * @constructor + */ + constructor(selector:string); /** - * Returns an appropriate type for this position. - * @see Specified by {@link yfiles.input.IHandle#type}. - */ - type:yfiles.input.HandleType; + * Creates a new instance of {@link yfiles.view.CanvasComponent} for the provided div element. + *

+ * The canvas will be empty with no associated {@link yfiles.view.CanvasComponent#inputMode}s. + *

+ * @param {HTMLDivElement} div The existing div element to use for rendering the canvas into. + * @constructor + */ + constructor(div:HTMLDivElement); /** - * Returns an appropriate cursor for the position. - * @see Specified by {@link yfiles.input.IHandle#cursor}. - */ - cursor:yfiles.canvas.ICanvasCursor; + * Creates a new instance of {@link yfiles.view.CanvasComponent} with default properties. + *

+ * The canvas will be empty with no associated InputModes. This constructor creates a new {@link yfiles.view.CanvasComponent#div} element that needs to be added + * to the DOM manually. + *

+ * @constructor + */ + constructor(); /** - * This implementation does nothing. - * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. - */ - initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + * Scrolls to the provided view point and zoom level in an animated fashion. + * @param {yfiles.geometry.Point} viewPoint The new {@link yfiles.view.CanvasComponent#viewPoint} + * @param {number} zoom The new zoom level. + */ + animateScrollTo(viewPoint:yfiles.geometry.Point,zoom:number):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}. - */ + * Cleans up the Div element by removing any connection from the element to the Control instance. + */ 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; + * Helper method that ensures that the view port limit as returned by the {@link yfiles.view.CanvasComponent#viewportLimiter} are obeyed. + *

+ * This method will {@link yfiles.view.CanvasComponent#zoomTo} the limited bounds if necessary. + *

+ * @see yfiles.view.CanvasComponent#viewportLimiter + */ + coerceViewportLimits():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; + * Compares two {@link yfiles.view.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.view.ICanvasObject} canvasObject1 the first object to compare + * @param {yfiles.view.ICanvasObject} canvasObject2 the second object to compare + * @returns {number} 0 if canvasObject1 == + * canvasObject2 + *
+ * >0 if canvasObject1 is painted before canvasObject2 <0 if canvasObject1 is painted after canvasObject2 + */ + compareRenderOrder(canvasObject1:yfiles.view.ICanvasObject,canvasObject2:yfiles.view.ICanvasObject):number; /** - * 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; + * Factory method for the BackgroundGroup property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#backgroundGroup} property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + * @protected + */ + createBackgroundGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Factory method for the ContentGroup property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#contentGroup} property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + * @protected + */ + createContentGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Factory method for the {@link yfiles.view.CanvasComponent#focusGroup} property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#focusGroup} property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + * @protected + */ + createFocusGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Factory method for the HighlightGroup property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#highlightGroup} property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + * @protected + */ + createHighlightGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Factory method for the {@link yfiles.view.CanvasComponent#inputModeContext} property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#inputModeContext} property. + *

+ * @returns {yfiles.input.IInputModeContext} a new instance of {@link yfiles.view.CanvasComponent#inputModeContext} that has this instance set as it's {@link yfiles.view.ICanvasContext#canvasComponent} and uses this instance's {@link yfiles.view.CanvasComponent#inputModeContextLookup} + * callback to satisfy requests. + * @protected + */ + createInputModeContext():yfiles.input.IInputModeContext; /** - * 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; + * Factory method for the InputModeGroup property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#inputModeGroup} property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + * @protected + */ + createInputModeGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Creates an appropriate {@link yfiles.view.IRenderContext render context} that can be used to {@link yfiles.view.IVisualCreator#createVisual create visuals} using {@link yfiles.view.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. + *

+ * @returns {yfiles.view.IRenderContext} A new context instance that is bound to this instance. + */ + createRenderContext():yfiles.view.IRenderContext; /** - * 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; + * Factory method for the SelectionGroup property. + *

+ * This method will be called upon first access to the {@link yfiles.view.CanvasComponent#selectionGroup} property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + * @protected + */ + createSelectionGroup():yfiles.view.ICanvasObjectGroup; /** - * The collection of {@link yfiles.input.SnapResult}s. - * This collection is automatically updated during moving the mouse. - */ - snapResults:yfiles.model.ICollectionModel; + * Ensures that the provided bounds are visible in this control by adjusting the viewport correspondingly. + * @param {yfiles.geometry.Rect} bounds The bounds to make visible. + */ + ensureVisible(bounds:yfiles.geometry.Rect):void; /** - * 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; + * Exports the graphical content for this {@link yfiles.view.CanvasComponent}. + *

+ * This method will create the visual content using the world coordinate system. + *

+ * @param {yfiles.view.IRenderContext} context The context to use. + * @returns {Element} A composite Visual that represents the contents of this control. + */ + exportContent(context:yfiles.view.IRenderContext):Element; /** - * 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; + * Fires the size changed event. + * @param {yfiles.geometry.Size} oldSize + */ + fireSizeChanged(oldSize:yfiles.geometry.Size):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; + * Adjusts the view port to fully encompass the {@link yfiles.view.CanvasComponent#contentRect}. + *

+ * The zoom level will not be greater than 1.0d. If the view port is limited by the {@link yfiles.view.CanvasComponent#viewportLimiter} the zoom level might be greater than 1.0d + * to respect the limits. + *

+ * @see yfiles.view.CanvasComponent#zoom + * @see yfiles.view.CanvasComponent#zoomTo + */ + fitContent():void; /** - * 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; + * Focuses the {@link yfiles.view.CanvasComponent#div} element that is backing this instance. + */ + focus():void; /** - * 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; + * Convenience method that calculates the bounds for a given canvas object in the scene graph. + *

+ * This method queries the descriptor for the {@link yfiles.view.IBoundsProvider} for the user object and returns the result. + *

+ * @param {yfiles.view.ICanvasObject} canvasObject the canvas object to query the bounds from + * @returns {yfiles.geometry.Rect} the non-null bounds + */ + getBounds(canvasObject:yfiles.view.ICanvasObject):yfiles.geometry.Rect; /** - * 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; + * 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.Point} location the coordinates of the query in the world coordinate system + * @returns {yfiles.view.ICanvasObject} + */ + getCanvasObject(location:yfiles.geometry.Point):yfiles.view.ICanvasObject; /** - * 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; + * Enumerates over all possible {@link yfiles.view.ICanvasObject} instances in the tree below the given group. + * @param {yfiles.view.ICanvasObjectGroup} group + * @returns {yfiles.collections.IEnumerable.} An enumerable for all {@link yfiles.view.ICanvasObject}s in the tree below the given group. + */ + getCanvasObjects(group:yfiles.view.ICanvasObjectGroup):yfiles.collections.IEnumerable; /** - * Gets or sets a value indicating whether this {@link yfiles.input.SnapContext} is enabled. - * Value: true if enabled; otherwise, false. - */ + * 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.Point} location the coordinates of the query in the world coordinate system + * @returns {yfiles.collections.IEnumerable.} an enumerable of canvas object that are hit in reverse painting order + */ + getCanvasObjects(location:yfiles.geometry.Point):yfiles.collections.IEnumerable; + /** + * Enumerates over all possible {@link yfiles.view.ICanvasObject} instances in the tree. + * @returns {yfiles.collections.IEnumerable.} An enumerable for all {@link yfiles.view.ICanvasObject}s in the tree. + */ + getCanvasObjects():yfiles.collections.IEnumerable; + /** + * Gets the {@link yfiles.view.CanvasComponent} instance that is associated with the given DOM element, or null. + * @param {Element} element + * @returns {yfiles.view.CanvasComponent} + * @static + */ + static getComponent(element:Element):yfiles.view.CanvasComponent; + /** + * Gets the {@link yfiles.view.Visual} that is currently visualizing the given {@link yfiles.view.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.view.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.view.ICanvasObject} canvasObject The canvas object. + * @returns {yfiles.view.Visual} The {@link yfiles.view.Visual} that is currently used by the canvasObject. + */ + getVisual(canvasObject:yfiles.view.ICanvasObject):yfiles.view.Visual; + /** + * Convenience method that retrieves the {@link yfiles.view.IVisualCreator} for a given {@link yfiles.view.ICanvasObject}. + * @param {yfiles.view.ICanvasObject} canvasObject the canvas object to query the visual creator implementation from + * @returns {yfiles.view.IVisualCreator} an instance of the visual creator interface + * @see yfiles.view.ICanvasObjectDescriptor#getVisualCreator + * @see yfiles.view.VoidVisualCreator#INSTANCE + */ + getVisualCreator(canvasObject:yfiles.view.ICanvasObject):yfiles.view.IVisualCreator; + /** + * Converts view coordinates from the document's coordinate system to the control's coordinate system. + * @param {yfiles.geometry.Point} localPoint The coordinates to convert. + * @returns {yfiles.geometry.Point} The coordinates in the control's coordinate system. + */ + globalToLocal(localPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Assures that the {@link yfiles.view.CanvasComponent#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.Rect} rectangle the rectangle that should be included in the content rectangle + */ + growContentRect(rectangle:yfiles.geometry.Rect):void; + /** + * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific {@link yfiles.view.ICanvasContext} + * as the argument to the {@link yfiles.input.IHitTestable#isHit} method. + *

+ * Hit testing is performed using the {@link yfiles.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible + * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. + *

+ * @param {yfiles.input.IInputModeContext} context The context instance to pass to {@link yfiles.input.IHitTestable#isHit}. + * @param {yfiles.geometry.Point} location the coordinates to perform the hit test at + * @param {yfiles.view.ICanvasObjectGroup} [root=null] the root of the scene graph to use + * @param {function(yfiles.view.ICanvasObject): boolean} [filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. + * @returns {yfiles.collections.IEnumerable.} a live enumeration of the elements that are hit + * @see yfiles.input.IHitTestable + */ + hitElementsAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean):yfiles.collections.IEnumerable; + /** + * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific {@link yfiles.view.ICanvasContext} + * as the argument to the {@link yfiles.input.IHitTestable#isHit} method. + *

+ * Hit testing is performed using the {@link yfiles.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible + * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.input.IInputModeContext} options.context The context instance to pass to {@link yfiles.input.IHitTestable#isHit}. + * @param {yfiles.geometry.Point} options.location the coordinates to perform the hit test at + * @param {yfiles.view.ICanvasObjectGroup} [options.root=null] the root of the scene graph to use + * @param {function(yfiles.view.ICanvasObject): boolean} [options.filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. + * @returns {yfiles.collections.IEnumerable.} a live enumeration of the elements that are hit + * @see yfiles.input.IHitTestable + */ + hitElementsAt(options:{context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean}):yfiles.collections.IEnumerable; + /** + * 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.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible + * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. + *

+ * @param {yfiles.geometry.Point} location the coordinates to perform the hit test at + * @param {yfiles.view.ICanvasObjectGroup} [root=null] the root of the scene graph to use + * @param {function(yfiles.view.ICanvasObject): boolean} [filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. + * @returns {yfiles.collections.IEnumerable.} a live enumeration of the elements that are hit + * @see yfiles.input.IHitTestable + * @see yfiles.view.CanvasComponent#hitTestRadius + */ + hitElementsAt(location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean):yfiles.collections.IEnumerable; + /** + * 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.view.ICanvasObjectDescriptor#getHitTestable} instance returned for each visible + * {@link yfiles.view.ICanvasObject} in the current scene graph. The enumeration is performed lazily. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.Point} options.location the coordinates to perform the hit test at + * @param {yfiles.view.ICanvasObjectGroup} [options.root=null] the root of the scene graph to use + * @param {function(yfiles.view.ICanvasObject): boolean} [options.filter=null] The predicate that decides whether a given canvas object should be considered for testing at all or null. + * @returns {yfiles.collections.IEnumerable.} a live enumeration of the elements that are hit + * @see yfiles.input.IHitTestable + * @see yfiles.view.CanvasComponent#hitTestRadius + */ + hitElementsAt(options:{location:yfiles.geometry.Point,root?:yfiles.view.ICanvasObjectGroup,filter?:(obj:yfiles.view.ICanvasObject)=>boolean}):yfiles.collections.IEnumerable; + /** + * Callback that is used by the default implementation of {@link yfiles.view.CanvasComponent#inputModeContext} to resolve {@link yfiles.graph.ILookup#lookup} calls. + * @param {yfiles.lang.Class} type The Type to query + * @returns {Object} The result of the query. + * @see yfiles.input.IInputModeContext + * @protected + */ + inputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * Invalidates this instance and marks it as in need for an update. + *

+ * Calling this method is fast and will only mark the control for a future, asynchronously executed call to UpdateVisual. + *

+ */ + invalidate():void; + /** + * Convenience method that calculates the hit tests a given canvas object in the scene graph. + *

+ * This method queries the descriptor for the {@link yfiles.input.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.view.ICanvasObject} canvasObject the canvas object to query the bounds from + * @param {yfiles.geometry.Point} location the coordinates of the query in the world coordinate system + * @returns {boolean} whether the canvas object is hit at the given coordinates + */ + isHit(canvasObject:yfiles.view.ICanvasObject,location:yfiles.geometry.Point):boolean; + /** + * Converts view coordinates from the control's coordinate system to the document's coordinate system. + * @param {yfiles.geometry.Point} localPoint The coordinates to convert. + * @returns {yfiles.geometry.Point} The coordinates in the document's coordinate system. + */ + localToGlobal(localPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * This method will be called when the mouse wheel was turned and if the {@link yfiles.view.CanvasComponent#mouseWheelBehavior} property is set to + * {@link yfiles.view.MouseWheelBehaviors#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.view.MouseEventArgs} evt the event describing the action + * @see yfiles.view.CanvasComponent#mouseWheelBehavior + * @see yfiles.view.CanvasComponent#mouseWheelScrollFactor + * @protected + */ + mouseWheelScroll(evt:yfiles.view.MouseEventArgs):void; + /** + * This method will be called when the mouse wheel was turned and if the {@link yfiles.view.CanvasComponent#mouseWheelBehavior} property is set to + * {@link yfiles.view.MouseWheelBehaviors#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.view.MouseEventArgs} evt the event describing the action + * @see yfiles.view.CanvasComponent#mouseWheelBehavior + * @protected + */ + mouseWheelZoom(evt:yfiles.view.MouseEventArgs):void; + /** + * Raises the {@link yfiles.view.CanvasComponent#addPrepareRenderContextListener PrepareRenderContext}. + * @param {yfiles.view.PrepareRenderContextEventArgs} evt The event arguments to raise. + * @see yfiles.view.CanvasComponent#addPrepareRenderContextListener + * @protected + */ + raisePrepareRenderContextEvent(evt:yfiles.view.PrepareRenderContextEventArgs):void; + /** + * Raises the {@link yfiles.view.CanvasComponent#addUpdatedVisualListener UpdatedVisual}. + * @see yfiles.view.CanvasComponent#addUpdatedVisualListener + * @protected + */ + raiseUpdatedVisualEvent():void; + /** + * Raises the {@link yfiles.view.CanvasComponent#addUpdatingVisualListener UpdatingVisual}. + * @see yfiles.view.CanvasComponent#addUpdatingVisualListener + * @protected + */ + raiseUpdatingVisualEvent():void; + /** + * Adds a callback to the invocation chain and triggers the chain's execution. + *

+ * Therefore, the given callback will be executed in sequence with previously added actions, e.g. the + * {@link yfiles.view.CanvasComponent}'s invalidation. + *

+ * @param {Function} callback The function that should be executed. + * @param {...Object} args The arguments with which the function should be called. + */ + schedule(callback:Function,...args:Object[]):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. + *

+ * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @see yfiles.view.CanvasComponent#contentRect + * @see yfiles.view.CanvasComponent#horizontalScrollBarPolicy + * @see yfiles.view.CanvasComponent#verticalScrollBarPolicy + */ + setContentRect(x:number,y:number,w:number,h:number):void; + /** + * Stops the mouse capture and returns to normal event capturing. + *

+ * When {@link yfiles.view.CanvasComponent#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; + /** + * Converts world coordinates to view coordinates expressed in the control's coordinate system. + * @param {yfiles.geometry.Point} worldPoint the coordinates in the world coordinate system + * @returns {yfiles.geometry.Point} returns the coordinates in pixels relative to the controls upper left corner + */ + toViewCoordinates(worldPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Converts view coordinates (expressed in the control's coordinate system) to world coordinates. + * @param {yfiles.geometry.Point} viewPoint the coordinates in pixels relative to the controls upper left corner + * @returns {yfiles.geometry.Point} returns the coordinates in the world coordinate system + */ + toWorldCoordinates(viewPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Updates the {@link yfiles.view.CanvasComponent#contentRect} to encompass the bounds by all elements in the current scene graph plus the given margins. + *

+ * This method will traverse all {@link yfiles.view.ICanvasObject#visible visible} elements in the scene graph and query their {@link yfiles.view.ICanvasObjectDescriptor#getBoundsProvider bounds} The resulting bounds will be + * set to the content rectangle plus the provided margins. + *

+ * @param {yfiles.geometry.Insets} [margins=null] + * @param {yfiles.view.ICanvasObjectGroup} [group=null] + * @see yfiles.view.IBoundsProvider + * @see yfiles.view.CanvasComponent#contentRect + */ + updateContentRect(margins?:yfiles.geometry.Insets,group?:yfiles.view.ICanvasObjectGroup):void; + /** + * Updates the {@link yfiles.view.CanvasComponent#contentRect} to encompass the bounds by all elements in the current scene graph plus the given margins. + *

+ * This method will traverse all {@link yfiles.view.ICanvasObject#visible visible} elements in the scene graph and query their {@link yfiles.view.ICanvasObjectDescriptor#getBoundsProvider bounds} The resulting bounds will be + * set to the content rectangle plus the provided margins. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.Insets} [options.margins=null] + * @param {yfiles.view.ICanvasObjectGroup} [options.group=null] + * @see yfiles.view.IBoundsProvider + * @see yfiles.view.CanvasComponent#contentRect + */ + updateContentRect(options:{margins?:yfiles.geometry.Insets,group?:yfiles.view.ICanvasObjectGroup}):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.view.ICanvasObject#dirty} canvas objects using the {@link yfiles.view.ICanvasObjectDescriptor#isDirty} method and will {@link yfiles.view.IVisualCreator#createVisual create} + * or {@link yfiles.view.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.view.CanvasComponent#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; + /** + * Sets the zoom level and view port center to the given values. + * @param {yfiles.geometry.Point} center the new center of the view port in world coordinates + * @param {number} zoom the new zoom level + */ + zoomTo(center:yfiles.geometry.Point,zoom:number):void; + /** + * Sets the zoom level and view port center so that the given rectangle in world coordinates fits the viewport. + * @param {yfiles.geometry.Rect} bounds The coordinates of the rectangle to zoom to. + */ + zoomTo(bounds:yfiles.geometry.Rect):void; + /** + * Gets the {@link yfiles.view.CanvasComponent#dropTarget} associated with this instance. + * @type {yfiles.view.DropTarget} + */ + dropTarget:yfiles.view.DropTarget; + /** + * Gets the div element that represents this instance. + * @type {HTMLDivElement} + */ + div:HTMLDivElement; + /** + * Gets or sets a value indicating whether all keyboard input is captured. + * @type {boolean} + */ + captureAllKeyboardInput:boolean; + /** + * Gets or sets a value indicating whether all pointer input is captured. + * @type {boolean} + */ + captureAllPointerInput:boolean; + /** + * 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). + *

+ * @type {boolean} + */ + mouseCaptureEnabled:boolean; + /** + * Gets a value indicating whether this instance currently has mouse capture. + * @type {boolean} + */ + hasMouseCapture:boolean; + /** + * Gets a value indicating whether this {@link yfiles.view.CanvasComponent} is currently focused. + * @type {boolean} + */ + focused:boolean; + /** + * Gets or sets a value indicating whether this {@link yfiles.view.CanvasComponent} is enabled. + * @type {boolean} + */ 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; + * Gets a value indicating whether the UI is right to left. + * @type {boolean} + */ + rightToLeft:boolean; /** - * 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; + * Gets or sets a value indicating whether to prevent scrolling if the element gets focused. + * @type {boolean} + */ + preventFocusScrolling:boolean; /** - * Initializes a new instance of the {@link yfiles.input.SnapContext} class. - */ - new ():yfiles.input.SnapContext; + * Gets the control's {@link yfiles.view.CanvasComponent#svgDefsManager} + * @type {yfiles.view.SvgDefsManager} + */ + svgDefsManager:yfiles.view.SvgDefsManager; /** - * 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 or sets whether to add a 'glass pane' overlay to the {@link yfiles.view.CanvasComponent} 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.view.CanvasComponent} 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. + *

+ * @type {boolean} + */ + useGlassPane:boolean; /** - * 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; + * Gets or sets the {@link yfiles.view.CanvasComponent#viewportLimiter} instance that can be used to limit the explorable region. + *

+ * By default there are no limits set on the explorable region. + *

+ * @type {yfiles.view.ViewportLimiter} + */ + viewportLimiter:yfiles.view.ViewportLimiter; /** - * 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{ + * 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. + *

+ * @default true + * @type {boolean} + */ + editable:boolean; /** - * The reshapeable instance to write the changes to. - */ - reshapeHandler:yfiles.input.IReshapeHandler; + * Determines the behavior of the mouse wheel. The behavior can be switched between {@link yfiles.view.MouseWheelBehaviors#ZOOM}, {@link yfiles.view.MouseWheelBehaviors#SCROLL} + * and {@link yfiles.view.MouseWheelBehaviors#NONE}. Additionally, this property can be configured to perform the action + * {@link yfiles.view.MouseWheelBehaviors#ONLY_WHEN_FOCUSED only when the control is focused}. + * @default 1 + * @type {yfiles.view.MouseWheelBehaviors} + */ + mouseWheelBehavior:yfiles.view.MouseWheelBehaviors; /** - * 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; + * Specifies an event recognizer 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.KeyEventRecognizers#CONTROL_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + centerZoomEventRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; /** - * 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; + * Determines whether the mouse wheel should be used for zooming. + *

+ * If set to false this task can be performed by custom {@link yfiles.input.IInputMode} implementations using the {@link yfiles.view.CanvasComponent#addMouseWheelListener MouseWheel} + * event. + *

+ * @default true + * @type {boolean} + */ + autoMouseWheelZoom:boolean; /** - * 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; + * 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.view.ScrollBarVisibility#AS_NEEDED}. + *

+ * @see yfiles.input.MoveViewportInputMode + * @see yfiles.view.CanvasComponent#horizontalScrollBarPolicy + * @default 1 + * @type {yfiles.view.ScrollBarVisibility} + */ + verticalScrollBarPolicy:yfiles.view.ScrollBarVisibility; /** - * 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; + * 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.view.ScrollBarVisibility#AS_NEEDED}. + *

+ * @see yfiles.input.MoveViewportInputMode + * @see yfiles.view.CanvasComponent#verticalScrollBarPolicy + * @default 1 + * @type {yfiles.view.ScrollBarVisibility} + */ + horizontalScrollBarPolicy:yfiles.view.ScrollBarVisibility; /** - * 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 a value indicating whether + * {@link yfiles.input.ICommand}s for scrolling like for example ScrollPageDown, the scrolling should be performed in animated + * fashion. + * @default true + * @type {boolean} + */ + animateScrollCommands:boolean; /** - * 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; + * 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. + *

+ * @default '0,0,100,100' + * @type {yfiles.geometry.Rect} + */ + contentRect:yfiles.geometry.Rect; /** - * This implementation does nothing. - * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. - */ - initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + * Adds the given listener for the ContentRectChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentRect content rectangle} has been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeContentRectChangedListener + */ + addContentRectChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):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; + * Removes the given listener for the ContentRectChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentRect content rectangle} has been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addContentRectChangedListener + */ + removeContentRectChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; /** - * 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; + * Gets and sets the insets in view coordinates that should be used by the {@link yfiles.view.CanvasComponent#fitContent} + * operation. + *

+ * This influences the amount of visible whitespace in the view coordinate system around the {@link yfiles.view.CanvasComponent#contentRect} after a {@link yfiles.view.CanvasComponent#fitContent} + * operation. The default value is (10,10,10,10). + *

+ *

+ * Note limits that are enforced by the {@link yfiles.view.CanvasComponent#viewportLimiter} have a higher priority than these insets. + *

+ * @default '10' + * @type {yfiles.geometry.Insets} + */ + fitContentViewMargins:yfiles.geometry.Insets; /** - * 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; + * Adds the given listener for the FitContentViewMarginsChanged event that occurs when the {@link yfiles.view.CanvasComponent#fitContentViewMargins margins for the fit content operation} + * have been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeFitContentViewMarginsChangedListener + */ + addFitContentViewMarginsChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; /** - * 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; - }; + * Removes the given listener for the FitContentViewMarginsChanged event that occurs when the {@link yfiles.view.CanvasComponent#fitContentViewMargins margins for the fit content operation} + * have been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addFitContentViewMarginsChangedListener + */ + removeFitContentViewMarginsChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; /** - * 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{ + * Adds the given listener for the MouseLeave event that occurs when the mouse has exited the canvas. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseLeaveListener + */ + addMouseLeaveListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * The rectangle to read the current state from. - */ - rectangle:yfiles.geometry.IRectangle; + * Removes the given listener for the MouseLeave event that occurs when the mouse has exited the canvas. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseLeaveListener + */ + removeMouseLeaveListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * The reshapeable to use for reshaping. - */ - reshapeable:yfiles.geometry.IReshapeable; + * Adds the given listener for the MouseEnter event that occurs when the mouse has entered the canvas. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * 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.view.MouseEventArgs} does not include this button unless the browser supports the + * property MouseEvent.buttons. See the Known Issues for more details. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseEnterListener + */ + addMouseEnterListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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; + * Removes the given listener for the MouseEnter event that occurs when the mouse has entered the canvas. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * 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.view.MouseEventArgs} does not include this button unless the browser supports the + * property MouseEvent.buttons. See the Known Issues for more details. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseEnterListener + */ + removeMouseEnterListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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; - }; + * Adds the given listener for the MouseMove event that occurs when the mouse has been moved in world coordinates. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseMoveListener + */ + addMouseMoveListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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{ + * Removes the given listener for the MouseMove event that occurs when the mouse has been moved in world coordinates. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseMoveListener + */ + removeMouseMoveListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Gets the rectangle this instance works on. - */ - rectangle:yfiles.geometry.IMutableRectangle; + * Adds the given listener for the MouseDown event that occurs when a mouse button has been pressed. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseDownListener + */ + addMouseDownListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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; + * Removes the given listener for the MouseDown event that occurs when a mouse button has been pressed. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseDownListener + */ + removeMouseDownListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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; + * Adds the given listener for the MouseDrag event that occurs when the mouse is being moved while at least one of the + * mouse buttons is pressed. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseDragListener + */ + addMouseDragListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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; - }; + * Removes the given listener for the MouseDrag event that occurs when the mouse is being moved while at least one of the + * mouse buttons is pressed. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseDragListener + */ + removeMouseDragListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * 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{ + * Adds the given listener for the MouseUp event that occurs when the mouse button has been released. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseUpListener + */ + addMouseUpListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates no position at all. - */ - NONE, + * Removes the given listener for the MouseUp event that occurs when the mouse button has been released. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseUpListener + */ + removeMouseUpListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at north west. - */ - NORTH_WEST, + * Adds the given listener for the MouseLostCapture event that occurs when the mouse capture has been lost. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseLostCaptureListener + */ + addMouseLostCaptureListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at north. - */ - NORTH, + * Removes the given listener for the MouseLostCapture event that occurs when the mouse capture has been lost. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseLostCaptureListener + */ + removeMouseLostCaptureListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at north east. - */ - NORTH_EAST, + * Adds the given listener for the MouseWheel event that occurs when the mouse wheel has turned. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseWheelListener + */ + addMouseWheelListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at west. - */ - WEST, + * Removes the given listener for the MouseWheel event that occurs when the mouse wheel has turned. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseWheelListener + */ + removeMouseWheelListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at the center. - */ - CENTER, + * Adds the given listener for the MouseClick event that occurs when the user clicked the mouse. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * This happens if press and release happens at the same position. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseClickListener + */ + addMouseClickListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at east. - */ - EAST, + * Removes the given listener for the MouseClick event that occurs when the user clicked the mouse. + *

+ * This event delivers {@link yfiles.view.MouseEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * This happens if press and release happens at the same position. + *

+ * @param {function(Object, yfiles.view.MouseEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseClickListener + */ + removeMouseClickListener(listener:(sender:Object,evt:yfiles.view.MouseEventArgs)=>void):void; /** - * Indicates the position at south west. - */ - SOUTH_WEST, + * Adds the given listener for the KeyDown event that occurs when keys are being pressed. + *

+ * This event delivers {@link yfiles.view.KeyEventArgs}. + *

+ * @param {function(Object, yfiles.view.KeyEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeKeyDownListener + */ + addKeyDownListener(listener:(sender:Object,evt:yfiles.view.KeyEventArgs)=>void):void; /** - * Indicates the position at south. - */ - SOUTH, + * Removes the given listener for the KeyDown event that occurs when keys are being pressed. + *

+ * This event delivers {@link yfiles.view.KeyEventArgs}. + *

+ * @param {function(Object, yfiles.view.KeyEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addKeyDownListener + */ + removeKeyDownListener(listener:(sender:Object,evt:yfiles.view.KeyEventArgs)=>void):void; /** - * Indicates the position at south east. - */ - SOUTH_EAST - } - export enum TapHandlingMode{ + * Adds the given listener for the KeyPressed event that occurs when keys are being typed. + *

+ * This event delivers {@link yfiles.view.KeyEventArgs}. + *

+ * @param {function(Object, yfiles.view.KeyEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeKeyPressedListener + */ + addKeyPressedListener(listener:(sender:Object,evt:yfiles.view.KeyEventArgs)=>void):void; /** - * 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, + * Removes the given listener for the KeyPressed event that occurs when keys are being typed. + *

+ * This event delivers {@link yfiles.view.KeyEventArgs}. + *

+ * @param {function(Object, yfiles.view.KeyEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addKeyPressedListener + */ + removeKeyPressedListener(listener:(sender:Object,evt:yfiles.view.KeyEventArgs)=>void):void; /** - * 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, + * Adds the given listener for the KeyUp event that occurs when keys are being released. + *

+ * This event delivers {@link yfiles.view.KeyEventArgs}. + *

+ * @param {function(Object, yfiles.view.KeyEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeKeyUpListener + */ + addKeyUpListener(listener:(sender:Object,evt:yfiles.view.KeyEventArgs)=>void):void; /** - * 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 + * Removes the given listener for the KeyUp event that occurs when keys are being released. + *

+ * This event delivers {@link yfiles.view.KeyEventArgs}. + *

+ * @param {function(Object, yfiles.view.KeyEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addKeyUpListener + */ + removeKeyUpListener(listener:(sender:Object,evt:yfiles.view.KeyEventArgs)=>void):void; + /** + * Adds the given listener for the EditableChanged event that occurs when the {@link yfiles.view.CanvasComponent#editable} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeEditableChangedListener + */ + addEditableChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the EditableChanged event that occurs when the {@link yfiles.view.CanvasComponent#editable} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addEditableChangedListener + */ + removeEditableChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Adds the given listener for the ViewportChanged event that occurs when the {@link yfiles.view.CanvasComponent#viewport} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeViewportChangedListener + */ + addViewportChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the ViewportChanged event that occurs when the {@link yfiles.view.CanvasComponent#viewport} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addViewportChangedListener + */ + removeViewportChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Adds the given listener for the TouchDown event that occurs when a finger has been put on the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchDownListener + */ + addTouchDownListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchDown event that occurs when a finger has been put on the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchDownListener + */ + removeTouchDownListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchUp event that occurs when a finger has been removed from the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchUpListener + */ + addTouchUpListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchUp event that occurs when a finger has been removed from the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchUpListener + */ + removeTouchUpListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchMove event that occurs when a finger has been moved on the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchMoveListener + */ + addTouchMoveListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchMove event that occurs when a finger has been moved on the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchMoveListener + */ + removeTouchMoveListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchEnter event that occurs when a finger on the touch screen has entered the canvas. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchEnterListener + */ + addTouchEnterListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchEnter event that occurs when a finger on the touch screen has entered the + * canvas. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchEnterListener + */ + removeTouchEnterListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchLeave event that occurs when a finger on the touch screen has exited the canvas. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchLeaveListener + */ + addTouchLeaveListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchLeave event that occurs when a finger on the touch screen has exited the + * canvas. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchLeaveListener + */ + removeTouchLeaveListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchLostCapture event that occurs when the touch capture has been lost. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchLostCaptureListener + */ + addTouchLostCaptureListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchLostCapture event that occurs when the touch capture has been lost. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchLostCaptureListener + */ + removeTouchLostCaptureListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchClick event that occurs when the user performed a tap gesture with a finger on the + * touch screen. + *

+ * An event that delivers {@link yfiles.view.TouchEventArgs} 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. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchClickListener + */ + addTouchClickListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchClick event that occurs when the user performed a tap gesture with a finger on + * the touch screen. + *

+ * An event that delivers {@link yfiles.view.TouchEventArgs} 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. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchClickListener + */ + removeTouchClickListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Adds the given listener for the TouchLongPress event that occurs when the user performed a long press gesture with a + * finger on the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * This happens if the finger is held in the same position for the duration specified in {@link yfiles.view.CanvasComponent#longPressTime} after a + * {@link yfiles.view.CanvasComponent#addTouchDownListener TouchDown}. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeTouchLongPressListener + */ + addTouchLongPressListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Removes the given listener for the TouchLongPress event that occurs when the user performed a long press gesture with a + * finger on the touch screen. + *

+ * This event delivers {@link yfiles.view.TouchEventArgs} in world coordinates using double precision floating points. + *

+ *

+ * This happens if the finger is held in the same position for the duration specified in {@link yfiles.view.CanvasComponent#longPressTime} after a + * {@link yfiles.view.CanvasComponent#addTouchDownListener TouchDown}. + *

+ * @param {function(Object, yfiles.view.TouchEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addTouchLongPressListener + */ + removeTouchLongPressListener(listener:(sender:Object,evt:yfiles.view.TouchEventArgs)=>void):void; + /** + * Gets a list of the active {@link yfiles.view.TouchDevice}s at the time of invocation. + *

+ * Note that this is not a live view, but rather a snapshot. + *

+ * @type {yfiles.collections.IListEnumerable.} + */ + currentTouchDevices:yfiles.collections.IListEnumerable; + /** + * Gets a value indicating whether at least one finger is on the touch screen. + * @type {boolean} + */ + isTouchDeviceDown:boolean; + /** + * Gets the last {@link yfiles.view.TouchEventArgs touch event} triggered by this instance. + * @type {yfiles.view.TouchEventArgs} + */ + lastTouchEvent:yfiles.view.TouchEventArgs; + /** + * Gets the last {@link yfiles.view.MouseEventArgs mouse event} triggered by this instance. + * @type {yfiles.view.MouseEventArgs} + */ + lastMouseEvent:yfiles.view.MouseEventArgs; + /** + * Gets the last location provided by a pointing device (for instance mouse or touch). + *

+ * Unlike {@link yfiles.view.CanvasComponent#lastMouseEvent} and {@link yfiles.view.CanvasComponent#lastTouchEvent} this will always contain the latest location, regardless of what input method generated it. + *

+ * @see yfiles.view.CanvasComponent#lastMouseEvent + * @see yfiles.view.CanvasComponent#lastTouchEvent + * @type {yfiles.geometry.Point} + */ + lastEventLocation:yfiles.geometry.Point; + /** + * Adds the given listener for the InputModeChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputMode} property is changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#inputMode + * @see yfiles.view.CanvasComponent#removeInputModeChangedListener + */ + addInputModeChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the InputModeChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputMode} property is changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#inputMode + * @see yfiles.view.CanvasComponent#addInputModeChangedListener + */ + removeInputModeChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets or sets the single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. + * @default null + * @type {yfiles.input.IInputMode} + */ + inputMode:yfiles.input.IInputMode; + /** + * Specifies the radius of the area around the mouse in view coordinates in which a {@link yfiles.input.IHitTestable} may lie to be + * considered a valid hit. + *

+ * This value can be queried from within the {@link yfiles.input.IHitTestable} implementation from the {@link yfiles.view.ICanvasContext#hitTestRadius} property. The default value + * is 3.0d + *

+ * @default 3.0 + * @type {number} + */ + hitTestRadius:number; + /** + * Adds the given listener for the HitTestRadiusChanged event that occurs when the {@link yfiles.view.CanvasComponent#hitTestRadius} property changes. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeHitTestRadiusChangedListener + */ + addHitTestRadiusChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the HitTestRadiusChanged event that occurs when the {@link yfiles.view.CanvasComponent#hitTestRadius} property changes. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addHitTestRadiusChangedListener + */ + removeHitTestRadiusChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets or sets the zoom factor for this {@link yfiles.view.CanvasComponent}. + *

+ * 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.view.CanvasComponent#minimumZoom} and {@link yfiles.view.CanvasComponent#maximumZoom} + *

+ * @see yfiles.view.CanvasComponent#addZoomChangedListener + * @see yfiles.view.CanvasComponent#minimumZoom + * @see yfiles.view.CanvasComponent#maximumZoom + * @default 1.0 + * @type {number} + */ + zoom:number; + /** + * Adds the given listener for the ZoomChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#zoom} property has been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeZoomChangedListener + */ + addZoomChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the ZoomChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#zoom} property has been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addZoomChangedListener + */ + removeZoomChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets or sets the minimum zoom factor for this {@link yfiles.view.CanvasComponent}. + *

+ * This property sets a lower bound for the allowed values of the {@link yfiles.view.CanvasComponent#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 yfiles.view.CanvasComponent#zoom + * @see yfiles.view.CanvasComponent#maximumZoom + * @default 0.01 + * @type {number} + */ + minimumZoom:number; + /** + * Get or set the maximum zoom level that is valid for {@link yfiles.view.CanvasComponent#zoom}. + *

+ * Default value is 1000d + *

+ * @default 1000.0 + * @type {number} + */ + 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. + *

+ * @default '0,0' + * @type {yfiles.geometry.Point} + */ + viewPoint:yfiles.geometry.Point; + /** + * Returns the size of the usable area in which the graph will be displayed. + * @type {yfiles.geometry.Size} + */ + size:yfiles.geometry.Size; + /** + * Returns the currently visible viewing region in world coordinates. + * @see yfiles.view.CanvasComponent#viewPoint + * @see yfiles.view.CanvasComponent#zoom + * @type {yfiles.geometry.Rect} + */ + viewport:yfiles.geometry.Rect; + /** + * Yields the size of the content of this control. + *

+ * This size corresponds to the size of the control without the scroll bars. + *

+ * @type {yfiles.geometry.Size} + */ + innerSize:yfiles.geometry.Size; + /** + * Adds the given listener for the GotFocus event that occurs when the Control got the focus. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeGotFocusListener + */ + addGotFocusListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the GotFocus event that occurs when the Control got the focus. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addGotFocusListener + */ + removeGotFocusListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the LostFocus event that occurs when the Control lost the focus. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeLostFocusListener + */ + addLostFocusListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the LostFocus event that occurs when the Control lost the focus. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addLostFocusListener + */ + removeLostFocusListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Retrieves the {@link yfiles.graph.LookupChain} that can be used do decorate the {@link yfiles.graph.ILookup#lookup} call in the {@link yfiles.view.CanvasComponent#inputModeContext}. + * @type {yfiles.graph.LookupChain} + */ + inputModeContextLookupChain:yfiles.graph.LookupChain; + /** + * Returns an implementation of {@link yfiles.view.ICanvasContext} that describes the state of this {@link yfiles.view.CanvasComponent}. + * @see yfiles.input.IHitTestable + * @see yfiles.view.IBoundsProvider + * @type {yfiles.view.ICanvasContext} + */ + canvasContext:yfiles.view.ICanvasContext; + /** + * Gets or sets the world coordinate at the center of the control. + *

+ * This can be used to move the view port. + *

+ * @type {yfiles.geometry.Point} + */ + center:yfiles.geometry.Point; + /** + * 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. + * @default true + * @type {boolean} + */ + autoDrag:boolean; + /** + * Adds the given listener for the AutoDragChanged event that occurs when the {@link yfiles.view.CanvasComponent#autoDrag} property is changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeAutoDragChangedListener + */ + addAutoDragChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the AutoDragChanged event that occurs when the {@link yfiles.view.CanvasComponent#autoDrag} property is changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addAutoDragChangedListener + */ + removeAutoDragChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets or sets the policy for caching {@link yfiles.view.Visual}s which are temporarily removed from the visual tree. + *

+ * Visuals are temporarily removed when they are moved outside the visual part of the canvas (the {@link yfiles.view.CanvasComponent#viewport}) and re-added when they + * enter the {@link yfiles.view.CanvasComponent#viewport} again. Caching prevents the need to re-build the visuals from scratch. + *

+ *

+ * Visuals are only cached if this property is set to another value than {@link yfiles.view.VisualCachingPolicy#NEVER} and if a + * dispose visual callback is {@link yfiles.view.IRenderContext#setDisposeCallback registered} during {@link yfiles.view.IVisualCreator#createVisual creation}. + *

+ * @type {yfiles.view.VisualCachingPolicy} + */ + visualCaching:yfiles.view.VisualCachingPolicy; + /** + * Adds the given listener for the UpdatedVisual event that occurs after the {@link yfiles.view.CanvasComponent#updateVisual visual tree has been updated}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeUpdatedVisualListener + */ + addUpdatedVisualListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the UpdatedVisual event that occurs after the {@link yfiles.view.CanvasComponent#updateVisual visual tree has been updated}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addUpdatedVisualListener + */ + removeUpdatedVisualListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the UpdatingVisual event. + *
+ * Event that will be triggered before the {@link yfiles.view.CanvasComponent#updateVisual visual tree is updated}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeUpdatingVisualListener + */ + addUpdatingVisualListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the UpdatingVisual event. + *
+ * Event that will be triggered before the {@link yfiles.view.CanvasComponent#updateVisual visual tree is updated}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addUpdatingVisualListener + */ + removeUpdatingVisualListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets the root of the scene graph. + *

+ * This group cannot be {@link yfiles.view.ICanvasObject#remove removed}. + *

+ * @type {yfiles.view.ICanvasObjectGroup} + */ + rootGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets or sets the ContentGroup property. + *

+ * The content group is the {@link yfiles.view.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.view.CanvasComponent#createContentGroup} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addContentGroupChangedListener ContentGroupChanged} + * event will be triggered. + *

+ * @type {yfiles.view.ICanvasObjectGroup} + */ + contentGroup:yfiles.view.ICanvasObjectGroup; + /** + * Adds the given listener for the ContentGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeContentGroupChangedListener + */ + addContentGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the ContentGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#contentGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addContentGroupChangedListener + */ + removeContentGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the HighlightGroup property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createHighlightGroup} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addHighlightGroupChangedListener HighlightGroupChanged} + * event will be triggered. + *

+ * @type {yfiles.view.ICanvasObjectGroup} + */ + highlightGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets or sets the HighlightGroup property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createHighlightGroup} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addHighlightGroupChangedListener HighlightGroupChanged} + * event will be triggered. + *

+ * @type {yfiles.view.ICanvasObjectGroup} + */ + focusGroup:yfiles.view.ICanvasObjectGroup; + /** + * Adds the given listener for the FocusGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#focusGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeFocusGroupChangedListener + */ + addFocusGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the FocusGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#focusGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addFocusGroupChangedListener + */ + removeFocusGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Adds the given listener for the HighlightGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#highlightGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeHighlightGroupChangedListener + */ + addHighlightGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the HighlightGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#highlightGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addHighlightGroupChangedListener + */ + removeHighlightGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the SelectionGroup property. + *

+ * The selection group is the {@link yfiles.view.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.view.CanvasComponent#createSelectionGroup} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addSelectionGroupChangedListener SelectionGroupChanged} + * event will be triggered. + *

+ * @type {yfiles.view.ICanvasObjectGroup} + */ + selectionGroup:yfiles.view.ICanvasObjectGroup; + /** + * Adds the given listener for the SelectionGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#selectionGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeSelectionGroupChangedListener + */ + addSelectionGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the SelectionGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#selectionGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addSelectionGroupChangedListener + */ + removeSelectionGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * 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.view.CanvasComponent#contentGroup}. + *

+ *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.CanvasComponent#createInputModeGroup} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addInputModeGroupChangedListener InputModeGroupChanged} + * event will be triggered. + *

+ * @see yfiles.view.CanvasComponent#contentGroup + * @see yfiles.view.CanvasComponent#backgroundGroup + * @type {yfiles.view.ICanvasObjectGroup} + */ + inputModeGroup:yfiles.view.ICanvasObjectGroup; + /** + * Adds the given listener for the InputModeGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeInputModeGroupChangedListener + */ + addInputModeGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the InputModeGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addInputModeGroupChangedListener + */ + removeInputModeGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the BackgroundGroup property. + *

+ * The background group is the {@link yfiles.view.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.view.CanvasComponent#createBackgroundGroup} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addBackgroundGroupChangedListener BackgroundGroupChanged} + * event will be triggered. + *

+ * @see yfiles.view.CanvasComponent#contentGroup + * @type {yfiles.view.ICanvasObjectGroup} + */ + backgroundGroup:yfiles.view.ICanvasObjectGroup; + /** + * Adds the given listener for the BackgroundGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#backgroundGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeBackgroundGroupChangedListener + */ + addBackgroundGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the BackgroundGroupChanged event that occurs when the {@link yfiles.view.CanvasComponent#backgroundGroup} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addBackgroundGroupChangedListener + */ + removeBackgroundGroupChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * 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. + *

+ * @type {yfiles.view.ShapeRenderingType} + */ + shapeRendering:yfiles.view.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. + *

+ * @type {yfiles.view.ImageRenderingType} + */ + imageRendering:yfiles.view.ImageRenderingType; + /** + * 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.view.CanvasComponent}. + *

+ * 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. + *

+ * @type {HTMLElement} + */ + 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.view.CanvasComponent#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 yfiles.view.CanvasComponent#dragSize + * @default '00:00:00.3000000' + * @type {yfiles.lang.TimeSpan} + */ + dragTime:yfiles.lang.TimeSpan; + /** + * Gets or sets the value of the double click time. + *

+ * This value indicates the amount of time that may pass within which two subsequent mouse clicks are considered multi + * clicks. The higher the value the easier it will be to double-click. The default value is 500 milliseconds. + *

+ * @see yfiles.view.CanvasComponent#doubleClickSize + * @type {yfiles.lang.TimeSpan} + */ + doubleClickTime:yfiles.lang.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 yfiles.view.CanvasComponent#doubleTapSize + * @type {yfiles.lang.TimeSpan} + */ + doubleTapTime:yfiles.lang.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.view.CanvasComponent#dragSize} area. The higher the value the later a touch pointer movement will be recognized as a long press. The + * default value is 250 milliseconds. + *

+ * @see yfiles.view.CanvasComponent#dragSize + * @type {yfiles.lang.TimeSpan} + */ + longPressTime:yfiles.lang.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.view.CanvasComponent#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 yfiles.view.CanvasComponent#dragSize + * @default '5,5' + * @type {yfiles.geometry.Size} + */ + dragSize:yfiles.geometry.Size; + /** + * The area in view coordinates the mouse needs to stay in before multiple clicks are considered multiple single clicks + * instead of multi-clicks. + *

+ * If the mouse stays within this within than {@link yfiles.view.CanvasComponent#doubleClickTime}, multiple clicks will be considered double or multi-clicks. The default + * value is (10, 10). + *

+ * @see yfiles.view.CanvasComponent#doubleClickTime + * @type {yfiles.geometry.Size} + */ + doubleClickSize:yfiles.geometry.Size; + /** + * 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.view.CanvasComponent#doubleTapTime}, multiple taps will be considered double or multi-taps. The default + * value is (20, 20). + *

+ * @see yfiles.view.CanvasComponent#doubleTapTime + * @type {yfiles.geometry.Size} + */ + doubleTapSize:yfiles.geometry.Size; + /** + * Gets or sets the factor by which the zoom level changes when the mouse wheel is turned. + *

+ * The default value is 1.2. + *

+ * @default 1.2 + * @type {number} + */ + mouseWheelZoomFactor:number; + /** + * Adds the given listener for the MouseWheelZoomFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelZoomFactor} property has been + * changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseWheelZoomFactorChangedListener + */ + addMouseWheelZoomFactorChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the MouseWheelZoomFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelZoomFactor} property has + * been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseWheelZoomFactorChangedListener + */ + removeMouseWheelZoomFactorChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets or sets a factor that controls how fast the viewport scrolls when the mouse wheel is turned. + *

+ * Scrolling can work either a few lines at a time (per notch of the scroll wheel) or one page at a time. This is a system + * setting. This property controls how many pixels represent a line if scrolling is done by line. In case scrolling is done + * by page, this property has no effect. + *

+ *

+ * The default value of 5 pixels. To speed up scrolling, set a larger value, to slow down scrolling, set a smaller value. + *

+ * @see yfiles.view.CanvasComponent#mouseWheelZoomFactor + * @see yfiles.view.CanvasComponent#mouseWheelBehavior + * @see yfiles.view.MouseEventArgs#scrollAmount + * @see yfiles.view.MouseEventArgs#deltaMode + * @default 5 + * @type {number} + */ + mouseWheelScrollFactor:number; + /** + * Adds the given listener for the MouseWheelScrollFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelScrollFactor} property has been + * changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeMouseWheelScrollFactorChangedListener + */ + addMouseWheelScrollFactorChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the MouseWheelScrollFactorChanged event that occurs when the value of the {@link yfiles.view.CanvasComponent#mouseWheelScrollFactor} property has + * been changed. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addMouseWheelScrollFactorChangedListener + */ + removeMouseWheelScrollFactorChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):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. + *

+ * @see yfiles.view.CanvasComponent#autoDrag + * @default '10' + * @type {yfiles.geometry.Insets} + */ + autoDragInsets:yfiles.geometry.Insets; + /** + * Adds the given listener for the PrepareRenderContext event. + *
+ * Event that will be triggered before the visual tree is painted to prepare the {@link yfiles.view.IRenderContext}. + * @param {function(Object, yfiles.view.PrepareRenderContextEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removePrepareRenderContextListener + */ + addPrepareRenderContextListener(listener:(sender:Object,evt:yfiles.view.PrepareRenderContextEventArgs)=>void):void; + /** + * Removes the given listener for the PrepareRenderContext event. + *
+ * Event that will be triggered before the visual tree is painted to prepare the {@link yfiles.view.IRenderContext}. + * @param {function(Object, yfiles.view.PrepareRenderContextEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addPrepareRenderContextListener + */ + removePrepareRenderContextListener(listener:(sender:Object,evt:yfiles.view.PrepareRenderContextEventArgs)=>void):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.view.CanvasComponent#createInputModeContext} + * will be called. Upon change the {@link yfiles.view.CanvasComponent#addInputModeChangedListener InputModeChanged} + * event will be triggered. + *

+ * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Adds the given listener for the InputModeContextChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeContext} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#removeInputModeContextChangedListener + */ + addInputModeContextChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the InputModeContextChanged event that occurs when the {@link yfiles.view.CanvasComponent#inputModeContext} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#addInputModeContextChangedListener + */ + removeInputModeContextChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * 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.input.ICommand#INCREASE_ZOOM}
  • + *
  • {@link yfiles.input.ICommand#ZOOM}
  • + *
  • {@link yfiles.input.ICommand#DECREASE_ZOOM}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_UP}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_LEFT}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_RIGHT}
  • + *
+ * @default true + * @type {boolean} + */ + 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. + *

+ * @type {yfiles.collections.IMap.} + */ + resources:yfiles.collections.IMap; + /** + * Gets or sets the interval of the size changed timer. + * @see yfiles.view.CanvasComponent#addSizeChangedListener + * @see yfiles.view.CanvasComponent#sizeChangedDetection + * @static + * @type {number} + */ + static sizeChangedTimerInterval:number; + /** + * Adds the given listener for the SizeChanged event that occurs when the size of this Control is changed. + * @param {function(Object, yfiles.view.SizeChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.CanvasComponent#sizeChangedDetection + * @see yfiles.view.SizeChangedDetectionMode + * @see yfiles.view.CanvasComponent#removeSizeChangedListener + */ + addSizeChangedListener(listener:(sender:Object,evt:yfiles.view.SizeChangedEventArgs)=>void):void; + /** + * Removes the given listener for the SizeChanged event that occurs when the size of this Control is changed. + * @param {function(Object, yfiles.view.SizeChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.CanvasComponent#sizeChangedDetection + * @see yfiles.view.SizeChangedDetectionMode + * @see yfiles.view.CanvasComponent#addSizeChangedListener + */ + removeSizeChangedListener(listener:(sender:Object,evt:yfiles.view.SizeChangedEventArgs)=>void):void; + /** + * Gets or sets how size changes of this {@link yfiles.view.CanvasComponent} will be detected. + *

+ * Since there is no size changed event in HTML, {@link yfiles.view.CanvasComponent} comes with its own methods to detect whether + * the size of its Div element has changed. This is needed to update its Size accordingly. + *

+ *

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

+ *

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

+ * @type {yfiles.view.SizeChangedDetectionMode} + */ + sizeChangedDetection:yfiles.view.SizeChangedDetectionMode; + static $class:yfiles.lang.Class; } /** - * 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{ + * This class sets up an {@link yfiles.view.IRenderContext} object for exporting the contents of a {@link yfiles.view.CanvasComponent} (see + * 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.view.SvgExport#worldBounds}.
  • + *
  • + * The size of the target graphics is controlled by the {@link yfiles.view.SvgExport#scale}. For a given target width or height, the apropriate scale can be + * calculated using {@link yfiles.view.SvgExport#calculateScaleForWidth} and {@link yfiles.view.SvgExport#calculateScaleForHeight}. + *
  • + *
+ * @class yfiles.view.SvgExport + */ + export interface SvgExport extends Object{} + export class SvgExport { /** - * 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; + * Creates a new {@link yfiles.view.SvgExport} instance for the given world bounds and scale. + * @param {yfiles.geometry.Rect} worldBounds the bounds of the content to export, see {@link yfiles.view.SvgExport#worldBounds} + * @param {number} [scale=1.0] the scale, see {@link yfiles.view.SvgExport#scale} + * @constructor + */ + constructor(worldBounds:yfiles.geometry.Rect,scale?:number); /** - * 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; + * Calculates the value to set the {@link yfiles.view.SvgExport#scale} to in order to achieve the given target height (without {@link yfiles.view.SvgExport#margin}). + * @param {number} height the height of the target image + * @returns {number} the scale value to use + */ + calculateScaleForHeight(height:number):number; /** - * 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; + * Calculates the value to set the {@link yfiles.view.SvgExport#scale} to in order to achieve the given target width (without {@link yfiles.view.SvgExport#margin}). + * @param {number} width the width of the target image + * @returns {number} the scale value to use + */ + calculateScaleForWidth(width:number):number; /** - * 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; + * Returns an initialized {@link yfiles.view.IRenderContext} and changes the given transform and the clip bounds such that a part + * of the given {@link yfiles.view.CanvasComponent} instance can be exported to an image. + * @param {yfiles.view.CanvasComponent} canvas The {@link yfiles.view.CanvasComponent} instance to export. + * @returns {yfiles.view.IRenderContext} An {@link yfiles.view.IRenderContext} to use. + */ + createRenderContext(canvas:yfiles.view.CanvasComponent):yfiles.view.IRenderContext; /** - * 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; + * 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. + * @returns {string} A data URI of the SVG document. + * @static + */ + static encodeSvgDataUrl(svgXml:string):string; /** - * 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; + * Exports the contents of the {@link yfiles.view.CanvasComponent} to a single, standalone SVG element. + *

+ * The asynchronous version of this method, + * {@link yfiles.view.SvgExport#exportSvgAsync}, is capable of encoding and inlining images that are embedded in the SVG. + *

+ * @param {yfiles.view.CanvasComponent} canvas The canvas to be exported. + * @returns {Element} An SVG element with the canvas contents. + */ + exportSvg(canvas:yfiles.view.CanvasComponent):Element; /** - * 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; + * Exports the contents of the {@link yfiles.view.CanvasComponent} to a single, standalone SVG element. + *

+ * In addition, images are inlined into the SVG using base64 encoding if {@link yfiles.view.SvgExport#encodeImagesBase64} is set to true. Image inlining can be controlled + * for each image individually by overwriting the predicate method {@link yfiles.view.SvgExport#shouldEncodeImageBase64}. + *

+ *

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

+ * @param {yfiles.view.CanvasComponent} canvas The canvas to be exported. + * @returns {Promise.} + */ + exportSvgAsync(canvas:yfiles.view.CanvasComponent):Promise; /** - * 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; + * 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. + * @returns {string} A string representation of the SVG. + * @static + */ + static exportSvgString(svg:Element):string; /** - * 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; + * Returns a suitable clip to use for the visual for this exporter. + * @returns {yfiles.geometry.Rect} The clip. + */ + getClip():yfiles.geometry.Rect; /** - * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. - * This implementation does nothing. - */ + * 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. + * @returns {Element} The element that's actually placed in the DOM as a replacement of the originalImage. + * @see yfiles.view.SvgExport#inlineSvgImages + * @see yfiles.view.SvgExport#exportSvgAsync + * @see yfiles.view.SvgExport#shouldInlineSvgImage + * @protected + */ + prepareInlinedImage(importedSvg:Element,originalImage:SVGImageElement):Element; + /** + * Specifies whether or not an image should be encoded to base64. + *

+ * This implementation returns the value of {@link yfiles.view.SvgExport#encodeImagesBase64} for all values of image. + *

+ * @param {SVGImageElement} image The image to be encoded. + * @returns {boolean} Whether the given image should be encoded. + * @protected + */ + shouldEncodeImageBase64(image:SVGImageElement):boolean; + /** + * Specifies whether or not an SVG image should be inlined. + *

+ * This implementation returns the value of {@link yfiles.view.SvgExport#inlineSvgImages} for all values of image. + *

+ * @param {SVGImageElement} image The image to be inlined. + * @returns {boolean} Whether the given image should be inlined. + * @protected + */ + shouldInlineSvgImage(image:SVGImageElement):boolean; + /** + * Gets or sets the bounds of the content to export in world coordinates. + * @type {yfiles.geometry.Rect} + */ + worldBounds:yfiles.geometry.Rect; + /** + * 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 + *

+ * @type {number} + */ + scale:number; + /** + * Gets or sets the {@link yfiles.view.ICanvasContext#zoom} property to use during the creation of the visualization. + *

+ * In contrast to the {@link yfiles.view.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 + *

+ * @type {number} + */ + 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.view.SvgExport#worldBounds} even if the {@link yfiles.view.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. + *

+ * @type {yfiles.geometry.Insets} + */ + margin:yfiles.geometry.Insets; + /** + * Gets the resulting width of the target image with respect to {@link yfiles.view.SvgExport#worldBounds}, {@link yfiles.view.SvgExport#scale} and {@link yfiles.view.SvgExport#margin}. + * @type {number} + */ + viewWidth:number; + /** + * Gets the resulting height of the target image with respect to {@link yfiles.view.SvgExport#worldBounds}, {@link yfiles.view.SvgExport#scale} and {@link yfiles.view.SvgExport#margin}. + * @type {number} + */ + viewHeight:number; + /** + * Determines whether children of the {@link yfiles.view.CanvasComponent}'s defs section that aren't known to the {@link yfiles.view.SvgDefsManager} + * should be copied to the exported SVG. + * @type {boolean} + */ + copyDefsElements:boolean; + /** + * Determines whether all images are encoded to Base64 in {@link yfiles.view.SvgExport#exportSvgAsync}. + *

+ * Override {@link yfiles.view.SvgExport#shouldEncodeImageBase64} to control the encoding for each image separately. + *

+ * @see yfiles.view.SvgExport#exportSvgAsync + * @see yfiles.view.SvgExport#shouldEncodeImageBase64 + * @type {boolean} + */ + encodeImagesBase64:boolean; + /** + * Determines whether all SVG images should be inlined in the SVG element in {@link yfiles.view.SvgExport#exportSvgAsync}. + *

+ * Override {@link yfiles.view.SvgExport#shouldInlineSvgImage} to control the inlining for each image separately. + *

+ * @see yfiles.view.SvgExport#exportSvgAsync + * @see yfiles.view.SvgExport#shouldInlineSvgImage + * @type {boolean} + */ + inlineSvgImages:boolean; + static $class:yfiles.lang.Class; + } + /** + * Helper class for {@link yfiles.view.CanvasComponent} that manages the defs section of the SVG document. + *

+ * This class is used internally by {@link yfiles.view.CanvasComponent} and operates on instances of {@link yfiles.view.ISvgDefsCreator}. + *

+ * @see yfiles.view.CanvasComponent#svgDefsManager + * @class yfiles.view.SvgDefsManager + */ + export interface SvgDefsManager extends Object{} + export class SvgDefsManager { + /** + * Initializes a new instance of the {@link yfiles.view.SvgDefsManager} class. + * @param {SVGDefsElement} defsElement The defs element of the svg document that will be managed by this instance. + * @constructor + */ + constructor(defsElement:SVGDefsElement); + /** + * Triggers the clean up for svg defs on the provided control. + * @param {yfiles.view.CanvasComponent} canvas + */ + cleanupDefs(canvas:yfiles.view.CanvasComponent):void; + /** + * Generates an id that is globally unique among all {@link yfiles.view.SvgDefsManager} instances. + *

+ * This id should be used for the "id" attribute of DOM nodes. + *

+ * @returns {string} A globally unique id. + */ + generateUniqueDefsId():string; + /** + * Gets or sets the interval for the timer to trigger the cleanup event. + *

+ * By default this is 10 seconds. + *

+ * @type {yfiles.lang.TimeSpan} + */ + cleanupTimerInterval:yfiles.lang.TimeSpan; + /** + * Gets or sets the prefix to use for the {@link yfiles.view.SvgDefsManager#generateUniqueDefsId unique ids}. + *

+ * By default this is ygc<number> + *

+ * @type {string} + */ + customPrefix:string; + /** + * Yields the defs element this instance is managing. + * @type {SVGDefsElement} + */ + defs:SVGDefsElement; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.input.IGridConstraintProvider. + * @class yfiles.view.GridInfo + */ + export interface GridInfo extends Object{} + export class 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.Point} origin The canonic origin of the grid. + * @constructor + */ + constructor(horizontalSpacing:number,verticalSpacing:number,origin:yfiles.geometry.Point); + /** + * Creates a new instance using "25" as the grid spacing. + * @param {number} [spacing=25] The horizontal and vertical spacing between the grid points. + * @constructor + */ + constructor(spacing?:number); + /** + * Gets or sets the horizontal spacing between grid points in the world coordinate system. + * @default 25 + * @type {number} + */ + horizontalSpacing:number; + /** + * Gets or sets the vertical spacing between grid points in the world coordinate system. + * @default 25 + * @type {number} + */ + verticalSpacing:number; + /** + * Gets or sets the canonic origin of the grid. + * @default '0,0' + * @type {yfiles.geometry.Point} + */ + origin:yfiles.geometry.Point; + static $class:yfiles.lang.Class; + } + /** + * This interface describes the context for many operations performed on items in a {@link yfiles.view.ICanvasContext#canvasComponent}. + *

+ * This interface extends the {@link yfiles.graph.ILookup} interface to provide {@link yfiles.graph.ILookup#lookup dynamic lookup capability}. + *

+ * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface ICanvasContext extends Object,yfiles.graph.ILookup{ + /** + * Adds an element to the defs section of the document, if it has not been added yet. + * @param {yfiles.view.ISvgDefsCreator} defsSupport The instance that is used to create and update the element and to query if the element is still referenced + * @returns {string} The id of the element with which it can be referenced using an url reference. + * @abstract + */ + getDefsId(defsSupport:yfiles.view.ISvgDefsCreator):string; + /** + * Returns the current zoom level that is the ratio of world coordinates to screen pixels. + * @abstract + * @type {number} + */ + zoom:number; + /** + * The radius for hit tests and marquee selection tests in world coordinates. + *

+ * This value already takes the zoom level into account. + *

+ * @abstract + * @type {number} + */ + hitTestRadius:number; + /** + * Yields the Canvas that is associated with this context. + *

+ * This value may be null in those cases where no control can be associated with the current context. + *

+ * @abstract + * @type {yfiles.view.CanvasComponent} + */ + canvasComponent:yfiles.view.CanvasComponent; + } + var ICanvasContext:{ + /** + * Provides a default immutable {@link yfiles.view.ICanvasContext} with the given values. + *

+ * If the values for zoom or hitTestRadius are not specified, the values will be obtained from the given canvas. + *

+ * @param {yfiles.view.CanvasComponent} canvas the canvas + * @param {number} [zoom=0] the zoom level + * @param {number} [hitTestRadius=-1] the hit test radius + * @returns {yfiles.view.ICanvasContext} + * @static + */ + createCanvasContext?(canvas:yfiles.view.CanvasComponent,zoom?:number,hitTestRadius?:number):yfiles.view.ICanvasContext; + /** + * Provides a default immutable {@link yfiles.view.ICanvasContext} with the given values. + *

+ * If the values for zoom or hitTestRadius are not specified, the values will be obtained from the given canvas. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.CanvasComponent} options.canvas the canvas + * @param {number} [options.zoom=0] the zoom level + * @param {number} [options.hitTestRadius=-1] the hit test radius + * @returns {yfiles.view.ICanvasContext} + * @static + */ + createCanvasContext?(options:{canvas:yfiles.view.CanvasComponent,zoom?:number,hitTestRadius?:number}):yfiles.view.ICanvasContext; + /** + * Provides a default immutable context with a hit radius of 3 and a zoom level of 1. + * @const + * @static + * @type {yfiles.view.ICanvasContext} + */ + DEFAULT?:yfiles.view.ICanvasContext; + $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.view.CanvasComponent}. + *

+ * 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. + *

+ * @interface + */ + export interface ICanvasObject extends Object{ + /** + * Moves this instance exactly behind the reference item in the referenced item's group rendering list, so that it will be + * rendered directly above the given reference. + *

+ * This method returns the current instance so that calls can be chained, e.g. object.Above(other).Raise(). + *

+ *

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

+ * @param {yfiles.view.ICanvasObject} reference + * @returns {yfiles.view.ICanvasObject} this so that calls can be chained. + * @abstract + */ + above(reference:yfiles.view.ICanvasObject):yfiles.view.ICanvasObject; + /** + * Moves this instance exactly before the reference item in the referenced item's group rendering list, so that it will be + * rendered directly behind the given reference. + *

+ * This method returns the current instance so that calls can be chained, e.g. object.Below(other).Lower(). + *

+ *

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

+ * @param {yfiles.view.ICanvasObject} reference + * @returns {yfiles.view.ICanvasObject} this so that calls can be chained. + * @abstract + */ + below(reference:yfiles.view.ICanvasObject):yfiles.view.ICanvasObject; + /** + * Moves this instance one step closer to the beginning of the group rendering list, so that it will be rendered 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() + *

+ * @returns {yfiles.view.ICanvasObject} this so that calls can be chained. + * @abstract + */ + lower():yfiles.view.ICanvasObject; + /** + * Moves this instance one step closer to the end of the group rendering list, so that it will be rendered 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() + *

+ * @returns {yfiles.view.ICanvasObject} this so that calls can be chained. + * @abstract + */ + raise():yfiles.view.ICanvasObject; + /** + * Removes this item from the scene graph it currently belongs to. + * @abstract + */ + remove():void; + /** + * Moves this instance to the beginning of the group rendering list, so that it will be rendered 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() + *

+ * @returns {yfiles.view.ICanvasObject} this so that calls can be chained. + * @abstract + */ + toBack():yfiles.view.ICanvasObject; + /** + * Moves this instance to the end of the group rendering list, so that it will be rendered 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() + *

+ * @returns {yfiles.view.ICanvasObject} this so that calls can be chained. + * @abstract + */ + toFront():yfiles.view.ICanvasObject; + /** + * Gets or sets the visibility state of this instance. + *

+ * If an ICanvasObject is not visible, it will not be considered for hit tests. + *

+ * @abstract + * @type {boolean} + */ + visible:boolean; + /** + * Gets or sets a flag that indicates whether {@link yfiles.view.ICanvasObject} needs to be updated during the next call to + * {@link yfiles.view.CanvasComponent#invalidate}. + *

+ * Note that it is up to the implementation of the {@link yfiles.view.ICanvasObjectDescriptor} to determine the actual dirty state + * of this instance. {@link yfiles.view.ICanvasObjectDescriptor#isDirty} can use any strategy to indicate dirtiness. The {@link yfiles.view.CanvasComponent} + * will reset this flag during {@link yfiles.view.CanvasComponent#invalidate} to false if the visual is created or updated. + *

+ * @abstract + * @type {boolean} + */ + dirty:boolean; + /** + * Gets or sets the parent group of this instance. + * @abstract + * @type {yfiles.view.ICanvasObjectGroup} + */ + group:yfiles.view.ICanvasObjectGroup; + /** + * Gets or sets the user object associated with this instance. + *

+ * The user object will be used by the {@link yfiles.view.ICanvasObject#descriptor} during rendering, hit testing, and bounds calculation + *

+ * @abstract + * @type {Object} + */ + userObject:Object; + /** + * Gets or sets the descriptor instance that interprets the {@link yfiles.view.ICanvasObject#userObject} during rendering, hit testing, and bounds calculation. + * @abstract + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + descriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets the next item in the list of rendered items that is owned by this element's {@link yfiles.view.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. + *

+ * @returns null if this item is last in the rendering list of its group or the next item otherwise. + * @abstract + * @type {yfiles.view.ICanvasObject} + */ + nextSibling:yfiles.view.ICanvasObject; + /** + * Gets the previous item in the list of rendered items that is owned by this element's {@link yfiles.view.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. + *

+ * @returns null if this item is first in the rendering list of its group or the previous item otherwise. + * @abstract + * @type {yfiles.view.ICanvasObject} + */ + previousSibling:yfiles.view.ICanvasObject; + } + var ICanvasObject:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Central interface used by the {@link yfiles.view.CanvasComponent} to render elements from the scene graph. + *

+ * Implementations will be queried using the user object obtained from {@link yfiles.view.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 {@link yfiles.view.ICanvasObjectGroup}'s {@link yfiles.view.ICanvasObjectGroup#addChild} method. + *

+ * @interface + */ + export interface ICanvasObjectDescriptor extends Object{ + /** + * Returns an implementation of {@link yfiles.view.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 + * @returns {yfiles.view.IBoundsProvider} an implementation or null if the bounds are not known, in which case the bounds are treated as infinite + * @abstract + */ + getBoundsProvider(forUserObject:Object):yfiles.view.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.input.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 + * @returns {yfiles.input.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @abstract + */ + getHitTestable(forUserObject:Object):yfiles.input.IHitTestable; + /** + * Returns an implementation of {@link yfiles.view.IVisibilityTestable} 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 + * @returns {yfiles.view.IVisibilityTestable} an implementation or null if the bounds are not known, in which case the bounds are treated as infinite + * @abstract + */ + getVisibilityTestable(forUserObject:Object):yfiles.view.IVisibilityTestable; + /** + * Returns an implementation of {@link yfiles.view.IVisualCreator} that will create the {@link yfiles.view.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 + * @returns {yfiles.view.IVisualCreator} an implementation or null if nothing shall be rendered + * @abstract + */ + getVisualCreator(forUserObject:Object):yfiles.view.IVisualCreator; + /** + * Determines whether the given canvas object is deemed dirty and needs updating. + * @param {yfiles.view.ICanvasContext} context The context that will be used for the update. + * @param {yfiles.view.ICanvasObject} canvasObject The object to check. + * @returns {boolean} Whether an update is needed. + * @abstract + */ + isDirty(context:yfiles.view.ICanvasContext,canvasObject:yfiles.view.ICanvasObject):boolean; + } + var ICanvasObjectDescriptor:{ + /** + * An implementation that returns an {@link yfiles.view.ICanvasObjectDescriptor} that does nothing. + * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + VOID?:yfiles.view.ICanvasObjectDescriptor; + /** + * An implementation that tries to cast the user object to the required interface. + *

+ * This implementation will respect the {@link yfiles.view.ICanvasObject#dirty} flag. + *

+ * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + DYNAMIC_DIRTY_INSTANCE?:yfiles.view.ICanvasObjectDescriptor; + /** + * An implementation that tries to cast the user object to the required interface. + *

+ * This implementation will treat always {@link yfiles.view.IVisualCreator#updateVisual update the Visual} and will effectively ignore the {@link yfiles.view.ICanvasObject#dirty} flag. + *

+ * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + ALWAYS_DIRTY_INSTANCE?:yfiles.view.ICanvasObjectDescriptor; + /** + * An implementation that tries to lookup the instance from the user object if it is an {@link yfiles.graph.ILookup}. + *

+ * This implementation will respect the {@link yfiles.view.ICanvasObject#dirty} flag. + *

+ * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + DYNAMIC_DIRTY_LOOKUP?:yfiles.view.ICanvasObjectDescriptor; + /** + * An implementation that tries to lookup the instance from the user object if it is an {@link yfiles.graph.ILookup}. + *

+ * This implementation will treat always {@link yfiles.view.IVisualCreator#updateVisual update the Visual} and will effectively ignore the {@link yfiles.view.ICanvasObject#dirty} flag. + *

+ * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + ALWAYS_DIRTY_LOOKUP?:yfiles.view.ICanvasObjectDescriptor; + /** + * An implementation that will cast the {@link yfiles.view.ICanvasObject#userObject} to {@link yfiles.view.ICanvasObjectDescriptor#VISUAL} and use that to insert into the + * scene graph. + * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + VISUAL?:yfiles.view.ICanvasObjectDescriptor; + $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.view.CanvasComponent}. + *

+ * It is meant to group multiple {@link yfiles.view.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.collections.IListEnumerable.} interface to allow for easy iteration and determination of the size of + * the group. + *

+ * @interface + * @implements {yfiles.view.ICanvasObject} + * @implements {yfiles.collections.IListEnumerable.} + */ + export interface ICanvasObjectGroup extends Object,yfiles.view.ICanvasObject,yfiles.collections.IListEnumerable{ + /** + * Adds a child element to the scene graph as a child of this group. + *

+ * The descriptor will be queried for the various rendering related implementations for the given userObject at rendering + * time. + *

+ * @param {Object} userObject The user object to associate with this child element. This object will be passed to the descriptor's methods. + * @param {yfiles.view.ICanvasObjectDescriptor} descriptor An implementation of the {@link yfiles.view.ICanvasObjectDescriptor} interface that will be passed the userObject to provide the + * various implementations that are used during rendering. + * @returns {yfiles.view.ICanvasObject} A handle that can be used to control the rendering order and to later {@link yfiles.view.ICanvasObject#remove remove} the element from the scene graph, again. + * @see yfiles.view.ICanvasObjectDescriptor + * @see yfiles.view.ICanvasObjectDescriptor#DYNAMIC_DIRTY_INSTANCE + * @abstract + */ + addChild(userObject:Object,descriptor:yfiles.view.ICanvasObjectDescriptor):yfiles.view.ICanvasObject; + /** + * Adds a new {@link yfiles.view.ICanvasObjectGroup} to this group in the current scene graph. + *

+ * This can be used to build groups of {@link yfiles.view.ICanvasObject} instances that can be moved within the scene graph or + * whose {@link yfiles.view.ICanvasObject#visible visibility} can be controlled easily. The group will have a null {@link yfiles.view.ICanvasObject#userObject}. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} A handle to the newly created group that can be used to control the rendering order and to later {@link yfiles.view.ICanvasObject#remove remove} the group from + * the scene graph, again. + * @abstract + */ + addGroup():yfiles.view.ICanvasObjectGroup; + /** + * 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. In order to + * iterate over all immediate children, use the following idiom: + *

+ * @see yfiles.collections.IListEnumerable. + * @see yfiles.collections.IEnumerable.#getEnumerator + * @abstract + * @type {yfiles.view.ICanvasObject} + */ + firstChild:yfiles.view.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. In order to iterate over all immediate children in + * reverse order, use the following idiom: + *

+ * @abstract + * @type {yfiles.view.ICanvasObject} + */ + lastChild:yfiles.view.ICanvasObject; + } + var ICanvasObjectGroup:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A container that can hold a number of {@link yfiles.view.SvgVisual}s. + *

+ * Use this class in a {@link yfiles.view.IVisualCreator} implementation to group several {@link yfiles.view.SvgVisual}s. + *

+ *

+ * The class cannot be used to group {@link yfiles.view.HtmlCanvasVisual}s. + *

+ * @class yfiles.view.SvgVisualGroup + * @extends {yfiles.view.SvgVisual} + */ + export interface SvgVisualGroup extends yfiles.view.SvgVisual{} + export class SvgVisualGroup { + /** + * Initializes a new instance of the {@link yfiles.view.SvgVisualGroup} class. + * @constructor + */ + constructor(); + /** + * Adds another {@link yfiles.view.SvgVisual} to the children collection of this instance. + * @param {yfiles.view.SvgVisual} child The child to add. + */ + add(child:yfiles.view.SvgVisual):void; + /** + * Removes a previously added {@link yfiles.view.SvgVisual} from the children collection of this instance. + * @param {yfiles.view.SvgVisual} child The child to remove. + */ + remove(child:yfiles.view.SvgVisual):void; + /** + * Gets or sets a transform that is applied to the children of the container. + * @type {yfiles.geometry.Matrix} + */ + transform:yfiles.geometry.Matrix; + /** + * Provides read and write access to the list of children. + * @type {yfiles.collections.IList.} + */ + children:yfiles.collections.IList; + static $class:yfiles.lang.Class; + } + /** + * Helper class used by {@link yfiles.view.CanvasComponent} to limit the interactive movement of the viewport. + *

+ * The {@link yfiles.view.CanvasComponent#viewportLimiter} instance should be consulted whenever the user tries to change the viewport. Using method {@link yfiles.view.ViewportLimiter#limitViewport} + * the desired viewport can be validated by the implementation. Note that setting the {@link yfiles.view.CanvasComponent#zoom} property or {@link yfiles.view.CanvasComponent#viewPoint} property will not be + * influenced by implementations of this class. It is up to the caller to perform verification. + *

+ * @see yfiles.view.ViewportLimiter#bounds + * @class yfiles.view.ViewportLimiter + */ + export interface ViewportLimiter extends Object{} + export class ViewportLimiter { + /** + * Initializes a new instance of the {@link yfiles.view.ViewportLimiter} class. + * @constructor + */ + constructor(); + /** + * Gets the to bounds that should be honored for the upcoming call. + *

+ * This method is used as callback by {@link yfiles.view.ViewportLimiter#limitViewport} for each request. The default + * implementation just yields {@link yfiles.view.ViewportLimiter#bounds}. + *

+ * @param {yfiles.view.CanvasComponent} canvas The canvas control. + * @param {yfiles.geometry.Rect} suggestedViewport The suggested viewport. + * @returns {yfiles.geometry.Rect} The bounds to honor or null. + * @protected + */ + getCurrentBounds(canvas:yfiles.view.CanvasComponent,suggestedViewport:yfiles.geometry.Rect):yfiles.geometry.Rect; + /** + * Inspects the desired or suggested new viewport for the given control and returns a valid viewport to use. + * @param {yfiles.view.CanvasComponent} canvas The canvas control on which the viewport should be applied. + * @param {yfiles.geometry.Rect} suggestedViewport The suggested viewport. + * @returns {yfiles.geometry.Rect} The viewport that should be used. + */ + limitViewport(canvas:yfiles.view.CanvasComponent,suggestedViewport:yfiles.geometry.Rect):yfiles.geometry.Rect; + /** + * Gets or sets a value indicating whether both dimensions of {@link yfiles.view.ViewportLimiter#bounds} need to be honored. + * @default true + * @type {boolean} + */ + honorBothDimensions:boolean; + /** + * Gets or sets the maximal allowed navigable bounds for the viewport. + * @type {yfiles.geometry.Rect} + */ + bounds:yfiles.geometry.Rect; + static $class:yfiles.lang.Class; + } + /** + * Runs {@link yfiles.view.IAnimation animations} in a {@link yfiles.view.CanvasComponent}. + *

+ * For running {@link yfiles.view.IAnimation} instances the method {@link yfiles.view.Animator#animate} can be used. For simpler cases of + * custom animations there are also overloads that take an animation callback. + *

+ * @see yfiles.view.IAnimation + * @class yfiles.view.Animator + */ + export interface Animator extends Object{} + export class Animator { + /** + * Initializes a new instance of the {@link yfiles.view.Animator} class for the given {@link yfiles.view.CanvasComponent}. + *

+ * Using this constructor this instance will query an instance of {@link yfiles.input.WaitInputMode} from the {@link yfiles.view.CanvasComponent#lookup canvas's context} to + * automatically set the {@link yfiles.input.WaitInputMode#waiting} property during animations if {@link yfiles.view.Animator#allowUserInteraction} is set to false. The animation is not started until {@link yfiles.view.Animator#animate} + * or {@link yfiles.view.Animator#animate} is called. + *

+ * @param {yfiles.view.CanvasComponent} canvas The canvas control. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent); + /** + * Initializes a new instance of the {@link yfiles.view.Animator} class for the given {@link yfiles.view.CanvasComponent}. + *

+ * Using this constructor this instance will query an instance of {@link yfiles.input.WaitInputMode} from the {@link yfiles.view.CanvasComponent#lookup canvas's context} to + * automatically set the {@link yfiles.input.WaitInputMode#waiting} property during animations if {@link yfiles.view.Animator#allowUserInteraction} is set to false. The animation is not started until {@link yfiles.view.Animator#animate} + * or {@link yfiles.view.Animator#animate} is called. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.CanvasComponent} options.canvas The canvas control. + * @param {boolean} options.allowUserInteraction Determines whether user interaction should be allowed during the animation. + *

+ * This option sets the {@link yfiles.view.Animator#allowUserInteraction} property on the created object. + *

+ * @param {boolean} options.autoInvalidation A value indicating whether to automatically {@link yfiles.view.Animator#invalidateComponent invalidate the control} this instance has been created for. + *

+ * This option sets the {@link yfiles.view.Animator#autoInvalidation} property on the created object. + *

+ * @constructor + */ + constructor(options:{canvas:yfiles.view.CanvasComponent,allowUserInteraction?:boolean,autoInvalidation?:boolean}); + /** + * Animates the given animation instance and triggers the callback upon completion. + * @param {yfiles.view.IAnimation} animation The animation to perform. + * @returns {Promise.} + */ + animate(animation:yfiles.view.IAnimation):Promise; + /** + * Starts animating the given animation for the specified duration. + * @param {function(number): void} callback The callback to use for the animation. + * @param {yfiles.lang.TimeSpan} duration The duration in milliseconds that the animation should last. + * @returns {Promise.} + */ + animate(callback:(time:number)=>void,duration:yfiles.lang.TimeSpan):Promise; + /** + * Stops all running animations. + */ + destroy():void; + /** + * Invalidates the control if {@link yfiles.view.Animator#autoInvalidation} is set to true. + *

+ * This implementation calls {@link yfiles.view.CanvasComponent#updateVisual }. + *

+ * @param {yfiles.view.CanvasComponent} canvas The control. + * @protected + */ + invalidateComponent(canvas:yfiles.view.CanvasComponent):void; + /** + * Determines whether user interaction should be allowed during the animation. + *

+ * If false, the {@link yfiles.input.WaitInputMode} is queried from the {@link yfiles.view.CanvasComponent} and {@link yfiles.input.WaitInputMode#waiting} is enabled during the + * animation. The default is false. + *

+ * @type {boolean} + */ + allowUserInteraction:boolean; + /** + * The control the animations are run on. + * @type {yfiles.view.CanvasComponent} + */ + canvasComponent:yfiles.view.CanvasComponent; + /** + * Gets or sets a value indicating whether to automatically {@link yfiles.view.Animator#invalidateComponent invalidate the control} this instance has been created for. + *

+ * The default is true. + *

+ * @type {boolean} + */ + autoInvalidation:boolean; + static $class:yfiles.lang.Class; + } + /** + * An interface for animations that can be run by {@link yfiles.view.Animator}. + *

+ * 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.view.IAnimation#initialize}.
  • + *
  • + * To change the state of the animated object a client does a series of calls to + * {@link yfiles.view.IAnimation#animate}, usually with an increasing relative time parameter. + *
  • + *
  • If the animation is done, the client calls {@link yfiles.view.IAnimation#cleanup} once.
  • + *
  • + * While {@link yfiles.view.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.view.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.view.IAnimation#preferredDuration} and try to find a suitable sequence of {@link yfiles.view.IAnimation#animate} + * calls in order to fulfill the preference. + *
  • + *
+ * @interface + */ + export interface IAnimation extends Object{ + /** + * 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] + * @abstract + */ + animate(time:number):void; + /** + * Cleans up after an animation has finished. + * @abstract + */ + cleanup():void; + /** + * Creates an eased animation for the given base animation. + *

+ * The animation speed linearly increases upto a easeIn and linearly decreases from + * easeOut. Between those two points, the animation speed is constant. + *

+ *

+ * 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. + *

+ * @param {number} [easeIn=0.5] The ratio for the ease-in time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. + * @param {number} [easeOut=0.5] The ratio for the ease-out time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. + * @returns {yfiles.view.IAnimation} + */ + createEasedAnimation?(easeIn?:number,easeOut?:number):yfiles.view.IAnimation; + /** + * Creates an eased animation for the given base animation. + *

+ * The animation speed linearly increases upto a easeIn and linearly decreases from + * easeOut. Between those two points, the animation speed is constant. + *

+ *

+ * 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. + *

+ * @param {Object} options The parameters to pass. + * @param {number} [options.easeIn=0.5] The ratio for the ease-in time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. + * @param {number} [options.easeOut=0.5] The ratio for the ease-out time [0,1] where 0 is the start of the animation and 1 the end. 0.5 is the default value. + * @returns {yfiles.view.IAnimation} + */ + createEasedAnimation?(options:{easeIn?:number,easeOut?:number}):yfiles.view.IAnimation; + /** + * Initializes the animation. + *

+ * Call this method once before subsequent calls to {@link yfiles.view.IAnimation#animate}. + *

+ * @abstract + */ + initialize():void; + /** + * Gets the preferred duration of the animation. + * @abstract + * @type {yfiles.lang.TimeSpan} + */ + preferredDuration:yfiles.lang.TimeSpan; + } + var IAnimation:{ + /** + * Creates a new {@link yfiles.view.IAnimation} that animates the given edge's bends from its current shape linearly to the shape + * given by the endBends and final port locations. + *

+ * The bends of the edge layout are animated from their current location to their target locations. 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. The number of bends in endBends can be different to the current number of + * bends. This will result in the animation automatically removing bends at the end of the animation or inserting new bends + * accordingly at the beginning of the animation. + *

+ *

+ * The source and target points are also animated to new locations. However, the ports will not be moved by this animation. + * Instead a separate {@link yfiles.view.IAnimation#createPortAnimation animation for the ports} is needed to actually move + * {@link yfiles.graph.IPort}s at the ends of the edge if desired. + *

+ * @param {yfiles.graph.IGraph} graph The graph the animated edge belongs to. + * @param {yfiles.graph.IEdge} edge The edge layout to animate. + * @param {Array.} endBends The bend positions after the animation. + * @param {yfiles.geometry.Point} endSourceLocation The absolute position of the source port after the animation. + * @param {yfiles.geometry.Point} endTargetLocation The absolute position of the target port after the animation. + * @param {yfiles.lang.TimeSpan} preferredDuration The preferred duration of the animation in milliseconds. + * @returns {yfiles.view.IAnimation} + * @static + */ + createEdgeSegmentAnimation?(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,endBends:yfiles.geometry.IPoint[],endSourceLocation:yfiles.geometry.Point,endTargetLocation:yfiles.geometry.Point,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates a new {@link yfiles.view.IAnimation} that animates the given layout of all types of graph items. + * @param {yfiles.graph.IGraph} graph The graph for which the layout should be animated. + * @param {yfiles.collections.IMapper.} targetNodeLayouts The node layouts after the animation. + * @param {yfiles.collections.IMapper.>} targetBendLocations 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.collections.IMapper.} targetLayoutParameters The label model parameters for each label after the animation. + * @param {yfiles.collections.IMapper.} targetPortLocations The {@link yfiles.graph.IPortLocationModelParameter}s for each {@link yfiles.graph.IPort} in the graph that will be morphed. + * @param {yfiles.lang.TimeSpan} preferredDuration The preferred duration of the animation in milliseconds. + * @returns {yfiles.view.IAnimation} + * @static + */ + createGraphAnimation?(graph:yfiles.graph.IGraph,targetNodeLayouts:yfiles.collections.IMapper,targetBendLocations:yfiles.collections.IMapper,targetPortLocations:yfiles.collections.IMapper,targetLayoutParameters:yfiles.collections.IMapper,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates a new {@link yfiles.view.IAnimation} that animates the given label from its current layout linearly to the layout given + * by the targetLayoutParameter. + *

+ * This animation will as a side effect assign the targetLayoutParameter to the label at the {@link Root.TI#cleanup end of the animation}. + *

+ * @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} targetLayoutParameter The target parameter of the label. + * @param {yfiles.lang.TimeSpan} preferredDuration The preferred duration of the animation. + * @returns {yfiles.view.IAnimation} A new instance of {@link yfiles.view.IAnimation}. + * @static + */ + createLabelAnimation?(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel,targetLayoutParameter:yfiles.graph.ILabelModelParameter,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates a new {@link yfiles.view.IAnimation} instance that animates the current graph to the layout given by a {@link yfiles.layout.CopiedLayoutGraph} + * instance. + *

+ * The returned instance is suitable for morphing an {@link yfiles.graph.IGraph} to a layout computed by one of the layout + * algorithms. + *

+ *

+ * While it is usually recommended to use {@link yfiles.layout.LayoutExecutor} to handle layout calculation and subsequent + * animation, the {@link yfiles.view.IAnimation} produced by this method can be used manually, as well: + *

+ * @param {yfiles.graph.IGraph} graph the graph for which the layout should be animated + * @param {yfiles.layout.CopiedLayoutGraph} layoutGraph the {@link yfiles.layout.CopiedLayoutGraph} that contains all target layout information + * @param {yfiles.lang.TimeSpan} preferredDuration the preferred duration of the animation + * @returns {yfiles.view.IAnimation} + * @static + */ + createLayoutAnimation?(graph:yfiles.graph.IGraph,layoutGraph:yfiles.layout.CopiedLayoutGraph,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates a new {@link yfiles.view.IAnimation} that animates the given node from its current layout to the new given + * targetLayout. + * @param {yfiles.graph.IGraph} graph The graph the animated node belongs to. + * @param {yfiles.graph.INode} node The node whose {@link yfiles.graph.INode#layout} to animate. + * @param {yfiles.geometry.IRectangle} targetLayout The expected node layout after the animation. + * @param {yfiles.lang.TimeSpan} preferredDuration The preferred duration of the animation. + * @returns {yfiles.view.IAnimation} A new instance of {@link yfiles.view.IAnimation}. + * @static + */ + createNodeAnimation?(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,targetLayout:yfiles.geometry.IRectangle,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates an {@link yfiles.view.IAnimation} according to the composite design pattern that animates multiple animations in + * parallel. + *

+ * The animations can be synchronized to the longest running animation. + *

+ * @param {yfiles.collections.IEnumerable.} animations The animations to run in parallel. + * @param {boolean} [synchronized=true] Whether all child animations should be adjusted to have the same (maximum) {@link yfiles.view.IAnimation#preferredDuration}. By default this is enabled. + * @returns {yfiles.view.IAnimation} A new instance that is the composite of the given animations. + * @static + */ + createParallelAnimation?(animations:yfiles.collections.IEnumerable,synchronized?:boolean):yfiles.view.IAnimation; + /** + * Creates a new instance of an {@link yfiles.view.IAnimation} that animates the given {@link yfiles.geometry.IMutablePoint} along a path. + * @param {yfiles.geometry.GeneralPath} path The path to animate the point along. + * @param {yfiles.geometry.IMutablePoint} animationPoint The mutable point instance that will be manipulated by the animation. + * @param {yfiles.lang.TimeSpan} preferredDuration The preferred duration of the animation. + * @returns {yfiles.view.IAnimation} + * @static + */ + createPathAnimation?(path:yfiles.geometry.GeneralPath,animationPoint:yfiles.geometry.IMutablePoint,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates a new {@link yfiles.view.IAnimation} that animates the given port from its current location to the new location given by + * the targetLocationParameter. + *

+ * This animation will as a side effect assign the targetLocationParameter to the port at the {@link Root.TI#cleanup end of the animation}. + *

+ * @param {yfiles.graph.IGraph} graph The graph that contains the port. + * @param {yfiles.graph.IPort} port The port to animate. + * @param {yfiles.graph.IPortLocationModelParameter} targetLocationParameter The parameter to linearly interpolate to. + * @param {yfiles.lang.TimeSpan} preferredDuration The {@link Root.TI#preferredDuration preferred duration} of this animation. + * @returns {yfiles.view.IAnimation} A new instance of {@link yfiles.view.IAnimation}. + * @static + */ + createPortAnimation?(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,targetLocationParameter:yfiles.graph.IPortLocationModelParameter,preferredDuration:yfiles.lang.TimeSpan):yfiles.view.IAnimation; + /** + * Creates a new {@link yfiles.view.IAnimation} for the given table that animates the table and its {@link yfiles.graph.IStripe stripes}. + *

+ * Note that only the sizes of + * leaf stripes, i.e. those without child stripes, are considered. The sizes of a stripe with children is implicitly determined by its + * contents. + *

+ *

+ * For more control of the animation, implement a custom {@link yfiles.view.TableAnimation} and override method + * {@link yfiles.view.TableAnimation#createStripeAnimation}. + *

+ * @param {yfiles.graph.ITable} table The table to animate. + * @param {Array.} columnLayout The sizes of the leaf columns, in natural order. + * @param {Array.} rowLayout The sizes of the leaf rows, in natural order. + * @returns {yfiles.view.IAnimation} + * @static + */ + createTableAnimation?(table:yfiles.graph.ITable,columnLayout:number[],rowLayout:number[]):yfiles.view.IAnimation; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Animates changing the viewport bounds and the zoom factor for a {@link yfiles.view.CanvasComponent}. + * @class yfiles.view.ViewportAnimation + * @implements {yfiles.view.IAnimation} + */ + export interface ViewportAnimation extends Object,yfiles.view.IAnimation{} + export class ViewportAnimation { + /** + * Creates a new instance of {@link yfiles.view.ViewportAnimation}. + * @param {yfiles.view.CanvasComponent} canvas The canvas control. + * @param {yfiles.geometry.Rect} targetBounds The target world bounds for the animation. + * @param {yfiles.lang.TimeSpan} [preferredDuration=null] The preferred duration. 1 second if omitted. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent,targetBounds:yfiles.geometry.Rect,preferredDuration?:yfiles.lang.TimeSpan); + /** + * Creates a new instance of {@link yfiles.view.ViewportAnimation}. + * @param {Object} options The parameters to pass. + * @param {yfiles.view.CanvasComponent} options.canvas The canvas control. + * @param {yfiles.geometry.Rect} options.targetBounds The target world bounds for the animation. + * @param {yfiles.lang.TimeSpan} [options.preferredDuration=null] The preferred duration. 1 second if omitted. + * @param {boolean} options.considerViewportLimiter Whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.CanvasComponent} whose {@link yfiles.view.CanvasComponent#viewport} is animated. + *

+ * This option sets the {@link yfiles.view.ViewportAnimation#considerViewportLimiter} property on the created object. + *

+ * @param {number} options.maximumTargetZoom The maximum zoom level to use after the animation. + *

+ * This option sets the {@link yfiles.view.ViewportAnimation#maximumTargetZoom} property on the created object. + *

+ * @constructor + */ + constructor(options:{canvas:yfiles.view.CanvasComponent,targetBounds:yfiles.geometry.Rect,preferredDuration?:yfiles.lang.TimeSpan,considerViewportLimiter?:boolean,maximumTargetZoom?:number}); + /** + * + * @param {number} time + */ + animate(time:number):void; + /** + * Effectively applies the center point value. + * @param {yfiles.geometry.Point} focus + * @protected + */ + applyCenterPoint(focus:yfiles.geometry.Point):void; + /** + * Effectively applies the view point value. + * @param {yfiles.geometry.Point} focus + * @protected + */ + applyViewPoint(focus:yfiles.geometry.Point):void; + /** + * Effectively applies the zoom value. + * @param {number} value + * @protected + */ + applyZoom(value:number):void; + /** + * Cancels this viewport animation so that subsequent calls to {@link yfiles.view.ViewportAnimation#animate} or {@link yfiles.view.ViewportAnimation#cleanup} + * won't affect the viewport anymore. + */ + cancel():void; + /** + * Cleans up after the animation. + */ + cleanup():void; + /** + * Initializes this animation. + *

+ * This has to be called once before any calls to {@link yfiles.view.ViewportAnimation#animate}. An instance of {@link yfiles.view.ViewportAnimation} + * can be reused after an animation by setting new {@link yfiles.view.ViewportAnimation#targetBounds} or a new {@link yfiles.view.ViewportAnimation#preferredDuration} and calling Initialize() again. + *

+ */ + initialize():void; + /** + * Gets or sets the target world bounds. + * @type {yfiles.geometry.Rect} + */ + targetBounds:yfiles.geometry.Rect; + /** + * Whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.CanvasComponent} whose {@link yfiles.view.CanvasComponent#viewport} is animated. + *

+ * Default is false. + *

+ * @type {boolean} + */ + considerViewportLimiter:boolean; + /** + * Gets or sets the preferred duration of the animation. + * @type {yfiles.lang.TimeSpan} + */ + preferredDuration:yfiles.lang.TimeSpan; + /** + * Gets or sets the maximum zoom level to use after the animation. + *

+ * The default is {@link number#POSITIVE_INFINITY}. + *

+ * @type {number} + */ + maximumTargetZoom:number; + /** + * Gets or sets the scroll bar visibility that will be used during the animation. + * @default 0 + * @type {yfiles.view.ScrollBarVisibility} + */ + scrollBarVisibility:yfiles.view.ScrollBarVisibility; + /** + * Gets or sets the margins in view coordinate dimensions to use at the target zoom level. + * @default '0' + * @type {yfiles.geometry.Insets} + */ + targetViewMargins:yfiles.geometry.Insets; + static $class:yfiles.lang.Class; + } + /** + * 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.view.ICanvasObjectInstaller}. This interface is used for {@link yfiles.graph.ILookup#lookup} + * operations. + *

+ * @see yfiles.view.HighlightIndicatorManager. + * @see yfiles.view.ISelectionIndicatorInstaller + * @interface + * @implements {yfiles.view.ICanvasObjectInstaller} + */ + export interface IHighlightIndicatorInstaller extends Object,yfiles.view.ICanvasObjectInstaller{ + } + var IHighlightIndicatorInstaller:{ + $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.view.ICanvasObjectInstaller}. This interface is used for {@link yfiles.graph.ILookup#lookup} + * operations. + *

+ * @see yfiles.view.FocusIndicatorManager. + * @see yfiles.view.ISelectionIndicatorInstaller + * @see yfiles.view.IHighlightIndicatorInstaller + * @interface + * @implements {yfiles.view.ICanvasObjectInstaller} + */ + export interface IFocusIndicatorInstaller extends Object,yfiles.view.ICanvasObjectInstaller{ + } + var IFocusIndicatorInstaller:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum BridgeCrossingStyle{ + /** + * A simple gap in the path. + */ + GAP, + /** + * A rectangular bridge will be inserted in the path. + */ + RECTANGLE, + /** + * A rectangular bridge with a fixed aspect ratio will be inserted in the path. + *

+ * This bridge will be scaled for wider bridges so that its aspect ratio remains constant. + *

+ */ + RECTANGLE_SCALED, + /** + * A triangular bridge will be inserted in the path. + */ + TWO_SIDES, + /** + * A triangular bridge with a fixed aspect ratio will be inserted in the path. + *

+ * This bridge will be scaled for wider bridges so that its aspect ratio remains constant. + *

+ */ + TWO_SIDES_SCALED, + /** + * A bridge, consisting of two quarter circle arcs connected by a straight line, will be inserted in the path. + */ + ARC, + /** + * A semi-circle bridge will be inserted in the path. + *

+ * This bridge will be scaled for wider bridges so that its aspect ratio remains constant. + *

+ */ + ARC_SCALED, + /** + * Inserts a custom bridge into the path. + *

+ * Custom bridges require an appropriate implementation of the {@link yfiles.view.IBridgeCreator} interface and {@link yfiles.view.IBridgeCreator#createCustomBridge} + * method. + *

+ */ + CUSTOM + } + export enum BridgeOrientationStyle{ + /** + * The brige is drawn to the right of the flow of the path. + */ + FLOW_RIGHT, + /** + * The brige is drawn to the left of the flow of the path. + */ + FLOW_LEFT, + /** + * The brige is drawn in the direction of the positive axes. + */ + POSITIVE, + /** + * The brige is drawn in the direction of the negative axes. + */ + NEGATIVE, + /** + * The bridge points to the right. + */ + LEFT, + /** + * The bridge points to the left. + */ + RIGHT, + /** + * The bridge points upwards. + */ + UP, + /** + * The bridge points downwards. + */ + DOWN + } + export enum BridgeCrossingPolicy{ + /** + * Makes horizontal segments bridge over vertical obstacles. + *

+ * Horizontal segments do not cross each other, just as vertical ones will not cross each other. Horizontal segments 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 horizontal obstacles. + *

+ * Horizontal segments do not cross each other, just as vertical ones will not cross each other. Horizontal segments 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 + } + /** + * Helper class that calculates visual hints in a path where said path crosses an obstacle. + *

+ * Most notably this feature is used to render crossings of {@link yfiles.graph.IEdge}s with other edges. + *

+ *

+ * To set up bridges in a {@link yfiles.view.GraphComponent} at the least the following is necessary: + *

+ *

+ * Furthermore, an edge style that supports bridges is necessary; {@link yfiles.styles.PolylineEdgeStyle} is a good choice. Various + * other properties can be set to change the defaults, e.g. {@link yfiles.view.BridgeCrossingStyle how bridges appear}, or {@link yfiles.view.BridgeOrientationStyle which way bridges point}. + *

+ *

Related demos:

+ *
    + *
  • Demo: Bridges, Demo.yFiles.Graph.Bridges
  • + *
+ * @class yfiles.view.BridgeManager + */ + export interface BridgeManager extends Object{} + export class BridgeManager { + /** + * Initializes a new instance of the {@link yfiles.view.BridgeManager} class. + *

+ * Initially the {@link yfiles.view.BridgeManager#defaultBridgeCreator} will be set to an instance that will delegate to the set of Default properties in this class and the {@link yfiles.view.BridgeManager#insertDefaultCustomBridge} + * method respectively. + *

+ * @constructor + */ + constructor(); + /** + * Core method that will add bridges to a {@link yfiles.geometry.GeneralPath} using the {@link yfiles.view.IBridgeCreator} 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.view.IRenderContext} context The context to use. + * @param {yfiles.geometry.GeneralPath} path The path to calculate the bridged variant for. + * @param {yfiles.view.IBridgeCreator} callback The callback or null that determines the appearance of the bridges. + * @returns {yfiles.geometry.GeneralPath} The path that might have been augmented by the bridges. + */ + addBridges(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath,callback:yfiles.view.IBridgeCreator):yfiles.geometry.GeneralPath; + /** + * Adds another {@link yfiles.view.IObstacleProvider} to query for obstacles. + *

+ * The {@link yfiles.view.IObstacleProvider#getObstacles} method will be invoked during construction of the obstacles. + *

+ * @param {yfiles.view.IObstacleProvider} provider The provider instance to use for later queries. + * @see yfiles.view.BridgeManager#registerObstacles + * @see yfiles.view.BridgeManager#removeObstacleProvider + */ + addObstacleProvider(provider:yfiles.view.IObstacleProvider):void; + /** + * Disposes of this instance by resetting the {@link yfiles.view.BridgeManager#canvasComponent} property to null. + */ + dispose():void; + /** + * Gets a hash code that describes the current state of the obstacles. + *

+ * This method can be used to get a concise, digest snapshot of the current obstacle locations. Storing that result and + * comparing it to another snapshot later allows to determine quickly whether obstacles have changed since the last call. + * This is helpful, e.g. in implementations of {@link yfiles.styles.IEdgeStyle} that support bridges to not recreate the edge path + * (including bridges) in {@link yfiles.view.IVisualCreator#updateVisual} if no obstacles changed. + *

+ * @param {yfiles.view.IRenderContext} context The context to inspect. + * @returns {number} A hash of the state of the obstacles. + */ + getObstacleHash(context:yfiles.view.IRenderContext):number; + /** + * Implementation that will be called by the default value of the {@link yfiles.view.BridgeManager#defaultBridgeCreator} to satisfy requests to + * {@link yfiles.view.IBridgeCreator#createCustomBridge}. + *

+ * This implementation will insert a gap style bridge by first creating a {@link yfiles.geometry.GeneralPath#lineTo line} to start and then {@link yfiles.geometry.GeneralPath#moveTo moving} to end. + *

+ * @param {yfiles.view.IRenderContext} context The context for the call. + * @param {yfiles.geometry.GeneralPath} path The path to append the next segment to. + * @param {yfiles.geometry.Point} start The coordinates of the starting point of the bridge. + * @param {yfiles.geometry.Point} end The coordinates of the ending point of the bridge. + * @param {number} gapLength The distance between the starting point and the end point. + * @see yfiles.view.IBridgeCreator#createCustomBridge + */ + insertDefaultCustomBridge(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath,start:yfiles.geometry.Point,end:yfiles.geometry.Point,gapLength:number):void; + /** + * Installs this manager for the specified {@link yfiles.view.BridgeManager#canvasComponent}. + * @param {yfiles.view.CanvasComponent} canvas The {@link yfiles.view.BridgeManager#canvasComponent}. + * @protected + */ + install(canvas:yfiles.view.CanvasComponent):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.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional + * obstacles at a later point in time. + *

+ * @param {yfiles.view.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.GeneralPath} path The path that describes the obstacles. + * @see yfiles.view.BridgeManager#registerObstacleLine + */ + registerObstacle(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath):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.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional + * obstacles at a later point in time. + *

+ * @param {yfiles.view.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.Point} p1 The coordinates of the starting point of the line. + * @param {yfiles.geometry.Point} cp1 The coordinates of the first control point of the curve. + * @param {yfiles.geometry.Point} cp2 The coordinates of the second control point of the curve. + * @param {yfiles.geometry.Point} p2 The coordinates of the ending point of the line. + * @see yfiles.view.BridgeManager#registerObstacleLine + */ + registerObstacleCubicCurve(context:yfiles.view.IRenderContext,p1:yfiles.geometry.Point,cp1:yfiles.geometry.Point,cp2:yfiles.geometry.Point,p2:yfiles.geometry.Point):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.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional + * obstacles at a later point in time. + *

+ * @param {yfiles.view.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.Point} p1 The coordinates of the first point of the line. + * @param {yfiles.geometry.Point} p2 The coordinates of the second point of the line. + * @see yfiles.view.BridgeManager#registerObstacleLine + */ + registerObstacleLine(context:yfiles.view.IRenderContext,p1:yfiles.geometry.Point,p2:yfiles.geometry.Point):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.view.BridgeManager#registerObstacles}. This method can be called during the rendering phase to register additional + * obstacles at a later point in time. + *

+ * @param {yfiles.view.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.Point} p1 The coordinates of the starting point of the line. + * @param {yfiles.geometry.Point} cp The coordinates of the control point of the curve. + * @param {yfiles.geometry.Point} p2 The coordinates of the ending point of the line. + * @see yfiles.view.BridgeManager#registerObstacleLine + */ + registerObstacleQuadCurve(context:yfiles.view.IRenderContext,p1:yfiles.geometry.Point,cp:yfiles.geometry.Point,p2:yfiles.geometry.Point):void; + /** + * Called to initialize the context with the obstacles. + * @param {yfiles.view.IRenderContext} context The context that will be used to store the obstacles with. + * @see yfiles.view.BridgeManager#registerObstacle + * @see yfiles.view.BridgeManager#registerObstacleLine + * @protected + */ + registerObstacles(context:yfiles.view.IRenderContext):void; + /** + * Removes a previously {@link yfiles.view.BridgeManager#addObstacleProvider added} {@link yfiles.view.IObstacleProvider} from the list of registered providers. + * @param {yfiles.view.IObstacleProvider} provider The provider instance to remove from this instance. + * @see yfiles.view.BridgeManager#addObstacleProvider + */ + removeObstacleProvider(provider:yfiles.view.IObstacleProvider):void; + /** + * Reverts the {@link yfiles.view.BridgeManager#install} method. + * @param {yfiles.view.CanvasComponent} canvas The {@link yfiles.view.BridgeManager#canvasComponent}. + * @protected + */ + uninstall(canvas:yfiles.view.CanvasComponent):void; + /** + * Gets or sets the default implementation of the {@link yfiles.view.IBridgeCreator} that will be used if {@link yfiles.view.BridgeManager#addBridges} + * is invoked with a null callback argument. + * @see yfiles.view.BridgeManager#defaultBridgeCrossingStyle + * @see yfiles.view.BridgeManager#defaultBridgeWidth + * @see yfiles.view.BridgeManager#defaultBridgeHeight + * @see yfiles.view.BridgeManager#insertDefaultCustomBridge + * @type {yfiles.view.IBridgeCreator} + */ + defaultBridgeCreator:yfiles.view.IBridgeCreator; + /** + * Gets or sets a value that determines whether curves ({@link yfiles.geometry.GeneralPath#cubicTo cubic} and {@link yfiles.geometry.GeneralPath#quadTo quadratic}) should be considered as obstacles. + *

+ * This can be a costly operation so the default is false. + *

+ * @type {boolean} + */ + 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. + *

+ * @type {number} + */ + zoomThreshold:number; + /** + * Gets or sets the {@link yfiles.view.BridgeManager#bridgeCrossingPolicy} mode that is used by this instance. + *

+ * By default the {@link yfiles.view.BridgeCrossingPolicy#HORIZONTAL_BRIDGES_VERTICAL} mode is set. + *

+ * @type {yfiles.view.BridgeCrossingPolicy} + */ + bridgeCrossingPolicy:yfiles.view.BridgeCrossingPolicy; + /** + * Gets or sets the {@link yfiles.view.BridgeManager#canvasComponent} that should be managed by this instance. + *

+ * This method will {@link yfiles.view.BridgeManager#install} a {@link yfiles.view.CanvasComponent#addPrepareRenderContextListener preparation stage} for the {@link yfiles.view.IRenderContext} in the + * provided {@link yfiles.view.BridgeManager#canvasComponent} via the {@link yfiles.graph.ILookup#lookup} mechanism. + *

+ * @type {yfiles.view.CanvasComponent} + */ + canvasComponent:yfiles.view.CanvasComponent; + /** + * Gets or sets the default {@link yfiles.view.BridgeCrossingStyle} that will be used by the default implementation of the {@link yfiles.view.IBridgeCreator} + * that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. + *

+ * The default value is {@link yfiles.view.BridgeCrossingStyle#ARC}. + *

+ * @see yfiles.view.IBridgeCreator#getCrossingStyle + * @type {yfiles.view.BridgeCrossingStyle} + */ + defaultBridgeCrossingStyle:yfiles.view.BridgeCrossingStyle; + /** + * Gets or sets the default width of a bridge that will be used by the default implementation of the {@link yfiles.view.IBridgeCreator} + * that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. + *

+ * The default value is 10.0d. Setting this value will adjust the {@link yfiles.view.BridgeManager#clipMargin}. + *

+ * @see yfiles.view.IBridgeCreator#getBridgeWidth + * @type {number} + */ + defaultBridgeWidth:number; + /** + * Gets or sets the margin by which the {@link yfiles.view.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.view.IBridgeCreator#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.view.BridgeManager#defaultBridgeWidth}. + *

+ * @type {number} + */ + clipMargin:number; + /** + * Gets or sets the default height of a bridge that will be used by the default implementation of the {@link yfiles.view.IBridgeCreator} + * that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. + *

+ * The default value is 5.0d. + *

+ * @see yfiles.view.IBridgeCreator#getBridgeHeight + * @type {number} + */ + defaultBridgeHeight:number; + /** + * Gets or sets the default {@link yfiles.view.BridgeOrientationStyle} for bridges that will be used by the default implementation + * of the {@link yfiles.view.IBridgeCreator} that is initially assigned to the {@link yfiles.view.BridgeManager#defaultBridgeCreator} property. + *

+ * The default is {@link yfiles.view.BridgeOrientationStyle#UP}. + *

+ * @see yfiles.view.IBridgeCreator#getOrientationStyle + * @type {yfiles.view.BridgeOrientationStyle} + */ + defaultBridgeOrientationStyle:yfiles.view.BridgeOrientationStyle; + static $class:yfiles.lang.Class; + } + /** + * Allows to add bridge visualizations to a {@link yfiles.geometry.GeneralPath}. + *

+ * An implementation of this interface is used by {@link yfiles.view.BridgeManager} to insert bridges into an edge path. + *

+ *

+ * A custom implementation of this interface is necessary if a {@link yfiles.view.BridgeCrossingStyle#CUSTOM custom bridge drawing style} is used. + *

+ *

Related demos:

+ *
    + *
  • Demo: Bridges, Demo.yFiles.Graph.Bridges
  • + *
+ * @see yfiles.view.BridgeManager + * @interface + */ + export interface IBridgeCreator extends Object{ + /** + * Callback that will be used by the {@link yfiles.view.BridgeManager} if the {@link yfiles.view.IBridgeCreator#getCrossingStyle} method + * yields {@link yfiles.view.BridgeCrossingStyle#CUSTOM} to actually insert a bridge into the given {@link yfiles.geometry.GeneralPath}. + *

+ * When this method is called the {@link yfiles.geometry.GeneralPath}'s {@link yfiles.geometry.GeneralPath#lastCoordinate last} coordinates are not yet at start. So most + * implementation should first {@link yfiles.geometry.GeneralPath#moveTo} that location. Also at the end of the call, + * implementation should make sure that the GeneralPath's end is at end. 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.view.IRenderContext} context The context for the call. + * @param {yfiles.geometry.GeneralPath} path The path to append the bridge segment to. + * @param {yfiles.geometry.Point} start The coordinates of the starting point of the bridge. + * @param {yfiles.geometry.Point} end The coordinates of the ending point of the bridge. + * @param {number} gapLength The distance between the starting point and the end point. + * @abstract + */ + createCustomBridge(context:yfiles.view.IRenderContext,path:yfiles.geometry.GeneralPath,start:yfiles.geometry.Point,end:yfiles.geometry.Point,gapLength:number):void; + /** + * Gets the height of the bridge for the given {@link yfiles.view.IRenderContext}. + *

+ * The height is the default height that will be used for drawing the non-{@link yfiles.view.BridgeCrossingStyle#CUSTOM custom} {@link yfiles.view.BridgeCrossingStyle}s. + *

+ * @param {yfiles.view.IRenderContext} context The context where the bridge will be created for. + * @returns {number} The non-negative preferred basic unscaled height of the bridge. + * @abstract + */ + getBridgeHeight(context:yfiles.view.IRenderContext):number; + /** + * Gets the width of the bridge for the given {@link yfiles.view.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.view.IRenderContext} context The context where the bridge will be created for. + * @returns {number} The positive preferred width of the bridge. + * @abstract + */ + getBridgeWidth(context:yfiles.view.IRenderContext):number; + /** + * Gets the {@link yfiles.view.BridgeCrossingStyle} to use in the given {@link yfiles.view.IRenderContext}. + * @param {yfiles.view.IRenderContext} context The context in which the crossing will be used. + * @returns {yfiles.view.BridgeCrossingStyle} The style to use, or {@link yfiles.view.BridgeCrossingStyle#CUSTOM} in order to let {@link yfiles.view.BridgeManager} call + * {@link yfiles.view.IBridgeCreator#createCustomBridge}. + * @abstract + */ + getCrossingStyle(context:yfiles.view.IRenderContext):yfiles.view.BridgeCrossingStyle; + /** + * Gets the {@link yfiles.view.BridgeOrientationStyle} to use in the given {@link yfiles.view.IRenderContext}. + * @param {yfiles.view.IRenderContext} context The context in which the style will be used.. + * @returns {yfiles.view.BridgeOrientationStyle} The style to use. Any value can be returned and will be ignored if the {@link yfiles.view.IBridgeCreator#getCrossingStyle crossing style} is set to + * {@link yfiles.view.BridgeCrossingStyle#CUSTOM}. + * @abstract + */ + getOrientationStyle(context:yfiles.view.IRenderContext):yfiles.view.BridgeOrientationStyle; + } + var IBridgeCreator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Implementations of this interface can provide a path that is used to determine bridges by {@link yfiles.view.BridgeManager}. + *

+ * Typically the {@link yfiles.graph.ILookup} implementation of styles will return an implementation of this interface. + *

+ * @interface + */ + export interface IObstacleProvider extends Object{ + /** + * Returns a path representing obstacles that would need bridges. + *

+ * For performance reasons the implementation should only return a non-null {@link yfiles.geometry.GeneralPath} if it might be {@link yfiles.view.IVisibilityTestable#isVisible visible} + * in the provided {@link yfiles.view.IRenderContext#clip}. + *

+ * @param {yfiles.view.IRenderContext} context The context for which the obstacles are queried. + * @returns {yfiles.geometry.GeneralPath} A path that describes the obstacles or null if there are no obstacles for the given context. + * @abstract + */ + getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; + } + var IObstacleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.view.ItemModelManager.} that automatically installs and removes visual representations of items in a {@link yfiles.collections.IObservableCollection.} into or from the canvas. + * Type parameter T: The type of items in the observable collection. + * @class yfiles.view.CollectionModelManager. + * @extends {yfiles.view.ItemModelManager.} + * @template T + */ + export interface CollectionModelManager extends yfiles.view.ItemModelManager{} + export class CollectionModelManager { + /** + * Creates a new instance using the given model. + * @param {yfiles.lang.Class} itemType The type of items in the observable collection. + * @param {yfiles.collections.IObservableCollection.} model The model to manage. + * @constructor + */ + constructor(itemType:yfiles.lang.Class,model:yfiles.collections.IObservableCollection); + /** + * Creates a new instance. + * @param {yfiles.lang.Class} itemType The type of items in the observable collection. + * @see yfiles.view.CollectionModelManager.#model + * @constructor + */ + constructor(itemType:yfiles.lang.Class); + /** + * Called when this mode gets {@link yfiles.view.CollectionModelManager.#enabled disabled}. + * @protected + */ + onDisabled():void; + /** + * Called when this mode gets {@link yfiles.view.CollectionModelManager.#enabled enabled}. + * @protected + */ 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; + * Gets or sets a value indicating whether this {@link yfiles.view.CollectionModelManager.} is enabled. + *

+ * If the manager is disabled, it will not install the {@link yfiles.view.ICanvasObject}s into the associated + * {@link yfiles.view.CanvasComponent}. + *

+ * @type {boolean} + */ + enabled:boolean; /** - * 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; + * 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. + *

+ * @type {yfiles.collections.IObservableCollection.} + */ + model:yfiles.collections.IObservableCollection; + static $class:yfiles.lang.Class; } - var TapInputMode:{ - $class:yfiles.lang.Class; + /** + * Installs and removes visual representations of items into or from the canvas. + * Type parameter T: The type of managed items. + * @class yfiles.view.ItemModelManager. + * @template T + */ + export interface ItemModelManager extends Object{} + export class ItemModelManager { /** - * Creates a new instance of this mode that detects touch taps. - */ - new ():yfiles.input.TapInputMode; + * + * @param {yfiles.lang.Class} itemType1 The type of managed items. + */ + constructor(itemType1:yfiles.lang.Class); + /** + * Registers and {@link yfiles.view.ItemModelManager.#install installs} the given item into the canvas. + * @param {T} item The item to install. + */ + addItem(item:T):void; + /** + * {@link yfiles.view.ItemModelManager.#addItem Adds} all items to the canvas. + *

+ * This is useful to initialize this manager with an existing collection of items. + *

+ * @param {yfiles.collections.IEnumerable.} items The items to add. + */ + addItems(items:yfiles.collections.IEnumerable):void; + /** + * Retrieves the canvas object that has been registered for the given item or null. + * @param {T} item The item to retrieve the canvas object for. + * @returns {yfiles.view.ICanvasObject} A canvas object instance or null. + * @see yfiles.view.ItemModelManager.#install + */ + getCanvasObject(item:T):yfiles.view.ICanvasObject; + /** + * Gets the {@link yfiles.view.ICanvasObjectGroup} used to {@link yfiles.view.ItemModelManager.#install} the item in the canvas. + *

+ * The default implementation simply returns the value of {@link yfiles.view.ItemModelManager.#canvasObjectGroup}. + *

+ * @param {T} item The item to get the group for. + * @returns {yfiles.view.ICanvasObjectGroup} The {@link yfiles.view.ICanvasObjectGroup} used to {@link yfiles.view.ItemModelManager.#install} an item in the canvas. + * @protected + */ + getCanvasObjectGroup(item:T):yfiles.view.ICanvasObjectGroup; + /** + * Returns the {@link yfiles.view.ICanvasObjectDescriptor} used to {@link yfiles.view.ItemModelManager.#install} the item in the canvas. + *

+ * The default implementation simply returns the value of {@link yfiles.view.ItemModelManager.#descriptor}. + *

+ * @param {T} item The item to get the descriptor for. + * @returns {yfiles.view.ICanvasObjectDescriptor} The {@link yfiles.view.ICanvasObjectDescriptor} used to {@link yfiles.view.ItemModelManager.#install} an item in the canvas. + * @protected + */ + getDescriptor(item:T):yfiles.view.ICanvasObjectDescriptor; + /** + * Tries to find the item managed by this instance that is associated with the given canvas object. + * @param {yfiles.view.ICanvasObject} canvasObject The canvas object to query the corresponding model item for. + * @returns {T} The item or null if no such item could be found. + */ + getItem(canvasObject:yfiles.view.ICanvasObject):T; + /** + * Installs a member of the collection into the canvas using the {@link yfiles.view.ItemModelManager.#descriptor}. + * @param {T} item The member to install. + * @returns {yfiles.view.ICanvasObject} The canvas object that has been returned by the installer. + * @protected + */ + install(item:T):yfiles.view.ICanvasObject; + /** + * Event handler for item creation events that adds the item to this manager. + *

+ * This method is intended to be used to delegate item creation events from observable collections: + *

+ *

+ * This method calls {@link yfiles.view.ItemModelManager.#addItem} with {@link yfiles.collections.ItemEventArgs.#item}. + *

+ * @param {Object} source The instance that raised the event. + * @param {yfiles.collections.ItemEventArgs.} evt The event arguments. + */ + itemAddedHandler(source:Object,evt:yfiles.collections.ItemEventArgs):void; + /** + * Event handler for item change events that updates the visual representation for that item. + *

+ * This method is intended to be used to delegate item change events from observable collections: + *

+ *

+ * This is necessary if the group the canvas object should be added to might change after the item change. This might + * happen, e.g. after changing an edge's port in a grouped graph. + *

+ * @param {Object} source The event source. + * @param {yfiles.collections.ItemEventArgs.} evt The item event args which indicate the change. + */ + itemChangedHandler(source:Object,evt:yfiles.collections.ItemEventArgs):void; + /** + * Event handler for item removal events that removes the item from this manager. + *

+ * This method is intended to be used to delegate item removal events from observable collections: + *

+ *

+ * This method calls {@link yfiles.view.ItemModelManager.#removeItem} with {@link yfiles.collections.ItemEventArgs.#item}. + *

+ * @param {Object} source The instance that raised the event. + * @param {yfiles.collections.ItemEventArgs.} evt The event arguments. + */ + itemRemovedHandler(source:Object,evt:yfiles.collections.ItemEventArgs):void; + /** + * Deregisters and uninstalls the given item from the canvas. + * @param {T} item The item to uninstall. + */ + removeItem(item:T):void; + /** + * {@link yfiles.view.ItemModelManager.#removeItem Removes} all items from the canvas. + *

+ * This method can be used to clean up this manager before disposing it. + *

+ * @param {yfiles.collections.IEnumerable.} items The items to remove. + */ + removeItems(items:yfiles.collections.IEnumerable):void; + /** + * This method may be called to update the visual representation of the given item in the canvas. + *

+ * If no visual representation is registered, yet, {@link yfiles.view.ItemModelManager.#install} will be called. + *

+ * @param {T} item The item to update. + */ + update(item:T):void; + /** + * 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. + *

+ * @type {yfiles.collections.IComparer.} + */ + comparer:yfiles.collections.IComparer; + /** + * Gets or sets the canvas object descriptor used by {@link yfiles.view.ItemModelManager.#install} when an item is {@link yfiles.view.ICanvasObjectGroup#addChild added} to an canvas object group. + *

+ * Setting the descriptor to null will prevent this manager from installing new items. + *

+ * @type {yfiles.view.ICanvasObjectDescriptor} + */ + descriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets or sets the canvas object group used by {@link yfiles.view.ItemModelManager.#install}. + *

+ * Setting this property to null will prevent this manager from installing new items. + *

+ * @type {yfiles.view.ICanvasObjectGroup} + */ + canvasObjectGroup:yfiles.view.ICanvasObjectGroup; + static $class:yfiles.lang.Class; + } + /** + * Default implementation of an {@link yfiles.view.ISelectionModel.} that is based on an observable collection to hold the selected elements. + *

+ * This selection model has a domain that's controlled with a {@link yfiles.view.DefaultSelectionModel.#isInDomain predicate} which encompasses the items that can be selected. + * If that domain changes it is important to delegate item removal events from the domain model to this selection model to + * ensure that items that have been removed are deselected as well. A {@link yfiles.view.DefaultSelectionModel.#itemRemovedFromDomainHandler convenience event handler} exists for that purpose. + *

+ * Type parameter T: The type of the items to be selected. + * @class yfiles.view.DefaultSelectionModel. + * @implements {yfiles.view.ISelectionModel.} + * @template T + */ + export interface DefaultSelectionModel extends Object,yfiles.view.ISelectionModel{} + export class DefaultSelectionModel { + /** + * Creates a default selection model implementation that uses a {@link yfiles.collections.ObservableCollection.} to hold the selection. + * @constructor + */ + constructor(); + /** + * + */ + clear():void; + /** + * + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Determines whether an item is selected by checking for the containment in the {@link yfiles.view.DefaultSelectionModel.#selection}. + * @param {T} item The item to check + * @returns {boolean} Whether the item is selected. + */ + isSelected(item:T):boolean; + /** + * Event handler for domain item removal events that removes the item from this model. + *

+ * This method is intended to be used to delegate item removal events from the respective domain collection: + *

+ *

+ * This method calls {@link yfiles.view.DefaultSelectionModel.#removeDomainItem} with {@link yfiles.collections.ItemEventArgs.#item}. + *

+ * @param {Object} source The instance that raised the event. + * @param {yfiles.collections.ItemEventArgs.} evt The event arguments. + */ + itemRemovedFromDomainHandler(source:Object,evt:yfiles.collections.ItemEventArgs):void; + /** + * Called when an item gets selected or deselected. + *

+ * Triggers the {@link yfiles.view.DefaultSelectionModel.#addItemSelectionChangedListener ItemSelectionChanged} event. + *

+ * @param {T} o The item. + * @param {boolean} selected Whether or not the item is selected after the change. + * @protected + */ + onItemSelectionChanged(o:T,selected:boolean):void; + /** + * Removes the given item from the selection in response to the item being removed from the domain. + * @param {T} item The item to remove from the considered items. + */ + removeDomainItem(item:T):void; + /** + * Sets the selection state of the item. + * @param {T} item + * @param {boolean} selected + */ + setSelected(item:T,selected:boolean):void; + /** + * Gets or sets the predicate which determines whether the queried item should be considered for this selection model. + * @type {function(T): boolean} + */ + isInDomain:(obj:T)=>boolean; + /** + * Provides an observable collection view over the selected items. + * @type {yfiles.collections.IObservableCollection.} + */ + selection:yfiles.collections.IObservableCollection; + /** + * + * @type {number} + */ + size:number; + /** + * + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener + */ + addItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener + */ + removeItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + export enum ShowFocusPolicy{ + /** + * Indicates that irrespectively of the keyboard focus, the focus should always be rendered for the {@link yfiles.view.FocusIndicatorManager.#focusedItem}. + */ + ALWAYS, + /** + * Indicates that depending on the value of {@link yfiles.view.FocusIndicatorManager.#focused} the focus should only be rendered if this property is set to true. + */ + WHEN_FOCUSED + } + /** + * A {@link yfiles.view.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.graph.ILookup} mechanism of the item to lookup an {@link yfiles.view.IFocusIndicatorInstaller} + * implementation which will do the actual installation of the decoration in the canvas. + *

+ * Type parameter T: The type of the items. + * @class yfiles.view.FocusIndicatorManager. + * @extends {yfiles.view.ModelManager.} + * @implements {yfiles.lang.IPropertyObservable} + * @template T + */ + export interface FocusIndicatorManager extends yfiles.view.ModelManager,yfiles.lang.IPropertyObservable{} + export class FocusIndicatorManager { + /** + * Creates an instance that for all focused items in the model dynamically installs a decoration. + * @param {yfiles.view.CanvasComponent} canvas The canvas to add the focus marks to. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent); + /** + * Called when the {@link yfiles.view.FocusIndicatorManager.#focused} property has changed. + * @see yfiles.view.FocusIndicatorManager.#focused + * @protected + */ + onFocusedChanged():void; + /** + * Callback method that is triggered when the focused item has changed. + *

+ * This method raises the {@link yfiles.view.FocusIndicatorManager.#addPropertyChangedListener PropertyChanged} event. Subclasses overriding this method should make sure to invoke + * the super class implementation. + *

+ * @param {yfiles.lang.PropertyChangedEventArgs} evt a description of the event + * @see yfiles.view.FocusIndicatorManager.#focusedItem + * @see yfiles.view.FocusIndicatorManager.#addPropertyChangedListener + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Adds the given listener for the PropertyChanged event that occurs when the {@link yfiles.view.FocusIndicatorManager.#focusedItem} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.FocusIndicatorManager.#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when the {@link yfiles.view.FocusIndicatorManager.#focusedItem} property has been changed. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.FocusIndicatorManager.#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the focused item, updates the canvas and fires the corresponding property change event. + * @type {T} + */ + focusedItem:T; + /** + * Gets or sets the show focus policy. + *

+ * The default is {@link yfiles.view.ShowFocusPolicy#WHEN_FOCUSED}. + *

+ * @default 1 + * @type {yfiles.view.ShowFocusPolicy} + */ + showFocusPolicy:yfiles.view.ShowFocusPolicy; + /** + * Gets or sets a value indicating whether the {@link yfiles.view.CanvasComponent container} this manager is installed in currently is focused. + * @type {boolean} + */ + focused:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.view.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.graph.ILookup} mechanism of the items to lookup an {@link yfiles.view.IHighlightIndicatorInstaller} + * implementation which will do the actual installation of the decoration in the canvas. + *

+ * Type parameter T: The type of the items. + * @class yfiles.view.HighlightIndicatorManager. + * @extends {yfiles.view.ModelManager.} + * @template T + */ + export interface HighlightIndicatorManager extends yfiles.view.ModelManager{} + export class HighlightIndicatorManager { + /** + * Creates an instance that for all selected items in the model dynamically installs a highlight decoration. + * @param {yfiles.view.CanvasComponent} canvas The canvas to add the selection marks to. + * @param {yfiles.view.ISelectionModel.} [selectionModel=null] The model that determines which items are highlighted. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent,selectionModel?:yfiles.view.ISelectionModel); + /** + * Adds another highlight. + * @param {T} item The item to highlight. + */ + addHighlight(item:T):void; + /** + * Removes all highlights. + */ + clearHighlights():void; + /** + * Removes an item from the current highlight selection. + * @param {T} item The item whose highlight decorator will be removed. + */ + removeHighlight(item:T):void; + /** + * Gets or sets the selection model that determines which items are highlighted. + *

+ * May be null, in which case no elements are considered highlighted. + *

+ * @type {yfiles.view.ISelectionModel.} + */ + selectionModel:yfiles.view.ISelectionModel; + static $class:yfiles.lang.Class; + } + /** + * Installs visual representations of items in a {@link yfiles.view.CanvasComponent}. + *

+ * This interface is most prominently used by {@link yfiles.view.ModelManager.} and its descendants to manage visuals in the canvas. + *

+ * @interface + */ + export interface ICanvasObjectInstaller extends Object{ + /** + * This the main method of the interface that performs the installation of an item's visual representation in the {@link yfiles.view.CanvasComponent canvas} by + * adding {@link yfiles.view.ICanvasObject}s. + * @param {yfiles.view.ICanvasContext} context The context that contains the information required to install the visual representation. + * @param {yfiles.view.ICanvasObjectGroup} group The canvas object group to add the newly generated {@link yfiles.view.ICanvasObject} to. + * @param {Object} item The item to install. + * @returns {yfiles.view.ICanvasObject} The newly generated {@link yfiles.view.ICanvasObject} for the item's visual representation. null if nothing was installed. + * @abstract + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + } + var ICanvasObjectInstaller:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; /** - * 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; + * 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.view.ICanvasObjectInstaller}. This interface is used for {@link yfiles.graph.ILookup#lookup} + * operations. + *

+ * @see yfiles.view.SelectionIndicatorManager. + * @see yfiles.view.IHighlightIndicatorInstaller + * @interface + * @implements {yfiles.view.ICanvasObjectInstaller} + */ + export interface ISelectionIndicatorInstaller extends Object,yfiles.view.ICanvasObjectInstaller{ } - var SnapState:{ + var ISelectionIndicatorInstaller:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * Event Arguments used by {@link yfiles.input.TapInputMode#addTappedListener Tapped}. - */ - export interface TapEventArgs extends yfiles.system.EventArgs{ + * 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. + *

+ * Type parameter T: The type of items contained in the selection's domain. + * @interface + * @implements {yfiles.collections.IEnumerable.} + * @template T + */ + export interface ISelectionModel extends Object,yfiles.collections.IEnumerable{ /** - * Gets the location of the tap. - * Value: The location. - */ - location:yfiles.geometry.PointD; + * Clears the selection. + *

+ * This is a convenience method that will set the selection state of all elements to unselected. + *

+ * @see yfiles.view.ISelectionModel.#addItemSelectionChangedListener + * @abstract + */ + clear():void; /** - * Gets the context in which the tap occurred. - */ - context:yfiles.input.IInputModeContext; + * Determines whether an item is currently selected. + * @param {T} item The item to check. + * @returns {boolean} Whether it is currently selected. + * @abstract + */ + isSelected(item:T):boolean; /** - * 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. - */ + * Sets the selection state of an item. + *

+ * If the state changes, this will trigger the {@link yfiles.view.ISelectionModel.#addItemSelectionChangedListener ItemSelectionChanged} event. + *

+ * @param {T} item The item to set the selection state for. + * @param {boolean} selected Whether to select the object. + * @abstract + */ + setSelected(item:T,selected:boolean):void; + /** + * Returns the number of selected items. + * @abstract + * @type {number} + */ + size:number; + /** + * Adds the given listener for the ItemSelectionChanged event that occurs when an item changed its selection state from + * selected to unselected or vice versa. + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener The listener to add. + * @see yfiles.view.ISelectionModel.#setSelected + * @see yfiles.view.ISelectionModel.#removeItemSelectionChangedListener + * @abstract + */ + addItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemSelectionChanged event that occurs when an item changed its selection state from + * selected to unselected or vice versa. + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.view.ISelectionModel.#setSelected + * @see yfiles.view.ISelectionModel.#addItemSelectionChangedListener + * @abstract + */ + removeItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + } + var ISelectionModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides data for the {@link yfiles.view.ISelectionModel.#addItemSelectionChangedListener ItemSelectionChanged} event. + * @class yfiles.view.ItemSelectionChangedEventArgs. + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface ItemSelectionChangedEventArgs extends yfiles.collections.ItemEventArgs{} + export class ItemSelectionChangedEventArgs { + /** + * Initializes a new event argument instance for the given item and its selection state. + * @param {T} item The item whose {@link yfiles.view.ISelectionModel.#isSelected selection state} has changed. + * @param {boolean} selected The value indicating whether the item is selected after the change. + * @constructor + */ + constructor(item:T,selected:boolean); + /** + * Gets a value indicating whether the item is selected after the change. + * @type {boolean} + */ + itemSelected:boolean; + static $class:yfiles.lang.Class; + } + /** + * Manages the visual representations of items in a {@link yfiles.view.CanvasComponent}. + * Type parameter T: The type of items this instance deals with. + * @class yfiles.view.ModelManager. + * @template T + */ + export interface ModelManager extends Object{} + export class ModelManager { + /** + * Creates a new instance that will manage the items for the given canvas. + * @param {yfiles.view.CanvasComponent} canvas The canvas to manage. + * @protected + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent); + /** + * Installs an itemm and adds it to this managers set of managed items. + *

+ * If {@link yfiles.view.ModelManager.#enabled} is set to false the item will not be installed. + *

+ * @param {T} item The item to add. + * @returns {yfiles.view.ICanvasObject} The newly created canvas object or null if nothing was installed. + * @protected + */ + add(item:T):yfiles.view.ICanvasObject; + /** + * Callback used by {@link yfiles.view.ModelManager.#install} to retrieve the canvas object group for a given item. + *

+ * Returning null will cause {@link yfiles.view.ModelManager.#install} not to install anything. + *

+ * @param {T} item The item to find a canvas object group for. + * @returns {yfiles.view.ICanvasObjectGroup} An {@link yfiles.view.ICanvasObjectGroup} or null + * @protected + * @abstract + */ + getCanvasObjectGroup(item:T):yfiles.view.ICanvasObjectGroup; + /** + * Callback used by {@link yfiles.view.ModelManager.#install} to retrieve the installer for a given item. + *

+ * Implementations may use the {@link yfiles.graph.ILookup#lookup} of the item. + *

+ *

+ * Returning null will cause {@link yfiles.view.ModelManager.#install} not to install anything. + *

+ * @param {T} item The item to find an installer for. + * @returns {yfiles.view.ICanvasObjectInstaller} An installer or null + * @protected + * @abstract + */ + getInstaller(item:T):yfiles.view.ICanvasObjectInstaller; + /** + * Installs a member of the collection into the canvas using the {@link yfiles.view.ICanvasObjectDescriptor} which is returned by + * {@link yfiles.view.ModelManager.#getInstaller}. + * @param {T} item The member to install. + * @returns {yfiles.view.ICanvasObject} The canvas object that has been returned by the installer. + * @protected + */ + install(item:T):yfiles.view.ICanvasObject; + /** + * Called when this mode gets {@link yfiles.view.ModelManager.#enabled disabled}. + * @protected + * @abstract + */ + onDisabled():void; + /** + * Called when this mode gets {@link yfiles.view.ModelManager.#enabled enabled}. + * @protected + * @abstract + */ + onEnabled():void; + /** + * Uninstalls the provided item and removes it from this managers set of managed items. + * @param {T} item The item to remove. + * @protected + */ + remove(item:T):void; + /** + * Simple implementation that removes the given {@link yfiles.view.ICanvasObject}. + * @param {yfiles.view.ICanvasObject} canvasObject The canvas objects that have been associated with the descriptor. + * @see yfiles.view.ICanvasObject#remove + * @protected + */ + unInstall(canvasObject:yfiles.view.ICanvasObject):void; + /** + * Gets the canvas instance this instance is managing. + * @type {yfiles.view.CanvasComponent} + */ + canvasComponent:yfiles.view.CanvasComponent; + /** + * Gets or sets whether this {@link yfiles.view.ModelManager.} is enabled. + *

+ * If the manager is disabled, it will not install the {@link yfiles.view.ICanvasObject}s into the associated + * {@link yfiles.view.CanvasComponent}. + *

+ *

+ * The default is true, i.e. this manager is enabled by default. + *

+ * @type {boolean} + */ + enabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.view.ModelManager.} implementation that manages the visual decorations of selected elements in a canvas. + *

+ * For each item in the {@link yfiles.view.SelectionIndicatorManager.#model} that is marked as selected by the {@link yfiles.view.SelectionIndicatorManager.#selectionModel} this class uses the {@link yfiles.graph.ILookup} mechanism of the items + * to lookup an {@link yfiles.view.ISelectionIndicatorInstaller} implementation which will do the actual installation of the + * decoration in the canvas. + *

+ * Type parameter T: The type of the items in the collection and selection model. + * @class yfiles.view.SelectionIndicatorManager. + * @extends {yfiles.view.ModelManager.} + * @template T + */ + export interface SelectionIndicatorManager extends yfiles.view.ModelManager{} + export class SelectionIndicatorManager { + /** + * Creates an instance that for all selected items in the model dynamically installs a selection render decoration. + * @param {yfiles.view.CanvasComponent} canvas The canvas to add the selection marks to. + * @param {yfiles.collections.IObservableCollection.} model The model that holds the domain. + * @param {yfiles.view.ISelectionModel.} selectionModel The model that determines which items are selected. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent,model:yfiles.collections.IObservableCollection,selectionModel:yfiles.view.ISelectionModel); + /** + * Adds an item to the current selection. + * @param {T} item The item whose selection decorator will added. + * @returns {yfiles.view.ICanvasObject} + */ + addSelection(item:T):yfiles.view.ICanvasObject; + /** + * Removes an item from the current selection. + * @param {T} item The item whose selection decorator will be removed. + */ + removeSelection(item:T):void; + /** + * Gets or sets the selection model that determines which items are selected. + *

+ * May be null, in which case no elements are considered selected. + *

+ * @type {yfiles.view.ISelectionModel.} + */ + selectionModel:yfiles.view.ISelectionModel; + /** + * Gets or sets the model that describes the domain for the selection. + *

+ * Only item contained in this model can be rendered as selected. + *

+ * @type {yfiles.collections.IObservableCollection.} + */ + model:yfiles.collections.IObservableCollection; + static $class:yfiles.lang.Class; + } + /** + * Renders a grid using various different {@link yfiles.view.GridVisualCreator#gridStyle styles}. + * @see yfiles.view.GridInfo + * @see yfiles.view.GridVisualCreator#gridStyle + * @class yfiles.view.GridVisualCreator + * @implements {yfiles.view.IVisualCreator} + */ + export interface GridVisualCreator extends Object,yfiles.view.IVisualCreator{} + export class GridVisualCreator { + /** + * Initializes a new instance of the {@link yfiles.view.GridVisualCreator} class. + * @param {yfiles.view.GridInfo} gridInfo The grid info. + * @constructor + */ + constructor(gridInfo:yfiles.view.GridInfo); + /** + * Initializes a new instance of the {@link yfiles.view.GridVisualCreator} class. + *

+ * This initializes the {@link yfiles.view.GridVisualCreator#gridInfo} field using the given values. + *

+ * @param {number} horizontalSpacing The x spacing. + * @param {number} verticalSpacing The y spacing. + * @constructor + */ + constructor(horizontalSpacing:number,verticalSpacing:number); + /** + * Initializes a new instance of the {@link yfiles.view.GridVisualCreator} class. + *

+ * The spacing is initialized to 25 units. + *

+ * @constructor + */ + constructor(); + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the grid style that this implementation uses. + * @default 0 + * @type {yfiles.view.GridStyle} + */ + gridStyle:yfiles.view.GridStyle; + /** + * Gets or sets the grid info that describes the geometry of the grid. + * @type {yfiles.view.GridInfo} + */ + gridInfo:yfiles.view.GridInfo; + /** + * Gets or sets a value indicating whether this {@link yfiles.view.GridVisualCreator} is visible. + * @default true + * @type {boolean} + */ + visible:boolean; + /** + * Gets or sets the {@link yfiles.view.GridVisualCreator#stroke} to use for painting the grid points. + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * 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. + *

+ * @default 20.0 + * @type {number} + */ + visibilityThreshold:number; + static $class:yfiles.lang.Class; + } + 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 + } + /** + * Interface that is implemented for elements that can provide rendering bounds in the world coordinate system. + *

+ * This information can be used by the rendering engine to increase rendering performance significantly. + *

+ *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 06 GetBounds
  • + *
+ * @see yfiles.view.IVisualCreator + * @see yfiles.view.CanvasComponent + * @see yfiles.view.ICanvasObjectDescriptor + * @see yfiles.view.ICanvasObject + * @interface + */ + 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 rendering is not bound to a certain area, this method may return + * {@link yfiles.geometry.Rect#INFINITE}. If nothing is rendered, this method should return an empty rectangle, where either or + * both the width and height is non-positive or {@link yfiles.geometry.Rect#EMPTY}. + *

+ * @param {yfiles.view.ICanvasContext} context the context to calculate the bounds for + * @returns {yfiles.geometry.Rect} the bounds or {@link yfiles.geometry.Rect#EMPTY} to indicate an unbound area + * @abstract + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + } + var IBoundsProvider:{ + /** + * Creates an instance that returns the given model as the bounds. + * @param {yfiles.geometry.IRectangle} bounds the rectangle + * @returns {yfiles.view.IBoundsProvider} + * @static + */ + fromRectangle?(bounds:yfiles.geometry.IRectangle):yfiles.view.IBoundsProvider; + /** + * An implementation that returns an {@link yfiles.view.IBoundsProvider} that yields an "Empty" bounds. + * @const + * @static + * @type {yfiles.view.IBoundsProvider} + */ + EMPTY?:yfiles.view.IBoundsProvider; + /** + * An implementation that returns an {@link yfiles.view.IBoundsProvider} that yields {@link yfiles.geometry.Rect#INFINITE "infinite"} bounds. + * @const + * @static + * @type {yfiles.view.IBoundsProvider} + */ + UNBOUNDED?:yfiles.view.IBoundsProvider; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is implemented for elements that can determine whether they might be visible in a given clipping + * rectangle. + *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 09 IsVisible
  • + *
+ * @see yfiles.view.IVisualCreator + * @see yfiles.view.CanvasComponent + * @see yfiles.view.ICanvasObjectDescriptor + * @see yfiles.view.ICanvasObject + * @interface + */ + export interface IVisibilityTestable extends Object{ + /** + * Determines whether an element might intersect the visible region for a given context. + *

+ * Conservative implementations can always return true. + *

+ * @param {yfiles.view.ICanvasContext} context The context to determine the visibility for. + * @param {yfiles.geometry.Rect} rectangle The visible region clip. + * @returns {boolean} false if and only if it is safe not to paint the element because it would not affect the given clipping region. + * @abstract + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + } + var IVisibilityTestable:{ + /** + * An implementation of a {@link yfiles.view.IVisibilityTestable} that always yields true. + * @const + * @static + * @type {yfiles.view.IVisibilityTestable} + */ + ALWAYS?:yfiles.view.IVisibilityTestable; + /** + * An implementation of a {@link yfiles.view.IVisibilityTestable} that always yields false. + * @const + * @static + * @type {yfiles.view.IVisibilityTestable} + */ + NEVER?:yfiles.view.IVisibilityTestable; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum VisualCachingPolicy{ + /** + * Disables caching of {@link yfiles.view.Visual}s completely. + */ + NEVER, + /** + * {@link yfiles.view.Visual}s will be cached using a weak reference, which means they might be removed by the Garbage Collection. + */ + WEAK, + /** + * {@link yfiles.view.Visual}s will always be cached. + *

+ * The cached reference will be kept until the corresponding {@link yfiles.view.ICanvasObject} is removed. + *

+ */ + STRONG + } + /** + * An interface that describes the current context for rendering routines. + * @see yfiles.view.IVisualCreator + * @interface + * @implements {yfiles.view.ICanvasContext} + */ + export interface IRenderContext extends Object,yfiles.view.ICanvasContext{ + /** + * Notifies the context that the visual has been removed from the visual tree. + *

+ * This has to be done in a {@link yfiles.view.IVisualCreator}'s {@link yfiles.view.IVisualCreator#updateVisual} method if a + * {@link yfiles.view.IVisualCreator}'s {@link yfiles.view.IVisualCreator#createVisual} is called or a previously added visual will be + * removed or replaced. Calling this method will call a previously {@link yfiles.view.IRenderContext#setDisposeCallback registered} dispose visual callback that the visual has + * been removed and needs to free its resources. + *

+ *

+ * If the visual has not been registered previously this method will do nothing. + *

+ * @param {yfiles.view.Visual} visual The visual which has been removed. + * @see yfiles.view.IRenderContext#setDisposeCallback + * @see yfiles.view.IVisualCreator + * @see yfiles.view.IVisualCreator#updateVisual + */ + childVisualRemoved?(visual:yfiles.view.Visual):void; + /** + * Registers a visual if children have registered themselves for disposal. + *

+ * This is necessary for visual creators which delegate to another visual creator to create one or more child visuals, like + * style decorators. + *

+ *

+ * Implementors have to add a call to this method at the end of their {@link yfiles.view.IVisualCreator#createVisual} and {@link yfiles.view.IVisualCreator#updateVisual} + * methods. + *

+ *

+ * The registered callback has to call {@link yfiles.view.IRenderContext#childVisualRemoved} on all child visuals of the visual. + *

+ * @param {yfiles.view.Visual} visual The visual to be registered. This is the visual which is returned by the {@link yfiles.view.IVisualCreator#createVisual} or {@link yfiles.view.IVisualCreator#updateVisual} + * method which calls this method. + * @param {function(yfiles.view.IRenderContext, yfiles.view.Visual, boolean): yfiles.view.Visual} callback A dispose visual callback which calls {@link yfiles.view.IRenderContext#childVisualRemoved} on all child visuals of the + * registered visual. + */ + registerForChildrenIfNecessary?(visual:yfiles.view.Visual,callback:(context:yfiles.view.IRenderContext,removedVisual:yfiles.view.Visual,dispose:boolean)=>yfiles.view.Visual):void; + /** + * Registers a callback which will be called when the visual will be removed from the visual tree. + *

+ * This applies to a {@link yfiles.view.IVisualCreator}'s {@link yfiles.view.IVisualCreator#createVisual} method if the created visual + * allocates resources which should be freed after the visual is no longer used. In this case the visual has to be + * registered together with a dispose visual callback which can free the allocated resources. The callback will be called + * by the framework when the visual is removed from the visual tree. + *

+ *

+ * The callback can also be used to support caching for temporarily removed visuals. See dispose visual callback. + *

+ * @param {yfiles.view.Visual} visual The visual which needs to be disposed after removal. + * @param {function(yfiles.view.IRenderContext, yfiles.view.Visual, boolean): yfiles.view.Visual} callback A callback which will dispose the visual. + * @see yfiles.view.IVisualCreator + * @see yfiles.view.IVisualCreator#createVisual + */ + setDisposeCallback?(visual:yfiles.view.Visual,callback:(context:yfiles.view.IRenderContext,removedVisual:yfiles.view.Visual,dispose:boolean)=>yfiles.view.Visual):void; + /** + * Converts the given set of world coordinates to a coordinate pair that can be used to render within the {@link yfiles.view.IRenderContext#viewTransform}. + * @param {yfiles.geometry.Point} worldPoint The coordinates in the world coordinate system. + * @returns {yfiles.geometry.Point} The coordinates in the view coordinate system. + * @see yfiles.view.IRenderContext#viewTransform + * @abstract + */ + toViewCoordinates(worldPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * The clipping rectangle in world coordinates. + *

+ * Rendering outside of this clip may be skipped altogether. + *

+ * @abstract + * @type {yfiles.geometry.Rect} + */ + clip:yfiles.geometry.Rect; + /** + * A transform that can be added to the transform list of a visual to be displayed in the original coordinate system (the + * view coordinate system). + *

+ * In contrast to the world coordinate system where the logical coordinates of the elements that are managed by a {@link yfiles.view.CanvasComponent} + * (for example, graph elements like node and edges), the view coordinate system is used to display visualizations that are + * independent to scale (zoom) or translation transformations (like handles or selection indicators). + *

+ * @abstract + * @type {yfiles.geometry.Matrix} + */ + viewTransform:yfiles.geometry.Matrix; + /** + * Provides access to the defs element in the SVG DOM that is managed by this instance. + * @see yfiles.view.IRenderContext#svgDefsManager + * @abstract + * @type {Element} + */ + defsElement:Element; + /** + * Provides access to the {@link yfiles.view.SvgDefsManager} that manages this instance. + * @abstract + * @type {yfiles.view.SvgDefsManager} + */ + svgDefsManager:yfiles.view.SvgDefsManager; + } + var IRenderContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Factory interface which is used by implementations that know how to create {@link yfiles.view.Visual}s for rendering into a + * given {@link yfiles.view.IRenderContext}. + * @see yfiles.view.CanvasComponent + * @see yfiles.view.ICanvasObjectDescriptor + * @see yfiles.view.ICanvasObject + * @interface + */ + export interface IVisualCreator extends Object{ + /** + * This method is called by the framework to create a {@link yfiles.view.Visual} that will be included into the + * {@link yfiles.view.IRenderContext}. + *

+ * {@link yfiles.view.CanvasComponent} uses this interface through the {@link yfiles.view.ICanvasObjectDescriptor} to populate the visual + * canvas object tree. + *

+ * @param {yfiles.view.IRenderContext} context The context that describes where the visual will be used. + * @returns {yfiles.view.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see yfiles.view.IVisualCreator#updateVisual + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.view.Visual} for inclusion in the + * {@link yfiles.view.IRenderContext}. + *

+ * The {@link yfiles.view.CanvasComponent} 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.view.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.view.IRenderContext} context The context that describes where the visual will be used in. + * @param {yfiles.view.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.view.IVisualCreator#createVisual} method was called + * on this instance. + * @returns {yfiles.view.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 yfiles.view.IVisualCreator#createVisual + * @see yfiles.view.ICanvasObjectDescriptor + * @see yfiles.view.CanvasComponent + * @abstract + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + } + var IVisualCreator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A void/null implementation of the {@link yfiles.view.IVisualCreator} interface that does nothing. + *

+ * Use {@link yfiles.view.VoidVisualCreator#INSTANCE} for methods that require non-null {@link yfiles.view.IVisualCreator} implementations + * if you want to have no visualization. + *

+ * @class yfiles.view.VoidVisualCreator + * @implements {yfiles.view.IVisualCreator} + * @final + */ + export interface VoidVisualCreator extends Object,yfiles.view.IVisualCreator{} + export class VoidVisualCreator { + /** + * Returns null. + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Returns null. + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * An immutable and shareable convenience instance of the {@link yfiles.view.VoidVisualCreator} class. + * @const + * @static + * @type {yfiles.view.IVisualCreator} + */ + static INSTANCE:yfiles.view.IVisualCreator; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class for the {@link yfiles.view.ISelectionIndicatorInstaller}, {@link yfiles.view.IFocusIndicatorInstaller} and {@link yfiles.view.IHighlightIndicatorInstaller} + * implementations that draws an oriented rectangle using a {@link yfiles.view.OrientedRectangleIndicatorInstaller#template}. + *

+ * In the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method, this implementation will add either a fixed {@link yfiles.geometry.IOrientedRectangle} + * instance that is passed in the constructor as a parameter or the return value of the method {@link yfiles.view.OrientedRectangleIndicatorInstaller#getRectangle} + * if the former does not exist (i.e. the parameterless constructor was used to instantiate this class). + *

+ * @class yfiles.view.OrientedRectangleIndicatorInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + * @implements {yfiles.view.IHighlightIndicatorInstaller} + * @implements {yfiles.view.IFocusIndicatorInstaller} + */ + export interface OrientedRectangleIndicatorInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} + export class OrientedRectangleIndicatorInstaller { + /** + * Initializes a new instance of the {@link yfiles.view.OrientedRectangleIndicatorInstaller} class with fixed bounds and a {@link string}. + *

+ * The given {@link yfiles.geometry.IOrientedRectangle} is used for all items as object that is added to the {@link yfiles.view.ICanvasObjectGroup} + * in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. + *

+ *

+ * If the {@link yfiles.view.OrientedRectangleIndicatorInstaller#template} property is not set, the templateKey is used to lookup a {@link yfiles.view.IVisualTemplate} in the resources of the + * {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. + *

+ * @param {yfiles.geometry.IOrientedRectangle} fixedBounds + * @param {string} [templateKey=null] + * @constructor + */ + constructor(fixedBounds:yfiles.geometry.IOrientedRectangle,templateKey?:string); + /** + * Initializes a new instance of the {@link yfiles.view.OrientedRectangleIndicatorInstaller} class without fixed bounds. + *

+ * The object that is created through this constructor relies on the value returned by the {@link yfiles.view.OrientedRectangleIndicatorInstaller#getRectangle} + * method to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the {@link yfiles.view.ICanvasObjectGroup} in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. + *

+ * @constructor + */ + constructor(); + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.view.ICanvasObjectGroup} group + * @param {Object} item + * @returns {yfiles.view.ICanvasObject} + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * Factory method that returns an {@link yfiles.geometry.IOrientedRectangle} for a given user object. + *

+ * This method is called for the object to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the + * {@link yfiles.view.ICanvasObjectGroup}, if there are no fixed bounds set on this instance (i.e. the parameterless constructor + * was used to instantiate this class). + *

+ *

+ * This implementation returns null for every given object. + *

+ * @param {Object} item + * @returns {yfiles.geometry.IOrientedRectangle} An {@link yfiles.geometry.IOrientedRectangle} for the given item that is {@link yfiles.view.ICanvasObjectGroup#addChild added} to the {@link yfiles.view.ICanvasObjectGroup}. + * @protected + */ + getRectangle(item:Object):yfiles.geometry.IOrientedRectangle; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the selection indicator. + * @const + * @static + * @type {string} + */ + static SELECTION_TEMPLATE_KEY:string; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the focus indicator. + * @const + * @static + * @type {string} + */ + static FOCUS_TEMPLATE_KEY:string; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the highlight indicator. + * @const + * @static + * @type {string} + */ + static HIGHLIGHT_TEMPLATE_KEY:string; + /** + * Gets or sets the {@link yfiles.view.IVisualTemplate} to use for this indicator. + *

+ * If this property is not set, the {@link string} passed in the constructor is used to lookup a {@link yfiles.view.IVisualTemplate} in the + * resources of the {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. + *

+ * @type {yfiles.view.IVisualTemplate} + */ + template:yfiles.view.IVisualTemplate; + static $class:yfiles.lang.Class; + } + /** + * A simple {@link yfiles.view.ISelectionIndicatorInstaller} implementation that draws an ellipse centered at a given point in + * world coordinate space. + * @class yfiles.view.PointSelectionIndicatorInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + */ + export interface PointSelectionIndicatorInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller{} + export class PointSelectionIndicatorInstaller { + /** + * Creates a new instance that indicates a point. + * @param {yfiles.geometry.IPoint} point The point to use for the center of the painting. + * @constructor + */ + constructor(point:yfiles.geometry.IPoint); + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.view.ICanvasObjectGroup} group + * @param {Object} item + * @returns {yfiles.view.ICanvasObject} + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * Factory method that retrieves the center for a given user object. + *

+ * This implementation simply returns the value provided to the constructor. + *

+ * @param {Object} userObject + * @returns {yfiles.geometry.IPoint} + * @protected + */ + getCenterPoint(userObject:Object):yfiles.geometry.IPoint; + /** + * Gets or sets the {@link yfiles.view.PointSelectionIndicatorInstaller#stroke} to use for drawing the point in the view coordinate system. + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Gets or sets the brush to use for filling the point's ellipse in the view coordinate system. + * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + static $class:yfiles.lang.Class; + } + /** + * A basis implementation of {@link yfiles.view.ISelectionIndicatorInstaller}, {@link yfiles.view.IFocusIndicatorInstaller} and {@link yfiles.view.IHighlightIndicatorInstaller} + * that draws a rectangle using a {@link yfiles.view.RectangleIndicatorInstaller#template}. + *

+ * In the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method, this implementation will add either a fixed {@link yfiles.geometry.IRectangle} + * instance that is passed in the constructor as a parameter or the return value of the method {@link yfiles.view.RectangleIndicatorInstaller#getRectangle} + * if the former does not exist (i.e. the parameterless constructor was used to instantiate this class). + *

+ * @class yfiles.view.RectangleIndicatorInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + * @implements {yfiles.view.IHighlightIndicatorInstaller} + * @implements {yfiles.view.IFocusIndicatorInstaller} + */ + export interface RectangleIndicatorInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} + export class RectangleIndicatorInstaller { + /** + * Initializes a new instance of the {@link yfiles.view.RectangleIndicatorInstaller} class with fixed bounds and a {@link string}. + *

+ * The given {@link yfiles.geometry.IOrientedRectangle} is used for all items as object that is added to the {@link yfiles.view.ICanvasObjectGroup} + * in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. + *

+ *

+ * If the {@link yfiles.view.RectangleIndicatorInstaller#template} property is not set, the resourceKey is used to lookup a {@link yfiles.view.IVisualTemplate} in the resources of the + * {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. + *

+ * @param {yfiles.geometry.IRectangle} fixedBounds + * @param {string} [resourceKey=null] + * @constructor + */ + constructor(fixedBounds:yfiles.geometry.IRectangle,resourceKey?:string); + /** + * Initializes a new instance of the {@link yfiles.view.RectangleIndicatorInstaller} class without fixed bounds. + *

+ * The object that is created through this constructor relies on the value returned by the {@link yfiles.view.RectangleIndicatorInstaller#getRectangle} + * method to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the {@link yfiles.view.ICanvasObjectGroup} in the {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject} method. + *

+ * @constructor + */ + constructor(); + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.view.ICanvasObjectGroup} group + * @param {Object} item + * @returns {yfiles.view.ICanvasObject} + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * Factory method that returns an {@link yfiles.geometry.IRectangle} for a given user object. + *

+ * This method is called for the object to {@link yfiles.view.ICanvasObjectGroup#addChild add} to the + * {@link yfiles.view.ICanvasObjectGroup}, if there are no fixed bounds set on this instance (i.e. the parameterless constructor + * was used to instantiate this class). + *

+ *

+ * This implementation returns null for every given object. + *

+ * @param {Object} userObject + * @returns {yfiles.geometry.IRectangle} An {@link yfiles.geometry.IRectangle} for the given item that is {@link yfiles.view.ICanvasObjectGroup#addChild added} to the {@link yfiles.view.ICanvasObjectGroup}. + * @protected + */ + getRectangle(userObject:Object):yfiles.geometry.IRectangle; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the selection indicator. + * @const + * @static + * @type {string} + */ + static SELECTION_TEMPLATE_KEY:string; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the focus indicator. + * @const + * @static + * @type {string} + */ + static FOCUS_TEMPLATE_KEY:string; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} for drawing the highlight indicator. + * @const + * @static + * @type {string} + */ + static HIGHLIGHT_TEMPLATE_KEY:string; + /** + * Gets or sets the {@link yfiles.view.IVisualTemplate} to use for this indicator. + *

+ * If this property is not set, the {@link string} passed in the constructor is used to lookup a {@link yfiles.view.IVisualTemplate} in the + * resources of the {@link yfiles.view.CanvasComponent}. If there is none, a default templated is used. + *

+ * @type {yfiles.view.IVisualTemplate} + */ + template:yfiles.view.IVisualTemplate; + static $class:yfiles.lang.Class; + } + /** + * Represents any object which fills an area. + * @class yfiles.view.Fill + * @implements {yfiles.lang.ICloneable} + */ + export interface Fill extends Object,yfiles.lang.ICloneable{} + export class Fill { + /** + * Assigns the fill defined by this instance to the given element. + *

+ * If this {@link yfiles.view.Fill} is a gradient and implements the {@link yfiles.view.ISvgDefsCreator} interface, it will be added to the + * defs section of the SVG document. The fill of the given element will be set to a reference to the gradient element. + *

+ * @param {SVGElement} element The element whose fill should be set. + * @param {yfiles.view.ICanvasContext} context The context. + */ + applyTo(element:SVGElement,context:yfiles.view.ICanvasContext):void; + /** + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance is already {@link yfiles.view.Fill#isFrozen frozen}. + * @returns {Object} An instance of the same type as this instance. + */ + clone():Object; + /** + * Freezes this instance. + *

+ * Freezing an object makes it immutable, which can result in performance enhancements. + *

+ */ + freeze():void; + /** + * Determines if this instance is frozen. + * @returns {boolean} + */ + isFrozen():boolean; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color AliceBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ALICE_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color AntiqueWhite. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ANTIQUE_WHITE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Aqua. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static AQUA:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Aquamarine. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static AQUAMARINE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Azure. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static AZURE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Beige. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BEIGE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Bisque. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BISQUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Black. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BLACK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color BlanchedAlmond. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BLANCHED_ALMOND:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Blue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color BlueViolet. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BLUE_VIOLET:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Brown. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BROWN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color BurlyWood. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static BURLY_WOOD:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color CadetBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CADET_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Chartreuse. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CHARTREUSE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Chocolate. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CHOCOLATE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Coral. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CORAL:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color CornflowerBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CORNFLOWER_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Cornsilk. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CORNSILK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Crimson. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CRIMSON:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Cyan. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static CYAN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkCyan. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_CYAN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkGoldenrod. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_GOLDENROD:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkGray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkKhaki. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_KHAKI:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkMagenta. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_MAGENTA:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkOliveGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_OLIVE_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkOrange. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_ORANGE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkOrchid. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_ORCHID:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkRed. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_RED:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSalmon. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_SALMON:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSeaGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_SEA_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSlateBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_SLATE_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkSlateGray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_SLATE_GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkTurquoise. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_TURQUOISE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DarkViolet. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DARK_VIOLET:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DeepPink. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DEEP_PINK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DeepSkyBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DEEP_SKY_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DimGray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DIM_GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color DodgerBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static DODGER_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Firebrick. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static FIREBRICK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color FloralWhite. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static FLORAL_WHITE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color ForestGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static FOREST_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Fuchsia. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static FUCHSIA:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Gainsboro. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GAINSBORO:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color GhostWhite. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GHOST_WHITE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Gold. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GOLD:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Goldenrod. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GOLDENROD:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Gray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Green. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color GreenYellow. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static GREEN_YELLOW:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Honeydew. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static HONEYDEW:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color HotPink. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static HOT_PINK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color IndianRed. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static INDIAN_RED:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Indigo. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static INDIGO:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Ivory. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static IVORY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Khaki. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static KHAKI:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Lavender. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LAVENDER:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LavenderBlush. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LAVENDER_BLUSH:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LawnGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LAWN_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LemonChiffon. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LEMON_CHIFFON:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightCoral. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_CORAL:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightCyan. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_CYAN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightGoldenrodYellow. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_GOLDENROD_YELLOW:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightGray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightPink. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_PINK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightSalmon. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_SALMON:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightSeaGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_SEA_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightSkyBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_SKY_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightSlateGray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_SLATE_GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightSteelBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_STEEL_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LightYellow. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIGHT_YELLOW:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Lime. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIME:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color LimeGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LIME_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Linen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static LINEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Magenta. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MAGENTA:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Maroon. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MAROON:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumAquamarine. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_AQUAMARINE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumOrchid. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_ORCHID:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumPurple. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_PURPLE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumSeaGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_SEA_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumSlateBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_SLATE_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumSpringGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_SPRING_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumTurquoise. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_TURQUOISE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MediumVioletRed. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MEDIUM_VIOLET_RED:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MidnightBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MIDNIGHT_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MintCream. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MINT_CREAM:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color MistyRose. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MISTY_ROSE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Moccasin. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static MOCCASIN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color NavajoWhite. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static NAVAJO_WHITE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Navy. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static NAVY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color OldLace. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static OLD_LACE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Olive. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static OLIVE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color OliveDrab. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static OLIVE_DRAB:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Orange. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ORANGE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color OrangeRed. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ORANGE_RED:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Orchid. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ORCHID:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PaleGoldenrod. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PALE_GOLDENROD:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PaleGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PALE_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PaleTurquoise. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PALE_TURQUOISE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PaleVioletRed. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PALE_VIOLET_RED:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PapayaWhip. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PAPAYA_WHIP:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PeachPuff. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PEACH_PUFF:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Peru. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PERU:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Pink. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PINK:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Plum. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PLUM:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color PowderBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static POWDER_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Purple. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static PURPLE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Red. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static RED:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color RosyBrown. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ROSY_BROWN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color RoyalBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static ROYAL_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SaddleBrown. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SADDLE_BROWN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Salmon. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SALMON:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SandyBrown. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SANDY_BROWN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SeaGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SEA_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SeaShell. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SEA_SHELL:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Sienna. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SIENNA:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Silver. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SILVER:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SkyBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SKY_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SlateBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SLATE_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SlateGray. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SLATE_GRAY:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Snow. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SNOW:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SpringGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static SPRING_GREEN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color SteelBlue. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static STEEL_BLUE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Tan. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static TAN:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Teal. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static TEAL:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Thistle. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static THISTLE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Tomato. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static TOMATO:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Transparent. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static TRANSPARENT:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Turquoise. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static TURQUOISE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Violet. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static VIOLET:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Wheat. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static WHEAT:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color White. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static WHITE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color WhiteSmoke. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static WHITE_SMOKE:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color Yellow. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static YELLOW:yfiles.view.Fill; + /** + * Gets a {@link yfiles.view.SolidColorFill} for the color YellowGreen. + *

+ * This property will yield a {@link yfiles.view.Fill#isFrozen frozen} shared immutable value. + *

+ */ + static YELLOW_GREEN:yfiles.view.Fill; + static $class:yfiles.lang.Class; + } + /** + * Represents an ARGB (alpha, red, green, blue) encoded color object. + * @class yfiles.view.Color + * @final + */ + export interface Color extends Object{} + export class Color { + /** + * Initializes a new instance of the {@link yfiles.view.Color} class. + * @param {number} [a=255] The alpha value; 255 by default. + * @param {number} [r=0] The red value; 0 by default. + * @param {number} [g=0] The green value; 0 by default + * @param {number} [b=0] The blue value; 0 by default. + * @constructor + */ + constructor(r?:number,g?:number,b?:number,a?:number); + /** + * Initializes a new instance of the {@link yfiles.view.Color} class. + * @param {Object} options The parameters to pass. + * @param {number} [options.a=255] The alpha value; 255 by default. + * @param {number} [options.r=0] The red value; 0 by default. + * @param {number} [options.g=0] The green value; 0 by default + * @param {number} [options.b=0] The blue value; 0 by default. + * @constructor + */ + constructor(options:{r?:number,g?:number,b?:number,a?:number}); + /** + * Creates a new color instance from ARGB values. + *

+ * All values must be between 0 and 255. + *

+ * @param {number} a The alpha value. + * @param {number} r The red value. + * @param {number} g The green value. + * @param {number} b The blue value. + * @returns {yfiles.view.Color} A new color instance with the given values. + * @static + */ + static fromArgb(a:number,r:number,g:number,b:number):yfiles.view.Color; + /** + * 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + a:number; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name AliceBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ALICE_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name AntiqueWhite. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ANTIQUE_WHITE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Aqua. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static AQUA:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Aquamarine. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static AQUAMARINE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Azure. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static AZURE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Beige. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BEIGE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Bisque. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BISQUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Black. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BLACK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name BlanchedAlmond. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BLANCHED_ALMOND:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Blue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name BlueViolet. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BLUE_VIOLET:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Brown. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BROWN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name BurlyWood. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static BURLY_WOOD:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name CadetBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CADET_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Chartreuse. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CHARTREUSE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Chocolate. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CHOCOLATE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Coral. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CORAL:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name CornflowerBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CORNFLOWER_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Cornsilk. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CORNSILK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Crimson. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CRIMSON:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Cyan. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static CYAN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkCyan. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_CYAN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkGoldenrod. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_GOLDENROD:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkGray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkKhaki. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_KHAKI:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkMagenta. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_MAGENTA:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkOliveGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_OLIVE_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkOrange. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_ORANGE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkOrchid. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_ORCHID:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkRed. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_RED:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSalmon. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_SALMON:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSeaGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_SEA_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSlateBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_SLATE_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkSlateGray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_SLATE_GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkTurquoise. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_TURQUOISE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DarkViolet. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DARK_VIOLET:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DeepPink. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DEEP_PINK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DeepSkyBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DEEP_SKY_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DimGray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DIM_GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name DodgerBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static DODGER_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Firebrick. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static FIREBRICK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name FloralWhite. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static FLORAL_WHITE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name ForestGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static FOREST_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Fuchsia. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static FUCHSIA:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Gainsboro. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GAINSBORO:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name GhostWhite. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GHOST_WHITE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Gold. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GOLD:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Goldenrod. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GOLDENROD:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Gray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Green. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name GreenYellow. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static GREEN_YELLOW:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Honeydew. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static HONEYDEW:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name HotPink. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static HOT_PINK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name IndianRed. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static INDIAN_RED:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Indigo. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static INDIGO:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Ivory. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static IVORY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Khaki. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static KHAKI:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Lavender. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LAVENDER:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LavenderBlush. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LAVENDER_BLUSH:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LawnGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LAWN_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LemonChiffon. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LEMON_CHIFFON:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightCoral. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_CORAL:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightCyan. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_CYAN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightGoldenrodYellow. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_GOLDENROD_YELLOW:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightGray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightPink. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_PINK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightSalmon. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_SALMON:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightSeaGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_SEA_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightSkyBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_SKY_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightSlateGray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_SLATE_GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightSteelBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_STEEL_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LightYellow. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIGHT_YELLOW:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Lime. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIME:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name LimeGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LIME_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Linen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static LINEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Magenta. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MAGENTA:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Maroon. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MAROON:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumAquamarine. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_AQUAMARINE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumOrchid. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_ORCHID:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumPurple. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_PURPLE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumSeaGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_SEA_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumSlateBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_SLATE_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumSpringGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_SPRING_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumTurquoise. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_TURQUOISE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MediumVioletRed. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MEDIUM_VIOLET_RED:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MidnightBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MIDNIGHT_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MintCream. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MINT_CREAM:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name MistyRose. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MISTY_ROSE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Moccasin. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static MOCCASIN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name NavajoWhite. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static NAVAJO_WHITE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Navy. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static NAVY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name OldLace. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static OLD_LACE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Olive. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static OLIVE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name OliveDrab. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static OLIVE_DRAB:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Orange. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ORANGE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name OrangeRed. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ORANGE_RED:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Orchid. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ORCHID:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PaleGoldenrod. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PALE_GOLDENROD:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PaleGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PALE_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PaleTurquoise. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PALE_TURQUOISE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PaleVioletRed. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PALE_VIOLET_RED:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PapayaWhip. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PAPAYA_WHIP:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PeachPuff. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PEACH_PUFF:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Peru. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PERU:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Pink. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PINK:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Plum. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PLUM:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name PowderBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static POWDER_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Purple. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static PURPLE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Red. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static RED:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name RosyBrown. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ROSY_BROWN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name RoyalBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static ROYAL_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SaddleBrown. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SADDLE_BROWN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Salmon. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SALMON:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SandyBrown. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SANDY_BROWN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SeaGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SEA_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SeaShell. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SEA_SHELL:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Sienna. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SIENNA:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Silver. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SILVER:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SkyBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SKY_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SlateBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SLATE_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SlateGray. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SLATE_GRAY:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Snow. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SNOW:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SpringGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static SPRING_GREEN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name SteelBlue. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static STEEL_BLUE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Tan. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static TAN:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Teal. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static TEAL:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Thistle. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static THISTLE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Tomato. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static TOMATO:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Transparent. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static TRANSPARENT:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Turquoise. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static TURQUOISE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Violet. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static VIOLET:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Wheat. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static WHEAT:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name White. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static WHITE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name WhiteSmoke. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static WHITE_SMOKE:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name Yellow. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static YELLOW:yfiles.view.Color; + /** + * Yields a new {@link yfiles.view.Color} for the wellknown name YellowGreen. + *

+ * This method will yield the same value for every call because it is immutable. + *

+ */ + static YELLOW_GREEN:yfiles.view.Color; + static $class:yfiles.lang.Class; + } + /** + * + * @class yfiles.view.ColorExtension + * @extends {yfiles.graphml.MarkupExtension} + */ + export interface ColorExtension extends yfiles.graphml.MarkupExtension{} + export class ColorExtension { + /** + * + * @param {yfiles.view.Color} color + * @constructor + */ + constructor(color:yfiles.view.Color); + /** + * + * @constructor + */ + constructor(); + /** + * + * @type {string} + */ + value:string; + static $class:yfiles.lang.Class; + } + /** + * Represents a cursor object. + * @class yfiles.view.Cursor + */ + export interface Cursor extends Object{} + export class Cursor { + /** + * Initializes a new {@link yfiles.view.Cursor} instance 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.view.Cursor} alternative Cursors can be chained but the last alternative needs to be one of the predefined cursors. + * @constructor + */ + constructor(url:string,alternative:yfiles.view.Cursor); + /** + * Returns the CSS text representation for the cursor and its alternatives. + * @returns {string} The CSS text representation for the cursor. + */ + getSystemCursor():string; + /** + * Gets the invisible cursor. + *

+ * This corresponds to the none CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NONE:yfiles.view.Cursor; + /** + * Gets the default cursor. + *

+ * This corresponds to the default CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static DEFAULT:yfiles.view.Cursor; + /** + * Gets the cursor with a pointing hand, as used for example on a hyperlink. + *

+ * This corresponds to the pointer CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static POINTER:yfiles.view.Cursor; + /** + * Gets the cursor that indicates that help is available for the object under the cursor. + *

+ * This corresponds to the help CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static HELP:yfiles.view.Cursor; + /** + * Gets the cursor that indicates progress. + *

+ * This corresponds to the progress CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static PROGRESS:yfiles.view.Cursor; + /** + * Gets the text selection cursor. + *

+ * This corresponds to the text CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static TEXT:yfiles.view.Cursor; + /** + * Gets the wait cursor. + *

+ * This corresponds to the wait CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static WAIT:yfiles.view.Cursor; + /** + * Gets the crosshair cursor. + *

+ * This corresponds to the crosshair CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static CROSSHAIR:yfiles.view.Cursor; + /** + * Gets the move cursor. + *

+ * This corresponds to the move CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static MOVE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the e-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static E_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the n-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static N_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the ne-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NE_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the nw-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NW_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the s-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static S_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the se-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static SE_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the sw-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static SW_RESIZE:yfiles.view.Cursor; + /** + * 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. + *

+ *

+ * This corresponds to the w-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static W_RESIZE:yfiles.view.Cursor; + /** + * Gets the vertical resize cursor. + *

+ * This corresponds to the ns-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NS_RESIZE:yfiles.view.Cursor; + /** + * Gets the diagonal resize cursor for NW to SE resizes. + *

+ * This corresponds to the nwse-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NWSE_RESIZE:yfiles.view.Cursor; + /** + * Gets the diagonal resize cursor for NE to SW resizes. + *

+ * This corresponds to the nesw-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NESW_RESIZE:yfiles.view.Cursor; + /** + * Gets the horizontal resize cursor. + *

+ * This corresponds to the ew-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static EW_RESIZE:yfiles.view.Cursor; + /** + * Gets the cursor for resizing columns. + *

+ * This corresponds to the col-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static COL_RESIZE:yfiles.view.Cursor; + /** + * Gets the cursor for resizing rows. + *

+ * This corresponds to the row-resize CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static ROW_RESIZE:yfiles.view.Cursor; + /** + * Gets the cursor where the browser determines the actual cursor to be displayed. + *

+ * This corresponds to the auto CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static AUTO:yfiles.view.Cursor; + /** + * Gets the cursor to indicate that there is a context menu available. + *

+ * This corresponds to the context-menu CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static CONTEXT_MENU:yfiles.view.Cursor; + /** + * Gets the cursor to indicate selection of a table cell.. + *

+ * This corresponds to the cell CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static CELL:yfiles.view.Cursor; + /** + * Gets the vertical text selection cursor. + *

+ * This corresponds to the vertical-text CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static VERTICAL_TEXT:yfiles.view.Cursor; + /** + * Gets the cursor to be shown when an alias or shortcut can be created. + *

+ * This corresponds to the alias CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static ALIAS:yfiles.view.Cursor; + /** + * Gets the cursor to be shown when something can be copied (often used for drag & drop). + *

+ * This corresponds to the copy CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static COPY:yfiles.view.Cursor; + /** + * Gets the cursor to be shown where nothing can be dropped in a drag & drop operation. + *

+ * This corresponds to the no-drop CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NO_DROP:yfiles.view.Cursor; + /** + * Gets the cursor to be shown when an action cannot be done. + *

+ * This corresponds to the not-allowed CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static NOT_ALLOWED:yfiles.view.Cursor; + /** + * Gets the cursor indicating that something can be scrolled or panned. + *

+ * This corresponds to the all-scroll CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static ALL_SCROLL:yfiles.view.Cursor; + /** + * Gets the cursor for zooming in. + *

+ * This corresponds to the zoom-in CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static ZOOM_IN:yfiles.view.Cursor; + /** + * Gets the cursor for zooming out. + *

+ * This corresponds to the zoom-out CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static ZOOM_OUT:yfiles.view.Cursor; + /** + * Gets the cursor indicating that something can be grabbed (usually in conjunction with {@link yfiles.view.Cursor#GRABBING}). + *

+ * This corresponds to the grab CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static GRAB:yfiles.view.Cursor; + /** + * Gets the cursor indicating that something is currently being grabbed (usually in conjunction with {@link yfiles.view.Cursor#GRAB}). + *

+ * This corresponds to the grabbing CSS cursor. This is how it appears in your browser (hover to see): + *

+ */ + static GRABBING:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * Template factory for creating visual representations of rectangular shaped objects. + *

+ * Implementations of this class have the purpose of creating a {@link yfiles.view.SvgVisual} that serves as the visual + * representation of the object associated with this instance. This special-purpose interface is only used in some places + * where the user interface can be customized. The {@link yfiles.view.IVisualCreator} interface is the main interface used by the + * {@link yfiles.view.CanvasComponent}. + *

+ * @interface + */ + export interface IVisualTemplate extends Object{ + /** + * This method is called by the framework to create a {@link yfiles.view.SvgVisual} with the given bounds. + *

+ * {@link yfiles.view.CanvasComponent} uses this interface through the {@link yfiles.view.ICanvasObjectDescriptor} to populate the visual + * canvas object tree. + *

+ * @param {yfiles.view.IRenderContext} context The context that describes where the visual will be used. + * @param {yfiles.geometry.Rect} bounds The initial bounds to use for the visual. + * @param {Object} dataObject The data object to visualize. + * @returns {yfiles.view.SvgVisual} The visual to include in the canvas object visual tree. This may be null. + * @see yfiles.view.IVisualTemplate#updateVisual + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext,bounds:yfiles.geometry.Rect,dataObject:Object):yfiles.view.SvgVisual; + /** + * This method updates or replaces a previously created {@link yfiles.view.SvgVisual} for inclusion in the + * {@link yfiles.view.IRenderContext}. + *

+ * The {@link yfiles.view.CanvasComponent} 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.view.IVisualTemplate#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.view.IRenderContext} context The context that describes where the visual will be used in. + * @param {yfiles.view.SvgVisual} oldVisual The visual instance that had been returned the last time the {@link yfiles.view.IVisualTemplate#createVisual} method was called + * on this instance. + * @param {yfiles.geometry.Rect} bounds The initial bounds to use for the visual. + * @param {Object} dataObject The data object to visualize. + * @returns {yfiles.view.SvgVisual} oldVisual, if this instance modified the visual, or a new visual that should replace the existing one in the canvas + * object visual tree. + * @abstract + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.SvgVisual,bounds:yfiles.geometry.Rect,dataObject:Object):yfiles.view.SvgVisual; + } + var IVisualTemplate:{ + $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 data can be copied or linked to the drop target. + */ + COPY_LINK, + /** + * Indicates that the data can be linked or copied to the drop target. + */ + LINK_MOVE, + /** + * Indicates that the data can be copied or moved to the drop target. + */ + COPY_MOVE, + /** + * Indicates that the value is uninitialized. + */ + UNINITIALIZED, + /** + * A combination of all of the flags. + */ + ALL + } + /** + * The event argument that will be used by {@link yfiles.view.DropTarget} to notify handlers of the various events during a drag + * and drop operation. + * @class yfiles.view.DragEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface DragEventArgs extends yfiles.lang.EventArgs{} + export class DragEventArgs { + /** + * 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. + * @returns {yfiles.geometry.Point} The position in the coordinates system of element + */ + getPosition(element:HTMLElement):yfiles.geometry.Point; + /** + * Gets or sets the effects that the current handler can realize. + *

+ * Setting this value will automatically mark this instance as {@link yfiles.view.DragEventArgs#handled}. + *

+ * @type {yfiles.view.DragDropEffects} + */ + dropEffect:yfiles.view.DragDropEffects; + /** + * Gets the key states relevant during the drag and drop operation. + * @type {yfiles.view.DragDropKeyStates} + */ + keyStates:yfiles.view.DragDropKeyStates; + /** + * Gets the data that is associated with the drag. + * @see yfiles.view.DragSource#startDrag + * @type {yfiles.view.DragDropItem} + */ + item:yfiles.view.DragDropItem; + /** + * Gets the allowed effects for the current drag operation as specified by the {@link yfiles.view.DragSource}. + * @type {yfiles.view.DragDropEffects} + */ + effectAllowed:yfiles.view.DragDropEffects; + /** + * Gets or sets a value indicating whether this {@link yfiles.view.DragEventArgs} has been handled. + *

+ * This property needs to be adjusted by handlers to tell the engine that the event has been handled. + *

+ * @type {boolean} + */ handled:boolean; + static $class:yfiles.lang.Class; } - var TapEventArgs:{ - $class:yfiles.lang.Class; + export enum GradientSpreadMethod{ /** - * 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; - }; + * The outside is filled with the terminal colors of the gradient. + */ + PAD, /** - * 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{ + * The outside is filled by repeating the gradient but in alternating directions, until the area is filled. + */ + REFLECT, /** - * 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 + * The outside is filled by repeating the original gradient. + */ + REPEAT } /** - * Event argument class for key events that carries the type of event. - */ - export interface CompoundKeyEventArgs extends yfiles.system.EventArgs{ + * Specifies the properties of a transition point of a gradient. + * @class yfiles.view.GradientStop + * @implements {yfiles.lang.ICloneable} + */ + export interface GradientStop extends Object,yfiles.lang.ICloneable{} + export class GradientStop { /** - * Gets the type of the event. - */ - eventType:yfiles.input.CompoundKeyEventType; + * Creates a new transition point of a gradient. + * @param {yfiles.view.Color} [color=null] + * @param {number} [offset=0] + * @constructor + */ + constructor(color?:yfiles.view.Color,offset?:number); /** - * Gets or sets a value that indicates whether this event has been handled. - */ - handled:boolean; + * Creates a new transition point of a gradient. + * @param {Object} options The parameters to pass. + * @param {yfiles.view.Color} [options.color=null] + * @param {number} [options.offset=0] + * @constructor + */ + constructor(options:{color?:yfiles.view.Color,offset?:number}); /** - * Returns the key code. - * This will be Keys.None for typed event. - */ - keyCode:yfiles.input.Key; + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance is already {@link yfiles.view.GradientStop#isFrozen frozen}. + * @returns {Object} An instance of the same type as this instance. + */ + clone():Object; /** - * Returns the value of the character that has been typed. - */ - keyValue:string; + * Freezes this instance. + *

+ * Freezing an object makes it immutable, which can result in performance enhancements. + *

+ */ + freeze():void; /** - * Returns the state of the modifiers at the time of the event. - */ - modifiers:yfiles.input.ModifierKeys; + * Determines if this instance is frozen. + * @returns {boolean} + */ + isFrozen():boolean; + /** + * Gets or sets the color of this transition point. + * @type {yfiles.view.Color} + */ + color:yfiles.view.Color; + /** + * Gets or sets the offset of this transition point. + * @type {number} + */ + offset:number; + static $class:yfiles.lang.Class; } - var CompoundKeyEventArgs:{ + /** + * Classes that implement this interface can be placed in the SVGs defs section by the {@link yfiles.view.SvgDefsManager}. + *

+ * The {@link yfiles.view.SvgDefsManager} can then create and update an element that can be used with an SVG use element. The + * interface is also used to help the {@link yfiles.view.SvgDefsManager} to find unused elements that can be removed from the defs + * section. + *

+ *

+ * When an element is created using this interface, the {@link yfiles.view.SvgDefsManager} assigns an ID to it that is required to + * reference it through an SVG use element. The ID that was assigned to it can be queried using the {@link yfiles.view.ICanvasContext#getDefsId} + * method when the {@link yfiles.view.ISvgDefsCreator} object is passed in that was used to create the element. + *

+ * @interface + */ + export interface ISvgDefsCreator extends Object{ + /** + * Checks if the specified node references the element represented by this object. + * @param {yfiles.view.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. + * @returns {boolean} true if node references the element represented by this instance. + * @abstract + */ + accept(context:yfiles.view.ICanvasContext,node:Node,id:string):boolean; + /** + * Creates the element that is put into the defs section of the SVG element. + * @param {yfiles.view.ICanvasContext} context The canvas context that can be used to register brushes etc. + * @returns {SVGElement} An {@link SVGElement} that can be put into the defs section of the SVG element. + * @abstract + */ + createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; + /** + * Updates the defs element with the current gradient data. + * @param {yfiles.view.ICanvasContext} context + * @param {SVGElement} oldElement + * @abstract + */ + updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; + } + var ISvgDefsCreator:{ + /** + * Determine whether the given element has an attribute with the given name 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 + * @returns {boolean} Whether the attribute is equal to "url(#{defsId})" + * @static + */ + 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. + * @returns {boolean} true if the specified element references the element; otherwise, false. + * @static + */ + isUseReference?(element:Node,defsId:string):boolean; $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; - }; + isInstance(o:Object):boolean; }; + 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 + } export enum Key{ ESCAPE, DELETE, @@ -75901,52092 +16597,2199 @@ declare module yfiles{ 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{ + export enum KeyEventType{ /** - * 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. - */ + * Neither Pressed, nor Typed, nor Released. + */ NONE, /** - * Indicates that the control key was pressed. - */ + * The key has been pressed. + */ + PRESSED, + /** + * The character has been typed. + */ + TYPED, + /** + * The key has been released. + */ + RELEASED + } + /** + * A wrapper for the native keyboard event which abstracts away incompatibilities in browser implementations. + * @class yfiles.view.KeyEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface KeyEventArgs extends yfiles.lang.EventArgs{} + export class KeyEventArgs { + /** + * 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]. + * @param {yfiles.view.KeyEventType} type The type of the event. + * @constructor + */ + constructor(evt:KeyboardEvent,isPrintable:boolean,type:yfiles.view.KeyEventType); + /** + * Sets this event's {@link yfiles.view.KeyEventArgs#defaultPrevented} property to true signalling that the event has been properly handled and any default behaviors should + * be prevented. + *

+ * This will call the corresponding method on the {@link yfiles.view.KeyEventArgs#originalEvent original native event}. + *

+ * @see yfiles.view.KeyEventArgs#defaultPrevented + */ + preventDefault():void; + /** + * Gets the original DOM event associated with this event. + * @type {Event} + */ + originalEvent:Event; + /** + * Gets the original source. + * @type {Node} + */ + originalSource:Node; + /** + * Gets the type of the event. + * @type {yfiles.view.KeyEventType} + */ + eventType:yfiles.view.KeyEventType; + /** + * Gets the key. + * @type {yfiles.view.Key} + */ + key:yfiles.view.Key; + /** + * Gets the charcode of the original event, if the original event was a key press. + *

+ * Otherwise returns 0. + *

+ * @type {number} + */ + charCode:number; + /** + * Gets the modifiers. + * @type {yfiles.view.ModifierKeys} + */ + modifiers:yfiles.view.ModifierKeys; + /** + * Gets a value indicating whether the alt modifier is pressed. + * @type {boolean} + */ + alt:boolean; + /** + * Gets a value indicating whether the shift modifier is pressed. + * @type {boolean} + */ + shift:boolean; + /** + * Gets a value indicating whether the control modifier is pressed. + * @type {boolean} + */ + control:boolean; + /** + * Gets a value indicating whether the meta modifier is pressed. + * @type {boolean} + */ + meta:boolean; + /** + * Gets a value indicating whether the default behaviors for this event have been prevented by a previous call to + * {@link yfiles.view.KeyEventArgs#preventDefault}. + * @type {boolean} + */ + defaultPrevented:boolean; + static $class:yfiles.lang.Class; + } + /** + * Fills an area with a linear gradient. + * @class yfiles.view.LinearGradient + * @extends {yfiles.view.Fill} + * @implements {yfiles.view.ISvgDefsCreator} + */ + export interface LinearGradient extends yfiles.view.Fill,yfiles.view.ISvgDefsCreator{} + export class LinearGradient { + /** + * Initializes a new instance of the {@link yfiles.view.LinearGradient} class. + * @param {Object} [options=null] The parameters to pass. + * @param options.gradientStops An array of {@link yfiles.view.GradientStop}s. Each item will be added to the {@link yfiles.view.LinearGradient#gradientStops} collection. + * @param {yfiles.geometry.Point} options.startPoint The start point of this gradient. + *

+ * This option sets the {@link yfiles.view.LinearGradient#startPoint} property on the created object. + *

+ * @param {yfiles.geometry.Point} options.endPoint The end point of this gradient. + *

+ * This option sets the {@link yfiles.view.LinearGradient#endPoint} property on the created object. + *

+ * @param {yfiles.view.GradientSpreadMethod} options.spreadMethod The spread method of this gradient. + *

+ * This option sets the {@link yfiles.view.LinearGradient#spreadMethod} property on the created object. + *

+ * @constructor + */ + constructor(options?:{startPoint?:yfiles.geometry.Point,endPoint?:yfiles.geometry.Point,spreadMethod?:yfiles.view.GradientSpreadMethod,gradientStops?:Array}); + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {Node} item + * @param {string} id + * @returns {boolean} + */ + accept(context:yfiles.view.ICanvasContext,item:Node,id:string):boolean; + /** + * Creates a new SVG gradient that corresponds to this gradient brush. + * @param {yfiles.view.ICanvasContext} context + * @returns {SVGElement} A new SVG gradient that corresponds to this gradient brush + */ + createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; + /** + * Creates a new SVG gradient that corresponds to this gradient brush. + * @returns {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 {yfiles.view.ICanvasContext} context The context. + * @param {SVGElement} oldElement The old element. + */ + updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; + /** + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {SVGElement} oldElement The old element. + * @param {yfiles.view.ICanvasContext} context The context. + */ + updateSvgGradient(oldElement:SVGElement,context:yfiles.view.ICanvasContext):void; + /** + * Gets or sets the spread method of this gradient. + * @type {yfiles.view.GradientSpreadMethod} + */ + spreadMethod:yfiles.view.GradientSpreadMethod; + /** + * Gets or sets the start point of this gradient. + * @type {yfiles.geometry.Point} + */ + startPoint:yfiles.geometry.Point; + /** + * Gets or sets the end point of this gradient. + * @type {yfiles.geometry.Point} + */ + endPoint:yfiles.geometry.Point; + /** + * Gets or sets the gradient stops of this brush. + * @type {yfiles.collections.List.} + */ + gradientStops:yfiles.collections.List; + static $class:yfiles.lang.Class; + } + 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. - */ + * Indicates that the shift key was pressed. + */ SHIFT, /** - * Indicates that the alt key was pressed. - */ + * Indicates that the alt key was pressed. + */ ALT, /** - * Indicates that the windows (or meta) key was pressed. - */ + * 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. - */ + * Fills an area with a SVG pattern. + * @class yfiles.view.PatternFill + * @extends {yfiles.view.Fill} + * @implements {yfiles.view.ISvgDefsCreator} + */ + export interface PatternFill extends yfiles.view.Fill,yfiles.view.ISvgDefsCreator{} + export class PatternFill { + /** + * Initializes a new instance of the {@link yfiles.view.PatternFill} class. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {Node} node + * @param {string} id + * @returns {boolean} + */ + accept(context:yfiles.view.ICanvasContext,node:Node,id:string):boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {SVGElement} + */ + createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {SVGElement} oldElement + */ + updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; + /** + * Gets or sets the content. + * @type {yfiles.view.SvgVisual} + */ + content:yfiles.view.SvgVisual; + /** + * Gets or sets the SVG view box of this pattern brush. + * @type {yfiles.geometry.Rect} + */ + viewBox:yfiles.geometry.Rect; + /** + * Gets or sets the origin of this pattern brush. + * @type {yfiles.geometry.Point} + */ + origin:yfiles.geometry.Point; + /** + * Gets or sets the size of this pattern brush. + * @type {yfiles.geometry.Size} + */ + size:yfiles.geometry.Size; + static $class:yfiles.lang.Class; + } + export enum LineCap{ + /** + * Indicates that the line cap of a {@link yfiles.view.Stroke} should be squared. + */ SQUARE, /** - * Indicates that the line cap of a pen should be flat. - */ + * Indicates that the line cap of a {@link yfiles.view.Stroke} should be flat. + */ FLAT, /** - * Indicates that the line cap of a pen should be a semicircle. - */ + * Indicates that the line cap of a {@link yfiles.view.Stroke} should be a semicircle. + */ ROUND } - export enum PenLineJoin{ + export enum LineJoin{ /** - * Indicates that the line joins of a pen should be beveled. - */ + * Indicates that the line joins of a {@link yfiles.view.Stroke} should be beveled. + */ BEVEL, /** - * Indicates that the line joins of a pen should be rounded. - */ + * Indicates that the line joins of a {@link yfiles.view.Stroke} should be rounded. + */ ROUND, /** - * Indicates that the line joins of a pen should be sharp. - */ + * Indicates that the line joins of a {@link yfiles.view.Stroke} 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{ + * Fills an area with a radial gradient. + * @class yfiles.view.RadialGradient + * @extends {yfiles.view.Fill} + * @implements {yfiles.view.ISvgDefsCreator} + */ + export interface RadialGradient extends yfiles.view.Fill,yfiles.view.ISvgDefsCreator{} + export class RadialGradient { /** - * 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; + * Initializes a new instance of the {@link yfiles.view.RadialGradient} class. + * @param {Object} [options=null] The parameters to pass. + * @param options.gradientStops An array of {@link yfiles.view.GradientStop}s. Each item will be added to the {@link yfiles.view.RadialGradient#gradientStops} collection. + * @param {yfiles.geometry.Point} options.center The center of this radial gradient. + *

+ * This option sets the {@link yfiles.view.RadialGradient#center} property on the created object. + *

+ * @param {number} options.radiusX The radius of the largest circle of this radial gradient in horizontal direction. + *

+ * This option sets the {@link yfiles.view.RadialGradient#radiusX} property on the created object. + *

+ * @param {number} options.radiusY The radius of the largest circle of this radial gradient in vertical direction. + *

+ * This option sets the {@link yfiles.view.RadialGradient#radiusY} property on the created object. + *

+ * @param {yfiles.view.GradientSpreadMethod} options.spreadMethod The spread method of this gradient. + *

+ * This option sets the {@link yfiles.view.RadialGradient#spreadMethod} property on the created object. + *

+ * @param {yfiles.geometry.Point} options.gradientOrigin The origin of this radial gradient. + *

+ * This option sets the {@link yfiles.view.RadialGradient#gradientOrigin} property on the created object. + *

+ * @constructor + */ + constructor(options?:{center?:yfiles.geometry.Point,radiusX?:number,radiusY?:number,spreadMethod?:yfiles.view.GradientSpreadMethod,gradientOrigin?:yfiles.geometry.Point,gradientStops?:Array}); /** - * 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; + * + * @param {yfiles.view.ICanvasContext} context + * @param {Node} item + * @param {string} id + * @returns {boolean} + */ + accept(context:yfiles.view.ICanvasContext,item:Node,id:string):boolean; /** - * 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; + * Creates a new SVG gradient that corresponds to this gradient brush. + * @param {yfiles.view.ICanvasContext} context + * @returns {SVGElement} A new SVG gradient that corresponds to this gradient brush + */ + createDefsElement(context:yfiles.view.ICanvasContext):SVGElement; /** - * 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; + * Creates a new SVG gradient that corresponds to this gradient brush. + * @returns {SVGElement} A new SVG gradient that corresponds to this gradient brush + */ + toSvgGradient():SVGElement; /** - * 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; + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {yfiles.view.ICanvasContext} context The context. + * @param {SVGElement} oldElement The old element. + */ + updateDefsElement(context:yfiles.view.ICanvasContext,oldElement:SVGElement):void; + /** + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {SVGElement} oldElement The old element. + * @param {yfiles.view.ICanvasContext} context The context. + */ + updateSvgGradient(oldElement:SVGElement,context:yfiles.view.ICanvasContext):void; + /** + * Gets or sets the center of this radial gradient. + * @type {yfiles.geometry.Point} + */ + center:yfiles.geometry.Point; + /** + * Gets or sets the origin of this radial gradient. + * @type {yfiles.geometry.Point} + */ + gradientOrigin:yfiles.geometry.Point; + /** + * Gets or sets the radius of the largest circle of this radial gradient in horizontal direction. + * @type {number} + */ + radiusX:number; + /** + * Gets or sets the radius of the largest circle of this radial gradient in vertical direction. + * @type {number} + */ + radiusY:number; + /** + * Gets or sets the spread method of this gradient. + * @type {yfiles.view.GradientSpreadMethod} + */ + spreadMethod:yfiles.view.GradientSpreadMethod; + /** + * Gets or sets the gradient stops of this brush. + * @type {yfiles.collections.List.} + */ + gradientStops:yfiles.collections.List; + static $class:yfiles.lang.Class; } - 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{ + * Base class for {@link yfiles.view.Visual}s that use HTML5's Canvas for the visualization. + *

+ * Note that instances of this class cannot be used anywhere where a {@link yfiles.view.Visual} is required. The visualization is + * implemented by the {@link yfiles.view.HtmlCanvasVisual#paint} method. This means that this kind of visual does not work in a {@link yfiles.view.SvgVisualGroup} + * and wrapping the visual will not work as there is no {@link SVGElement} that could be put into another SVG container. These kind + * of visuals can be used at the top-level of a {@link yfiles.view.CanvasComponent}'s {@link yfiles.view.ICanvasObject}s, only. + *

+ * @see yfiles.view.HtmlCanvasVisual#paint + * @class yfiles.view.HtmlCanvasVisual + * @extends {yfiles.view.Visual} + */ + export interface HtmlCanvasVisual extends yfiles.view.Visual{} + export class HtmlCanvasVisual { + constructor(); /** - * 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; + * 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.view.IRenderContext} renderContext The render context of the {@link yfiles.view.CanvasComponent} + * @param {CanvasRenderingContext2D} ctx The HTML5 Canvas context to use for rendering. + * @abstract + */ + paint(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D):void; + static $class:yfiles.lang.Class; } - var CultureInfo:{ - $class:yfiles.lang.Class; + export enum ShapeRenderingType{ /** - * Gets the invariant culture. - */ - INVARIANT_CULTURE:yfiles.system.CultureInfo; + * Indicates that the rendering engine should use a balanced setup with a slight preference of geometric precision. + */ + AUTO, /** - * Gets or sets the current UI culture. - * Value: - * The current UI culture. - */ - currentUICulture:yfiles.system.CultureInfo; + * Indicates that the rendering speed should be optimized. + */ + OPTIMIZE_SPEED, /** - * Initializes a new instance of the {@link yfiles.system.CultureInfo} class to the invariant culture. - */ - new ():yfiles.system.CultureInfo; + * Indicates that the rendering should be optimized for crisp edges. + */ + CRISP_EDGES, /** - * 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; - }; - }; + * Indicates that the rendering should be optimized for geometric precision. + */ + GEOMETRIC_PRECISION, + INHERIT + } /** - * Defines an event which is dispatched when a property changes. - */ - export interface INotifyPropertyChanged extends Object{ + * Fills an area with a specified solid color. + * @class yfiles.view.SolidColorFill + * @extends {yfiles.view.Fill} + */ + export interface SolidColorFill extends yfiles.view.Fill{} + export class SolidColorFill { /** - * Event which is dispatched when a property changes. - */ - addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + * Initializes a new instance of the {@link yfiles.view.SolidColorFill} class with the specified color. + * @param {yfiles.view.Color} color The solid color with which the area is filled. + * @constructor + */ + constructor(color:yfiles.view.Color); /** - * Event which is dispatched when a property changes. - */ - removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + * Gets the solid color with which the area is filled. + * @type {yfiles.view.Color} + */ + color:yfiles.view.Color; + static $class:yfiles.lang.Class; } - 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{ + * Wraps a {@link SVGElement} as {@link yfiles.view.Visual}. + * @class yfiles.view.SvgVisual + * @extends {yfiles.view.Visual} + */ + export interface SvgVisual extends yfiles.view.Visual{} + export class SvgVisual { /** - * The name of the changed property. - */ - propertyName:string; + * Initializes a new instance of the {@link yfiles.view.SvgVisual} class which wraps the specified SVG element. + * @param {SVGElement} element The SVG element which this object wraps. + * @constructor + */ + constructor(element:SVGElement); + /** + * Gets or sets the SVG element that is wrapped by this object. + * @type {SVGElement} + */ + svgElement:SVGElement; + static $class:yfiles.lang.Class; } - var PropertyChangedEventArgs:{ - $class:yfiles.lang.Class; + export enum HorizontalTextAlignment{ /** - * 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. - */ + * Indicates that the text should be centered. + */ CENTER, /** - * Indicates that the text should be aligned to the left. - */ + * Indicates that the text should be aligned to the left. + */ LEFT, /** - * Indicates that the text should be aligned to the right. - */ + * 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{ + export enum TextDecoration{ + /** + * No Text Decoration + */ + NONE, + /** + * Underlined text + */ + UNDERLINE, + /** + * Overlined Text + */ + OVERLINE, + /** + * Text with line through + */ + LINE_THROUGH, + /** + * Blinking Text + */ + BLINK } - var Brushes:{ - $class:yfiles.lang.Class; + export enum TextDecorations{ /** - * 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; + * No text decoration + */ + NONE, /** - * 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; + * Underlined text. + */ + UNDERLINE, /** - * 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; + * Overlined text. + */ + OVERLINE, /** - * 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; + * Crossed out text. + */ + STRIKETHROUGH } - 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{ + export enum TextWrapping{ /** - * 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; + * The text should not be trimmed. + */ + NONE, /** - * 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; + * The text could be wrapped and clipped after any character. + */ + CHARACTER, /** - * 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; + * The text could be wrapped and clipped after any character. An ellipsis is added to indicate clipped text. + */ + CHARACTER_ELLIPSIS, /** - * Gets or sets the item with the specified key. - * Value: The value to store with the key. - */ - getItem(key:yfiles.system.ResourceKey):Object; + * The text could be wrapped and clipped at word boundaries. + */ + WORD, /** - * 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; + * The text could be wrapped and clipped at word boundaries. An ellipsis is added to indicate trimmed text. + */ + WORD_ELLIPSIS } - var ApplicationResources:{ - $class:yfiles.lang.Class; + /** + * Displays a string or any HTML element as tool tip. + * @class yfiles.view.ToolTip + */ + export interface ToolTip extends Object{} + export class ToolTip { /** - * Initializes a new instance of the {@link yfiles.system.ApplicationResources} class. - */ - new ():yfiles.system.ApplicationResources; + * Creates a new instance. + *

+ * This implementation calls {@link yfiles.view.ToolTip#createToolTip} to create the HTML element to display as tool tip. + *

+ * @constructor + */ + constructor(); /** - * Gets the single static instance of this class for the current application. - * Value: The instance. - */ - INSTANCE:yfiles.system.ApplicationResources; - }; - export enum VerticalAlignment{ + * 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. + *

+ * @returns {HTMLDivElement} A HTML div element. + * @protected + */ + createToolTip():HTMLDivElement; /** - * Indicates that the object should be placed in the center of another object. - */ + * Sets the content to the HTML element that is displayed as tool tip. + *

+ * This implementation adds a string as innerHTML of the Div. A HTMLElement is added as child to the 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. + * @protected + */ + onContentChanged(oldContent:Object,newContent:Object):void; + /** + * Gets the div element that represents this {@link yfiles.view.ToolTip}. + * @type {HTMLDivElement} + */ + div:HTMLDivElement; + /** + * Specifies whether the tool tip is visible. + * @type {boolean} + */ + isOpen:boolean; + /** + * The top position of the tool tip. + * @type {number} + */ + verticalOffset:number; + /** + * The left position of the tool tip. + * @type {number} + */ + horizontalOffset:number; + /** + * Gets or sets the desired size of this control. + * @type {yfiles.geometry.Size} + */ + desiredSize:yfiles.geometry.Size; + /** + * Gets or sets the content. + *

+ * This setter invokes the method {@link yfiles.view.ToolTip#onContentChanged} if the content is changed. + *

+ * @type {Object} + */ + content:Object; + static $class:yfiles.lang.Class; + } + export enum VerticalTextAlignment{ + /** + * 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. - */ + * 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. - */ + * 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{ + * Base class for all objects that support drawing in the context of a {@link yfiles.view.CanvasComponent}. + * @see yfiles.view.SvgVisual + * @see yfiles.view.HtmlCanvasVisual + * @class yfiles.view.Visual + */ + export interface Visual extends Object{} + export class Visual { + static $class:yfiles.lang.Class; } - var ApplicationCommands:{ - $class:yfiles.lang.Class; + export enum MouseEventTypes{ /** - * 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. - */ + * Not a mouse event. + */ 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. - */ + * The mouse has been moved. + */ MOVE, /** - * Indicates that the data can be linked to the drop target. - */ - LINK, + * The mouse has been dragged, which means that it has been moved while at least one button has been pressed. + */ + DRAG, /** - * Indicates that the drop target is currently scrolling. - */ - SCROLL, + * A button has been pressed. + */ + DOWN, /** - * A combination of all of the flags. - */ - ALL + * A button has been released. + *

+ * If there was no drag event since the last press event, this will result in a click. + *

+ */ + UP, + /** + * The mouse has entered the control's bounds. + */ + ENTER, + /** + * The mouse has exited the control's bounds. + */ + LEAVE, + /** + * The mouse wheel has been turned. + */ + WHEEL, + /** + * A mouse click has been recognized. + *

+ * This is the case if a press has directly been followed by a release. + *

+ */ + CLICK, + /** + * 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 } /** - * Represents an ARGB (alpha, red, green, blue) encoded color object. - */ - export interface Color extends Object{ + * Complex event arguments that is used by the {@link yfiles.view.CanvasComponent} to indicate mouse events in world coordinates. + * @class yfiles.view.MouseEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface MouseEventArgs extends yfiles.lang.EventArgs{} + export class MouseEventArgs { /** - * 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; + * Constructs a new mouse event argument. + * @param {yfiles.view.MouseEventTypes} eventType The type of the event + * @param {yfiles.geometry.Point} location the position of the mouse in world coordinates at the time of the event + * @param {yfiles.view.MouseButtons} [changedButtons=yfiles.view.MouseButtons.NONE] the mouse buttons that have changed state if the type of event is {@link yfiles.view.MouseEventTypes#DOWN} or + * {@link yfiles.view.MouseEventTypes#UP} + * @param {yfiles.view.ModifierKeys} [changedModifiers=yfiles.view.ModifierKeys.NONE] the modifier Keys that have been changed + * @param {yfiles.view.MouseButtons} [buttons=yfiles.view.MouseButtons.NONE] the current state of the MouseButtons + * @param {yfiles.view.ModifierKeys} [modifiers=yfiles.view.ModifierKeys.NONE] the current state of the modifier Keys + * @param {number} [clickCount=0] the number of clicks this event represents, 2 for a double click + * @param {number} [mouseWheelDelta=0] the signed number of mouse wheel turn units + * @param {number} [scrollAmount=0] The number of lines to scroll, if scrollType is {@link yfiles.view.MouseWheelDeltaMode#LINES}. + * @param {yfiles.view.MouseWheelDeltaMode} [scrollType=yfiles.view.MouseWheelDeltaMode.LINES] The type of scrolling performed. + * @param {Event} originalEvent + * @constructor + */ + constructor(originalEvent:Event,eventType:yfiles.view.MouseEventTypes,location:yfiles.geometry.Point,changedButtons?:yfiles.view.MouseButtons,changedModifiers?:yfiles.view.ModifierKeys,buttons?:yfiles.view.MouseButtons,modifiers?:yfiles.view.ModifierKeys,clickCount?:number,mouseWheelDelta?:number,scrollAmount?:number,scrollType?:yfiles.view.MouseWheelDeltaMode); /** - * 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; + * Constructs a new mouse event argument. + * @param {Object} options The parameters to pass. + * @param {yfiles.view.MouseEventTypes} options.eventType The type of the event + * @param {yfiles.geometry.Point} options.location the position of the mouse in world coordinates at the time of the event + * @param {yfiles.view.MouseButtons} [options.changedButtons=yfiles.view.MouseButtons.NONE] the mouse buttons that have changed state if the type of event is {@link yfiles.view.MouseEventTypes#DOWN} or + * {@link yfiles.view.MouseEventTypes#UP} + * @param {yfiles.view.ModifierKeys} [options.changedModifiers=yfiles.view.ModifierKeys.NONE] the modifier Keys that have been changed + * @param {yfiles.view.MouseButtons} [options.buttons=yfiles.view.MouseButtons.NONE] the current state of the MouseButtons + * @param {yfiles.view.ModifierKeys} [options.modifiers=yfiles.view.ModifierKeys.NONE] the current state of the modifier Keys + * @param {number} [options.clickCount=0] the number of clicks this event represents, 2 for a double click + * @param {number} [options.mouseWheelDelta=0] the signed number of mouse wheel turn units + * @param {number} [options.scrollAmount=0] The number of lines to scroll, if scrollType is {@link yfiles.view.MouseWheelDeltaMode#LINES}. + * @param {yfiles.view.MouseWheelDeltaMode} [options.scrollType=yfiles.view.MouseWheelDeltaMode.LINES] The type of scrolling performed. + * @param {Event} options.originalEvent + * @constructor + */ + constructor(options:{originalEvent:Event,eventType:yfiles.view.MouseEventTypes,location:yfiles.geometry.Point,changedButtons?:yfiles.view.MouseButtons,changedModifiers?:yfiles.view.ModifierKeys,buttons?:yfiles.view.MouseButtons,modifiers?:yfiles.view.ModifierKeys,clickCount?:number,mouseWheelDelta?:number,scrollAmount?:number,scrollType?:yfiles.view.MouseWheelDeltaMode}); /** - * 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; + * Sets this event's {@link yfiles.view.MouseEventArgs#defaultPrevented} property to true signalling that the event has been properly handled and any default behaviors should + * be prevented. + *

+ * This will call the corresponding method on the {@link yfiles.view.MouseEventArgs#originalEvent original native event}. + *

+ * @see yfiles.view.MouseEventArgs#defaultPrevented + */ + preventDefault():void; /** - * 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; + * Gets the type of this event. + * @type {yfiles.view.MouseEventTypes} + */ + eventType:yfiles.view.MouseEventTypes; /** - * 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; + * Returns the coordinates in the world coordinate space associated with this event. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; /** - * 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 the number of clicks the current event represents if it is of type {@link yfiles.view.MouseEventTypes#CLICK}. + * @type {number} + */ + clickCount:number; /** - * 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; + * Gets the signed number of mouse wheel turn units. + *

+ * Note that this can, for high-precision mouse wheels, include fractional turns. + *

+ * @type {number} + */ + wheelDelta: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; + * Gets the distance to scroll at once when {@link yfiles.view.MouseEventArgs#deltaMode} is {@link yfiles.view.MouseWheelDeltaMode#LINES}. + *

+ * This is a system setting that only applies to scrolling (not zooming) and usually translates to the number of small + * scroll increments per scroll wheel notch. + *

+ *

+ * This property has a value of 1 if {@link yfiles.view.MouseEventArgs#deltaMode} is {@link yfiles.view.MouseWheelDeltaMode#PAGE}, as it is not applicable in that case. + *

+ * @type {number} + */ + scrollAmount:number; + /** + * Gets the scrolling behavior. + *

+ * This is a system setting that only applies to scrolling (not zooming) and can be either + * {@link yfiles.view.MouseWheelDeltaMode#LINES}, in which case {@link yfiles.view.MouseEventArgs#scrollAmount} will contain the number of "lines" to scroll with each scroll + * wheel notch, or {@link yfiles.view.MouseWheelDeltaMode#PAGE} in which case a single scroll wheel notch should scroll a "page" at + * a time. + *

+ * @type {yfiles.view.MouseWheelDeltaMode} + */ + deltaMode:yfiles.view.MouseWheelDeltaMode; + /** + * Returns the modifier keys that have changed for this event. + * @see yfiles.view.MouseEventArgs#modifiers + * @type {yfiles.view.ModifierKeys} + */ + changedModifiers:yfiles.view.ModifierKeys; + /** + * Returns the mouse buttons that have changed for this event. + * @see yfiles.view.MouseEventArgs#buttons + * @type {yfiles.view.MouseButtons} + */ + changedButtons:yfiles.view.MouseButtons; + /** + * The state of the modifier keys at the time of the event creation. + * @type {yfiles.view.ModifierKeys} + */ + modifiers:yfiles.view.ModifierKeys; + /** + * The state of the mouse buttons at the time of the event creation. + * @type {yfiles.view.MouseButtons} + */ + buttons:yfiles.view.MouseButtons; + /** + * Gets the original DOM event associated with this event. + * @type {Event} + */ + originalEvent:Event; + /** + * Gets a value indicating whether the default behaviors for this event have been prevented by a previous call to + * {@link yfiles.view.MouseEventArgs#preventDefault}. + * @type {boolean} + */ + defaultPrevented:boolean; + static $class:yfiles.lang.Class; } - var Color:{ - $class:yfiles.lang.Class; + export enum MouseWheelDeltaMode{ /** - * 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; - }; + * Scrolling should scroll a set number of lines per mouse wheel notch. + * @see yfiles.view.MouseEventArgs#scrollAmount + */ + LINES, + /** + * Scrolling should scroll a single "page" per mouse wheel notch. + */ + PAGE + } + export enum TouchEventTypes{ + /** + * Not a touch event. + */ + NONE, + /** + * A pointer has been moved. + */ + MOVE, + /** + * A touch device went down. + */ + DOWN, + /** + * A touch device went up. + */ + UP, + /** + * A touch device has entered the control's bounds. + */ + ENTER, + /** + * A touch device has exited the control's bounds. + */ + LEAVE, + /** + * A touch tap has been recognized. + *

+ * This is the case if a down has directly been followed by an up. + *

+ */ + TAP, + /** + * 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. or sent to the background or similar actions. + *

+ * This can be the case if the application or control is minimized + *

+ */ + LOST_CAPTURE + } /** - * Contains meta data related to the {@link yfiles.system.DependencyProperty}. - */ - export interface PropertyMetadata extends Object{ + * Complex event arguments that is used by the {@link yfiles.view.CanvasComponent} to indicate touch events in world coordinates. + * @class yfiles.view.TouchEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface TouchEventArgs extends yfiles.lang.EventArgs{} + export class TouchEventArgs { + /** + * Constructs a new touch event argument. + * @param {yfiles.view.TouchEventTypes} eventType The type of the event + * @param {yfiles.geometry.Point} location The position of the touch device in world coordinates at the time of the event + * @param {yfiles.view.TouchDevice} device The device the event was triggered by + * @param {Event} originalEvent + * @constructor + */ + constructor(originalEvent:Event,eventType:yfiles.view.TouchEventTypes,location:yfiles.geometry.Point,device:yfiles.view.TouchDevice); + /** + * Constructs a new touch event argument. + * @param {yfiles.view.TouchEventTypes} eventType The type of the event + * @param {yfiles.geometry.Point} location The position of the touch device in world coordinates at the time of the event + * @param {yfiles.view.TouchDevice} device The device the event was triggered by + * @param {number} tapCount the number of taps this event represents, 2 for a double tap + * @param {Event} originalEvent + * @constructor + */ + constructor(originalEvent:Event,eventType:yfiles.view.TouchEventTypes,location:yfiles.geometry.Point,device:yfiles.view.TouchDevice,tapCount:number); + /** + * Sets this event's {@link yfiles.view.TouchEventArgs#defaultPrevented} property to true signalling that the event has been properly handled and any default behaviors should + * be prevented. + *

+ * This will call the corresponding method on the {@link yfiles.view.TouchEventArgs#originalEvent original native event}. + *

+ * @see yfiles.view.TouchEventArgs#defaultPrevented + */ + preventDefault():void; + /** + * Gets the type of this event. + * @type {yfiles.view.TouchEventTypes} + */ + eventType:yfiles.view.TouchEventTypes; + /** + * Returns the location represented by this event in world coordinates. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + /** + * Returns the touch device associated with this event. + * @type {yfiles.view.TouchDevice} + */ + device:yfiles.view.TouchDevice; + /** + * Returns the number of taps the current event represents if it is of type {@link yfiles.view.TouchEventTypes#TAP}. + * @type {number} + */ + tapCount:number; + /** + * Gets the original DOM event associated with this event. + * @type {Event} + */ + originalEvent:Event; + /** + * Gets a value indicating whether the default behaviors for this event have been prevented by a previous call to + * {@link yfiles.view.TouchEventArgs#preventDefault}. + * @type {boolean} + */ + defaultPrevented:boolean; + static $class:yfiles.lang.Class; } - 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{ + * The representation of a touch point on the screen. + * @class yfiles.view.TouchDevice + */ + export interface TouchDevice extends Object{} + export class TouchDevice { /** - * 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; + * Gets the device's index + * @type {number} + */ + deviceIndex:number; /** - * The days part of the time span. - */ - days:number; + * Gets a value indicating whether this device is the primary one. + *

+ * If {@link yfiles.view.TouchDevice#deviceIndex} is 0 this property has the value true, otherwise false. + *

+ * @type {boolean} + */ + isPrimaryDevice:boolean; /** - * The total milliseconds (i.e. ticks) of this time span. - */ - totalMilliseconds:number; + * Gets the last device coordinate in the view coordinate system. + * @type {yfiles.geometry.Point} + */ + lastViewCoordinate:yfiles.geometry.Point; /** - * The milliseconds part of this time span. - */ - milliseconds:number; + * Gets the time of the last {@link yfiles.view.TouchEventArgs event} that was raised by this device. + * @type {Date} + */ + lastEventTimeJS:Date; /** - * 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; + * Indicates if this device is currently down or not. + *

+ * Default is true. + *

+ * @type {boolean} + */ + isDown:boolean; + static $class:yfiles.lang.Class; } - 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. - */ + * The event argument class that is used by {@link yfiles.view.DragSource#addQueryContinueDragListener QueryContinueDrag} + * during drags to query the drag source whether the drag should be continued. + * @class yfiles.view.QueryContinueDragEventArgs + * @extends {yfiles.lang.EventArgs} + * @final + */ + export interface QueryContinueDragEventArgs extends yfiles.lang.EventArgs{} + export class QueryContinueDragEventArgs { + /** + * Gets or sets the action. + * @type {yfiles.view.DragAction} + */ + action:yfiles.view.DragAction; + /** + * Gets a value indicating whether the escape key had been pressed. + * @type {boolean} + */ + escapePressed:boolean; + /** + * Gets the current state of the keys. + * @type {yfiles.view.DragDropKeyStates} + */ + keyStates:yfiles.view.DragDropKeyStates; + /** + * Gets or sets a value indicating whether this {@link yfiles.view.QueryContinueDragEventArgs} is handled. + * @type {boolean} + */ 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; + static $class:yfiles.lang.Class; } - var ExecutedRoutedEventArgs:{ - $class:yfiles.lang.Class; + export enum DragAction{ /** - * 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; - }; + * Whether the drag should be continued. + */ + CONTINUE, /** - * 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; - }; + * Whether the drag should be finalized by an immediate drop. + */ + DROP, + /** + * Whether the drag operation should be canceled. + */ + CANCEL + } /** - * 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{ + * Helper class for drag and drop support that is used for the source of drag and drop operations. + * @class yfiles.view.DragSource + */ + export interface DragSource extends Object{} + export class DragSource { /** - * Gets a value indicating whether this instance is frozen. - * Value: true if this instance is frozen; otherwise, false. - */ - isFrozen:boolean; + * Initializes a new instance of the {@link yfiles.view.DragSource} class setting the {@link yfiles.view.DragSource#source} property to the given element. + * @param {HTMLElement} source The source. + * @constructor + */ + constructor(source:HTMLElement); /** - * Freezes this instance. - */ + * Cleans up by removing the association with the {@link yfiles.view.DragSource#source} element. + */ + cleanUp():void; + /** + * Raises the {@link yfiles.view.DragSource#addQueryContinueDragListener QueryContinueDrag} event. + *

+ * If the event is not {@link yfiles.view.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.view.DragAction#CONTINUE continued}. + *

+ * @param {yfiles.view.QueryContinueDragEventArgs} evt The {@link yfiles.view.QueryContinueDragEventArgs} instance containing the event data. + */ + onQueryContinueDrag(evt:yfiles.view.QueryContinueDragEventArgs):void; + /** + * Initiates a new drag operation using the provided drag data and effects. + *

+ * If useCssCursors is 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-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @param {yfiles.view.DragDropItem} dragData The data to use for the drag. + * @param {yfiles.view.DragDropEffects} [dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed effects. + * @param {boolean} [useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. + */ + startDrag(dragData:yfiles.view.DragDropItem,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean):void; + /** + * Initiates a new drag operation using the provided drag data and effects. + *

+ * If useCssCursors is 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-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.DragDropItem} options.dragData The data to use for the drag. + * @param {yfiles.view.DragDropEffects} [options.dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed effects. + * @param {boolean} [options.useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. + */ + startDrag(options:{dragData:yfiles.view.DragDropItem,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean}):void; + /** + * Adds the given listener for the QueryContinueDrag event that occurs when the state of the {@link yfiles.view.DragDropKeyStates} + * has changed to query the source whether the drag operation should be continued. + *

+ * Handlers should adjust the {@link yfiles.view.QueryContinueDragEventArgs#handled} and {@link yfiles.view.QueryContinueDragEventArgs#action} properties accordingly. + *

+ * @param {function(Object, yfiles.view.QueryContinueDragEventArgs): void} listener The listener to add. + * @see yfiles.view.DragSource#removeQueryContinueDragListener + */ + addQueryContinueDragListener(listener:(sender:Object,evt:yfiles.view.QueryContinueDragEventArgs)=>void):void; + /** + * Removes the given listener for the QueryContinueDrag event that occurs when the state of the {@link yfiles.view.DragDropKeyStates} + * has changed to query the source whether the drag operation should be continued. + *

+ * Handlers should adjust the {@link yfiles.view.QueryContinueDragEventArgs#handled} and {@link yfiles.view.QueryContinueDragEventArgs#action} properties accordingly. + *

+ * @param {function(Object, yfiles.view.QueryContinueDragEventArgs): void} listener The listener to remove. + * @see yfiles.view.DragSource#addQueryContinueDragListener + */ + removeQueryContinueDragListener(listener:(sender:Object,evt:yfiles.view.QueryContinueDragEventArgs)=>void):void; + /** + * Gets or sets the source element from which drags can originate. + *

+ * If the {@link yfiles.view.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.view.DragSource#startDrag initiate a drag and drop operation}. + *

+ * @default null + * @type {HTMLElement} + */ + source:HTMLElement; + /** + * Gets or sets a value indicating whether default drag gestures should be automatically recognized on the {@link yfiles.view.DragSource#source}. + * @default false + * @type {boolean} + */ + allowDrag:boolean; + /** + * Gets or sets the data that will be used for the {@link yfiles.view.DragSource#allowDrag automatic drag operation}. + *

+ * If this data is not a {@link yfiles.view.DragDropItem}, the {@link yfiles.input.DropInputMode expected format} of the automatic drag operation will be code. + *

+ * @default null + * @type {Object} + */ + item:Object; + /** + * Gets or sets the {@link yfiles.view.DragSource#effectAllowed} that will be used for the {@link yfiles.view.DragSource#allowDrag automatic drag operation}. + * @default 7 + * @type {yfiles.view.DragDropEffects} + */ + effectAllowed:yfiles.view.DragDropEffects; + static $class:yfiles.lang.Class; + } + /** + * Helper class that plays the role of the target during a drag and drop operation that is initiated using {@link yfiles.view.DragSource#startDrag} + * in a {@link yfiles.view.DragSource}. + * @class yfiles.view.DropTarget + */ + export interface DropTarget extends Object{} + export class DropTarget { + /** + * Initializes a new instance of the {@link yfiles.view.DropTarget} class. + *

+ * In order to make the instance available to the drag and drop mechanisms, the {@link yfiles.view.DropTarget#setDropTarget} helper + * method should be used. If the optional element is passed in, it will automatically be registered. + *

+ * @param {Element} [element=null] The element to optionally {@link yfiles.view.DropTarget#setDropTarget associate} with the new instance. + * @see yfiles.view.DropTarget#setDropTarget + * @see yfiles.view.DropTarget#getDropTarget + * @constructor + */ + constructor(element?:Element); + /** + * Gets the {@link yfiles.view.DropTarget} instance associated with the given element. + * @param {Element} element The element to get the drop target instance of. + * @returns {yfiles.view.DropTarget} The associated instance or null. + * @see yfiles.view.DropTarget#setDropTarget + * @static + */ + static getDropTarget(element:Element):yfiles.view.DropTarget; + /** + * Sets the drop target for the given element. + * @param {Element} element The element or null to register the drop target instance with. + * @param {yfiles.view.DropTarget} dropTarget The instance to attach to the element, null to remove the association from the element. + * @see yfiles.view.DropTarget#getDropTarget + * @static + */ + static setDropTarget(element:Element,dropTarget:yfiles.view.DropTarget):void; + /** + * Adds the given listener for the DragEnter event that occurs when a drag enters the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to add. + * @see yfiles.view.DropTarget#removeDragEnterListener + */ + addDragEnterListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Removes the given listener for the DragEnter event that occurs when a drag enters the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to remove. + * @see yfiles.view.DropTarget#addDragEnterListener + */ + removeDragEnterListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Adds the given listener for the DragLeave event that occurs when a drag leaves the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to add. + * @see yfiles.view.DropTarget#removeDragLeaveListener + */ + addDragLeaveListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Removes the given listener for the DragLeave event that occurs when a drag leaves the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to remove. + * @see yfiles.view.DropTarget#addDragLeaveListener + */ + removeDragLeaveListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Adds the given listener for the DragOver event that occurs when a drag is being performed over the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to add. + * @see yfiles.view.DropTarget#removeDragOverListener + */ + addDragOverListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Removes the given listener for the DragOver event that occurs when a drag is being performed over the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to remove. + * @see yfiles.view.DropTarget#addDragOverListener + */ + removeDragOverListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Adds the given listener for the Drop event that occurs when the drop operation is performed on the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to add. + * @see yfiles.view.DropTarget#removeDropListener + */ + addDropListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Removes the given listener for the Drop event that occurs when the drop operation is performed on the drop target. + *

+ * The handler may adjust the {@link yfiles.view.DragEventArgs#dropEffect} and call {@link yfiles.view.DragEventArgs#handled}. + *

+ * @param {function(Object, yfiles.view.DragEventArgs): void} listener The listener to remove. + * @see yfiles.view.DropTarget#addDropListener + */ + removeDropListener(listener:(sender:Object,evt:yfiles.view.DragEventArgs)=>void):void; + /** + * Gets or sets a value indicating whether dropping to this target is currently allowed. + * @type {boolean} + */ + allowDrop:boolean; + static $class:yfiles.lang.Class; + } + /** + * A container for {@link yfiles.view.DashStyle#dashes} and an {@link yfiles.view.DashStyle#offset}. + *

+ * All of these values are in terms of multiples of the the thickness of a + * {@link yfiles.view.Stroke}. This is different from the corresponding properties of a SVG stroke. + *

+ * @class yfiles.view.DashStyle + */ + export interface DashStyle extends Object{} + export class DashStyle { + /** + * Initializes a new instance of the {@link yfiles.view.DashStyle} class using the provided dashes and offset. + * @param {Array.} dashes The dashes. + * @param {number} offset The offset. + * @constructor + */ + constructor(dashes:number[],offset:number); + /** + * Initializes a new instance of the {@link yfiles.view.DashStyle} class using an empty {@link yfiles.view.DashStyle#dashes} and zero {@link yfiles.view.DashStyle#offset}. + * @constructor + */ + constructor(); + /** + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance is already {@link yfiles.view.DashStyle#isFrozen frozen}. + * @returns {Object} An instance of the same type as this instance. + */ + clone():Object; + /** + * Freezes this instance. + *

+ * Freezing an object makes it immutable, which can result in performance enhancements. + *

+ */ 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. - */ + * Determines if this instance is frozen. + * @returns {boolean} + */ + isFrozen():boolean; + /** + * Gets or sets the dashes. + * @type {yfiles.collections.List.} + */ + dashes:yfiles.collections.List; + /** + * Gets or sets the offset. + * @type {number} + */ 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; + * Gets the dash style with a single dash. + *

+ * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and + * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't look as expected if its dash cap is {@link yfiles.view.LineCap#FLAT}. + * Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. + *

+ */ + static DASH:yfiles.view.DashStyle; + /** + * Gets the dash style with a single dash and dot. + *

+ * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and + * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't contain visible dots if its dash cap is + * {@link yfiles.view.LineCap#FLAT}. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. + *

+ */ + static DASH_DOT:yfiles.view.DashStyle; + /** + * Gets the dash style with a single dash and two dots. + *

+ * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and + * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't contain visible dots if its dash cap is + * {@link yfiles.view.LineCap#FLAT}. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. + *

+ */ + static DASH_DOT_DOT:yfiles.view.DashStyle; + /** + * Gets the dash style with a single dot. + *

+ * This style is designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and + * {@link yfiles.view.LineCap#ROUND}. A pen with this style doesn't contain visible dots if its dash cap is + * {@link yfiles.view.LineCap#FLAT}. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value. + *

+ */ + static DOT:yfiles.view.DashStyle; + /** + * Gets the solid dash style with no dashes. + */ + static SOLID:yfiles.view.DashStyle; + static $class:yfiles.lang.Class; } - 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; + * The default implementation of a data object for the {@link yfiles.input.DropInputMode}. + * @class yfiles.view.DragDropItem + * @final + */ + export interface DragDropItem extends Object{} + export class DragDropItem { /** - * Gets a 50 percent hatch brush. - * Value: The frozen brush instance. - */ - HATCH50:yfiles.system.Brush; - }; + * Initializes a new instance of the {@link yfiles.view.DragDropItem} class and sets the provided data item for the specified + * format. + * @param {string} [format=null] The format. + * @param {Object} [data=null] The data item. + * @see yfiles.view.DragDropItem#setData + * @constructor + */ + constructor(format?:string,data?:Object); + /** + * Initializes a new instance of the {@link yfiles.view.DragDropItem} class and sets the provided data item for the specified + * format. + * @param {Object} options The parameters to pass. + * @param {string} [options.format=null] The format. + * @param {Object} [options.data=null] The data item. + * @see yfiles.view.DragDropItem#setData + * @constructor + */ + constructor(options:{format?:string,data?:Object}); + /** + * Gets the data item for the given format. + * @param {string} format The format. + * @returns {Object} The data item that is stored for this format, or null if no such item exists. + * @see yfiles.view.DragDropItem#setData + */ + getData(format:string):Object; + /** + * Sets the data item for the given format. + * @param {string} format The format. + * @param {Object} data The data item. + * @see yfiles.view.DragDropItem#getData + */ + setData(format:string,data:Object):void; + /** + * Gets the types of the data items stored in this instance. + * @type {Array.} + */ + types:string[]; + static $class:yfiles.lang.Class; + } /** - * 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{ + * A utility class that holds all properties of a {@link yfiles.view.Stroke}. + * @class yfiles.view.Stroke + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface Stroke extends Object,yfiles.lang.ICloneable{} + export class Stroke { /** - * Gets the prefix. - * Value: The prefix. - */ - prefix:string; + * Initializes a new instance of the {@link yfiles.view.Stroke} class using the given brush and thickness. + * @param {yfiles.view.Fill} [fill=null] The brush. + * @param {number} [thickness=1.0] The thickness. + * @constructor + */ + constructor(fill?:yfiles.view.Fill,thickness?:number); /** - * Gets the XML namespace. - * Value: The XML namespace. - */ - xmlNamespace:string; + * Initializes a new instance of the {@link yfiles.view.Stroke} class using the given brush and thickness. + * @param {Object} options The parameters to pass. + * @param {yfiles.view.Fill} [options.fill=null] The brush. + * @param {number} [options.thickness=1.0] The thickness. + * @param {yfiles.view.LineCap} options.lineCap The dash cap. + *

+ * This option sets the {@link yfiles.view.Stroke#lineCap} property on the created object. + *

+ * @param {yfiles.view.DashStyle} options.dashStyle The dash style for the {@link yfiles.view.Stroke}. + *

+ * This option sets the {@link yfiles.view.Stroke#dashStyle} property on the created object. + *

+ * @param {yfiles.view.LineJoin} options.lineJoin The line join property. + *

+ * This option sets the {@link yfiles.view.Stroke#lineJoin} property on the created object. + *

+ * @param {number} options.miterLimit The miter limit. + *

+ * This option sets the {@link yfiles.view.Stroke#miterLimit} property on the created object. + *

+ * @constructor + */ + constructor(options:{fill?:yfiles.view.Fill,thickness?:number,lineCap?:yfiles.view.LineCap,dashStyle?:yfiles.view.DashStyle,lineJoin?:yfiles.view.LineJoin,miterLimit?:number}); + /** + * Assigns the stroke defined by this instance to the given element. + * @param {SVGElement} element The element whose stroke should be set. + * @param {yfiles.view.ICanvasContext} context The context. + */ + applyTo(element:SVGElement,context:yfiles.view.ICanvasContext):void; + /** + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance is already {@link yfiles.view.Stroke#isFrozen frozen}. + * @returns {Object} An instance of the same type as this instance. + */ + clone():Object; + /** + * Clones the current value of this instance to a new unfrozen {@link yfiles.view.Stroke}. + * @returns {yfiles.view.Stroke} + */ + cloneCurrentValue():yfiles.view.Stroke; + /** + * Freezes this instance. + *

+ * Freezing an object makes it immutable, which can result in performance enhancements. + *

+ */ + freeze():void; + /** + * Determines if this instance is frozen. + * @returns {boolean} + */ + isFrozen():boolean; + /** + * Gets or sets the brush for the {@link yfiles.view.Stroke}. + * @default 'Black' + * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + /** + * Gets or sets the dash cap. + * @default 1 + * @type {yfiles.view.LineCap} + */ + lineCap:yfiles.view.LineCap; + /** + * Gets or sets the line join property. + * @default 2 + * @type {yfiles.view.LineJoin} + */ + lineJoin:yfiles.view.LineJoin; + /** + * Gets or sets the dash style for the {@link yfiles.view.Stroke}. + *

+ * The visual appearance of the 'dashes' and 'gaps' specified by this property depends on the value of the property {@link yfiles.view.Stroke#lineCap}, too. + *

+ *

+ * The predefined dash styles are designed for dash caps that extend into the 'gaps' like {@link yfiles.view.LineCap#SQUARE} and + * {@link yfiles.view.LineCap#ROUND}. With {@link yfiles.view.LineCap#FLAT}, the dashes might not look like expected, for example {@link yfiles.view.DashStyle#DOT} will not + * be visible at all. Since {@link yfiles.view.LineCap#FLAT} is the default value, you should explicitly set another value in this + * case. + *

+ * @default 'Solid' + * @type {yfiles.view.DashStyle} + */ + dashStyle:yfiles.view.DashStyle; + /** + * Gets or sets the miter limit. + * @default 10.0 + * @type {number} + */ + miterLimit:number; + /** + * Gets or sets the thickness of the stroke. + * @default 1.0 + * @type {number} + */ + thickness:number; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ALICE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ALICE_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ANTIQUE_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ANTIQUE_WHITE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#AQUA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static AQUA:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#AQUAMARINE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static AQUAMARINE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#AZURE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static AZURE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BEIGE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BEIGE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BISQUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BISQUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLACK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BLACK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLANCHED_ALMOND} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BLANCHED_ALMOND:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BLUE_VIOLET} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BLUE_VIOLET:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BROWN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#BURLY_WOOD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static BURLY_WOOD:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CADET_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CADET_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CHARTREUSE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CHARTREUSE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CHOCOLATE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CHOCOLATE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CORAL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CORAL:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CORNFLOWER_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CORNFLOWER_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CORNSILK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CORNSILK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CRIMSON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CRIMSON:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#CYAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static CYAN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_CYAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_CYAN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_GOLDENROD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_GOLDENROD:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_KHAKI} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_KHAKI:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_MAGENTA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_MAGENTA:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_OLIVE_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_OLIVE_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_ORANGE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_ORANGE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_ORCHID} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_ORCHID:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_RED:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SALMON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_SALMON:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_SEA_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SLATE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_SLATE_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_SLATE_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_SLATE_GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_TURQUOISE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DARK_VIOLET} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DARK_VIOLET:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DEEP_PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DEEP_PINK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DEEP_SKY_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DEEP_SKY_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DIM_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DIM_GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#DODGER_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static DODGER_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FIREBRICK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static FIREBRICK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FLORAL_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static FLORAL_WHITE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FOREST_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static FOREST_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#FUCHSIA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static FUCHSIA:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GAINSBORO} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GAINSBORO:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GHOST_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GHOST_WHITE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GOLD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GOLD:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GOLDENROD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GOLDENROD:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#GREEN_YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static GREEN_YELLOW:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#HONEYDEW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static HONEYDEW:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#HOT_PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static HOT_PINK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#INDIAN_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static INDIAN_RED:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#INDIGO} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static INDIGO:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#IVORY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static IVORY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#KHAKI} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static KHAKI:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LAVENDER} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LAVENDER:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LAVENDER_BLUSH} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LAVENDER_BLUSH:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LAWN_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LAWN_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LEMON_CHIFFON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LEMON_CHIFFON:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_CORAL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_CORAL:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_CYAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_CYAN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_GOLDENROD_YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_GOLDENROD_YELLOW:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_PINK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SALMON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_SALMON:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_SEA_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SKY_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_SKY_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_SLATE_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_SLATE_GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_STEEL_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_STEEL_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIGHT_YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIGHT_YELLOW:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIME} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIME:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LIME_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LIME_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#LINEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static LINEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MAGENTA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MAGENTA:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MAROON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MAROON:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_AQUAMARINE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_AQUAMARINE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_ORCHID} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_ORCHID:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_PURPLE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_PURPLE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_SEA_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_SLATE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_SLATE_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_SPRING_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_SPRING_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_TURQUOISE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MEDIUM_VIOLET_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MEDIUM_VIOLET_RED:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MIDNIGHT_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MIDNIGHT_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MINT_CREAM} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MINT_CREAM:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MISTY_ROSE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MISTY_ROSE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#MOCCASIN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static MOCCASIN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#NAVAJO_WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static NAVAJO_WHITE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#NAVY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static NAVY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#OLD_LACE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static OLD_LACE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#OLIVE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static OLIVE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#OLIVE_DRAB} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static OLIVE_DRAB:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ORANGE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ORANGE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ORANGE_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ORANGE_RED:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ORCHID} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ORCHID:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_GOLDENROD} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PALE_GOLDENROD:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PALE_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PALE_TURQUOISE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PALE_VIOLET_RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PALE_VIOLET_RED:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PAPAYA_WHIP} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PAPAYA_WHIP:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PEACH_PUFF} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PEACH_PUFF:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PERU} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PERU:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PINK} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PINK:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PLUM} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PLUM:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#POWDER_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static POWDER_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#PURPLE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static PURPLE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#RED} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static RED:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ROSY_BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ROSY_BROWN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#ROYAL_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static ROYAL_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SADDLE_BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SADDLE_BROWN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SALMON} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SALMON:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SANDY_BROWN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SANDY_BROWN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SEA_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SEA_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SEA_SHELL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SEA_SHELL:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SIENNA} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SIENNA:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SILVER} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SILVER:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SKY_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SKY_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SLATE_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SLATE_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SLATE_GRAY} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SLATE_GRAY:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SNOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SNOW:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#SPRING_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static SPRING_GREEN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#STEEL_BLUE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static STEEL_BLUE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TAN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static TAN:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TEAL} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static TEAL:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#THISTLE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static THISTLE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TOMATO} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static TOMATO:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TRANSPARENT} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static TRANSPARENT:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#TURQUOISE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static TURQUOISE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#VIOLET} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static VIOLET:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#WHEAT} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static WHEAT:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#WHITE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static WHITE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#WHITE_SMOKE} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static WHITE_SMOKE:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#YELLOW} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static YELLOW:yfiles.view.Stroke; + /** + * Gets a {@link yfiles.view.Stroke#isFrozen frozen} {@link yfiles.view.Stroke} that uses {@link yfiles.view.Fill#YELLOW_GREEN} as its {@link yfiles.view.Stroke#fill} and has a {@link yfiles.view.Stroke#thickness} of 1. + */ + static YELLOW_GREEN:yfiles.view.Stroke; + static $class:yfiles.lang.Class; } - 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{ + * Describes a font, with size, family, style, weight and line spacing. + * @class yfiles.view.Font + */ + export interface Font extends Object{} + export class Font { /** - * Gets or sets the name of the assembly. - * Value: The name of the assembly. - */ - assemblyName:string; + * Initializes a new instance of the {@link yfiles.view.Font} class with size 10, "Arial" family, normal weight and style and line + * spacing 0.5, or the given values. + * @param {string} [fontFamily=null] + * @param {number} [fontSize=10] + * @param {yfiles.view.FontStyle} [fontStyle=null] + * @param {yfiles.view.FontWeight} [fontWeight=null] + * @param {number} [lineSpacing=0.5] + * @param {yfiles.view.TextDecoration} [textDecoration=null] + * @see yfiles.view.Font#createCopy + * @constructor + */ + constructor(fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration); /** - * Gets the CLR namespace. - * Value: The CLR namespace. - */ - clrNamespace:string; + * Initializes a new instance of the {@link yfiles.view.Font} class with size 10, "Arial" family, normal weight and style and line + * spacing 0.5, or the given values. + * @param {Object} options The parameters to pass. + * @param {string} [options.fontFamily=null] + * @param {number} [options.fontSize=10] + * @param {yfiles.view.FontStyle} [options.fontStyle=null] + * @param {yfiles.view.FontWeight} [options.fontWeight=null] + * @param {number} [options.lineSpacing=0.5] + * @param {yfiles.view.TextDecoration} [options.textDecoration=null] + * @see yfiles.view.Font#createCopy + * @constructor + */ + constructor(options:{fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration}); /** - * Gets the XML namespace. - * Value: The XML namespace. - */ - xmlNamespace:string; + * Assigns the text properties of this instance to the given text element. + * @param {SVGTextElement} textElement The text element to assign set the {@link yfiles.view.Font} on. + */ + applyTo(textElement:SVGTextElement):void; + /** + * Creates a copy with the values of this instance or optionally the explicitly specified values. + * @param {string} [fontFamily=null] The font family to use for the copy. + * @param {number} [fontSize=-1] The font size to use for the copy. + * @param {yfiles.view.FontStyle} [fontStyle=null] The font style to use for the copy. + * @param {yfiles.view.FontWeight} [fontWeight=null] The font weight to use for the copy. + * @param {number} [lineSpacing=-1] The line spacing to use for the copy. + * @param {yfiles.view.TextDecoration} [textDecoration=null] The text decoration to use for the copy. + * @returns {yfiles.view.Font} A new {@link yfiles.view.Font} instance. + */ + createCopy(fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration):yfiles.view.Font; + /** + * Creates a copy with the values of this instance or optionally the explicitly specified values. + * @param {Object} options The parameters to pass. + * @param {string} [options.fontFamily=null] The font family to use for the copy. + * @param {number} [options.fontSize=-1] The font size to use for the copy. + * @param {yfiles.view.FontStyle} [options.fontStyle=null] The font style to use for the copy. + * @param {yfiles.view.FontWeight} [options.fontWeight=null] The font weight to use for the copy. + * @param {number} [options.lineSpacing=-1] The line spacing to use for the copy. + * @param {yfiles.view.TextDecoration} [options.textDecoration=null] The text decoration to use for the copy. + * @returns {yfiles.view.Font} A new {@link yfiles.view.Font} instance. + */ + createCopy(options:{fontFamily?:string,fontSize?:number,fontStyle?:yfiles.view.FontStyle,fontWeight?:yfiles.view.FontWeight,lineSpacing?:number,textDecoration?:yfiles.view.TextDecoration}):yfiles.view.Font; + /** + * Gets the size of the font. + *

+ * The font size is interpreted as px. + *

+ * @default 10 + * @type {number} + */ + fontSize:number; + /** + * Gets or sets the font family. + * @default 'Arial' + * @type {string} + */ + fontFamily:string; + /** + * Gets or sets the font style. + * @default 0 + * @type {yfiles.view.FontStyle} + */ + fontStyle:yfiles.view.FontStyle; + /** + * Gets or sets the font weight. + * @default 0 + * @type {yfiles.view.FontWeight} + */ + fontWeight:yfiles.view.FontWeight; + /** + * Gets or sets the line spacing. + *

+ * The value is interpreted as parts of the line height. + *

+ * @default 0.5 + * @type {number} + */ + lineSpacing:number; + /** + * Gets or sets the text decoration. + * @default 0 + * @type {yfiles.view.TextDecoration} + */ + textDecoration:yfiles.view.TextDecoration; + static $class:yfiles.lang.Class; } - 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; + export enum FontStyle{ + NORMAL, + ITALIC, + OBLIQUE, + INHERIT } - 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, @@ -128003,3242 +18806,79040 @@ declare module yfiles{ ITEM900, INHERIT } - export enum TextDecoration{ + /** + * A component for displaying and editing an {@link yfiles.graph.IGraph}. + *

+ * This is a specialized {@link yfiles.view.CanvasComponent} that can hold, display, and edit an {@link yfiles.graph.IGraph} instance. It + * provides access to the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.GraphComponent#selection} instances. + *

+ *

+ * This class has bindings for the following {@link yfiles.input.ICommand}s. + *

+ *
    + *
  • {@link yfiles.input.ICommand#FIT_GRAPH_BOUNDS_COMMAND} that invokes FitGraphBounds()
  • + *
  • {@link yfiles.input.ICommand#SET_CURRENT_ITEM_COMMAND} for setting the {@link yfiles.view.GraphComponent#currentItem}
  • + *
  • {@link yfiles.input.ICommand#ZOOM_TO_CURRENT_ITEM_COMMAND} for adjusting the {@link yfiles.view.CanvasComponent#viewport} to the {@link yfiles.view.GraphComponent#currentItem}
  • + *
+ *

+ * The {@link yfiles.input.ICommand#ZOOM_TO_CURRENT_ITEM_COMMAND} is enabled, if {@link yfiles.view.CanvasComponent#navigationCommandsEnabled} is true. + *

+ *

+ * The components that can be used to display and edit a model are discussed in the section + * {@link @DGUIDE_PREFIX@/view_graphcontrol.html The Component for Displaying Graphs}. + *

+ *

Related demos:

+ *
    + *
  • Demo: GraphViewer, Demo.yFiles.Graph.Viewer
  • + *
  • Demo: SimpleEditorForm, Demo.yFiles.Graph.SimpleEditor
  • + *
+ * @class yfiles.view.GraphComponent + * @extends {yfiles.view.CanvasComponent} + */ + export interface GraphComponent extends yfiles.view.CanvasComponent{} + export class GraphComponent { /** - * No Text Decoration. - */ + * Creates a new instance of {@link yfiles.view.GraphComponent} using the div element that is specified by the selector. + *

+ * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.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. + *

+ * @param {string} selector The CSS selector or id for an existing div element + * @constructor + */ + constructor(selector:string); + /** + * Creates a new instance of {@link yfiles.view.GraphComponent} using the div element that is specified by the selector. + *

+ * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.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. + *

+ * @param {Object} options The parameters to pass. + * @param {string} options.selector The CSS selector or id for an existing div element + * @param {yfiles.input.IInputMode} options.inputMode The single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. + *

+ * This option sets the {@link yfiles.view.CanvasComponent#inputMode} property on the created object. + *

+ * @param {yfiles.graph.IGraph} options.graph The graph that is displayed in this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#graph} property on the created object. + *

+ * @param {yfiles.graph.GraphClipboard} options.clipboard The {@link yfiles.graph.GraphClipboard} associated with this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#clipboard} property on the created object. + *

+ * @param {yfiles.view.IGraphSelection} options.selection The selection model that is used for this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#selection} property on the created object. + *

+ * @constructor + */ + constructor(options:{selector:string,inputMode?:yfiles.input.IInputMode,graph?:yfiles.graph.IGraph,clipboard?:yfiles.graph.GraphClipboard,selection?:yfiles.view.IGraphSelection}); + /** + * Creates a new instance of the {@link yfiles.view.GraphComponent} in the given div element. + *

+ * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.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. + *

+ * @param {HTMLDivElement} div The existing div element to use for rendering the canvas into. + * @constructor + */ + constructor(div:HTMLDivElement); + /** + * Creates a new instance of the {@link yfiles.view.GraphComponent} in the given div element. + *

+ * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.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. + *

+ * @param {Object} options The parameters to pass. + * @param {HTMLDivElement} options.div The existing div element to use for rendering the canvas into. + * @param {yfiles.input.IInputMode} options.inputMode The single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. + *

+ * This option sets the {@link yfiles.view.CanvasComponent#inputMode} property on the created object. + *

+ * @param {yfiles.graph.IGraph} options.graph The graph that is displayed in this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#graph} property on the created object. + *

+ * @param {yfiles.graph.GraphClipboard} options.clipboard The {@link yfiles.graph.GraphClipboard} associated with this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#clipboard} property on the created object. + *

+ * @param {yfiles.view.IGraphSelection} options.selection The selection model that is used for this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#selection} property on the created object. + *

+ * @constructor + */ + constructor(options:{div:HTMLDivElement,inputMode?:yfiles.input.IInputMode,graph?:yfiles.graph.IGraph,clipboard?:yfiles.graph.GraphClipboard,selection?:yfiles.view.IGraphSelection}); + /** + * Creates a new instance of the {@link yfiles.view.GraphComponent}. + *

+ * If the {@link yfiles.view.GraphComponent#graph} and {@link yfiles.view.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. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.input.IInputMode} options.inputMode The single {@link yfiles.input.IInputMode} instance that shall be installed for this canvas. + *

+ * This option sets the {@link yfiles.view.CanvasComponent#inputMode} property on the created object. + *

+ * @param {yfiles.graph.IGraph} options.graph The graph that is displayed in this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#graph} property on the created object. + *

+ * @param {yfiles.graph.GraphClipboard} options.clipboard The {@link yfiles.graph.GraphClipboard} associated with this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#clipboard} property on the created object. + *

+ * @param {yfiles.view.IGraphSelection} options.selection The selection model that is used for this control. + *

+ * This option sets the {@link yfiles.view.GraphComponent#selection} property on the created object. + *

+ * @constructor + */ + constructor(options?:{inputMode?:yfiles.input.IInputMode,graph?:yfiles.graph.IGraph,clipboard?:yfiles.graph.GraphClipboard,selection?:yfiles.view.IGraphSelection}); + /** + * Factory method for the FocusIndicatorManager property. + *

+ * This method will be called upon first access to the {@link yfiles.view.GraphComponent#focusIndicatorManager} property. + *

+ * @returns {yfiles.view.FocusIndicatorManager.} a new instance of FocusIndicatorManager + * @protected + */ + createFocusIndicatorManager():yfiles.view.FocusIndicatorManager; + /** + * Factory method for the Graph property. + *

+ * This method will be called upon first access to the {@link yfiles.view.GraphComponent#graph} property. + *

+ * @returns {yfiles.graph.IGraph} a new instance of {@link yfiles.graph.DefaultGraph} + * @protected + */ + createGraph():yfiles.graph.IGraph; + /** + * Creates the default instance to use if no custom instance has been set. + * @returns {yfiles.graph.GraphClipboard} A default {@link yfiles.graph.GraphClipboard} instance. + * @protected + */ + createGraphClipboard():yfiles.graph.GraphClipboard; + /** + * Factory method for the {@link yfiles.view.GraphComponent#graphModelManager} property. + *

+ * This method will be called upon first access to the {@link yfiles.view.GraphComponent#graphModelManager} property. + *

+ * @returns {yfiles.view.GraphModelManager} a new instance of GraphModelManager + * @protected + */ + createGraphModelManager():yfiles.view.GraphModelManager; + /** + * Factory method for the {@link yfiles.view.GraphComponent#highlightIndicatorManager} property. + *

+ * This method will be called upon first access to the {@link yfiles.view.GraphComponent#highlightIndicatorManager} property. + *

+ * @returns {yfiles.view.HighlightIndicatorManager.} a new instance of HighlightIndicatorManager + * @protected + */ + createHighlightIndicatorManager():yfiles.view.HighlightIndicatorManager; + /** + * Factory method for the Selection property. + *

+ * This method will be called upon first access to the {@link yfiles.view.GraphComponent#selection} property. + *

+ * @returns {yfiles.view.IGraphSelection} a new instance of {@link yfiles.view.GraphSelection} + * @protected + */ + createSelection():yfiles.view.IGraphSelection; + /** + * Factory method for the {@link yfiles.view.GraphComponent#selectionIndicatorManager} property. + *

+ * This method will be called upon first access to the {@link yfiles.view.GraphComponent#selectionIndicatorManager} property. + *

+ * @returns {yfiles.view.SelectionIndicatorManager.} a new instance of {@link yfiles.view.SelectionIndicatorManager.} + * @protected + */ + createSelectionIndicatorManager():yfiles.view.SelectionIndicatorManager; + /** + * {@link yfiles.view.CanvasComponent#updateContentRect Updates the content rectangle} for the {@link yfiles.view.CanvasComponent#contentGroup} considering the provided insets and + * {@link yfiles.view.CanvasComponent#fitContent adjusts the viewport to encompass the contents}. + * @param {yfiles.geometry.Insets} [insets=null] + */ + fitGraphBounds(insets?:yfiles.geometry.Insets):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.layout.LayoutExecutor}. In addition to + * the default configuration, it enables {@link yfiles.layout.LayoutExecutor#animateViewport}, {@link yfiles.layout.LayoutExecutor#easedAnimation}, and {@link yfiles.layout.LayoutExecutor#updateContentRect}. For more fine-grained control of the animation, use {@link yfiles.layout.LayoutExecutor} + * directly. + *

+ * @param {yfiles.layout.ILayoutAlgorithm} layout + * @param {yfiles.lang.TimeSpan} [morphDuration=null] + * @param {yfiles.layout.LayoutData} [layoutData=null] + * @returns {Promise.} + */ + morphLayout(layout:yfiles.layout.ILayoutAlgorithm,morphDuration?:yfiles.lang.TimeSpan,layoutData?:yfiles.layout.LayoutData):Promise; + /** + * 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.layout.LayoutExecutor}. In addition to + * the default configuration, it enables {@link yfiles.layout.LayoutExecutor#animateViewport}, {@link yfiles.layout.LayoutExecutor#easedAnimation}, and {@link yfiles.layout.LayoutExecutor#updateContentRect}. For more fine-grained control of the animation, use {@link yfiles.layout.LayoutExecutor} + * directly. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.layout.ILayoutAlgorithm} options.layout + * @param {yfiles.lang.TimeSpan} [options.morphDuration=null] + * @param {yfiles.layout.LayoutData} [options.layoutData=null] + * @returns {Promise.} + */ + morphLayout(options:{layout:yfiles.layout.ILayoutAlgorithm,morphDuration?:yfiles.lang.TimeSpan,layoutData?:yfiles.layout.LayoutData}):Promise; + /** + * Gets or sets the 'current' item. + * @default null + * @type {yfiles.graph.IModelItem} + */ + currentItem:yfiles.graph.IModelItem; + /** + * Adds the given listener for the CurrentItemChanged event that occurs when the {@link yfiles.view.GraphComponent#currentItem} property has changed its value. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.view.GraphComponent#removeCurrentItemChangedListener + */ + addCurrentItemChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the CurrentItemChanged event that occurs when the {@link yfiles.view.GraphComponent#currentItem} property has changed its value. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.view.GraphComponent#addCurrentItemChangedListener + */ + removeCurrentItemChangedListener(listener:(sender:Object,evt:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the {@link yfiles.view.GraphComponent#selectionIndicatorManager} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createSelectionIndicatorManager} + * will be called. + *

+ * @type {yfiles.view.SelectionIndicatorManager.} + */ + selectionIndicatorManager:yfiles.view.SelectionIndicatorManager; + /** + * Gets or sets the {@link yfiles.view.GraphComponent#highlightIndicatorManager} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createHighlightIndicatorManager} + * will be called. + *

+ * @type {yfiles.view.HighlightIndicatorManager.} + */ + highlightIndicatorManager:yfiles.view.HighlightIndicatorManager; + /** + * Gets or sets the FocusIndicatorManager property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createFocusIndicatorManager} + * will be called. + *

+ * @type {yfiles.view.FocusIndicatorManager.} + */ + focusIndicatorManager:yfiles.view.FocusIndicatorManager; + /** + * Gets or sets the {@link yfiles.view.GraphComponent#graphModelManager} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createGraphModelManager} + * will be called. + *

+ * @type {yfiles.view.GraphModelManager} + */ + graphModelManager:yfiles.view.GraphModelManager; + /** + * Gets or sets the graph that is displayed in this control. + *

+ * Normally the {@link yfiles.view.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 component might need to be replaced + * or adjusted, too. If the field has not yet been initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createGraph} + * will be called. + *

+ * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Adds the given listener for the GraphChanged event that occurs when the {@link yfiles.view.GraphComponent#graph} property has been changed. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.view.GraphComponent#removeGraphChangedListener + */ + addGraphChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GraphChanged event that occurs when the {@link yfiles.view.GraphComponent#graph} property has been changed. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.view.GraphComponent#addGraphChangedListener + */ + removeGraphChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * 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.view.GraphComponent#graph} instance is changed. If the field has not yet been + * initialized upon first access, the factory method {@link yfiles.view.GraphComponent#createSelection} will be called. + *

+ * @type {yfiles.view.IGraphSelection} + */ + selection:yfiles.view.IGraphSelection; + /** + * 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. + *

+ * @type {yfiles.graph.GraphClipboard} + */ + clipboard:yfiles.graph.GraphClipboard; + static $class:yfiles.lang.Class; + } + export enum DragDropKeyStates{ + /** + * The left mouse button is down or a touch gesture is in progress. + */ + POINTER_DOWN, + /** + * No button and no key is pressed. + */ NONE, /** - * Underlined text. - */ - UNDERLINE, + * The shift key is down. + */ + SHIFT_KEY, /** - * Overlined Text. - */ - OVERLINE, + * The control key is down. + */ + CONTROL_KEY, /** - * Text with line through. - */ - LINE_THROUGH, - /** - * Blinking Text. - */ - BLINK + * The alt key is down. + */ + ALT_KEY } /** - * 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{ + * A simple {@link yfiles.view.ICanvasObjectDescriptor} that can be used to draw {@link yfiles.input.IPortCandidate} instances in a + * {@link yfiles.view.CanvasComponent}. + * @class yfiles.view.DefaultPortCandidateDescriptor + * @implements {yfiles.view.ICanvasObjectDescriptor} + * @implements {yfiles.view.IVisualCreator} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + */ + export interface DefaultPortCandidateDescriptor extends Object,yfiles.view.ICanvasObjectDescriptor,yfiles.view.IVisualCreator,yfiles.view.IBoundsProvider,yfiles.input.IHitTestable,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable{} + export class DefaultPortCandidateDescriptor { /** - * Gets or sets the text to display in a UI component. - * Value: The text. - */ - text:string; + * Instantiates a new descriptor. + * @constructor + */ + constructor(); /** - * 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; + * + * @param {Object} forUserObject + * @returns {yfiles.view.IBoundsProvider} + */ + getBoundsProvider(forUserObject:Object):yfiles.view.IBoundsProvider; /** - * Initializes a new instance of the {@link yfiles.system.RoutedUICommand} class with an empty {@link yfiles.system.RoutedUICommand#text}. - */ - WithDefaults:{ - new ():yfiles.system.RoutedUICommand; - }; + * + * @param {Object} forUserObject + * @returns {yfiles.input.IHitTestable} + */ + getHitTestable(forUserObject:Object):yfiles.input.IHitTestable; /** - * 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; - }; + * + * @param {Object} forUserObject + * @returns {yfiles.view.IVisibilityTestable} + */ + getVisibilityTestable(forUserObject:Object):yfiles.view.IVisibilityTestable; /** - * 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{ + * + * @param {Object} forUserObject + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(forUserObject:Object):yfiles.view.IVisualCreator; /** - * Gets or sets the size of the font. - * Value: The size of the font. - * The font size is interpreted as px. - */ - fontSize:number; + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.view.ICanvasObject} canvasObject + * @returns {boolean} + */ + isDirty(context:yfiles.view.ICanvasContext,canvasObject:yfiles.view.ICanvasObject):boolean; /** - * Gets or sets the font family. - * Value: The font family. - */ - fontFamily:string; + * Sets the {@link yfiles.view.IVisualTemplate} to use for the given {@link string} by this instance. + *

+ * This method can be used to reconfigure the visualization for the various keys that are declared by this class. + *

+ * @param {string} resourceKey The key to reconfigure. This is one of + * {@link yfiles.view.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY}, + * {@link yfiles.view.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY}, + * {@link yfiles.view.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_INVALID_FOCUSED_KEY}, + * {@link yfiles.view.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_VALID_FOCUSED_KEY}. + * @param {yfiles.view.IVisualTemplate} template The template to use instead of the default. + */ + setTemplate(resourceKey:string,template:yfiles.view.IVisualTemplate):void; /** - * Gets or sets the font style. - * Value: The font style. - */ - fontStyle:yfiles.system.FontStyle; + * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} + * that will be used for rendering a valid, non-focused {@link yfiles.input.IPortCandidate}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY:string; /** - * Gets or sets the font weight. - * Value: The font weight. - */ - fontWeight:yfiles.system.FontWeight; + * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} + * that will be used for rendering a valid, focused {@link yfiles.input.IPortCandidate}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static CANDIDATE_DRAWING_VALID_FOCUSED_KEY:string; /** - * Gets or sets the line spacing. - * The value is interpreted as parts of the line height. - * Value: The line spacing. - */ - lineSpacing:number; + * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} + * that will be used for rendering an invalid, non-focused {@link yfiles.input.IPortCandidate}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY:string; /** - * Gets or sets the text decoration. - * Value: The text decoration. - */ - textDecoration:yfiles.system.TextDecoration; - } - var Typeface:{ - $class:yfiles.lang.Class; + * A {@link string} that can be used by instances of the {@link yfiles.view.DefaultPortCandidateDescriptor} to look up a {@link yfiles.view.IVisualTemplate} + * that will be used for rendering a invalid, focused {@link yfiles.input.IPortCandidate}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static CANDIDATE_DRAWING_INVALID_FOCUSED_KEY:string; /** - * 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 + * Gets or sets a property that determines whether this descriptor uses the "current" candidates. + * @type {boolean} + */ + currentCandidate:boolean; + /** + * Gets or sets the logical size of the candidate. + *

+ * This size is used for hit testing, visibility tests, etc. The default is 3. + *

+ * @type {number} + */ + size:number; + static $class:yfiles.lang.Class; } /** - * Fills an area with a SVG pattern. - */ - export interface PatternBrush extends yfiles.system.Brush,yfiles.drawing.IDefsSupport{ + * Manages the visual appearance of an {@link yfiles.graph.IGraph} instance in a {@link yfiles.view.CanvasComponent}. + *

+ * This class monitors the structural changes of an {@link yfiles.graph.IGraph} implementation and installs the necessary {@link yfiles.view.ICanvasObject} + * instance in the canvas for each item in the graph. Note that {@link yfiles.view.GraphComponent} has an instance of this type + * built-in already and usually it is not necessary to create an own one. This class will also {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting use the node hierarchy} to + * nest the nodes {@link yfiles.view.GraphModelManager#useHierarchicEdgeNesting and edges} accordingly. + *

+ * @see yfiles.view.GraphModelManager#nodeGroup + * @see yfiles.view.GraphModelManager#useHierarchicEdgeNesting + * @see yfiles.view.GraphModelManager#useHierarchicNodeNesting + * @class yfiles.view.GraphModelManager + */ + export interface GraphModelManager extends Object{} + export class GraphModelManager { /** - * Gets or sets the content. - * Value: - * The content. - */ - content:yfiles.drawing.Visual; + * 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.view.GraphModelManager#graph} property should be set to an instance after construction. + *

+ * @param {yfiles.view.CanvasComponent} canvas the canvas to manage the visual appearance of a graph for. + * @param {yfiles.view.ICanvasObjectGroup} contentGroup the group to add the graph's visual content to. Can be null, in which case {@link yfiles.view.GraphModelManager#contentGroup} should be set afterwards or {@link yfiles.view.GraphModelManager#createContentGroup} + * will automatically create a group lazily. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent,contentGroup:yfiles.view.ICanvasObjectGroup); /** - * Gets or sets the SVG view box of this pattern brush. - * Value: - * The SVG view box of this pattern brush. - */ - viewBox:yfiles.geometry.RectD; + * 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.view.GraphModelManager#graph} property should be set to an instance after construction. + *

+ * @param {yfiles.view.CanvasComponent} canvas the canvas to manage the visual appearance of a graph for. + * @constructor + */ + constructor(canvas:yfiles.view.CanvasComponent); /** - * Gets or sets the origin of this pattern brush. - * Value: - * The origin of this pattern brush. - */ - origin:yfiles.geometry.PointD; + * Compares two items with respect to their visibility order. + * @param {yfiles.graph.IModelItem} item1 the first item to compare + * @param {yfiles.graph.IModelItem} item2 the second item to compare + * @returns {number} an integer value indicating the relative rendering order of the two items + * @see yfiles.view.GraphModelManager#comparer + */ + compare(item1:yfiles.graph.IModelItem,item2:yfiles.graph.IModelItem):number; /** - * Gets or sets the size of this pattern brush. - * Value: - * The size of this pattern brush. - */ - size:yfiles.geometry.SizeD; + * Factory method that creates the {@link yfiles.view.GraphModelManager#contentGroup} + *

+ * The default implementation will just add another group to the {@link yfiles.view.CanvasComponent}. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} The group to use for adding the content. + * @protected + */ + createContentGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Factory method for the {@link yfiles.view.GraphModelManager#edgeGroup} property. + *

+ * This method will be called upon first access to the property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.view.GraphModelManager#contentGroup} + * @protected + */ + createEdgeGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Factory method for the {@link yfiles.view.GraphModelManager#edgeLabelGroup} property. + *

+ * This method will be called upon first access to the property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.view.GraphModelManager#contentGroup} + * @protected + */ + createEdgeLabelGroup():yfiles.view.ICanvasObjectGroup; /** - * 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; + * Gets a {@link yfiles.input.IHitTester.} 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. + *

+ * Type parameter T. + * @param {yfiles.lang.Class} itemType + * @returns {yfiles.input.IHitTester.} + * @template T + */ + createHitTester(itemType:yfiles.lang.Class):yfiles.input.IHitTester; + /** + * Factory method for the {@link yfiles.view.GraphModelManager#nodeGroup} property. + *

+ * This method will be called upon first access to the property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.view.GraphModelManager#contentGroup} + * @protected + */ + createNodeGroup():yfiles.view.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.view.GraphModelManager#nodeLabelGroup} property. + *

+ * This method will be called upon first access to the property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.view.GraphModelManager#contentGroup} + * @protected + */ + createNodeLabelGroup():yfiles.view.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.view.GraphModelManager#portGroup} property. + *

+ * This method will be called upon first access to the property. + *

+ * @returns {yfiles.view.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.view.GraphModelManager#contentGroup} + * @protected + */ + createPortGroup():yfiles.view.ICanvasObjectGroup; + /** + * Retrieves the {@link yfiles.view.ICanvasObject} for a given model item managed by this instance. + * @param {yfiles.graph.IModelItem} item the item + * @returns {yfiles.view.ICanvasObject} the canvas object for the given item or null + * @see yfiles.view.ItemModelManager.#getCanvasObject + */ + getCanvasObject(item:yfiles.graph.IModelItem):yfiles.view.ICanvasObject; + /** + * Retrieves the Canvas Object group to use for the given label. + *

+ * This implementation is called by the default {@link yfiles.view.GraphModelManager#nodeLabelDescriptor} and {@link yfiles.view.GraphModelManager#edgeLabelDescriptor} instances. + *

+ * @param {yfiles.graph.ILabel} label The label that will be installed in the canvas. + * @returns {yfiles.view.ICanvasObjectGroup} The group to use. + * @protected + */ + getCanvasObjectGroup(label:yfiles.graph.ILabel):yfiles.view.ICanvasObjectGroup; + /** + * Retrieves the Canvas Object group to use for the given port. + *

+ * This implementation is called by the default {@link yfiles.view.GraphModelManager#portDescriptor} instance. + *

+ * @param {yfiles.graph.IPort} port The port that will be installed in the canvas. + * @returns {yfiles.view.ICanvasObjectGroup} The group to use. + * @protected + */ + getCanvasObjectGroup(port:yfiles.graph.IPort):yfiles.view.ICanvasObjectGroup; + /** + * Retrieves the Canvas Object group to use for the given edge. + *

+ * This implementation is called by the default {@link yfiles.view.GraphModelManager#edgeDescriptor} instance. + *

+ * @param {yfiles.graph.IEdge} edge The edge that will be installed in the canvas. + * @returns {yfiles.view.ICanvasObjectGroup} The group to use. + * @protected + */ + getCanvasObjectGroup(edge:yfiles.graph.IEdge):yfiles.view.ICanvasObjectGroup; + /** + * Retrieves the Canvas Object group to use for the given node. + *

+ * This implementation is called by the default {@link yfiles.view.GraphModelManager#nodeDescriptor} instance. + *

+ * @param {yfiles.graph.INode} node The node that will be installed in the canvas. + * @returns {yfiles.view.ICanvasObjectGroup} The group to use. + * @protected + */ + getCanvasObjectGroup(node:yfiles.graph.INode):yfiles.view.ICanvasObjectGroup; + /** + * Retrieves the corresponding {@link yfiles.graph.IModelItem} for the given canvas object. + * @param {yfiles.view.ICanvasObject} canvasObject the instance to use for the query + * @returns {yfiles.graph.IModelItem} The item that is associated with the object or null. + */ + getModelItem(canvasObject:yfiles.view.ICanvasObject):yfiles.graph.IModelItem; + /** + * 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. The + * enumeration is performed lazily. + *

+ * @param {yfiles.input.IInputModeContext} context The context to provide to {@link yfiles.input.IHitTestable#isHit} + * @param {yfiles.geometry.Point} location the world coordinates to perform the hit test + * @param {yfiles.view.ICanvasObjectGroup} root The group to search the subtree of. + * @returns {yfiles.collections.IEnumerable.} an enumerable that will enumerate the hits at the given coordinates + */ + hitElementsAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root:yfiles.view.ICanvasObjectGroup):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. The + * enumeration is performed lazily. + *

+ * @param {yfiles.geometry.Point} location the world coordinates to perform the hit test + * @returns {yfiles.collections.IEnumerable.} an enumerable that will enumerate the hits at the given coordinates + */ + hitElementsAt(location:yfiles.geometry.Point):yfiles.collections.IEnumerable; + /** + * Called when the {@link yfiles.view.GraphModelManager#graph} property changes. + *

+ * This method registers the collections of the graph instance with the {@link yfiles.view.CollectionModelManager. mechanism} that manages the mapping between the + * elements and the + * {@link yfiles.view.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. + * @protected + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * 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. The + * enumeration is performed lazily. + *

+ * Type parameter T. + * @param {yfiles.lang.Class} modelItemType + * @param {yfiles.input.IInputModeContext} context The context to provide to {@link yfiles.input.IHitTestable#isHit} + * @param {yfiles.geometry.Point} location the world coordinates to perform the hit test + * @param {yfiles.view.ICanvasObjectGroup} root The group to search the subtree of. + * @returns {yfiles.collections.IEnumerable.} an enumerable that will enumerate the hits at the given coordinates + * @template T + */ + typedHitElementsAt(modelItemType:yfiles.lang.Class,context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,root:yfiles.view.ICanvasObjectGroup):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. The + * enumeration is performed lazily. + *

+ * Type parameter T. + * @param {yfiles.lang.Class} itemType + * @param {yfiles.geometry.Point} location the world coordinates to perform the hit test + * @returns {yfiles.collections.IEnumerable.} an enumerable that will enumerate the hits at the given coordinates + * @template T + */ + typedHitElementsAt(itemType:yfiles.lang.Class,location:yfiles.geometry.Point):yfiles.collections.IEnumerable; + /** + * {@link yfiles.view.CollectionModelManager.#update Updates} the visual representation of the given item. + * @param {yfiles.graph.IModelItem} item The item to update the visual representation + * @see yfiles.view.CollectionModelManager.#update + */ + update(item:yfiles.graph.IModelItem):void; + /** + * Gets the {@link yfiles.view.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.view.GraphModelManager#createNodeGroup} + * will be called. Note that in the case of {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting hierarchic node nesting}, nodes will not be installed at the top-level of this + * group. Rather a more complicated nesting of dynamically created {@link yfiles.view.ICanvasObjectGroup}s will be used. + *

+ * @see yfiles.view.GraphModelManager#getCanvasObjectGroup + * @see yfiles.view.GraphModelManager#nodeDescriptor + * @type {yfiles.view.ICanvasObjectGroup} + */ + nodeGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.view.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.view.GraphModelManager#createEdgeGroup} + * will be called. Note that in the case of {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting hierarchically nested graphs} edges will only be put directly in this + * {@link yfiles.view.ICanvasObjectGroup}, if the {@link yfiles.view.GraphModelManager#useHierarchicEdgeNesting} property is set to false. Otherwise edges will actually be nested in the subtree + * of the {@link yfiles.view.GraphModelManager#nodeGroup} according to the node nesting. + *

+ * @see yfiles.view.GraphModelManager#getCanvasObjectGroup + * @see yfiles.view.GraphModelManager#edgeDescriptor + * @type {yfiles.view.ICanvasObjectGroup} + */ + edgeGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.view.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.view.GraphModelManager#createEdgeLabelGroup} + * will be called. + *

+ * @see yfiles.view.GraphModelManager#getCanvasObjectGroup + * @see yfiles.view.GraphModelManager#edgeLabelDescriptor + * @type {yfiles.view.ICanvasObjectGroup} + */ + edgeLabelGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.view.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.view.GraphModelManager#createNodeLabelGroup} + * will be called. + *

+ * @see yfiles.view.GraphModelManager#getCanvasObjectGroup + * @see yfiles.view.GraphModelManager#nodeLabelDescriptor + * @type {yfiles.view.ICanvasObjectGroup} + */ + nodeLabelGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.view.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.view.GraphModelManager#createPortGroup} + * will be called. + *

+ * @see yfiles.view.GraphModelManager#getCanvasObjectGroup + * @see yfiles.view.GraphModelManager#portDescriptor + * @type {yfiles.view.ICanvasObjectGroup} + */ + portGroup:yfiles.view.ICanvasObjectGroup; + /** + * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.IEdge} into the + * canvas. + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + edgeDescriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.IPort} into the + * canvas. + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + portDescriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.ILabel} of an {@link yfiles.graph.IEdge} + * into the canvas. + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + edgeLabelDescriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.ILabel} of an {@link yfiles.graph.INode} + * into the canvas. + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + nodeLabelDescriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Determines whether this instance should nest the edges accordingly if the graph is grouped. + *

+ * Hierarchic nesting for edges requires that {@link yfiles.view.GraphModelManager#useHierarchicNodeNesting hierarchic nesting for nodes} is enabled as well. If both properties are + * enabled (the default) the edges will actually be interleaved with the nodes in the nested canvas object subtree so the {@link yfiles.view.GraphModelManager#edgeGroup} + * will be empty. + *

+ * @see yfiles.view.GraphModelManager#useHierarchicNodeNesting + * @type {boolean} + */ + useHierarchicEdgeNesting:boolean; + /** + * Gets or sets the {@link yfiles.view.ICanvasObjectDescriptor} instance used for installing an {@link yfiles.graph.INode} into the + * canvas. + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + nodeDescriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets or sets the content group this manager instance uses to add visual representation of the graph to. + * @type {yfiles.view.ICanvasObjectGroup} + */ + contentGroup:yfiles.view.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. + *

+ * @type {yfiles.collections.IComparer.} + */ + comparer:yfiles.collections.IComparer; + /** + * Gets a {@link yfiles.input.IHitTester.} 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. + *

+ * @type {yfiles.input.IHitTester.} + */ + hitTester:yfiles.input.IHitTester; + /** + * Gets or sets the graph this manager manages. + * @see yfiles.view.GraphModelManager#onGraphChanged + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Determines whether this instance should nest the nodes {@link yfiles.view.GraphModelManager#useHierarchicEdgeNesting and optionally edges} accordingly if the graph is grouped. + * @type {boolean} + */ + useHierarchicNodeNesting:boolean; + /** + * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.INode}s which simply defers to + * the node's {@link yfiles.styles.INodeStyle}. + * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + static DEFAULT_NODE_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; + /** + * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.IEdge}s which simply defers to + * the edge's {@link yfiles.styles.IEdgeStyle}. + * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + static DEFAULT_EDGE_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; + /** + * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.IPort}s which simply defers to + * the port's {@link yfiles.styles.IPortStyle}. + * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + static DEFAULT_PORT_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; + /** + * The immutable instance of the default {@link yfiles.view.ICanvasObjectDescriptor} for {@link yfiles.graph.ILabel}s which simply defers + * to the label's {@link yfiles.styles.ILabelStyle}. + * @const + * @static + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + static DEFAULT_LABEL_DESCRIPTOR:yfiles.view.ICanvasObjectDescriptor; + static $class:yfiles.lang.Class; } - 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{ + * An implementation of the {@link yfiles.view.IObstacleProvider} interface that uses the {@link yfiles.graph.IGraph#edges edges} and {@link yfiles.graph.IGraph#nodes nodes} of an {@link yfiles.graph.IGraph} + * as obstacles. + *

+ * The {@link yfiles.view.BridgeManager} then calculates bridges for edge paths that cross these obstacles. + *

+ *

+ * This class can be used to add bridge support via the {@link yfiles.view.BridgeManager} to a rendered {@link yfiles.graph.IGraph}. + *

+ * @see yfiles.view.BridgeManager#addObstacleProvider + * @see yfiles.view.BridgeManager + * @see yfiles.view.IObstacleProvider + * @class yfiles.view.GraphObstacleProvider + * @implements {yfiles.view.IObstacleProvider} + */ + export interface GraphObstacleProvider extends Object,yfiles.view.IObstacleProvider{} + export class GraphObstacleProvider { /** - * Gets or sets the center of this radial gradient. - * Value: - * The center of this radial gradient. - */ - center:yfiles.geometry.PointD; + * Helper method that retrieves the {@link yfiles.graph.IGraph} to use from the context + *

+ * This implementation uses the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.view.ICanvasContext#canvasComponent} to query the {@link yfiles.graph.IGraph} implementation. + *

+ * @param {yfiles.view.IRenderContext} context The context to retrieve the implementation from. + * @returns {yfiles.graph.IGraph} The {@link yfiles.graph.IGraph} instance to query or null. + * @protected + */ + getGraph(context:yfiles.view.IRenderContext):yfiles.graph.IGraph; /** - * Gets or sets the origin of this radial gradient. - * Value: - * The origin of this radial gradient. - */ - gradientOrigin:yfiles.geometry.PointD; + * Iterates over all {@link yfiles.graph.IGraph#edges} and {@link yfiles.graph.IGraph#nodes} to query an {@link yfiles.view.IObstacleProvider} from the {@link yfiles.graph.IModelItem}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This method will depending on the {@link yfiles.view.GraphObstacleProvider#queryEdges} and {@link yfiles.view.GraphObstacleProvider#queryNodes} property query the items for an implementation of {@link yfiles.view.IObstacleProvider} + * and concatenate all resulting {@link yfiles.geometry.GeneralPath} obstacles into one path that will then be returned. + *

+ * @param {yfiles.view.IRenderContext} context The context where the obstacles are queried for. + * @returns {yfiles.geometry.GeneralPath} A path that is the concatenated path of all obstacles for the given context. + */ + getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; /** - * 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 a value indicating whether to query the {@link yfiles.graph.IGraph#edges} for an {@link yfiles.view.IObstacleProvider} implementation. + *

+ * The default is true. + *

+ * @type {boolean} + */ + queryEdges:boolean; /** - * 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; + * Gets or sets a value indicating whether to query the {@link yfiles.graph.IGraph#nodes} for an {@link yfiles.view.IObstacleProvider} implementation. + * @type {boolean} + */ + queryNodes:boolean; + static $class:yfiles.lang.Class; } - var RadialGradientBrush:{ - $class:yfiles.lang.Class; - new ():yfiles.system.RadialGradientBrush; - }; /** - * Fills an area with a linear gradient. - */ - export interface LinearGradientBrush extends yfiles.system.GradientBrush{ + * Simple implementation of the {@link yfiles.view.IGraphSelection} interface. + * @class yfiles.view.GraphSelection + * @implements {yfiles.view.IGraphSelection} + */ + export interface GraphSelection extends Object,yfiles.view.IGraphSelection{} + export class GraphSelection { /** - * Gets or sets the spread method of this gradient. - * Value: - * The spread method of this gradient. - */ - spreadMethod:yfiles.system.GradientSpreadMethod; + * Instantiates an instance using the the graph as the model. + * @param {yfiles.graph.IGraph} graph + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); /** - * Gets or sets the start point of this gradient. - * Value: - * The start point of this gradient. - */ - startPoint:yfiles.geometry.PointD; + * Creates a new instance with no initial {@link yfiles.view.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.view.GraphSelection#graph} property. + *

+ * @constructor + */ + constructor(); /** - * Gets or sets the end point of this gradient. - * Value: - * The end point of this gradient. - */ - endPoint:yfiles.geometry.PointD; + * + */ + clear():void; /** - * 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; + * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the bends. + * @returns {yfiles.view.DefaultSelectionModel.} + * @protected + */ + createBendSelectionModel():yfiles.view.DefaultSelectionModel; /** - * 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; + * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the edges. + * @returns {yfiles.view.DefaultSelectionModel.} + * @protected + */ + createEdgeSelectionModel():yfiles.view.DefaultSelectionModel; /** - * 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; + * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the labels. + * @returns {yfiles.view.DefaultSelectionModel.} + * @protected + */ + createLabelSelectionModel():yfiles.view.DefaultSelectionModel; + /** + * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the nodes. + * @returns {yfiles.view.DefaultSelectionModel.} + * @protected + */ + createNodeSelectionModel():yfiles.view.DefaultSelectionModel; + /** + * Factory method that creates the {@link yfiles.view.DefaultSelectionModel.} to use for the ports. + * @returns {yfiles.view.DefaultSelectionModel.} + * @protected + */ + createPortSelectionModel():yfiles.view.DefaultSelectionModel; + /** + * Returns an enumerator that iterates through the collection of all selected elements. + * @returns {yfiles.collections.IEnumerator.} An {@link yfiles.collections.IEnumerator.} object that can be used to iterate through all selected elements. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * + * @param {yfiles.graph.IModelItem} item + * @returns {boolean} + */ + isSelected(item:yfiles.graph.IModelItem):boolean; + /** + * Raises the {@link yfiles.view.GraphSelection#addItemSelectionChangedListener ItemSelectionChanged} event + * @param {yfiles.view.ItemSelectionChangedEventArgs.} evt The parameters for the event + * @protected + */ + onItemSelectionChanged(evt:yfiles.view.ItemSelectionChangedEventArgs):void; + /** + * + * @param {yfiles.graph.IModelItem} item + * @param {boolean} selected + */ + setSelected(item:yfiles.graph.IModelItem,selected:boolean):void; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedNodes:yfiles.view.ISelectionModel; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedEdges:yfiles.view.ISelectionModel; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedLabels:yfiles.view.ISelectionModel; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedPorts:yfiles.view.ISelectionModel; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedBends:yfiles.view.ISelectionModel; + /** + * + * @type {number} + */ + size:number; + /** + * Gets or sets the {@link yfiles.graph.IGraph} this instance is using as the domain for the selection. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener + */ + addItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener + */ + removeItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + static $class:yfiles.lang.Class; } - 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{ + * Manages the selection state of items in an {@link yfiles.graph.IGraph} instance. + *

+ * This interface provides access to the {@link yfiles.view.ISelectionModel.} instances that manage the selection of nodes, edges, labels, ports, and bends. + * The generic methods that use {@link yfiles.graph.IModelItem} parameters delegate to the corresponding domain-specific selection + * models. + *

+ * @see yfiles.view.ISelectionModel. + * @interface + * @implements {yfiles.view.ISelectionModel.} + */ + export interface IGraphSelection extends Object,yfiles.view.ISelectionModel{ + /** + * An {@link yfiles.view.ISelectionModel.} of the selected nodes. + *

+ * This is the node part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedNodes:yfiles.view.ISelectionModel; + /** + * An {@link yfiles.view.ISelectionModel.} of the selected labels. + *

+ * This is the label part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedLabels:yfiles.view.ISelectionModel; + /** + * An {@link yfiles.view.ISelectionModel.} of the selected edges. + *

+ * This is the edge part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedEdges:yfiles.view.ISelectionModel; + /** + * An {@link yfiles.view.ISelectionModel.} of the selected ports. + *

+ * This is the ports part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedPorts:yfiles.view.ISelectionModel; + /** + * An {@link yfiles.view.ISelectionModel.} of the selected bends. + *

+ * This is the bend part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedBends:yfiles.view.ISelectionModel; } - 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:{ + var IGraphSelection:{ $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{ + * Convenience component implementation that shows an overview of an {@link yfiles.graph.IGraph} contained in another {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * This component uses a {@link yfiles.view.GraphOverviewComponent#graphVisualCreator} to display the graph in a preview mode and an {@link yfiles.view.GraphOverviewComponent#overviewInputMode} to allow for easily navigating in the {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleEditorForm, Demo.yFiles.Graph.SimpleEditor
  • + *
+ * @class yfiles.view.GraphOverviewComponent + * @extends {yfiles.view.CanvasComponent} + */ + export interface GraphOverviewComponent extends yfiles.view.CanvasComponent{} + export class GraphOverviewComponent { /** - * 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; + * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is specified by the selector and + * that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * If no graphControl is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. + *

+ * @param {yfiles.view.GraphComponent} [graphComponent=null] The {@link yfiles.view.GraphOverviewComponent#graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. + * @param {string} selector The CSS selector or id for an existing div element + * @constructor + */ + constructor(selector:string,graphComponent?:yfiles.view.GraphComponent); /** - * 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; + * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is specified by the selector and + * that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * If no graphControl is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.GraphComponent} [options.graphComponent=null] The {@link yfiles.view.GraphOverviewComponent#graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. + * @param {string} options.selector The CSS selector or id for an existing div element + * @param {boolean} options.svgRendering A value indicating whether the graph is rendered using SVG rendering. + *

+ * This option sets the {@link yfiles.view.GraphOverviewComponent#svgRendering} property on the created object. + *

+ * @constructor + */ + constructor(options:{selector:string,graphComponent?:yfiles.view.GraphComponent,svgRendering?:boolean}); /** - * 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; + * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is optionally bound to the + * provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * If no graphControl is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. + *

+ * @param {HTMLDivElement} div The div element to use for holding the canvas. + * @param {yfiles.view.GraphComponent} [graphComponent=null] The optional graph control to {@link yfiles.view.GraphOverviewComponent#graphComponent bind} this instance to. If omitted, the property needs to be set to initialize the + * component. + * @constructor + */ + constructor(div:HTMLDivElement,graphComponent?:yfiles.view.GraphComponent); /** - * 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; + * Creates a new instance of {@link yfiles.view.GraphOverviewComponent} using the div element that is optionally bound to the + * provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * If no graphControl is provided, in order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. + *

+ * @param {Object} options The parameters to pass. + * @param {HTMLDivElement} options.div The div element to use for holding the canvas. + * @param {yfiles.view.GraphComponent} [options.graphComponent=null] The optional graph control to {@link yfiles.view.GraphOverviewComponent#graphComponent bind} this instance to. If omitted, the property needs to be set to initialize the + * component. + * @param {boolean} options.svgRendering A value indicating whether the graph is rendered using SVG rendering. + *

+ * This option sets the {@link yfiles.view.GraphOverviewComponent#svgRendering} property on the created object. + *

+ * @constructor + */ + constructor(options:{div:HTMLDivElement,graphComponent?:yfiles.view.GraphComponent,svgRendering?: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; + * Creates a new instance that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * This constructor creates a new {@link yfiles.view.CanvasComponent#div} element that needs to be added to the DOM manually. If no graphControl is provided, in + * order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. + *

+ * @param {yfiles.view.GraphComponent} [graphComponent=null] The {@link yfiles.view.GraphOverviewComponent#graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. + * @constructor + */ + constructor(graphComponent?:yfiles.view.GraphComponent); /** - * 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; + * Creates a new instance that is optionally bound to the provided {@link yfiles.view.GraphOverviewComponent#graphComponent}. + *

+ * This constructor creates a new {@link yfiles.view.CanvasComponent#div} element that needs to be added to the DOM manually. If no graphControl is provided, in + * order for this instance to be useful, either the {@link yfiles.view.GraphOverviewComponent#graphComponent} or the {@link yfiles.view.GraphOverviewComponent#graph} property need to be set. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.GraphComponent} [options.graphComponent=null] The {@link yfiles.view.GraphOverviewComponent#graphComponent} to bind this instance to. If omitted, the property needs to be set to initialize the component. + * @param {boolean} options.svgRendering A value indicating whether the graph is rendered using SVG rendering. + *

+ * This option sets the {@link yfiles.view.GraphOverviewComponent#svgRendering} property on the created object. + *

+ * @constructor + */ + constructor(options:{graphComponent?:yfiles.view.GraphComponent,svgRendering?: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[]; + * Factory method that creates the {@link yfiles.view.IVisualCreator} that renders the preview of the graph in a HTML canvas + * element. + * @param {yfiles.graph.IGraph} graph The graph to draw. + * @returns {yfiles.view.IVisualCreator} An {@link yfiles.view.IVisualCreator} that creates HTML canvas rendering. + * @protected + */ + createCanvasVisualCreator(graph:yfiles.graph.IGraph):yfiles.view.IVisualCreator; /** - * 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[]; + * Factory method that creates the {@link yfiles.view.IVisualCreator} that renders the preview of the graph in SVG. + * @param {yfiles.graph.IGraph} graph The graph to draw. + * @returns {yfiles.view.IVisualCreator} An {@link yfiles.view.IVisualCreator} that creates SVG. + * @protected + */ + createSvgVisualCreator(graph:yfiles.graph.IGraph):yfiles.view.IVisualCreator; /** - * 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; + * Gets or sets a value indicating whether the graph is rendered using SVG rendering. + * @default false + * @type {boolean} + */ + svgRendering:boolean; /** - * 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; + * Gets the {@link yfiles.styles.GraphOverviewSvgVisualCreator} that is used to render the over view graph. + * @type {yfiles.view.IVisualCreator} + */ + graphVisualCreator:yfiles.view.IVisualCreator; /** - * 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; + * Gets the {@link yfiles.input.IInputMode} that is used to navigate the client control. + * @type {yfiles.input.OverviewInputMode} + */ + overviewInputMode:yfiles.input.OverviewInputMode; /** - * 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; + * Gets or sets the graph that is rendered in the overview. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; /** - * 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 + * Gets or sets the client component, that will be used to retrieve the graph from and that will be used for navigating. + * @type {yfiles.view.GraphComponent} + */ + graphComponent:yfiles.view.GraphComponent; + static $class:yfiles.lang.Class; } /** - * 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; + * An implementation of the {@link yfiles.view.ICanvasObjectInstaller} interface that can decorate the visual appearence of an + * {@link yfiles.graph.IEdge}. + *

+ * This will install an {@link yfiles.view.ICanvasObject} during {@link yfiles.view.ICanvasObjectInstaller#addCanvasObject installation}, that will render the path and the bends of an edge + * using a {@link yfiles.view.EdgeDecorationInstaller#getStroke pen} for the path and a {@link yfiles.view.EdgeDecorationInstaller#getBendDrawing drawing} for the bends. + *

+ * @class yfiles.view.EdgeDecorationInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + * @implements {yfiles.view.IHighlightIndicatorInstaller} + * @implements {yfiles.view.IFocusIndicatorInstaller} + */ + export interface EdgeDecorationInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} + export class EdgeDecorationInstaller { + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.IEdge} that will use the {@link yfiles.view.EdgeDecorationInstaller#getBendDrawing} + * and {@link yfiles.view.EdgeDecorationInstaller#getStroke} to render the path and bends. + * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.view.ICanvasObjectGroup} group The {@link yfiles.view.ICanvasObjectGroup} to add the new canvas object to. + * @param {Object} item The item to install. + * @returns {yfiles.view.ICanvasObject} The canvas object representing the item. + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * Callback method that retrieves the drawing of the bend for the context. + *

+ * This implementation will use the {@link yfiles.view.EdgeSelectionIndicatorInstaller#BEND_TEMPLATE_KEY} resource to find a {@link yfiles.view.IVisualTemplate} + * instance. If null is yielded, a default drawing will be used. + *

+ * @param {yfiles.view.CanvasComponent} canvas The canvas for which the drawing shall be returned. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @returns {yfiles.view.IVisualTemplate} The drawing instance to use for the rendering of the bends in the given context. + * @protected + * @abstract + */ + getBendDrawing(canvas:yfiles.view.CanvasComponent,edge:yfiles.graph.IEdge):yfiles.view.IVisualTemplate; + /** + * Callback method that retrieves the {@link yfiles.view.Stroke} for the context. + *

+ * This implementation will use the {@link yfiles.view.EdgeSelectionIndicatorInstaller#STROKE_KEY} resource to find a {@link yfiles.view.Stroke} + * instance. If null is yielded, a default {@link yfiles.view.Stroke} will be used. + *

+ * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @param {yfiles.view.CanvasComponent} canvas The canvas for which the {@link yfiles.view.Stroke} shall be returned. + * @returns {yfiles.view.Stroke} The {@link yfiles.view.Stroke} instance to use for the rendering of the edge in the given context. + * @protected + * @abstract + */ + getStroke(canvas:yfiles.view.CanvasComponent,edge:yfiles.graph.IEdge):yfiles.view.Stroke; + static $class:yfiles.lang.Class; } - var DesignerSerializationVisibilityAttribute:{ + /** + * An implementation of the {@link yfiles.view.ICanvasObjectInstaller} interface that can install the selection outline of an + * {@link yfiles.graph.IEdge}. + *

+ * This will {@link yfiles.view.EdgeDecorationInstaller#addCanvasObject install} an {@link yfiles.view.ICanvasObject} that will render the path and the bends of an edge using a {@link yfiles.view.EdgeSelectionIndicatorInstaller#getStroke pen} for the + * path and a {@link yfiles.view.EdgeSelectionIndicatorInstaller#getBendDrawing drawing} for the bends. + *

+ * @class yfiles.view.EdgeSelectionIndicatorInstaller + * @extends {yfiles.view.EdgeDecorationInstaller} + */ + export interface EdgeSelectionIndicatorInstaller extends yfiles.view.EdgeDecorationInstaller{} + export class EdgeSelectionIndicatorInstaller { + constructor(); + /** + * A {@link string} that will be used to find the {@link yfiles.view.Stroke} that will be used to draw the path of the edge. + * @const + * @static + * @type {string} + */ + static STROKE_KEY:string; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to draw the bends of the edge. + * @const + * @static + * @type {string} + */ + static BEND_TEMPLATE_KEY:string; + static $class:yfiles.lang.Class; + } + /** + * An specialized subclass of the {@link yfiles.view.EdgeSelectionIndicatorInstaller} that can install the focus indicator of an + * {@link yfiles.graph.IEdge}. + *

+ * This will {@link yfiles.view.EdgeDecorationInstaller#addCanvasObject install} an {@link yfiles.view.ICanvasObject} that will render the path and the bends of an edge using a {@link yfiles.view.EdgeFocusIndicatorInstaller#getStroke pen} for the + * path and a {@link yfiles.view.EdgeFocusIndicatorInstaller#getBendDrawing drawing} for the bends. + *

+ * @class yfiles.view.EdgeFocusIndicatorInstaller + * @extends {yfiles.view.EdgeDecorationInstaller} + */ + export interface EdgeFocusIndicatorInstaller extends yfiles.view.EdgeDecorationInstaller{} + export class EdgeFocusIndicatorInstaller { + constructor(); + /** + * A {@link string} that will be used to find the {@link yfiles.view.Stroke} that will be used to draw the path of the edge. + * @const + * @static + * @type {string} + */ + static STROKE_KEY:string; + /** + * A {@link string} that will be used to find the DataTemplate that will be used to draw the bends of the edge. + * @const + * @static + * @type {string} + */ + static BEND_TEMPLATE_KEY:string; + static $class:yfiles.lang.Class; + } + /** + * An specialized subclass of the {@link yfiles.view.EdgeSelectionIndicatorInstaller} that can install the highlight rendering of + * an {@link yfiles.graph.IEdge}. + *

+ * This will {@link yfiles.view.EdgeDecorationInstaller#addCanvasObject install} an {@link yfiles.view.ICanvasObject} that will render the path and the bends of an edge using a {@link yfiles.view.EdgeHighlightIndicatorInstaller#getStroke pen} for the + * path and a {@link yfiles.view.EdgeHighlightIndicatorInstaller#getBendDrawing drawing} for the bends. + *

+ * @class yfiles.view.EdgeHighlightIndicatorInstaller + * @extends {yfiles.view.EdgeDecorationInstaller} + */ + export interface EdgeHighlightIndicatorInstaller extends yfiles.view.EdgeDecorationInstaller{} + export class EdgeHighlightIndicatorInstaller { + constructor(); + /** + * A {@link string} that will be used to find the {@link yfiles.view.Stroke} that will be used to draw the path of the edge. + * @const + * @static + * @type {string} + */ + static STROKE_KEY:string; + /** + * A {@link string} that will be used to find the DataTemplate that will be used to draw the bends of the edge. + * @const + * @static + * @type {string} + */ + static BEND_TEMPLATE_KEY:string; + static $class:yfiles.lang.Class; + } + /** + * Allows the use of an {@link yfiles.styles.IEdgeStyle} to render the selection, highlight or focus indicator of edges. + *

+ * The {@link yfiles.view.EdgeStyleDecorationInstaller#zoomPolicy} 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. + *

+ * @see yfiles.view.NodeStyleDecorationInstaller + * @see yfiles.view.LabelStyleDecorationInstaller + * @class yfiles.view.EdgeStyleDecorationInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + * @implements {yfiles.view.IHighlightIndicatorInstaller} + * @implements {yfiles.view.IFocusIndicatorInstaller} + */ + export interface EdgeStyleDecorationInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} + export class EdgeStyleDecorationInstaller { + /** + * Create a new instance of this class. + * @constructor + */ + constructor(); + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.IEdge}. + * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.view.ICanvasObjectGroup} group The canvas object group to add the newly created {@link yfiles.view.ICanvasObject} to. + * @param {Object} item The item to install. + * @returns {yfiles.view.ICanvasObject} The canvas object representing the item. + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * 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. + *

+ * @type {yfiles.view.StyleDecorationZoomPolicy} + */ + zoomPolicy:yfiles.view.StyleDecorationZoomPolicy; + /** + * The style to use for the rendering. + *

+ * Changes of the value of this property are not propagated to already created styles. + *

+ * @type {yfiles.styles.IEdgeStyle} + */ + edgeStyle:yfiles.styles.IEdgeStyle; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.view.IVisualCreator} for use in a {@link yfiles.view.CanvasComponent} that renders a {@link yfiles.graph.IGraph} instance in a + * sloppy overview style. + * @class yfiles.view.GraphOverviewCanvasVisualCreator + * @implements {yfiles.view.IVisualCreator} + */ + export interface GraphOverviewCanvasVisualCreator extends Object,yfiles.view.IVisualCreator{} + export class GraphOverviewCanvasVisualCreator { + /** + * Creates a new instance for the given graph. + * @param {yfiles.graph.IGraph} graph + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * Callback that paints the specified edge. + * @param {yfiles.view.IRenderContext} renderContext + * @param {CanvasRenderingContext2D} ctx + * @param {yfiles.graph.IEdge} edge + * @protected + */ + paintEdge(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D,edge:yfiles.graph.IEdge):void; + /** + * Callback method that paints the specified node. + * @param {yfiles.view.IRenderContext} renderContext + * @param {CanvasRenderingContext2D} ctx + * @param {yfiles.graph.INode} node + * @protected + */ + paintGroupNode(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D,node:yfiles.graph.INode):void; + /** + * Callback method that paints the specified node. + * @param {yfiles.view.IRenderContext} renderContext + * @param {CanvasRenderingContext2D} ctx + * @param {yfiles.graph.INode} node + * @protected + */ + paintNode(renderContext:yfiles.view.IRenderContext,ctx:CanvasRenderingContext2D,node:yfiles.graph.INode):void; + static $class:yfiles.lang.Class; + } + /** + * Allows the use of an {@link yfiles.styles.ILabelStyle} to render the selection, highlight or focus indicator of labels. + *

+ * The {@link yfiles.view.LabelStyleDecorationInstaller#zoomPolicy} 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. + *

+ * @see yfiles.view.EdgeStyleDecorationInstaller + * @see yfiles.view.NodeStyleDecorationInstaller + * @class yfiles.view.LabelStyleDecorationInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + * @implements {yfiles.view.IHighlightIndicatorInstaller} + * @implements {yfiles.view.IFocusIndicatorInstaller} + */ + export interface LabelStyleDecorationInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} + export class LabelStyleDecorationInstaller { + /** + * Create a new instance of this class. + * @constructor + */ + constructor(); + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.ILabel}. + * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.view.ICanvasObjectGroup} group The canvas object group to add the newly created canvas object to. + * @param {Object} item The item to install. + * @returns {yfiles.view.ICanvasObject} The canvas object representing the item. + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * 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. + *

+ * @type {yfiles.view.StyleDecorationZoomPolicy} + */ + zoomPolicy:yfiles.view.StyleDecorationZoomPolicy; + /** + * 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. + *

+ * @type {yfiles.geometry.Insets} + */ + margin:yfiles.geometry.Insets; + /** + * The style to use for the rendering. + *

+ * Changes of the value of this property are not propagated to already created styles. + *

+ * @type {yfiles.styles.ILabelStyle} + */ + labelStyle:yfiles.styles.ILabelStyle; + static $class:yfiles.lang.Class; + } + /** + * Allows the use of an {@link yfiles.styles.INodeStyle} to render the selection, highlight or focus indicator of nodes. + *

+ * The {@link yfiles.view.NodeStyleDecorationInstaller#zoomPolicy} 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. + *

+ * @see yfiles.view.EdgeStyleDecorationInstaller + * @see yfiles.view.LabelStyleDecorationInstaller + * @class yfiles.view.NodeStyleDecorationInstaller + * @implements {yfiles.view.ISelectionIndicatorInstaller} + * @implements {yfiles.view.IHighlightIndicatorInstaller} + * @implements {yfiles.view.IFocusIndicatorInstaller} + */ + export interface NodeStyleDecorationInstaller extends Object,yfiles.view.ISelectionIndicatorInstaller,yfiles.view.IHighlightIndicatorInstaller,yfiles.view.IFocusIndicatorInstaller{} + export class NodeStyleDecorationInstaller { + /** + * Create a new instance of this class. + * @constructor + */ + constructor(); + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.INode}. + * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.view.ICanvasObjectGroup} group The canvas object group to add the newly created canvas object to. + * @param {Object} item The item to install. + * @returns {yfiles.view.ICanvasObject} The canvas object representing the item. + */ + addCanvasObject(context:yfiles.view.ICanvasContext,group:yfiles.view.ICanvasObjectGroup,item:Object):yfiles.view.ICanvasObject; + /** + * 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. + *

+ * @type {yfiles.view.StyleDecorationZoomPolicy} + */ + zoomPolicy:yfiles.view.StyleDecorationZoomPolicy; + /** + * 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. + *

+ * @type {yfiles.geometry.Insets} + */ + margin:yfiles.geometry.Insets; + /** + * The style to use for the rendering. + *

+ * Changes of the value of this property are not propagated to already created styles. + *

+ * @type {yfiles.styles.INodeStyle} + */ + nodeStyle:yfiles.styles.INodeStyle; + static $class:yfiles.lang.Class; + } + export enum StyleDecorationZoomPolicy{ + /** + * 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 + } + /** + * An animation for the {@link yfiles.graph.IStripe stripes} in an {@link yfiles.graph.ITable}. + * @class yfiles.view.TableAnimation + * @implements {yfiles.view.IAnimation} + */ + export interface TableAnimation extends Object,yfiles.view.IAnimation{} + export class TableAnimation { + /** + * Initializes a new instance of the {@link yfiles.view.TableAnimation} class for the given table, the column widths, and row + * heights. + *

+ * Note that only the sizes of + * leaf stripes, i.e. those without child stripes, are considered. The sizes of a stripe with children is implicitly determined by its + * contents. + *

+ * @param {yfiles.graph.ITable} table The table to animate. + * @param {Array.} columnLayout The sizes of the leaf columns, in natural order. + * @param {Array.} rowLayout The sizes of the leaf rows, in natural order. + * @constructor + */ + constructor(table:yfiles.graph.ITable,columnLayout:number[],rowLayout:number[]); + /** + * + * @param {number} time + */ + animate(time:number):void; + /** + * + */ + cleanup():void; + /** + * Create the animation for a single {@link yfiles.graph.IStripe} + * @param {yfiles.graph.IStripe} stripe The stripe + * @param {number} targetSize The target size of the stripe + * @returns {yfiles.view.IAnimation} An animation that morphs the stripe size + * @protected + */ + createStripeAnimation(stripe:yfiles.graph.IStripe,targetSize:number):yfiles.view.IAnimation; + /** + * + */ + initialize():void; + /** + * Gets or sets the preferred duration of the animation. + * @type {yfiles.lang.TimeSpan} + */ + preferredDuration:yfiles.lang.TimeSpan; + static $class:yfiles.lang.Class; + } + /** + * Manages the selection state of items in an {@link yfiles.graph.ITable} instance. + *

+ * This interface provides access to the {@link yfiles.view.ISelectionModel.} instances that manage the selection of rows and columns. The generic methods that + * use {@link yfiles.graph.IModelItem} parameters delegate to the corresponding domain-specific selection models. + *

+ * @see yfiles.view.ISelectionModel. + * @interface + * @implements {yfiles.view.ISelectionModel.} + */ + export interface IStripeSelection extends Object,yfiles.view.ISelectionModel{ + /** + * An {@link yfiles.view.ISelectionModel.} of the selected rows. + *

+ * This is the row part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedRows:yfiles.view.ISelectionModel; + /** + * An {@link yfiles.view.ISelectionModel.} of the selected columns. + *

+ * This is the column part of the selection that this instance is a composite of. + *

+ * @abstract + * @type {yfiles.view.ISelectionModel.} + */ + selectedColumns:yfiles.view.ISelectionModel; + /** + * Whether to allow mixed row/column selections + * @abstract + * @type {boolean} + */ + allowMixedSelection:boolean; + /** + * Whether to allow the selection to span multiple table instances + *

+ * The default is false + *

+ * @abstract + * @type {boolean} + */ + allowCrossTableSelection:boolean; + } + var IStripeSelection:{ $class:yfiles.lang.Class; - CONTENT:yfiles.system.DesignerSerializationVisibilityAttribute; - VISIBLE:yfiles.system.DesignerSerializationVisibilityAttribute; - HIDDEN:yfiles.system.DesignerSerializationVisibilityAttribute; - DEFAULT:yfiles.system.DesignerSerializationVisibilityAttribute; + isInstance(o:Object):boolean; }; /** - * 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{ + * Default implementation of the {@link yfiles.view.IStripeSelection} interface. + * @class yfiles.view.StripeSelection + * @implements {yfiles.view.IStripeSelection} + */ + export interface StripeSelection extends Object,yfiles.view.IStripeSelection{} + export class StripeSelection { /** - * Gets the default value of the property this attribute is bound to. - */ - value:Object; + * Default constructor that creates empty selection models. + * @constructor + */ + constructor(); /** - * Sets the default value of the property this attribute is bound to. - * @param {Object} value - */ - setValue(value:Object):void; + * + */ + clear():void; + /** + * + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Return whether stripe is currently selected + * @param {yfiles.graph.IStripe} stripe The stripe to test + * @returns {boolean} true iff stripe is currently selected + */ + isSelected(stripe:yfiles.graph.IStripe):boolean; + /** + * Raises the {@link yfiles.view.StripeSelection#addItemSelectionChangedListener ItemSelectionChanged} event + * @param {yfiles.view.ItemSelectionChangedEventArgs.} evt The parameters for the event + * @protected + */ + onItemSelectionChanged(evt:yfiles.view.ItemSelectionChangedEventArgs):void; + /** + * + * @param {yfiles.graph.IStripe} item + * @param {boolean} selected + */ + setSelected(item:yfiles.graph.IStripe,selected:boolean):void; + /** + * Whether to allow mixed row/column selections + *

+ * The default is false + *

+ * @type {boolean} + */ + allowMixedSelection:boolean; + /** + * Whether to allow the selection to span multiple table instances + *

+ * The default is true + *

+ * @type {boolean} + */ + allowCrossTableSelection:boolean; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedRows:yfiles.view.ISelectionModel; + /** + * + * @type {yfiles.view.ISelectionModel.} + */ + selectedColumns:yfiles.view.ISelectionModel; + /** + * + * @type {number} + */ + size:number; + /** + * + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener + */ + addItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.view.ItemSelectionChangedEventArgs.): void} listener + */ + removeItemSelectionChangedListener(listener:(sender:Object,evt:yfiles.view.ItemSelectionChangedEventArgs)=>void):void; + static $class:yfiles.lang.Class; } - 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{ + }export namespace input{ + export enum GridSnapTypes{ + /** + * 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 } - var Convert:{ + /** + * An interface that can enumerate hits of a given type for a certain position in world coordinates. + * Type parameter T: the type of hits returned by the enumerator + * @interface + * @template T + */ + export interface IHitTester extends Object{ + /** + * Yields an enumerable that enumerates the hits for a given world coordinate. + * @param {yfiles.input.IInputModeContext} context The context in which to perform the hit testing. + * @param {yfiles.geometry.Point} location the coordinates in the world coordinate system + * @returns {yfiles.collections.IEnumerable.} an enumerable that yields hits for the given coordinates + * @abstract + */ + enumerateHits(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.collections.IEnumerable; + } + var IHitTester:{ $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; + isInstance(o:Object):boolean; }; /** - * Provides helper methods to manipulate arrays. - */ - export interface ArrayExtensions extends Object{ + * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.INode INodes}. + *

+ * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} + *

+ * @interface + * @implements {yfiles.input.IHitTester.} + */ + export interface INodeHitTester extends Object,yfiles.input.IHitTester{ } - var ArrayExtensions:{ + var INodeHitTester:{ $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; + isInstance(o:Object):boolean; }; /** - * 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; + * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.ILabel ILabels}. + *

+ * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} + *

+ * @interface + * @implements {yfiles.input.IHitTester.} + */ + export interface ILabelHitTester extends Object,yfiles.input.IHitTester{ } - var TypeConverterAttribute:{ + var ILabelHitTester:{ $class:yfiles.lang.Class; - new ():yfiles.system.TypeConverterAttribute; - WithType:{ - new (type:yfiles.lang.Class):yfiles.system.TypeConverterAttribute; - }; - WithTypeName:{ - new (typeName:string):yfiles.system.TypeConverterAttribute; - }; + isInstance(o:Object):boolean; }; /** - * An {@link yfiles.lang.Exception} to indicate an error in an arithmetic operation. - */ - export interface ArithmeticException extends yfiles.lang.Exception{ + * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.ILabelOwner}. + *

+ * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} + *

+ * @interface + * @implements {yfiles.input.IHitTester.} + */ + export interface ILabelOwnerHitTester extends Object,yfiles.input.IHitTester{ } - var ArithmeticException:{ + var ILabelOwnerHitTester:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * 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{ + * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.IPort IPorts}. + *

+ * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} + *

+ * @interface + * @implements {yfiles.input.IHitTester.} + */ + export interface IPortHitTester extends Object,yfiles.input.IHitTester{ } - var IndexOutOfRangeException:{ + var IPortHitTester:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * 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{ + * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.IEdge IEdges}. + *

+ * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} + *

+ * @interface + * @implements {yfiles.input.IHitTester.} + */ + export interface IEdgeHitTester extends Object,yfiles.input.IHitTester{ } - var InvalidOperationException:{ + var IEdgeHitTester:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * An {@link yfiles.lang.Exception} to indicate that the called method is not implemented. - */ - export interface NotImplementedException extends yfiles.lang.Exception{ + * This is a flagging interface for instances of {@link yfiles.input.IHitTester.} that enumerate over a collection of {@link yfiles.graph.IBend IBends}. + *

+ * An implementation of this interface can be queried using the lookup of a {@link yfiles.view.GraphComponent} + *

+ * @interface + * @implements {yfiles.input.IHitTester.} + */ + export interface IBendHitTester extends Object,yfiles.input.IHitTester{ } - var NotImplementedException:{ + var IBendHitTester:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * An {@link yfiles.lang.Exception} to indicate an error in an IO operation. - */ - export interface IOException extends yfiles.lang.Exception{ + * Abstract base class implementation of an {@link yfiles.input.IInputMode} that can be used concurrently with other {@link yfiles.input.IInputMode} + * implementations if its {@link yfiles.input.InputModeBase#exclusive} property is true. + *

+ * This class adds convenience methods for derived classes. + *

+ * @class yfiles.input.InputModeBase + * @implements {yfiles.input.IInputMode} + */ + export interface InputModeBase extends Object,yfiles.input.IInputMode{} + export class InputModeBase { + /** + * Initializes a new instance of the {@link yfiles.input.InputModeBase} class. + * @param {boolean} exclusive Iff this mode should be {@link yfiles.input.InputModeBase#exclusive}. + * @protected + * @constructor + */ + constructor(exclusive:boolean); + /** + * Initializes a new instance of the {@link yfiles.input.InputModeBase} class that is {@link yfiles.input.InputModeBase#exclusive} by default. + * @protected + * @constructor + */ + constructor(); + /** + * Cancels the editing of this mode by first disabling and afterwards reenabling the installed {@link yfiles.input.InputModeBase#controller}. + *

+ * This implementation disables and reenables the {@link yfiles.input.InputModeBase#controller} and fires the {@link yfiles.input.InputModeBase#onCanceled} event afterwards. + * Classes that need to perform clean-up should override the {@link yfiles.input.InputModeBase#onConcurrencyControllerDeactivated} + * method and invoke base.OnConcurrencyControllerDeactivated as the last statement. + *

+ * @see yfiles.input.InputModeBase#onCanceled + * @see yfiles.input.InputModeBase#addCanceledListener + */ + cancel():void; + /** + * Determines whether this instance can request the mutex. + *

+ * This will return true, iff a {@link yfiles.input.InputModeBase#controller} has been injected and the helper allows requesting the mutex. + *

+ * @returns {boolean} Whether a call to {@link yfiles.input.InputModeBase#requestMutex} would currently succeed. + * @protected + */ + canRequestMutex():boolean; + /** + * Creates an implementation of {@link yfiles.input.IInputModeContext} that is specific to this mode. + *

+ * This is needed for events that are triggered by this InputMode to signalize where the event is coming from. A common + * usage for this is for example in {@link yfiles.input.IHitTestable#isHit} calls. + *

+ *

+ * The result can be given to {@link yfiles.input.IHitTestable#isHit} or {@link yfiles.view.CanvasComponent#hitElementsAt} to let + * implementations of {@link yfiles.input.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.view.ICanvasContext}'s {@link yfiles.graph.ILookup#lookup} method or + * simply downcasting. + *

+ * @returns {yfiles.input.IInputModeContext} A readily configured {@link yfiles.input.IInputModeContext}. + * @see yfiles.view.CanvasComponent#hitElementsAt + * @see yfiles.input.IHitTestable#isHit + * @see yfiles.input.IInputModeContext + * @protected + */ + createChildInputModeContext():yfiles.input.IInputModeContext; + /** + * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. + * @param {yfiles.input.IInputModeContext} context An input mode context that is available in the {@link yfiles.input.InputModeEventArgs}. + *

+ * Can be null in which case a new context for this instance is created automatically. + *

+ * @returns {yfiles.input.InputModeEventArgs} An input mode event argument that is configured for this instance. + * @protected + */ + createInputModeEventArgs(context:yfiles.input.IInputModeContext):yfiles.input.InputModeEventArgs; + /** + * Determines whether this instance owns the input mutex. + *

+ * If no {@link yfiles.input.InputModeBase#controller} had been associated with this instance upon the call to {@link yfiles.input.InputModeBase#requestMutex} this method will + * return false. + *

+ * @returns {boolean} Whether this instance has the input mutex. + * @protected + */ + hasMutex():boolean; + /** + * 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.InputModeBase#install installation} of this mode. + *

+ *

+ * This code will be executed only once per instance. The {@link yfiles.input.InputModeBase#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 yfiles.input.InputModeBase#install + * @protected + */ + initialize():void; + /** + * Installs this mode into a {@link yfiles.view.CanvasComponent} 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.InputModeBase#initialize} method. This implementation will call the {@link yfiles.input.InputModeBase#initialize} + * method the first time this mode gets installed. The initialization will be surrounded by calls to {@link yfiles.input.InputModeBase#onInitializing} + * and {@link yfiles.input.InputModeBase#onInitialized} to trigger the corresponding events. + *

+ * @param {yfiles.input.IInputModeContext} context the context to install this mode into + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.InputModeBase#controller} for this mode. + * @see yfiles.input.InputModeBase#inputModeContext + * @see yfiles.view.CanvasComponent#inputMode + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addCanceledListener Canceled} + * event. + *

+ * This method is called by subclasses when the editing process has been {@link yfiles.input.InputModeBase#cancel}ed. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event arguments. + * @see yfiles.input.InputModeBase#initialize + * @protected + */ + onCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addInitializedListener Initialized} + * event. + *

+ * This method will be called by {@link yfiles.input.InputModeBase#install} for the first installation directly after {@link yfiles.input.InputModeBase#initialize} + * has returned. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event arguments. + * @see yfiles.input.InputModeBase#initialize + * @protected + */ + onInitialized(evt:yfiles.input.InputModeEventArgs):void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addInitializingListener Initializing} + * event. + *

+ * This method will be called by {@link yfiles.input.InputModeBase#install} for the first installation directly before {@link yfiles.input.InputModeBase#initialize} + * is invoked. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event arguments. + * @see yfiles.input.InputModeBase#initialize + * @protected + */ + onInitializing(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called when this instance obtains the mutex. + *

+ * If no {@link yfiles.input.InputModeBase#controller} had been associated with this instance upon the call to {@link yfiles.input.InputModeBase#requestMutex} this method will + * not be called. + *

+ * @protected + */ + onMutexObtained():void; + /** + * Called when this instance released the mutex. + *

+ * If no {@link yfiles.input.InputModeBase#controller} had been associated with this instance upon the call to {@link yfiles.input.InputModeBase#requestMutex} this method will + * not be called. + *

+ * @protected + */ + onMutexReleased():void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.InputModeBase#addStoppedListener Stopped} + * event. + *

+ * This method will be called by {@link yfiles.input.InputModeBase#tryStop} or can be called by subclasses during a {@link yfiles.input.InputModeBase#tryStop} + * operation. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event arguments. + * @see yfiles.input.InputModeBase#tryStop + * @see yfiles.input.InputModeBase#addStoppedListener + * @protected + */ + onStopped(evt:yfiles.input.InputModeEventArgs):void; + /** + * Releases previously captured keyboard input. + * @protected + */ + releaseKeyboard():void; + /** + * Releases the mutex that is currently owned by this instance. + *

+ * This will trigger the {@link yfiles.input.InputModeBase#onMutexReleased} method if this instance previously owned the mutex. + *

+ * @protected + */ + releaseMutex():void; + /** + * Releases previously captured mouse and touch input. + * @protected + */ + releasePointer():void; + /** + * Requests capturing of all keyboard input that happens in the {@link yfiles.view.CanvasComponent}. + *

+ * This sets the CaptureAllKeyboardInput property to + * true, which will prevent visuals inside the canvas from stealing key strokes. + *

+ * @see yfiles.input.InputModeBase#releaseKeyboard + * @protected + */ + requestKeyboard():void; + /** + * Requests the mutex from the current {@link yfiles.input.InputModeBase#controller}. + *

+ * This implementation will call the {@link yfiles.input.InputModeBase#onMutexObtained} method if the mutex has been successfully + * obtained. If the mutex cannot be obtained this method will trigger an exception. + *

+ * @throws {yfiles.lang.Exception} If the mutex could not be obtained. + * @protected + */ + requestMutex():void; + /** + * Requests capturing of all mouse and touch input that happens in the {@link yfiles.view.CanvasComponent}. + *

+ * This sets the CaptureAllPointerInput property to + * true, which will prevent visuals inside the canvas from stealing mouse input. + *

+ * @see yfiles.input.InputModeBase#releasePointer + * @protected + */ + requestPointer():void; + /** + * Tries to stop the editing. + *

+ * This implementation returns if this instance does not currently {@link yfiles.input.InputModeBase#hasMutex have the input mutex}. + *

+ *

+ * This implementation calls {@link yfiles.input.InputModeBase#onStopped}. Subclasses that want to prevent a stop or need to do + * special clean up should do this here if the base class implementation of {@link yfiles.input.InputModeBase#tryStop} returns + * true. A typical implementation should follow this idiom if it wants to stop: + *

+ *

+ * and if it doesn't want to stop simply return false immediately. + *

+ *

+ * Calling this method raises the {@link yfiles.input.InputModeBase#addStoppedListener Stopped} event. + *

+ * @returns {boolean} true iff this instance does not {@link yfiles.input.InputModeBase#hasMutex own the mutex}. + * @see yfiles.input.InputModeBase#onStopped + */ + tryStop():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.InputModeBase#install}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Adds the given listener for the Initializing event that occurs before the call to {@link yfiles.input.InputModeBase#initialize} + *

+ * Clients can use this event to perform configuration of the instance shortly before the initialization begins. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.InputModeBase#install + * @see yfiles.input.InputModeBase#removeInitializingListener + */ + addInitializingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Initializing event that occurs before the call to + * {@link yfiles.input.InputModeBase#initialize} + *

+ * Clients can use this event to perform configuration of the instance shortly before the initialization begins. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.InputModeBase#install + * @see yfiles.input.InputModeBase#addInitializingListener + */ + removeInitializingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Initialized event that occurs after the call to {@link yfiles.input.InputModeBase#initialize} + *

+ * Clients can use this event to perform post configuration steps of the instance shortly after the initialization has been + * performed. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.InputModeBase#install + * @see yfiles.input.InputModeBase#removeInitializedListener + */ + addInitializedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Initialized event that occurs after the call to + * {@link yfiles.input.InputModeBase#initialize} + *

+ * Clients can use this event to perform post configuration steps of the instance shortly after the initialization has been + * performed. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.InputModeBase#install + * @see yfiles.input.InputModeBase#addInitializedListener + */ + removeInitializedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Canceled event that occurs after the call to {@link yfiles.input.InputModeBase#cancel} + *

+ * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been canceled. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.InputModeBase#onCanceled + * @see yfiles.input.InputModeBase#cancel + * @see yfiles.input.InputModeBase#tryStop + * @see yfiles.input.InputModeBase#addStoppedListener + * @see yfiles.input.InputModeBase#removeCanceledListener + */ + addCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Canceled event that occurs after the call to {@link yfiles.input.InputModeBase#cancel} + *

+ * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been canceled. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.InputModeBase#onCanceled + * @see yfiles.input.InputModeBase#cancel + * @see yfiles.input.InputModeBase#tryStop + * @see yfiles.input.InputModeBase#addStoppedListener + * @see yfiles.input.InputModeBase#addCanceledListener + */ + removeCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Stopped event that occurs after the call to {@link yfiles.input.InputModeBase#tryStop} + *

+ * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been stopped. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.InputModeBase#onStopped + * @see yfiles.input.InputModeBase#cancel + * @see yfiles.input.InputModeBase#tryStop + * @see yfiles.input.InputModeBase#addCanceledListener + * @see yfiles.input.InputModeBase#removeStoppedListener + */ + addStoppedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Stopped event that occurs after the call to {@link yfiles.input.InputModeBase#tryStop} + *

+ * Clients can use this event to perform post cleanup steps of the instance shortly after the mode has been stopped. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.InputModeBase#onStopped + * @see yfiles.input.InputModeBase#cancel + * @see yfiles.input.InputModeBase#tryStop + * @see yfiles.input.InputModeBase#addCanceledListener + * @see yfiles.input.InputModeBase#addStoppedListener + */ + removeStoppedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Returns whether this mode is currently installed in a {@link yfiles.view.CanvasComponent}. + * @see yfiles.input.InputModeBase#install + * @type {boolean} + */ + installed:boolean; + /** + * Returns the context instance this mode is currently installed in or null if this instance is not installed. + *

+ * Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context + * that has this instance set as the {@link yfiles.input.IInputModeContext#parentInputMode} should be used. One such instance can be obtained through helper method + * {@link yfiles.input.InputModeBase#createChildInputModeContext}. + *

+ * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.InputModeBase#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * Returns if this mode is active. + *

+ * This mode is active if a {@link yfiles.input.InputModeBase#controller} is installed and is {@link yfiles.input.ConcurrencyController#active}. + *

+ * @type {boolean} + */ + active:boolean; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.InputModeBase#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Returns the installed {@link yfiles.input.InputModeBase#controller}. + * @see yfiles.input.InputModeBase#requestMutex + * @see yfiles.input.InputModeBase#releaseMutex + * @see yfiles.input.InputModeBase#hasMutex + * @see yfiles.input.InputModeBase#canRequestMutex + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + static $class:yfiles.lang.Class; } - var IOException:{ + /** + * Event arguments used by {@link yfiles.input.ClickInputMode#addClickedListener Clicked}. + * @class yfiles.input.ClickEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface ClickEventArgs extends yfiles.input.InputModeEventArgs{} + export class 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.Point} location The location. + * @param {yfiles.view.ModifierKeys} modifiers State of the modifiers. + * @param {yfiles.view.MouseButtons} mouseButtons The mouse button(s) that have changed + * @param {number} clickCount + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,modifiers:yfiles.view.ModifierKeys,mouseButtons:yfiles.view.MouseButtons,clickCount:number); + /** + * Gets the location of the click. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + /** + * Gets the state of the modifiers at the time of the click. + * @type {yfiles.view.ModifierKeys} + */ + modifiers:yfiles.view.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. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * Gets the MouseButtons that have changed for this event. + * @type {yfiles.view.MouseButtons} + */ + mouseButtons:yfiles.view.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. + *

+ * @type {number} + */ + clickCount:number; + static $class:yfiles.lang.Class; + } + export enum DoubleClickPolicy{ + /** + * In case of a double click, only the double click event is raised, but no single click events. + *

+ * Single clicks not belonging to a double click will be reported with a short delay to ensure that they do not become + * double clicks. + *

+ */ + DOUBLE_CLICK_ONLY, + /** + * In case of a double click, one single click event is raised, followed by a double click event. + *

+ * The second click of the double click is not reported as a single click. Single clicks not belonging to a double click + * will be reported instantly. + *

+ */ + INITIAL_SINGLE_AND_DOUBLE_CLICK, + /** + * In case of a double click, two single click events are raised, followed by a double click event. + */ + 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#activeButtons} 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. + *

+ *

+ * This mode is {@link yfiles.input.ClickInputMode#exclusive} by default. + *

+ * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#swallowFocusClick + * @see yfiles.input.ClickInputMode#activeButtons + * @class yfiles.input.ClickInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface ClickInputMode extends Object,yfiles.input.IInputMode{} + export class ClickInputMode { + /** + * Creates a new instance of this mode that detects left mouse clicks. + * @constructor + */ + constructor(); + /** + * Cancels the editing of this mode. + *

+ * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls + * {@link yfiles.input.ClickInputMode#onCanceled}. + *

+ * @see yfiles.input.ClickInputMode#onCanceled + */ + cancel():void; + /** + * Creates the event recognizer that is used to recognize the clicks for this instance. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @protected + */ + createClickRecognizer():(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates the event recognizer that is used to recognize the press event for this instance. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @protected + */ + createPressRecognizer():(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates the event recognizer that is used to recognize the release event for this instance. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @protected + */ + createReleaseRecognizer():(eventSource:Object,evt:yfiles.lang.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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.ClickInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Determines whether the given event is a press event that occurred at an invalid location. + * @param {Object} eventSource + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @see yfiles.input.ClickInputMode#validClickHitTestable + * @protected + */ + isInvalidPress(eventSource:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Determines whether the given event is a valid click event. + * @param {Object} src + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @see yfiles.input.ClickInputMode#validClickHitTestable + * @protected + */ + isValidClick(src:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Determines whether the given event is a valid press event. + * @param {Object} eventSource + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @protected + */ + isValidPress(eventSource:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Determines whether the given event is a valid release event. + * @param {Object} src + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @see yfiles.input.ClickInputMode#validClickHitTestable + * @protected + */ + isValidRelease(src:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Called after {@link yfiles.input.ClickInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * 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} evt The arguments. + * @protected + */ + onClicked(evt:yfiles.input.ClickEventArgs):void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():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} evt The arguments. + * @protected + */ + onDoubleClicked(evt: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} evt The arguments. + * @protected + */ + onLeftClicked(evt: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} evt The arguments. + * @protected + */ + onLeftDoubleClicked(evt: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} evt The arguments. + * @protected + */ + onRightClicked(evt: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} evt The arguments. + * @protected + */ + onRightDoubleClicked(evt:yfiles.input.ClickEventArgs):void; + /** + * Called after {@link yfiles.input.ClickInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():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 yfiles.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. + *

+ * @returns {boolean} + * @protected + */ + queryAndResetPreventNextDoubleClick():boolean; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ClickInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.ClickInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Gets the installed {@link yfiles.input.ClickInputMode#controller}. + * @see yfiles.input.IInputMode#install + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the Clicked event that occurs once a click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#removeClickedListener + */ + addClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the Clicked event that occurs once a click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#addClickedListener + */ + removeClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Adds the given listener for the LeftClicked event that occurs once a left click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#removeLeftClickedListener + */ + addLeftClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the LeftClicked event that occurs once a left click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#addLeftClickedListener + */ + removeLeftClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Adds the given listener for the RightClicked event that occurs once a right click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#removeRightClickedListener + */ + addRightClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the RightClicked event that occurs once a right click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#addRightClickedListener + */ + removeRightClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Adds the given listener for the DoubleClicked event that occurs once a double-click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#removeDoubleClickedListener + */ + addDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the DoubleClicked event that occurs once a double-click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#addDoubleClickedListener + */ + removeDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Adds the given listener for the LeftDoubleClicked event that occurs once a left double-click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#removeLeftDoubleClickedListener + */ + addLeftDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the LeftDoubleClicked event that occurs once a left double-click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#addLeftDoubleClickedListener + */ + removeLeftDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Adds the given listener for the RightDoubleClicked event that occurs once a right double-click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#removeRightDoubleClickedListener + */ + addRightDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the RightDoubleClicked event that occurs once a right double-click has been detected. + * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.ClickEventArgs + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @see yfiles.input.ClickInputMode#addRightDoubleClickedListener + */ + removeRightDoubleClickedListener(listener:(sender:Object,evt: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}. + * @see yfiles.input.ClickInputMode#doubleClickPolicy + * @default 2 + * @type {yfiles.input.DoubleClickPolicy} + */ + doubleClickPolicy:yfiles.input.DoubleClickPolicy; + /** + * 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.input.IHitTestable#ALWAYS}. + *

+ * @type {yfiles.input.IHitTestable} + */ + validClickHitTestable:yfiles.input.IHitTestable; + /** + * Whether to {@link yfiles.input.ConcurrencyController#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. + *

+ * @default true + * @type {boolean} + */ + requestMutexOnClick:boolean; + /** + * Gets or sets the cursor to use when hovering over a valid hit region. + *

+ * The default is null and the current cursor is used instead. + *

+ * @type {yfiles.view.Cursor} + */ + validClickHitCursor:yfiles.view.Cursor; + /** + * Determines for which button(s) mouse clicks should be processed. + *

+ * Default value is {@link yfiles.view.MouseButtons#LEFT} + *

+ * @see yfiles.input.ClickInputMode#createClickRecognizer + * @default 1 + * @type {yfiles.view.MouseButtons} + */ + activeButtons:yfiles.view.MouseButtons; + /** + * 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.view.CanvasComponent} got focus. + *

+ * The default is false. If set to true clicks are discarded within 100 ms after the focus entered. + *

+ * @default false + * @type {boolean} + */ + swallowFocusClick:boolean; + /** + * Gets the location of the last click. + * @type {yfiles.geometry.Point} + */ + clickLocation:yfiles.geometry.Point; + /** + * Returns the state of the modifier keys at the time of the end of the gesture. + * @type {yfiles.view.ModifierKeys} + */ + modifiers:yfiles.view.ModifierKeys; + static $class:yfiles.lang.Class; + } + /** + * Event arguments for the {@link yfiles.input.SnapContext#addCollectSnapResultsListener CollectSnapResults} event. + *

+ * Event handlers can use the {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult} method to add snapping results for the + * current move operation. + *

+ * @class yfiles.input.CollectSnapResultsEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface CollectSnapResultsEventArgs extends yfiles.input.InputModeEventArgs{} + export class CollectSnapResultsEventArgs { + /** + * Creates a new instance of the event arguments using the provided values for initialization. + * @param {yfiles.input.IInputModeContext} context The context for which the event is queried. + * @param {yfiles.geometry.Point} originalLocation The original location of the mouse at the beginning of the gesture. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point,snapDistance:number,snapResults:yfiles.collections.ICollection); + /** + * Adds a {@link yfiles.input.SnapResult} to the collection of snap results. + *

+ * null values will be discarded. + *

+ * @param {yfiles.input.SnapResult} snapResult The result to add. + */ + addSnapResult(snapResult:yfiles.input.SnapResult):void; + /** + * Gets the original location of the mouse at the beginning of the gesture. + * @type {yfiles.geometry.Point} + */ + originalLocation:yfiles.geometry.Point; + /** + * Gets the new (current) location of the mouse that is going to be manipulated by the snapping process. + * @type {yfiles.geometry.Point} + */ + newLocation:yfiles.geometry.Point; + /** + * Gets the vector by which the mouse has been moved since initialization of the snapping process. + * @type {yfiles.geometry.Point} + */ + delta:yfiles.geometry.Point; + /** + * The zoom invariant snap distance. + * @type {number} + */ + snapDistance:number; + static $class:yfiles.lang.Class; + } + /** + * A controller class that manages a single {@link yfiles.input.IInputMode} implementation. + *

+ * The controller will be passed to its associated {@link yfiles.input.IInputMode} in the input mode's {@link yfiles.input.IInputMode#install} + * method. The associated mode can {@link yfiles.input.ConcurrencyController#requestMutex request} an input mutex to {@link yfiles.input.ConcurrencyController#active deactivate} other modes added to the same {@link yfiles.input.MultiplexingInputMode} + * and using {@link yfiles.input.ConcurrencyController#exclusive} controllers. {@link yfiles.input.ConcurrencyController#releaseMutex Releasing the mutex} will reactivate the controller of other modes. + *

+ * @see yfiles.input.IInputMode + * @see yfiles.input.MultiplexingInputMode + * @class yfiles.input.ConcurrencyController + * @final + */ + export interface ConcurrencyController extends Object{} + export class ConcurrencyController { + /** + * Creates an instance that can be used to {@link yfiles.input.IInputMode#install} the given mode. + *

+ * The returned {@link yfiles.input.ConcurrencyController} is not synchronized with any other one so the mode will effectively run + * in a non-{@link yfiles.input.ConcurrencyController#exclusive exclusive} mode. + *

+ * @param {yfiles.input.IInputMode} mode The mode, the {@link yfiles.input.ConcurrencyController} shall be created for. + * @constructor + */ + constructor(mode:yfiles.input.IInputMode); + /** + * Determines if the mutex can be successfully requested currently. + *

+ * This will return true, iff this instance is {@link yfiles.input.ConcurrencyController#active} and doesn't hold the mutex. + *

+ * @returns {boolean} Whether a call to {@link yfiles.input.ConcurrencyController#requestMutex} would currently succeed. + */ + canRequestMutex():boolean; + /** + * Determines whether this instance owns the input mutex. + *

+ * The instance owns the input mutex if it has successfully {@link yfiles.input.ConcurrencyController#requestMutex requested} the mutex in the past and not yet {@link yfiles.input.ConcurrencyController#releaseMutex released} it. + *

+ * @returns {boolean} Whether this instance has the input mutex. + */ + hasMutex():boolean; + /** + * Triggers a {@link yfiles.input.ConcurrencyController#addPriorityChangedListener PriorityChanged} event with + * {@link yfiles.lang.EventArgs#EMPTY}. + *

+ * This method should be called by the associated mode if its {@link yfiles.input.IInputMode#priority} has changed. + *

+ */ + onPriorityChanged():void; + /** + * Releases the input mutex. + *

+ * Modes should call this method when they have finished editing the contents exclusively. This will reactivate those modes + * whose controller that had been {@link yfiles.input.ConcurrencyController#active deactivated} at the time the mutex has been requested. + *

+ */ + releaseMutex():void; + /** + * Can be called to request an input mutex for the input mode. + *

+ * Modes should call this method to request exclusive editing for a canvas control. {@link yfiles.input.ConcurrencyController#canRequestMutex} + * should be called before requesting the mutex. 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; + /** + * Adds the given listener for the MutexObtained event that occurs when the mutex has been successfully obtained. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ConcurrencyController#removeMutexObtainedListener + */ + addMutexObtainedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the MutexObtained event that occurs when the mutex has been successfully obtained. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ConcurrencyController#addMutexObtainedListener + */ + removeMutexObtainedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the MutexReleased event that occurs when the mutex has been released. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ConcurrencyController#removeMutexReleasedListener + */ + addMutexReleasedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the MutexReleased event that occurs when the mutex has been released. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ConcurrencyController#addMutexReleasedListener + */ + removeMutexReleasedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets the current owner of the input mutex or null if no mode currently owns the mutex. + * @type {yfiles.input.IInputMode} + */ + mutexOwner:yfiles.input.IInputMode; + /** + * Gets or sets if this controller is enabled. + *

+ * The default state is disabled. A disabled controller is always {@link yfiles.input.ConcurrencyController#active inactive}. + *

+ *

+ * When the controller is {@link yfiles.input.IInputMode#install installed} and the input mode is ready for editing, it has to set this property to true if it + * wants to use the input mutex. + *

+ * @see yfiles.input.ConcurrencyController#active + * @see yfiles.input.ConcurrencyController#addActiveChangedListener + * @type {boolean} + */ + enabled:boolean; + /** + * Returns if this controller is active. + *

+ * An {@link yfiles.input.IInputMode} should only handle events and gestures if this property on its associated {@link yfiles.input.ConcurrencyController} + * is set to true. + *

+ *

+ * If this controller is set as {@link yfiles.input.ConcurrencyController#exclusive non-exclusive} by its input mode it is active iff it is {@link yfiles.input.ConcurrencyController#enabled}. Otherwise it has to be {@link yfiles.input.ConcurrencyController#enabled} and no + * other input mode may have the {@link yfiles.input.ConcurrencyController#requestMutex input mutex}. + *

+ * @see yfiles.input.ConcurrencyController#addActiveChangedListener + * @type {boolean} + */ + active:boolean; + /** + * Adds the given listener for the ActiveChanged event that occurs the {@link yfiles.input.ConcurrencyController#active} property changes. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ConcurrencyController#removeActiveChangedListener + */ + addActiveChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the ActiveChanged event that occurs the {@link yfiles.input.ConcurrencyController#active} property changes. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ConcurrencyController#addActiveChangedListener + */ + removeActiveChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Gets a value indicating whether this controller will be the only one running when it has the mutex. + *

+ * If this controller is marked as exclusive and has the mutex, all controllers of other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be {@link yfiles.input.ConcurrencyController#active deactivated}. Otherwise it will always run concurrently with all other controllers. + *

+ *

+ * Changing this property will temporarily {@link yfiles.input.ConcurrencyController#enabled disable} the controller. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Returns the cursor the associated mode of this controller would like to have displayed in the + * {@link yfiles.view.CanvasComponent}. + *

+ * To indicate that the mode does not have any preferences the property should be set to null. + *

+ * @type {yfiles.view.Cursor} + */ + preferredCursor:yfiles.view.Cursor; + /** + * Adds the given listener for the PreferredCursorChanged event that occurs when the {@link yfiles.input.ConcurrencyController#preferredCursor} property changes. + *

+ * {@link yfiles.input.MultiplexingInputMode} listens to property changes of the controller of its sub modes. properties. This + * event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ConcurrencyController#removePreferredCursorChangedListener + */ + addPreferredCursorChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the PreferredCursorChanged event that occurs when the {@link yfiles.input.ConcurrencyController#preferredCursor} property changes. + *

+ * {@link yfiles.input.MultiplexingInputMode} listens to property changes of the controller of its sub modes. properties. This + * event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ConcurrencyController#addPreferredCursorChangedListener + */ + removePreferredCursorChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the PriorityChanged event that occurs when {@link yfiles.input.ConcurrencyController#onPriorityChanged} + * is called by the associated mode. + *

+ * {@link yfiles.input.MultiplexingInputMode} listens to priority changes of the controller of its sub modes. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ConcurrencyController#removePriorityChangedListener + */ + addPriorityChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the PriorityChanged event that occurs when {@link yfiles.input.ConcurrencyController#onPriorityChanged} + * is called by the associated mode. + *

+ * {@link yfiles.input.MultiplexingInputMode} listens to priority changes of the controller of its sub modes. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ConcurrencyController#addPriorityChangedListener + */ + removePriorityChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Event arguments for the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} + * event. + * @class yfiles.input.PopulateMenuEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface PopulateMenuEventArgs extends yfiles.input.InputModeEventArgs{} + export class PopulateMenuEventArgs { + /** + * Initializes a new instance of the {@link yfiles.input.PopulateMenuEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context. + * @param {yfiles.geometry.Point} queryLocation The query location. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point); + /** + * Gets the queried location in world coordinates. + * @type {yfiles.geometry.Point} + */ + queryLocation:yfiles.geometry.Point; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.PopulateMenuEventArgs} has been handled. + *

+ * If this event is marked as handled, the input mode will use the property {@link yfiles.input.PopulateMenuEventArgs#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.PopulateMenuEventArgs#showMenu}. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * Gets or sets a value indicating whether to actually display the context menu. + *

+ * This will set the {@link yfiles.input.PopulateMenuEventArgs#handled} property to true. + *

+ *

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

+ * @type {boolean} + */ + showMenu:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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.view.CanvasComponent}. + *

+ * 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 method + * {@link yfiles.input.ContextMenuInputMode#shouldOpenMenu}, 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 {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} + * and GraphInputMode.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. + *

+ *

Related demos:

+ *
    + *
  • Demo: Context Menu, demo.yfiles.input.contextmenu
  • + *
+ * @class yfiles.input.ContextMenuInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface ContextMenuInputMode extends Object,yfiles.input.IInputMode{} + export class ContextMenuInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.ContextMenuInputMode} class. + * @constructor + */ + constructor(); + /** + * Cancels the display of the context menu and requests that the context menu is closed. + */ + cancel():void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} + * call in the upcoming query. + * @returns {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + * @protected + */ + createPopulateMenuContext():yfiles.input.IInputModeContext; + /** + * Installs this mode in the canvas. + * @param {yfiles.input.IInputModeContext} context The context to install this mode into. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.ContextMenuInputMode#controller} for this mode. + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):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 yfiles.input.ContextMenuInputMode#addCloseMenuListener + */ + menuClosed():void; + /** + * Called after {@link yfiles.input.ContextMenuInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called when the menu is closed and triggers the {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} + * event. + * @protected + */ + onCloseMenu():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * This will populate the context menu for the given world coordinate. + *

+ * This implementation will trigger the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} + * event and will use the {@link yfiles.input.PopulateMenuEventArgs#showMenu} value as the return value. If the event will not be handled, this method will return true if the + * menu already contains elements. + *

+ * @param {yfiles.geometry.Point} location The location in the world coordinate system for which the context menu has been invoked. + * @returns {boolean} Whether to show the context menu. + * @protected + */ + onMenuOpening(location:yfiles.geometry.Point):boolean; + /** + * Raises the {@link yfiles.input.ContextMenuInputMode#addPopulateMenuListener PopulateMenu} event. + * @param {yfiles.input.PopulateMenuEventArgs} evt The {@link yfiles.input.PopulateMenuEventArgs} instance containing the event data. + * @protected + */ + onPopulateMenu(evt:yfiles.input.PopulateMenuEventArgs):void; + /** + * Called after {@link yfiles.input.ContextMenuInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():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. + *

+ * @param {yfiles.geometry.Point} [queryLocation=null] The optional location for which the context menu content should be queried. This value will be passed to {@link yfiles.input.ContextMenuInputMode#onPopulateMenu} + * and will ultimately be available in {@link yfiles.input.PopulateMenuEventArgs#queryLocation}. If not specified, the last known mouse location will be used. + * @returns {boolean} + * @see yfiles.input.ContextMenuInputMode#menuClosed + * @see yfiles.input.ContextMenuInputMode#addCloseMenuListener + */ + shouldOpenMenu(queryLocation?:yfiles.geometry.Point):boolean; + /** + * Stops the display of the context menu and requests that the context menu is closed. + * @returns {boolean} + */ + tryStop():boolean; + /** + * Removes the menu from the context and replaces it with the old instance. + * @param {yfiles.input.IInputModeContext} context The context to uninstall this mode from. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ContextMenuInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.ContextMenuInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Gets the installed {@link yfiles.input.ConcurrencyController}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the PopulateMenu event that occurs when the context menu is about to be shown. + *

+ * Handlers of the event can populate their context menu, set the {@link yfiles.input.PopulateMenuEventArgs#showMenu} and set or respect the {@link yfiles.input.PopulateMenuEventArgs#handled} property. Note that all handlers + * will be called, even if one of them sets the {@link yfiles.input.PopulateMenuEventArgs#handled} property to + * true. Every handler should query this property and decide carefully what to do. + *

+ * @param {function(Object, yfiles.input.PopulateMenuEventArgs): void} listener The listener to add. + * @see yfiles.input.ContextMenuInputMode#removePopulateMenuListener + */ + addPopulateMenuListener(listener:(sender:Object,evt:yfiles.input.PopulateMenuEventArgs)=>void):void; + /** + * Removes the given listener for the PopulateMenu event that occurs when the context menu is about to be shown. + *

+ * Handlers of the event can populate their context menu, set the {@link yfiles.input.PopulateMenuEventArgs#showMenu} and set or respect the {@link yfiles.input.PopulateMenuEventArgs#handled} property. Note that all handlers + * will be called, even if one of them sets the {@link yfiles.input.PopulateMenuEventArgs#handled} property to + * true. Every handler should query this property and decide carefully what to do. + *

+ * @param {function(Object, yfiles.input.PopulateMenuEventArgs): void} listener The listener to remove. + * @see yfiles.input.ContextMenuInputMode#addPopulateMenuListener + */ + removePopulateMenuListener(listener:(sender:Object,evt:yfiles.input.PopulateMenuEventArgs)=>void):void; + /** + * Gets or sets an {@link yfiles.input.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#onMenuOpening} will not be queried and the context menu + * will not be shown. By default there is a hit testable instance that always yields true. + *

+ * @type {yfiles.input.IHitTestable} + */ + validMenuLocationHitTestable:yfiles.input.IHitTestable; + /** + * 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. + *

+ * @type {boolean} + */ + swallowCloseClick:boolean; + /** + * Adds the given listener for the CloseMenu event that occurs when this instance requests closing an open context menu. + *

+ * Custom context menus must be closed in response to this event. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ContextMenuInputMode#menuClosed + * @see yfiles.input.ContextMenuInputMode#removeCloseMenuListener + */ + addCloseMenuListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the CloseMenu event that occurs when this instance requests closing an open context + * menu. + *

+ * Custom context menus must be closed in response to this event. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ContextMenuInputMode#menuClosed + * @see yfiles.input.ContextMenuInputMode#addCloseMenuListener + */ + removeCloseMenuListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * This is an input mode handling drag and drop related events on a {@link yfiles.view.CanvasComponent}. + *

+ * 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.view.CanvasComponent}. + *
  • + *
  • + * {@link yfiles.input.DropInputMode#addDragOverListener DragOver} is raised, if a drag operation moves over the + * {@link yfiles.view.CanvasComponent} after having entered it. + *
  • + *
  • + * {@link yfiles.input.DropInputMode#addDragDroppedListener DragDropped} is raised, if a drag is dropped onto the + * {@link yfiles.view.CanvasComponent}. + *
  • + *
  • + * {@link yfiles.input.DropInputMode#addDragLeftListener DragLeft} is raised, if a drag is operation leaves the + * {@link yfiles.view.CanvasComponent}. + *
  • + *
+ *

+ * 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 mode is {@link yfiles.input.DropInputMode#exclusive} by default. + *

+ * @class yfiles.input.DropInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface DropInputMode extends Object,yfiles.input.IInputMode{} + export class DropInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.DropInputMode} class for the expected data format. + *

+ * This instance fires events only if a drag operation carries data of the expected format. + *

+ * @param {string} expectedFormat This is a format that is used in {@link yfiles.view.DragDropItem#getData}. + * @see yfiles.input.DropInputMode#addDragEnteredListener + * @see yfiles.input.DropInputMode#addDragDroppedListener + * @constructor + */ + constructor(expectedFormat:string); + /** + * Callback that adjusts the effect accordingly. + * @param {yfiles.view.DragEventArgs} evt + * @returns {boolean} + * @protected + */ + adjustEffect(evt:yfiles.view.DragEventArgs):boolean; + /** + * Cleanly cancels this mode. + */ + cancel():void; + /** + * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. + * @returns {yfiles.input.InputModeEventArgs} An input mode event argument that is configured for this instance. + * @protected + */ + createInputModeEventArgs():yfiles.input.InputModeEventArgs; + /** + * 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 + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.DropInputMode#controller} for this mode. + * @see yfiles.view.CanvasComponent + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.DropInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Called once a drag has been dropped on the canvas. + * @param {yfiles.input.InputModeEventArgs} evt + * @protected + */ + onDragDropped(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called once a drag has entered the canvas. + * @param {yfiles.input.InputModeEventArgs} evt + * @protected + */ + onDragEntered(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called whenever a drag is over the canvas. + * @param {yfiles.input.InputModeEventArgs} evt + * @protected + */ + onDraggedOver(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called once a drag has left the canvas. + * @param {yfiles.input.InputModeEventArgs} evt + * @protected + */ + onDragLeft(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called after {@link yfiles.input.DropInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * 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.Point} location The current location of the mouse in world coordinates. + * @protected + */ + setDragLocation(location:yfiles.geometry.Point):void; + /** + * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. + * @returns {boolean} true iff this instance does not {@link yfiles.input.ConcurrencyController#hasMutex own the mutex}. + */ + tryStop():boolean; + /** + * 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 + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.DropInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.DropInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.DropInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the DragEntered event that occurs when a drag operation enters the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.DropInputMode#removeDragEnteredListener + */ + addDragEnteredListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragEntered event that occurs when a drag operation enters the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.DropInputMode#addDragEnteredListener + */ + removeDragEnteredListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragOver event that occurs when a drag operation drags over the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.DropInputMode#removeDragOverListener + */ + addDragOverListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragOver event that occurs when a drag operation drags over the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.DropInputMode#addDragOverListener + */ + removeDragOverListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragLeft event that occurs when a drag operation leaves the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.DropInputMode#removeDragLeftListener + */ + addDragLeftListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragLeft event that occurs when a drag operation leaves the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.DropInputMode#addDragLeftListener + */ + removeDragLeftListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragDropped event that occurs when a drag operation is dropped onto the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.DropInputMode#removeDragDroppedListener + */ + addDragDroppedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragDropped event that occurs when a drag operation is dropped onto the {@link yfiles.view.CanvasComponent} + * into which this instance is installed. + *

+ * No event is raised + *

+ *
    + *
  • if this instance is not {@link yfiles.input.DropInputMode#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.lang.EventArgs} provide no useful data. + *

+ * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.DropInputMode#addDragDroppedListener + */ + removeDragDroppedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Gets or sets the {@link yfiles.view.DragDropEffects} that will be used for drags on the canvas. + * @type {yfiles.view.DragDropEffects} + */ + dragDropEffect:yfiles.view.DragDropEffects; + /** + * Gets or sets the {@link yfiles.input.IHitTestable} that determines whether the given location is a valid drop location. + * @type {yfiles.input.IHitTestable} + */ + validDropHitTestable:yfiles.input.IHitTestable; + /** + * Gets the last processed drag event argument. + * @type {yfiles.view.DragEventArgs} + */ + lastDragEventArgs:yfiles.view.DragEventArgs; + /** + * Gets the current mouse position during drag operations. + *

+ * The position is returned in world coordinates according to the {@link yfiles.view.CanvasComponent} into which this input mode is + * installed. + *

+ * @type {yfiles.geometry.IPoint} + */ + mousePosition:yfiles.geometry.IPoint; + /** + * Gets the mouse position after dropping an item. + *

+ * The position is returned in world coordinates according to the {@link yfiles.view.CanvasComponent} into which this input mode is + * installed. + *

+ * @type {yfiles.geometry.Point} + */ + dropLocation:yfiles.geometry.Point; + /** + * Gets the data carried by a drag operation. + *

+ * This is only valid, if a drag entered the {@link yfiles.view.CanvasComponent} first. + *

+ * @type {Object} + */ + 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. + *

+ * @default true + * @type {boolean} + */ + captureMouseInputDuringDrag:boolean; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} 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 gains focus. It 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#add} 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. + *

+ *

+ * This mode is {@link yfiles.input.ConcurrencyController#exclusive} by default. + *

+ * @class yfiles.input.FocusGuardInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface FocusGuardInputMode extends Object,yfiles.input.IInputMode{} + export class FocusGuardInputMode { + /** + * Creates a new instance of this mode. + * @constructor + */ + constructor(); + /** + * + */ + cancel():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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.FocusGuardInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.FocusGuardInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Called after {@link yfiles.input.FocusGuardInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.FocusGuardInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.FocusGuardInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Gets or sets the {@link yfiles.view.Cursor} that will be shown during active guards. + *

+ * The default is {@link yfiles.view.Cursor#DEFAULT} + *

+ * @type {yfiles.view.Cursor} + */ + guardCursor:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * 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.view.CanvasComponent} and deal with + * mouse gestures that drag the visual representations accordingly. + *

+ *

+ * This mode is {@link yfiles.input.HandleInputMode#exclusive} by default. + *

+ * @see yfiles.input.IHandle + * @class yfiles.input.HandleInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface HandleInputMode extends Object,yfiles.input.IInputMode{} + export class HandleInputMode { + /** + * Creates a new mode with no handles initially. + * @see yfiles.input.HandleInputMode#handles + * @constructor + */ + constructor(); + /** + * 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; + /** + * 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 type are used to initialize the {@link yfiles.input.IHandle} instance. + *

+ * @param {yfiles.geometry.IMutablePoint} location The point to use as a handle. + * @param {yfiles.view.Cursor} [cursor=null] The cursor to use. + * @param {yfiles.input.HandleTypes} [type=yfiles.input.HandleTypes.DEFAULT] The type of the handle to create. + * @returns {yfiles.input.IHandle} The handle created. + */ + addHandle(location:yfiles.geometry.IMutablePoint,cursor?:yfiles.view.Cursor,type?:yfiles.input.HandleTypes):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 type are used to initialize the {@link yfiles.input.IHandle} instance. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.IMutablePoint} options.location The point to use as a handle. + * @param {yfiles.view.Cursor} [options.cursor=null] The cursor to use. + * @param {yfiles.input.HandleTypes} [options.type=yfiles.input.HandleTypes.DEFAULT] The type of the handle to create. + * @returns {yfiles.input.IHandle} The handle created. + */ + addHandle(options:{location:yfiles.geometry.IMutablePoint,cursor?:yfiles.view.Cursor,type?:yfiles.input.HandleTypes}):yfiles.input.IHandle; + /** + * Callback method that is invoked when this mode gets "armed". + *

+ * This happens when the mouse pointer hovers over a handle. This changes the mouse cursor to the handle's {@link yfiles.input.IHandle#cursor}. + *

+ * @param {yfiles.input.IHandle} handle + * @protected + */ + arm(handle:yfiles.input.IHandle):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; + /** + * + */ + cancel():void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.IHandle} interface for the upcoming drag + * operation. + * @returns {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + * @protected + */ + createHandleInputModeContext():yfiles.input.IInputModeContext; + /** + * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. + * @returns {yfiles.input.InputModeEventArgs} An input mode event argument that is configured for this instance. + * @protected + */ + createInputModeEventArgs():yfiles.input.InputModeEventArgs; + /** + * Callback that creates the {@link yfiles.view.Visual} for the given handle. + * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.input.IHandle} handle The handle to create a visual representation for. + * @returns {yfiles.view.SvgVisual} The {@link yfiles.view.Visual}. + * @protected + */ + createVisual(context:yfiles.view.IRenderContext,handle:yfiles.input.IHandle):yfiles.view.SvgVisual; + /** + * Callback method that is invoked when this mode gets "disarmed". + *

+ * This happens when the mouse stops hovering over a handle. This resets the mouse cursor + *

+ * @protected + */ + disarm():void; + /** + * Finds the closest hit handle for the given world coordinate pair. + *

+ * The default implementation compares the manhatten distance of the handles to find the closest handle. + *

+ * @param {yfiles.geometry.Point} location The coordinates in the world coordinate system. + * @returns {yfiles.input.IHandle} The closest handle that has been hit or null + * @protected + */ + getClosestHitHandle(location:yfiles.geometry.Point):yfiles.input.IHandle; + /** + * Finds the closest hit handle for the given world coordinate pair. + * @param {yfiles.geometry.Point} location The coordinates in the world coordinate system. + * @returns {yfiles.input.IHandle} The closest handle that has been hit or null + * @protected + */ + getClosestHitHandleTouch(location:yfiles.geometry.Point):yfiles.input.IHandle; + /** + * Determines whether a given handle has been visually hit by the mouse at the given world coordinates. + *

+ * This implementation uses the manhatten distance as a metric to determine if the handle was hit. + *

+ * @param {yfiles.input.IHandle} handle The handle to check + * @param {yfiles.geometry.Point} location The view coordinates to check. + * @param {yfiles.geometry.Point} distance The distance of the handle to the location. In the default implementation, this is a tuple representing the x- and + * y-distance of the handle to the location. + * @returns {boolean} Whether the handle has been hit. + * @protected + */ + handleIsHit(handle:yfiles.input.IHandle,location:yfiles.geometry.Point,distance:yfiles.geometry.Point):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.Point} location The world coordinates to check. + * @param {yfiles.geometry.Point} distance The distance of the handle to the touch location. In the default implementation, this is a tuple representing the x- and + * y-distance of the handle to the touch location. + * @returns {boolean} Whether the handle has been hit. + * @protected + */ + handleIsHitTouch(handle:yfiles.input.IHandle,location:yfiles.geometry.Point,distance:yfiles.geometry.Point):boolean; + /** + * Installs the visual representation of the handles into the canvas into the {@link yfiles.view.CanvasComponent#inputModeGroup}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.input.ConcurrencyController} controller + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Convenience method that invalidates the canvas this mode is currently installed in. + * @protected + */ + invalidate():void; + /** + * Event recognizer callback used to determine whether the mouse is currently hovering over a handle. + * @param {Object} sender + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} Whether the mouse is hovering over handle. + * @see yfiles.input.HandleInputMode#getClosestHitHandle + * @protected + */ + isHovering(sender:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Called after {@link yfiles.input.HandleInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceling(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinished(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinishing(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragged(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragging(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarted(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarting(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called after {@link yfiles.input.HandleInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():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; + /** + * + * @returns {boolean} + */ + tryStop():boolean; + /** + * Removes the {@link yfiles.view.ICanvasObject} that displays the handles from the canvas. + * @param {yfiles.input.IInputModeContext} context + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.HandleInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.HandleInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ *

+ * Disabling this mode will hide the handles and prevent the user from interacting with them. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.HandleInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#DEFAULT}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_DEFAULT_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_MOVE_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_RESIZE_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_ROTATE_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_SHEAR_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_INVISIBLE_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE} | + * {@link yfiles.input.HandleTypes#VARIANT2}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_INVISIBLE_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_INVISIBLE_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#INVISIBLE} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_INVISIBLE_VARIANT4_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} H{@link yfiles.input.HandleTypes#DEFAULT} | + * {@link yfiles.input.HandleTypes#VARIANT2}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_DEFAULT_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE} | + * {@link yfiles.input.HandleTypes#VARIANT2}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_MOVE_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE} | + * {@link yfiles.input.HandleTypes#VARIANT2} + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_RESIZE_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE} | + * {@link yfiles.input.HandleTypes#VARIANT2}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_ROTATE_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR} | + * {@link yfiles.input.HandleTypes#VARIANT2}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_SHEAR_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#DEFAULT} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_DEFAULT_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_MOVE_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_RESIZE_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_ROTATE_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_SHEAR_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#DEFAULT} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_DEFAULT_VARIANT4_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#MOVE} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_MOVE_VARIANT4_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#RESIZE} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_RESIZE_VARIANT4_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#ROTATE} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_ROTATE_VARIANT4_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#SHEAR} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_SHEAR_VARIANT4_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_WARP_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP} | + * {@link yfiles.input.HandleTypes#VARIANT2}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_WARP_VARIANT2_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP} | + * {@link yfiles.input.HandleTypes#VARIANT3}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_WARP_VARIANT3_KEY:string; + /** + * A {@link string} that can be used by instances of the {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.view.IVisualTemplate} that will + * be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleTypes type} {@link yfiles.input.HandleTypes#WARP} | + * {@link yfiles.input.HandleTypes#VARIANT4}. + *

+ * The drawing returned should be centered around (0,0). + *

+ * @const + * @static + * @type {string} + */ + static HANDLE_DRAWING_WARP_VARIANT4_KEY:string; + /** + * Gets or sets event recognizer that recognizes when the user temporarily disables snapping. + * @see yfiles.input.HandleInputMode#enableSnappingRecognizer + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + disableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + enableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "pressed" state recognizer. + *

+ * This recognizer instance will be used to determine when the user begins to move a handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer. + *

+ * This recognizer instance determines when the user is moving a handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "cancel" recognizer. + *

+ * This recognizer recognizes the cancel action during the move. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer. + *

+ * This instance determines when the user has finished moving the handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer for touch input. + *

+ * This recognizer instance determines when the user is moving a handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer for touch input. + *

+ * This instance determines when the user has finished moving the handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the collection of {@link yfiles.input.IHandle}s this mode manages. + * @type {yfiles.collections.IObservableCollection.} + */ + handles:yfiles.collections.IObservableCollection; + /** + * The {@link yfiles.input.HandleInputMode#snapContext} which manages snapping model items to certain coordinates (for instance, 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. + *

+ * @type {yfiles.input.SnapContext} + */ + snapContext:yfiles.input.SnapContext; + /** + * Gets the handle that is currently being moved or null otherwise. + * @type {yfiles.input.IHandle} + */ + currentHandle:yfiles.input.IHandle; + /** + * Gets an immutable snapshot of the {@link yfiles.graph.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.graph.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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + affectedItems:yfiles.collections.IEnumerable; + /** + * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDragFinishingListener + */ + addDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDragFinishingListener + */ + removeDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDragFinishedListener + */ + addDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDragFinishedListener + */ + removeDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDragStartingListener + */ + addDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDragStartingListener + */ + removeDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDragStartedListener + */ + addDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDragStartedListener + */ + removeDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDraggingListener + */ + addDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDraggingListener + */ + removeDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDraggedListener + */ + addDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDraggedListener + */ + removeDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDragCanceledListener + */ + addDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDragCanceledListener + */ + removeDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.HandleInputMode#removeDragCancelingListener + */ + addDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.HandleInputMode#addDragCancelingListener + */ + removeDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Interface for an object that can be used to drag something displayed in a {@link yfiles.view.CanvasComponent} + *

+ * 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}. + *

+ *

Related demos:

+ *
    + *
  • Demo: PositionHandler, demo.yfiles.input.positionhandler
  • + *
+ * @see yfiles.input.IPositionHandler + * @see yfiles.input.IHandle + * @see yfiles.input.IInputModeContext + * @interface + */ + export interface IDragHandler extends Object{ + /** + * 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} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Point} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @abstract + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):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} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Point} 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.Point} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @abstract + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):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.input.IInputModeContext} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Point} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.Point} 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. + * @abstract + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):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} context The context to retrieve information about the drag from. + * @abstract + */ + initializeDrag(context:yfiles.input.IInputModeContext):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. + *

+ * @abstract + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + } + var IDragHandler:{ $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum SnapPolicy{ /** - * Creates a new instance with an empty message. - */ - new ():yfiles.system.IOException; + * Don't perform snapping. + */ + NO_SNAPPING, /** - * Creates a new instance with the given message. - * @param {string} message The error message. - */ - FromMessage:{ - new (message:string):yfiles.system.IOException; - }; + * Snap to the nearest grid coordinate. + */ + TO_NEAREST, /** - * 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; - }; + * 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 + } + /** + * Interface for classes that can snap coordinates of items of a specific type to a grid. + * Type parameter T: The type of the items this class can snap + * @see yfiles.input.GridConstraintProvider. + * @interface + * @template T + */ + export interface IGridConstraintProvider extends Object{ + /** + * 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} location 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. + * @returns {boolean} Whether the point has been snapped. + * @abstract + */ + snapToGrid(context:yfiles.input.IInputModeContext,item:T,location:yfiles.geometry.IMutablePoint,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):boolean; + /** + * Gets the canonic grid width in horizontal direction. + * @abstract + * @type {number} + */ + horizontalGridWidth:number; + /** + * Gets the canonic grid width in vertical direction. + * @abstract + * @type {number} + */ + verticalGridWidth:number; + /** + * Gets the canonic origin of the grid. + * @abstract + * @type {yfiles.geometry.Point} + */ + gridOrigin:yfiles.geometry.Point; + } + var IGridConstraintProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; /** - * An {@link yfiles.lang.Exception} to indicate that an argument has not the expected format. - */ - export interface FormatException extends yfiles.lang.Exception{ + * A simple integer based implementation of {@link yfiles.input.IGridConstraintProvider.}. + * Type parameter T: The type of the items. + * @class yfiles.input.GridConstraintProvider. + * @implements {yfiles.input.IGridConstraintProvider.} + * @template T + */ + export interface GridConstraintProvider extends Object,yfiles.input.IGridConstraintProvider{} + export class GridConstraintProvider { + /** + * Creates a new instance using the given grid info. + * @param {yfiles.view.GridInfo} gridInfo The grid info object. + * @constructor + */ + constructor(gridInfo:yfiles.view.GridInfo); + /** + * Creates a new instance using the given grid specification. + * @param {number} gridWidth Width of the grid. + * @param {number} gridHeight Height of the grid. + * @constructor + */ + constructor(gridWidth:number,gridHeight:number); + /** + * Creates a new instance using the given grid distances. + * @param {number} gridSize + * @constructor + */ + constructor(gridSize:number); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {T} item + * @param {yfiles.geometry.IMutablePoint} location + * @param {yfiles.input.SnapPolicy} xSnapPolicy + * @param {yfiles.input.SnapPolicy} ySnapPolicy + * @returns {boolean} + */ + snapToGrid(context:yfiles.input.IInputModeContext,item:T,location:yfiles.geometry.IMutablePoint,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):boolean; + /** + * Gets or sets the grid info that describes the geometry of the grid. + * @type {yfiles.view.GridInfo} + */ + gridInfo:yfiles.view.GridInfo; + /** + * Gets the grid height. + *

+ * This implementation delegates to the {@link yfiles.input.GridConstraintProvider.#gridInfo} + *

+ * @type {number} + */ + horizontalGridWidth:number; + /** + * Gets the grid width. + *

+ * This implementation delegates to the {@link yfiles.input.GridConstraintProvider.#gridInfo} + *

+ * @type {number} + */ + verticalGridWidth:number; + /** + * Gets the grid origin. + *

+ * This implementation delegates to the {@link yfiles.input.GridConstraintProvider.#gridInfo} + *

+ * @type {yfiles.geometry.Point} + */ + gridOrigin:yfiles.geometry.Point; + static $class:yfiles.lang.Class; } - var FormatException:{ + export enum HandleTypes{ + /** + * 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.HandleTypes#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.HandleTypes#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.HandleTypes#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.HandleTypes#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.HandleTypes#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.HandleTypes#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.HandleTypes#TYPE_MASK}. + *

+ */ + WARP, + /** + * A bitmask that can be used to query the basic type of a handle type. + * @see yfiles.input.HandleTypes#DEFAULT + * @see yfiles.input.HandleTypes#MOVE + * @see yfiles.input.HandleTypes#RESIZE + * @see yfiles.input.HandleTypes#ROTATE + * @see yfiles.input.HandleTypes#SHEAR + * @see yfiles.input.HandleTypes#WARP + */ + TYPE_MASK, + /** + * A default variant modifier that decorates a basic type. + * @see yfiles.input.HandleTypes#VARIANT_MASK + */ + VARIANT1, + /** + * The second variant modifier that decorates a basic type. + * @see yfiles.input.HandleTypes#VARIANT_MASK + */ + VARIANT2, + /** + * The third variant modifier that decorates a basic type. + * @see yfiles.input.HandleTypes#VARIANT_MASK + */ + VARIANT3, + /** + * The forth variant modifier that decorates a basic type. + * @see yfiles.input.HandleTypes#VARIANT_MASK + */ + VARIANT4, + /** + * A bitmask that can be used to query the variant of a basic handle type. + * @see yfiles.input.HandleTypes#VARIANT1 + * @see yfiles.input.HandleTypes#VARIANT2 + * @see yfiles.input.HandleTypes#VARIANT3 + * @see yfiles.input.HandleTypes#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 yfiles.input.HandleTypes#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 yfiles.input.HandleTypes#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 yfiles.input.HandleTypes#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 yfiles.input.HandleTypes#OFFSET_MASK + */ + OFFSET_WEST, + /** + * A bitmask that can be used to query the offsets of a basic handle type. + * @see yfiles.input.HandleTypes#OFFSET_NORTH + * @see yfiles.input.HandleTypes#OFFSET_EAST + * @see yfiles.input.HandleTypes#OFFSET_SOUTH + * @see yfiles.input.HandleTypes#OFFSET_WEST + */ + OFFSET_MASK + } + 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, + /** + * A combined bitset of all possible handle positions at the four corners of a rectangle. + */ + CORNERS, + /** + * A combined bitset of the two horizontal handles of a rectangle. + */ + HORIZONTAL, + /** + * A combined bitset of the two vertical handles of a rectangle. + */ + VERTICAL, + /** + * A combined bitset of all possible handle positions at the border of a rectangle. + */ + BORDER, + /** + * A combined bitset of all possible handle positions. + */ + ALL + } + /** + * Interface for a handle that can be displayed in a {@link yfiles.view.CanvasComponent} 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}. + *

+ *

Related demos:

+ *
    + *
  • Demo: ReshapeHandleProvider, demo.yfiles.input.reshapehandleprovider
  • + *
+ * @see yfiles.input.HandleInputMode + * @see yfiles.input.IDragHandler + * @interface + * @implements {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. + * @abstract + * @type {yfiles.input.HandleTypes} + */ + type:yfiles.input.HandleTypes; + /** + * Provides the cursor to display when the mouse hovers over or drags this handle. + * @abstract + * @type {yfiles.view.Cursor} + */ + cursor:yfiles.view.Cursor; + } + var IHandle:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * 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{ + * Interface for an object that provides a number of {@link yfiles.input.IHandle} implementations. + * @interface + */ + export interface IHandleProvider extends Object{ /** - * Gets or sets a value indicating whether the action should be canceled. - * Value: - * true if the action should be canceled; otherwise, false. - */ + * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations that are associated with this instance. + * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.collections.IEnumerable.} A collection of handles. + * @abstract + */ + getHandles(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var IHandleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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. + *

Related demos:

+ *
    + *
  • Demo: ReshapeHandleProvider, demo.yfiles.input.reshapehandleprovider
  • + *
+ * @interface + */ + 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} context The context for which the handles are queried. + * @returns {yfiles.input.HandlePositions} A bitwise combination of all positions the {@link yfiles.input.IReshapeHandleProvider#getHandle} method can be queried for. + * @abstract + */ + getAvailableHandles(context: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} context The context for which the handles are queried. + * @param {yfiles.input.HandlePositions} position The single position a handle implementation should be returned for. + * @returns {yfiles.input.IHandle} An implementation of {@link yfiles.input.IHandle} for the given position. + * @abstract + */ + getHandle(context:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; + } + var IReshapeHandleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface implemented by input modes that can be registered with a {@link yfiles.view.CanvasComponent} 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. + *

+ *

+ * Implementations may request an input mutex from the {@link yfiles.input.ConcurrencyController} that will be given to them in + * their {@link yfiles.input.IInputMode#install} method. This allows them to exclusively modify the contents of the view. If + * another {@link yfiles.input.IInputMode} successfully acquires the mutex, the {@link yfiles.input.ConcurrencyController} will be + * {@link yfiles.input.ConcurrencyController#active deactivated}. + *

+ * @see yfiles.input.InputModeBase + * @interface + */ + export interface IInputMode extends Object{ + /** + * 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: + *

+ * @abstract + */ + cancel():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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.ConcurrencyController} for this mode. + * @see yfiles.input.IInputMode#uninstall + * @abstract + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):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 + *

+ * @returns {boolean} true if and only if the editing has been stopped or there was no edit in progress + * @see yfiles.input.IInputMode#cancel + * @abstract + */ + tryStop():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. + * @abstract + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Returns the context instance this mode is currently installed in or null if this instance is not installed. + *

+ * Note that this instance should not be passed down to subordinate modes or instances. Instead a corresponding context + * that has this instance set as the {@link yfiles.input.IInputModeContext#parentInputMode} should be used. + *

+ * @abstract + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * The priority of this input 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. + *

+ * @abstract + * @type {number} + */ + priority:number; + } + var IInputMode:{ + $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.graph.ILookup#lookup} method. + *

+ * @see yfiles.graph.ILookup + * @see yfiles.input.IInputMode + * @interface + * @implements {yfiles.view.ICanvasContext} + */ + export interface IInputModeContext extends Object,yfiles.view.ICanvasContext{ + /** + * Tries to call {@link yfiles.graph.IGraph#invalidateDisplays} on the {@link yfiles.input.IInputModeContext#graph graph} from the {@link yfiles.input.IInputModeContext}. + *

+ * If the graph instance cannot be found, {@link yfiles.view.CanvasComponent#invalidate} will be called instead. + *

+ */ + invalidateDisplays?():void; + /** + * 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. + *

+ * @abstract + * @type {yfiles.input.IInputMode} + */ + parentInputMode:yfiles.input.IInputMode; + /** + * Tries to retrieve an {@link yfiles.graph.IGraph} instance from the {@link yfiles.input.IInputModeContext}. + *

+ * This will use the {@link yfiles.graph.ILookup} and if this yields nothing, it will use the {@link yfiles.graph.ILookup} of the {@link yfiles.view.ICanvasContext#canvasComponent} or + * finally test if it is a {@link yfiles.view.GraphComponent} to obtain the graph from. + *

+ * @returns Return the graph or null. + * @type {yfiles.graph.IGraph} + */ + graph?:yfiles.graph.IGraph; + } + var IInputModeContext:{ + /** + * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode, parent context, and + * lookup decoration. + * @param {yfiles.input.IInputMode} parent + * @param {yfiles.input.IInputModeContext} parentContext + * @param {function(Object, yfiles.lang.Class): Object} lookupCallback + * @returns {yfiles.input.IInputModeContext} + * @static + */ + createInputModeContext?(parent:yfiles.input.IInputMode,parentContext:yfiles.input.IInputModeContext,lookupCallback:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.input.IInputModeContext; + /** + * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode and lookup decoration. + * @param {yfiles.input.IInputMode} parent + * @param {function(Object, yfiles.lang.Class): Object} lookupCallback + * @returns {yfiles.input.IInputModeContext} + * @static + */ + createInputModeContext?(parent:yfiles.input.IInputMode,lookupCallback:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.input.IInputModeContext; + /** + * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided values. + * @param {yfiles.view.CanvasComponent} canvas The {@link yfiles.view.CanvasComponent} to use, may not be null. + * @param {yfiles.input.IInputMode} [parent=null] The mode to set as the parent. This may be null for the canvas' context. + * @param {yfiles.graph.ILookup} [lookup=null] The lookup to use. + * @returns {yfiles.input.IInputModeContext} + * @static + */ + createInputModeContext?(canvas:yfiles.view.CanvasComponent,parent?:yfiles.input.IInputMode,lookup?:yfiles.graph.ILookup):yfiles.input.IInputModeContext; + /** + * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided values. + * @param {Object} options The parameters to pass. + * @param {yfiles.view.CanvasComponent} options.canvas The {@link yfiles.view.CanvasComponent} to use, may not be null. + * @param {yfiles.input.IInputMode} [options.parent=null] The mode to set as the parent. This may be null for the canvas' context. + * @param {yfiles.graph.ILookup} [options.lookup=null] The lookup to use. + * @returns {yfiles.input.IInputModeContext} + * @static + */ + createInputModeContext?(options:{canvas:yfiles.view.CanvasComponent,parent?:yfiles.input.IInputMode,lookup?:yfiles.graph.ILookup}):yfiles.input.IInputModeContext; + /** + * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode, parent context, and + * lookup decoration. + * @param {yfiles.input.IInputMode} parent + * @param {yfiles.input.IInputModeContext} parentContext + * @param {yfiles.graph.ILookup} lookup + * @returns {yfiles.input.IInputModeContext} + * @static + */ + createInputModeContext?(parent:yfiles.input.IInputMode,parentContext:yfiles.input.IInputModeContext,lookup:yfiles.graph.ILookup):yfiles.input.IInputModeContext; + /** + * Factory method that creates an {@link yfiles.input.IInputModeContext} that uses the provided parent mode and lookup decoration. + * @param {yfiles.input.IInputMode} parent + * @param {yfiles.graph.ILookup} [lookup=null] + * @returns {yfiles.input.IInputModeContext} + * @static + */ + createInputModeContext?(parent:yfiles.input.IInputMode,lookup?:yfiles.graph.ILookup):yfiles.input.IInputModeContext; + /** + * An empty context where both the inputmode and the canvas is null. + *

+ * The lookup always yields null, also. + *

+ * @const + * @static + * @type {yfiles.input.IInputModeContext} + */ + EMPTY?:yfiles.input.IInputModeContext; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that allows input modes to collect {@link yfiles.graph.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 yfiles.input.HandleInputMode#affectedItems + * @see yfiles.input.MoveInputMode#affectedItems + * @interface + */ + export interface IModelItemCollector extends Object{ + /** + * Adds a model item to this collector instance. + * @param {yfiles.graph.IModelItem} item The model item to add. + * @abstract + */ + add(item:yfiles.graph.IModelItem):void; + } + var IModelItemCollector:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Event argument base class that is used by events that are triggered by {@link yfiles.input.IInputMode} implementations + * @class yfiles.input.InputModeEventArgs + * @extends {yfiles.lang.EventArgs} + */ + export interface InputModeEventArgs extends yfiles.lang.EventArgs{} + export class InputModeEventArgs { + /** + * 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. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext); + /** + * Gets the context for the current event. + * @type {yfiles.input.IInputModeContext} + */ + context:yfiles.input.IInputModeContext; + static $class:yfiles.lang.Class; + } + /** + * Interface for an object that can handle the position of an item displayed in a {@link yfiles.view.CanvasComponent} + *

+ * 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 + * finally by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + *

+ *

Related demos:

+ *
    + *
  • Demo: PositionHandler, demo.yfiles.input.positionhandler
  • + *
+ * @see yfiles.input.IDragHandler + * @see yfiles.input.IHandle + * @see yfiles.input.MoveInputMode + * @interface + * @implements {yfiles.input.IDragHandler} + */ + export interface IPositionHandler extends Object,yfiles.input.IDragHandler{ + } + var IPositionHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for an object that can be interactively reshaped in a {@link yfiles.view.CanvasComponent} + *

+ * 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 yfiles.input.IDragHandler + * @see yfiles.input.IPositionHandler + * @see yfiles.input.IHandle + * @see yfiles.input.IInputModeContext + * @interface + */ + export interface IReshapeHandler extends Object{ + /** + * 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} context The context to retrieve information about the reshaping from. + * @param {yfiles.geometry.Rect} originalBounds The value of the coordinate of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @abstract + */ + cancelReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):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.input.IInputModeContext} context The context to retrieve information about the reshaping from. + * @param {yfiles.geometry.Rect} originalBounds The value of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.Rect} 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. + * @abstract + */ + handleReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * 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} context The context to retrieve information about the drag from. + * @abstract + */ + initializeReshape(context:yfiles.input.IInputModeContext):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} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Rect} 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.Rect} originalBounds The value of the coordinate of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @abstract + */ + reshapeFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * 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. + *

+ * @abstract + * @type {yfiles.geometry.IRectangle} + */ + bounds:yfiles.geometry.IRectangle; + } + var IReshapeHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.input.IInputMode} that recognizes simple key events and invokes a registered handler. + *

+ * This mode is {@link yfiles.input.KeyboardInputMode#exclusive} by default. + *

+ * @class yfiles.input.KeyboardInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface KeyboardInputMode extends Object,yfiles.input.IInputMode{} + export class KeyboardInputMode { + constructor(); + /** + * Adds a command and associated execution handlers to this instance. + *

+ * The command will not be allowed to execute if this mode is {@link yfiles.input.KeyboardInputMode#enabled disabled} or {@link yfiles.input.ConcurrencyController#active inactive}. + *

+ * @param {yfiles.input.ICommand} command The command to register handlers with. + * @param {function(yfiles.input.ICommand, Object, Object): boolean} [execute=null] The handler for the execution; a handler that will do nothing if omitted. + * @param {function(yfiles.input.ICommand, Object, Object): boolean} [canExecute=null] The handler that determines executability; a handler that is always enabled if omitted. + * @returns {yfiles.input.KeyboardInputModeBinding} A token for the newly created command binding that can used to later {@link yfiles.input.KeyboardInputModeBinding#remove remove} this binding from this instance again. + */ + addCommandBinding(command:yfiles.input.ICommand,execute?:(command:yfiles.input.ICommand,parameter:Object,source:Object)=>boolean,canExecute?:(command:yfiles.input.ICommand,parameter:Object,source:Object)=>boolean):yfiles.input.KeyboardInputModeBinding; + /** + * Adds a command and associated execution handlers to this instance. + *

+ * The command will not be allowed to execute if this mode is {@link yfiles.input.KeyboardInputMode#enabled disabled} or {@link yfiles.input.ConcurrencyController#active inactive}. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.input.ICommand} options.command The command to register handlers with. + * @param {function(yfiles.input.ICommand, Object, Object): boolean} [options.execute=null] The handler for the execution; a handler that will do nothing if omitted. + * @param {function(yfiles.input.ICommand, Object, Object): boolean} [options.canExecute=null] The handler that determines executability; a handler that is always enabled if omitted. + * @returns {yfiles.input.KeyboardInputModeBinding} A token for the newly created command binding that can used to later {@link yfiles.input.KeyboardInputModeBinding#remove remove} this binding from this instance again. + */ + addCommandBinding(options:{command:yfiles.input.ICommand,execute?:(command:yfiles.input.ICommand,parameter:Object,source:Object)=>boolean,canExecute?:(command:yfiles.input.ICommand,parameter:Object,source:Object)=>boolean}):yfiles.input.KeyboardInputModeBinding; + /** + * Adds an event handler for a specific key press gesture to this mode. + *

+ * Using this registration method, the command will not be allowed to execute if this mode is {@link yfiles.input.KeyboardInputMode#enabled disabled} or {@link yfiles.input.ConcurrencyController#active inactive}. + *

+ * @param {yfiles.view.Key} key The key constant that should be recognized. + * @param {yfiles.view.ModifierKeys} modifiers The modifiers that should be recognized when the key is pressed. + * @param {yfiles.input.ICommand} command The command to execute. + * @param {Object} [commandParameter=null] The command parameter to use for the {@link yfiles.input.ICommand#execute execution}; null if omitted. + * @returns {yfiles.input.KeyboardInputModeBinding} A token for the newly created command binding that can used to later {@link yfiles.input.KeyboardInputModeBinding#remove remove} this binding from this instance again. + */ + addKeyBinding(key:yfiles.view.Key,modifiers:yfiles.view.ModifierKeys,command:yfiles.input.ICommand,commandParameter?:Object):yfiles.input.KeyboardInputModeBinding; + /** + * Adds a given handler to this instance that will be triggered if the event recognizer recognizes a {@link yfiles.view.KeyEventArgs key event} that has + * been triggered by the {@link yfiles.view.CanvasComponent}. + * @param {function(Object, yfiles.lang.EventArgs): boolean} recognizer An event recognizer that will be fed with all key events. + * @param {yfiles.input.ICommand} command The command to invoke if the recognizer matches a key event. + * @param {Object} [commandParameter=null] The optional parameter to provide to the command. + * @returns {yfiles.input.KeyboardInputModeBinding} The newly constructed binding on which {@link yfiles.input.KeyboardInputModeBinding#remove} can be called to remove the + * resulting binding from this instance. + */ + addRecognizerBinding(recognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean,command:yfiles.input.ICommand,commandParameter?:Object):yfiles.input.KeyboardInputModeBinding; + /** + * + */ + cancel():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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.KeyboardInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.KeyboardInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Enables the registered commands and can be overridden in subclasses to perform additional actions after the mode has + * been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Disables the registered commands and can be overridden in subclasses to perform additional actions after the mode has + * been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Called after {@link yfiles.input.KeyboardInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Removes all previously registered commands from this instance. + *

+ * This effectively turn disables the command for the instance managed by this mode. + *

+ * @param {yfiles.input.ICommand} command The command to remove from all registered bindings. + * @see yfiles.input.KeyboardInputMode#addKeyBinding + * @see yfiles.input.KeyboardInputMode#addRecognizerBinding + */ + removeCommand(command:yfiles.input.ICommand):void; + /** + * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. + * @returns {boolean} true iff this instance does not {@link yfiles.input.ConcurrencyController#hasMutex own the mutex}. + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.KeyboardInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.KeyboardInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.KeyboardInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + static $class:yfiles.lang.Class; + } + /** + * A token returned by {@link yfiles.input.KeyboardInputMode}'s factory methods that can be used to {@link yfiles.input.KeyboardInputModeBinding#remove} + * the binding again. + *

+ * Instances of this class can only be obtained from AddCommandBinding, {@link yfiles.input.KeyboardInputMode#addKeyBinding}, and + * {@link yfiles.input.KeyboardInputMode#addRecognizerBinding}. Removing the instances is done via the instance method {@link yfiles.input.KeyboardInputModeBinding#remove} + * of this type. + *

+ * @class yfiles.input.KeyboardInputModeBinding + * @final + */ + export interface KeyboardInputModeBinding extends Object{} + export class KeyboardInputModeBinding { + /** + * Removes the binding represented by this instance from the {@link yfiles.input.KeyboardInputMode} it has been created for. + *

+ * Once this method has been called, the instance can be + *

+ */ + remove():void; + /** + * Gets the {@link yfiles.input.ICommand} that is associated with this binding. + * @type {yfiles.input.ICommand} + */ + command:yfiles.input.ICommand; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} implementation that can handle marquee selections performed by the user with a mouse. + *

+ * This implementation will request the mutex as soon as it recognizes a mouse drag. + *

+ *

+ * This mode is {@link yfiles.input.MarqueeSelectionInputMode#exclusive} by default. + *

+ * @class yfiles.input.MarqueeSelectionInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface MarqueeSelectionInputMode extends Object,yfiles.input.IInputMode{} + export class MarqueeSelectionInputMode { + /** + * Creates a new instance of the marquee selection mode. + * @constructor + */ + constructor(); + /** + * Cancels any pending marquee selection. + */ + cancel():void; + /** + * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. + * @returns {yfiles.input.MarqueeSelectionEventArgs} An input mode event argument that is configured for this instance. + * @protected + */ + createInputModeEventArgs():yfiles.input.MarqueeSelectionEventArgs; + /** + * 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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.MarqueeSelectionInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.MarqueeSelectionInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragCanceledListener DragCanceled} + * event. + * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceled(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragCancelingListener DragCanceling} + * event. + * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceling(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + *

+ * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragFinishedListener DragFinished} + * event. + *

+ * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragFinished(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + *

+ * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragFinishingListener DragFinishing} + * event. + *

+ * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragFinishing(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Callback triggered at the end of each drag. + *

+ * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDraggedListener Dragged} + * event. + *

+ * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragged(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Callback triggered at the start of each drag. + *

+ * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDraggingListener Dragging} + * event. + *

+ * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragging(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragStartedListener DragStarted} + * event. + * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarted(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragStartingListener DragStarting} + * event. + * @param {yfiles.input.MarqueeSelectionEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarting(evt:yfiles.input.MarqueeSelectionEventArgs):void; + /** + * Called after {@link yfiles.input.MarqueeSelectionInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MarqueeSelectionInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.MarqueeSelectionInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.MarqueeSelectionInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Gets the current or last marquee selection rectangle. + * @type {yfiles.geometry.Rect} + */ + selectionRectangle:yfiles.geometry.Rect; + /** + * Gets or sets the template that is used for the visualization of the marquee rectangle. + * @type {yfiles.view.IVisualTemplate} + */ + template:yfiles.view.IVisualTemplate; + /** + * Gets or sets the "cancel" recognizer. + *

+ * This recognizer recognizes the cancel action during the marquee selection. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} that can be used to create the visual that will be used to + * draw the marquee box. + * @const + * @static + * @type {string} + */ + static MARQUEE_RECTANGLE_TEMPLATE_KEY:string; + /** + * Gets or sets the cursor to use during the dragging of the marquee. + *

+ * The default is Cursors.Cross + *

+ * @type {yfiles.view.Cursor} + */ + marqueeCursor:yfiles.view.Cursor; + /** + * Gets or sets the "pressed" state recognizer. + *

+ * This recognizer instance will be used to determine when the user begins to draw the marquee. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer. + *

+ * This recognizer instance determines when the user is dragging the marquee. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer. + *

+ * This instance determines when the user has finished creating the marquee. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer for touch input. + *

+ * This recognizer instance determines when the user is dragging the marquee. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer for touch input. + *

+ * This instance determines when the user has finished creating the marquee. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Adds the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDraggingListener + */ + addDraggingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDraggingListener + */ + removeDraggingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDraggedListener + */ + addDraggedListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDraggedListener + */ + removeDraggedListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDragCanceledListener + */ + addDragCanceledListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDragCanceledListener + */ + removeDragCanceledListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDragCancelingListener + */ + addDragCancelingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDragCancelingListener + */ + removeDragCancelingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDragFinishingListener + */ + addDragFinishingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDragFinishingListener + */ + removeDragFinishingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinished event that occurs the drag has been finished. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDragFinishedListener + */ + addDragFinishedListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinished event that occurs the drag has been finished. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDragFinishedListener + */ + removeDragFinishedListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDragStartingListener + */ + addDragStartingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDragStartingListener + */ + removeDragStartingListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to add. + * @see yfiles.input.MarqueeSelectionInputMode#removeDragStartedListener + */ + addDragStartedListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.MarqueeSelectionEventArgs): void} listener The listener to remove. + * @see yfiles.input.MarqueeSelectionInputMode#addDragStartedListener + */ + removeDragStartedListener(listener:(sender:Object,evt:yfiles.input.MarqueeSelectionEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Event arguments used by {@link yfiles.input.MarqueeSelectionInputMode}. + * @class yfiles.input.MarqueeSelectionEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface MarqueeSelectionEventArgs extends yfiles.input.InputModeEventArgs{} + export class MarqueeSelectionEventArgs { + /** + * Gets the current selection rectangle of the {@link yfiles.input.MarqueeSelectionInputMode}. + * @type {yfiles.geometry.Rect} + */ + rectangle:yfiles.geometry.Rect; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.input.MouseHoverInputMode + * @class yfiles.input.ToolTipQueryEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface ToolTipQueryEventArgs extends yfiles.input.InputModeEventArgs{} + export class ToolTipQueryEventArgs { + /** + * Initializes a new instance of the {@link yfiles.input.ToolTipQueryEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context of the query. + * @param {yfiles.geometry.Point} queryLocation The query location. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point); + /** + * Gets the query location in world coordinates. + * @type {yfiles.geometry.Point} + */ + queryLocation:yfiles.geometry.Point; + /** + * Gets or sets the tool tip content to use. + *

+ * Setting this property will set the {@link yfiles.input.ToolTipQueryEventArgs#handled} property to true. + *

+ * @type {Object} + */ + 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. + *

+ * @type {boolean} + */ + handled:boolean; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} that detects when the mouse hovers over the {@link yfiles.view.CanvasComponent}. + *

+ * 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. + *

+ *

+ * This mode is {@link yfiles.input.MouseHoverInputMode#exclusive} by default. + *

+ * @class yfiles.input.MouseHoverInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface MouseHoverInputMode extends Object,yfiles.input.IInputMode{} + export class MouseHoverInputMode { + /** + * Creates a new instance using the provided {@link yfiles.input.MouseHoverInputMode#toolTip} and query callback. + * @param {yfiles.view.ToolTip} toolTip + * @param {function(Object, yfiles.input.ToolTipQueryEventArgs): void} textProvider + * @constructor + */ + constructor(toolTip:yfiles.view.ToolTip,textProvider:(sender:Object,evt:yfiles.input.ToolTipQueryEventArgs)=>void); + /** + * Creates a new instance with default values. + * @constructor + */ + constructor(); + /** + * 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.Point} originalPosition The calculated tooltip position relative to the document root + * @returns {yfiles.geometry.Point} The adjusted tooltip location + * @see yfiles.input.MouseHoverInputMode#getToolTipLocation + * @protected + */ + adjustTooltipPosition(originalPosition:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * + */ + cancel():void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} + * event for the upcoming text query operation. + * @returns {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + * @protected + */ + createHoverInputModeContext():yfiles.input.IInputModeContext; + /** + * Factory method that creates the {@link yfiles.input.MouseHoverInputMode#toolTip}. + * @returns {yfiles.view.ToolTip} A simple {@link yfiles.input.MouseHoverInputMode#toolTip}. + * @protected + */ + createToolTip():yfiles.view.ToolTip; + /** + * Callback method that provides a text for the given location or null. + * @param {yfiles.geometry.Point} location The location to find a text for. + * @returns {Object} A string or null to indicate that no tool tip should be shown. + * @see yfiles.input.MouseHoverInputMode#addQueryToolTipListener + * @see yfiles.input.MouseHoverInputMode#createHoverInputModeContext + * @protected + */ + getToolTipContent(location:yfiles.geometry.Point):Object; + /** + * 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.Point} location The position in world coordinates. + * @returns {yfiles.geometry.Point} The position in view coordinates. + * @see yfiles.input.MouseHoverInputMode#toolTipLocationOffset + * @protected + */ + getToolTipLocation(location:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Immediately hides the tool tip. + */ + hide():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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.MouseHoverInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.MouseHoverInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Called when the tooltip should be hidden. + * @protected + */ + onHide():void; + /** + * Raises the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} event. + * @param {yfiles.input.ToolTipQueryEventArgs} evt The {@link yfiles.input.ToolTipQueryEventArgs} instance containing the event data. + * @protected + */ + onQueryToolTip(evt:yfiles.input.ToolTipQueryEventArgs):void; + /** + * 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. + *

+ * @param {yfiles.geometry.Point} location + * @protected + */ + onShow(location:yfiles.geometry.Point):void; + /** + * Called after {@link yfiles.input.MouseHoverInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Immediately shows the tool tip at the given location. + * @param {yfiles.geometry.Point} location The location in the world coordinate system. + */ + show(location:yfiles.geometry.Point):void; + /** + * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. + * @returns {boolean} true iff this instance does not {@link yfiles.input.ConcurrencyController#hasMutex own the mutex}. + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MouseHoverInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.MouseHoverInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.MouseHoverInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Gets or sets an {@link yfiles.input.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.input.IHitTestable#ALWAYS} + *

+ * @type {yfiles.input.IHitTestable} + */ + validHoverLocationHitTestable:yfiles.input.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. + *

+ * @type {yfiles.view.ToolTip} + */ + toolTip:yfiles.view.ToolTip; + /** + * Determines whether the tool tip is currently showing. + * @type {boolean} + */ + showing:boolean; + /** + * 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 yfiles.input.MouseHoverInputMode#getToolTipLocation + * @type {yfiles.geometry.Point} + */ + toolTipLocationOffset:yfiles.geometry.Point; + /** + * Gets or sets the duration to show the tool tip. + *

+ * The default value is 3 seconds. + *

+ * @default '00:00:03.0' + * @type {yfiles.lang.TimeSpan} + */ + duration:yfiles.lang.TimeSpan; + /** + * Gets or sets the delay time before showing the tool tip. + *

+ * The default value is 1 second + *

+ * @default '00:00:01.0' + * @type {yfiles.lang.TimeSpan} + */ + delay:yfiles.lang.TimeSpan; + /** + * Gets or sets the amount the mouse pointer has to move in order to hide the tooltip. + *

+ * The default value is 10, 10. + *

+ * @default '10, 10' + * @type {yfiles.geometry.Size} + */ + mouseHoverSize:yfiles.geometry.Size; + /** + * If true the tooltip is closed when the a click is performed over the tooltip. + * @type {boolean} + */ + closeOnClick:boolean; + /** + * Adds the given listener for the QueryToolTip event that 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. + *

+ * @param {function(Object, yfiles.input.ToolTipQueryEventArgs): void} listener The listener to add. + * @see yfiles.input.MouseHoverInputMode#removeQueryToolTipListener + */ + addQueryToolTipListener(listener:(sender:Object,evt:yfiles.input.ToolTipQueryEventArgs)=>void):void; + /** + * Removes the given listener for the QueryToolTip event that 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. + *

+ * @param {function(Object, yfiles.input.ToolTipQueryEventArgs): void} listener The listener to remove. + * @see yfiles.input.MouseHoverInputMode#addQueryToolTipListener + */ + removeQueryToolTipListener(listener:(sender:Object,evt:yfiles.input.ToolTipQueryEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * 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#positionHandler} to + * delegate the actual work of moving the elements to. + *

+ *

+ * This mode is {@link yfiles.input.MoveInputMode#exclusive} by default. + *

+ * @class yfiles.input.MoveInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface MoveInputMode extends Object,yfiles.input.IInputMode{} + export class MoveInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.MoveInputMode} class. + * @constructor + */ + constructor(); + /** + * Callback that is called when this mode is "armed". + *

+ * This happens when the mouse {@link yfiles.input.MoveInputMode#hoverRecognizer hovers} over the item(s) to move. This implementation sets the mouse cursor to {@link yfiles.input.MoveInputMode#moveCursor}. + *

+ * @protected + */ + arm():void; + /** + * Cancels the editing of this mode. + *

+ * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls + * {@link yfiles.input.MoveInputMode#onCanceled}. + *

+ * @see yfiles.input.MoveInputMode#onCanceled + */ + cancel():void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use with the {@link yfiles.input.IPositionHandler} interface for the upcoming drag + * operation. + * @returns {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + * @protected + */ + createPositionHandlerInputModeContext():yfiles.input.IInputModeContext; + /** + * Callback that is called when this mode is "disarmed". + *

+ * This happens when the mouse stops hovering over the item(s). This implementation resets the mouse cursor again. + *

+ * @protected + */ + disarm():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 location. + *

+ * @param {yfiles.geometry.Point} location The location where the drag had been initialized. + */ + doStartDrag(location:yfiles.geometry.Point):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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.MoveInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * 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}. + *

+ * @param {yfiles.geometry.Point} location The location in the world coordinate system. + * @returns {boolean} true if at the given location it is valid to start the move gesture; otherwise, false. + * @protected + */ + isValidStartLocation(location:yfiles.geometry.Point):boolean; + /** + * Called after {@link yfiles.input.MoveInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceling(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinished(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinishing(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragged(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragging(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarted(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarting(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.MoveInputMode#addQueryPositionHandlerListener QueryPositionHandler} event. + * @param {yfiles.input.QueryPositionHandlerEventArgs} evt The {@link yfiles.input.QueryPositionHandlerEventArgs} instance containing the event data. + * @protected + */ + onQueryPositionHandler(evt:yfiles.input.QueryPositionHandlerEventArgs):void; + /** + * Called after {@link yfiles.input.MoveInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.MoveInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.MoveInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MoveInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets event recognizer that recognizes when the user temporarily disables snapping. + * @see yfiles.input.MoveInputMode#enableSnappingRecognizer + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + disableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + enableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "pressed" state recognizer. + *

+ * This recognizer instance will be used to determine when the user begins to move the selection. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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#isValidStartLocation} method + * to determine whether the mode can be initialized, here. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + hoverRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer. + *

+ * This recognizer instance determines when the user is moving the selection + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "cancel" recognizer. + *

+ * This recognizer recognizes a cancel action during the move. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer. + *

+ * This instance determines when the user has finished the move. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "pressed" recognizer for touch events. + *

+ * This recognizer instance determines when the user begins the move selection operation. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer for touch events. + *

+ * This recognizer instance determines when the user is moving the selection + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer for touch events. + *

+ * This instance determines when the user has finished the move using touch. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the {@link yfiles.input.IHitTestable} that will be used by this mode to determine where the user may start + * dragging. + * @type {yfiles.input.IHitTestable} + */ + hitTestable:yfiles.input.IHitTestable; + /** + * Gets or sets the {@link yfiles.input.IPositionHandler} that will be used as fallback to handle that actual movement of the + * elements during the drag. + *

+ * Note that the {@link yfiles.input.IPositionHandler} retrieved by the {@link yfiles.input.MoveInputMode#addQueryPositionHandlerListener QueryPositionHandler} + * event has priority before this property. Only if the event is not {@link yfiles.input.QueryPositionHandlerEventArgs#handled} this property is used. + *

+ * @type {yfiles.input.IPositionHandler} + */ + positionHandler:yfiles.input.IPositionHandler; + /** + * Gets or sets the cursor to use during the move. + * @type {yfiles.view.Cursor} + */ + moveCursor:yfiles.view.Cursor; + /** + * The {@link yfiles.input.MoveInputMode#snapContext} which manages snapping model items to certain coordinates (for instance, 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. + *

+ * @type {yfiles.input.SnapContext} + */ + snapContext:yfiles.input.SnapContext; + /** + * Adds the given listener for the QueryPositionHandler event that occurs when a drag is recognized for the + * {@link yfiles.input.MoveInputMode}. + *

+ * If the event args are {@link yfiles.input.QueryPositionHandlerEventArgs#handled}, the {@link yfiles.input.IPositionHandler} that is carried with the event args is used to actually move + * the items. Otherwise the pre-set {@link yfiles.input.MoveInputMode#positionHandler} property is used. + *

+ * @param {function(Object, yfiles.input.QueryPositionHandlerEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeQueryPositionHandlerListener + */ + addQueryPositionHandlerListener(listener:(sender:Object,evt:yfiles.input.QueryPositionHandlerEventArgs)=>void):void; + /** + * Removes the given listener for the QueryPositionHandler event that occurs when a drag is recognized for the + * {@link yfiles.input.MoveInputMode}. + *

+ * If the event args are {@link yfiles.input.QueryPositionHandlerEventArgs#handled}, the {@link yfiles.input.IPositionHandler} that is carried with the event args is used to actually move + * the items. Otherwise the pre-set {@link yfiles.input.MoveInputMode#positionHandler} property is used. + *

+ * @param {function(Object, yfiles.input.QueryPositionHandlerEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addQueryPositionHandlerListener + */ + removeQueryPositionHandlerListener(listener:(sender:Object,evt:yfiles.input.QueryPositionHandlerEventArgs)=>void):void; + /** + * Gets a value indicating whether a drag operation is currently in progress. + * @type {boolean} + */ + isDragging:boolean; + /** + * Returns the initial position where the dragging was initiated. + * @type {yfiles.geometry.Point} + */ + initialLocation:yfiles.geometry.Point; + /** + * Gets an immutable snapshot of the {@link yfiles.graph.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.graph.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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + affectedItems:yfiles.collections.IEnumerable; + /** + * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDragFinishingListener + */ + addDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDragFinishingListener + */ + removeDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDragFinishedListener + */ + addDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDragFinishedListener + */ + removeDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDragStartingListener + */ + addDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDragStartingListener + */ + removeDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDragStartedListener + */ + addDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDragStartedListener + */ + removeDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDraggingListener + */ + addDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDraggingListener + */ + removeDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDraggedListener + */ + addDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDraggedListener + */ + removeDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDragCanceledListener + */ + addDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDragCanceledListener + */ + removeDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveInputMode#removeDragCancelingListener + */ + addDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveInputMode#addDragCancelingListener + */ + removeDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Event argument that is used to query the {@link yfiles.input.IPositionHandler} that is used to move the items while dragging via + * {@link yfiles.input.MoveInputMode}. + * @see yfiles.input.MoveInputMode + * @see yfiles.input.MoveInputMode#addQueryPositionHandlerListener + * @class yfiles.input.QueryPositionHandlerEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface QueryPositionHandlerEventArgs extends yfiles.input.InputModeEventArgs{} + export class QueryPositionHandlerEventArgs { + /** + * Instantiates a new {@link yfiles.input.QueryPositionHandlerEventArgs} + * @param {yfiles.input.IInputModeContext} context The {@link yfiles.input.IInputModeContext} of the operation. + * @param {yfiles.geometry.Point} queryLocation The initial location of the movement. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point); + /** + * The {@link yfiles.input.IPositionHandler} to use for the movement of the items that are affected by the + * {@link yfiles.input.MoveInputMode}. + * @type {yfiles.input.IPositionHandler} + */ + positionHandler:yfiles.input.IPositionHandler; + /** + * Gets the location of the movement (where the drag has started). + * @type {yfiles.geometry.Point} + */ + queryLocation:yfiles.geometry.Point; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.QueryPositionHandlerEventArgs} has been handled. + * @type {boolean} + */ + handled:boolean; + static $class:yfiles.lang.Class; + } + export enum InertiaPolicies{ + /** + * 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 + } + /** + * 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 mutex 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. + *

+ *

+ * This mode is {@link yfiles.input.MoveViewportInputMode#exclusive} by default. + *

+ * @class yfiles.input.MoveViewportInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface MoveViewportInputMode extends Object,yfiles.input.IInputMode{} + export class MoveViewportInputMode { + /** + * Creates a new instance of the move viewport mode + * @constructor + */ + constructor(); + /** + * Called to prepare moving the viewport when the mouse is pressed. + *

+ * This will set the mouse cursor to {@link yfiles.input.MoveViewportInputMode#dragCursor}. + *

+ * @protected + */ + arm():void; + /** + * Cancels navigation. + */ + cancel():void; + /** + * Called after moving the viewport is finished or canceled. + *

+ * This will reset the mouse cursor. + *

+ * @protected + */ + disarm():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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.MoveViewportInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.MoveViewportInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceling(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinished(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinishing(evt:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + *

+ * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDraggedListener Dragged} + * event. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragged(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragging(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarted(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarting(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called after {@link yfiles.input.MoveViewportInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * + * @returns {boolean} + */ + tryStop():boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MoveViewportInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.MoveViewportInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.MoveViewportInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Gets or sets the event recognizer that starts the 'move viewport' gesture. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + primaryDownRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that moves the viewport or zooms the canvas if a secondary device is down. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + primaryMoveRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that ends the 'move viewport' or 'pinch' gesture. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + primaryUpRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that starts the 'pinch' gesture + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + secondaryDownRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that zooms the canvas using the 'pinch' gesture or moves the viewport if no primary + * device is down. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + secondaryMoveRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that ends the pinch zoom gesture or ends the move if no primary device is down. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + secondaryUpRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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. + *

+ * The default value is 0.02d + *

+ * @default 0.02 + * @type {number} + */ + inertiaFactor:number; + /** + * Gets or sets the threshold that determines when inertia movement should stop. + *

+ * The default value is 30 + *

+ * @type {number} + */ + inertiaThreshold:number; + /** + * The amount of damping that is applied to the inertia movement. + *

+ * The default value is 0.15d + *

+ * @type {number} + */ + inertiaDamping:number; + /** + * Gets or sets the mode that determines when to use inertia when dragging the viewport. + * @default 2 + * @type {yfiles.input.InertiaPolicies} + */ + inertia:yfiles.input.InertiaPolicies; + /** + * Gets or sets a value indicating whether to allow the pinch zoom gesture. + * @default true + * @type {boolean} + */ + allowPinchZoom:boolean; + /** + * The cursor to use during the dragging. + *

+ * The default is {@link yfiles.view.Cursor#POINTER}. + *

+ * @type {yfiles.view.Cursor} + */ + dragCursor:yfiles.view.Cursor; + /** + * Gets or sets the "pressed" state recognizer. + *

+ * This recognizer instance will be used to determine when the user begins the navigation gesture. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer. + *

+ * This recognizer instance determines when the user is dragging the viewport. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer. + *

+ * This instance determines when the user has finished dragging the viewport. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Adds the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDraggingListener + */ + addDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDraggingListener + */ + removeDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDraggedListener + */ + addDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDraggedListener + */ + removeDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDragFinishingListener + */ + addDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDragFinishingListener + */ + removeDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDragFinishedListener + */ + addDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDragFinishedListener + */ + removeDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDragStartingListener + */ + addDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDragStartingListener + */ + removeDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDragStartedListener + */ + addDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDragStartedListener + */ + removeDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDragCanceledListener + */ + addDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDragCanceledListener + */ + removeDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.MoveViewportInputMode#removeDragCancelingListener + */ + addDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.MoveViewportInputMode#addDragCancelingListener + */ + removeDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * A composite {@link yfiles.input.IInputMode} implementation that additionally can deal with {@link yfiles.input.ConcurrencyController#exclusive} instances. + *

+ * Instances of this class can {@link yfiles.input.MultiplexingInputMode#install} and {@link yfiles.input.MultiplexingInputMode#uninstall} + * multiple {@link yfiles.input.IInputMode}s. Child input modes can be added using the {@link yfiles.input.MultiplexingInputMode#add} + * method. By providing {@link yfiles.input.IInputMode#priority priorities} to the different modes, their {@link yfiles.input.IInputMode#install installation} order can be influenced. Input modes with + * lower priorities are handled earlier. + *

+ *

+ * Child input modes can run exclusively while they hold the mutex. Other exclusive input modes are temporarily {@link yfiles.input.ConcurrencyController#active deactivated} + * until the mutex is released. This can be controlled by setting the {@link yfiles.input.ConcurrencyController#exclusive} property on the controller. Input modes that disable + * the {@link yfiles.input.ConcurrencyController#exclusive} property will always run concurrently with all other input modes. + *

+ *

+ * This class itself implements the {@link yfiles.input.IInputMode} 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.MultiplexingInputMode#enabled disabled}, it will stop or cancel the current owner of the mutex. + *

+ * @see yfiles.input.MultiplexingInputMode#add + * @class yfiles.input.MultiplexingInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface MultiplexingInputMode extends Object,yfiles.input.IInputMode{} + export class MultiplexingInputMode { + /** + * Creates an instance with no initial modes. + * @constructor + */ + constructor(); + /** + * Adds the given mode. + *

+ * The input modes will be ordered according to their {@link yfiles.input.IInputMode#priority}: Input modes with lower priority will be {@link yfiles.input.IInputMode#install installed} earlier. + *

+ *

+ * Input modes will run exclusively if the {@link yfiles.input.ConcurrencyController#exclusive} property of their {@link yfiles.input.IInputMode#install installed controller} is set to true. Otherwise they can not + * and will not be deactivated if another {@link yfiles.input.IInputMode} acquires the mutex. + *

+ * @param {yfiles.input.IInputMode} mode The input mode to add to this mode. + * @throws {Stubs.Exceptions.ArgumentError} If the same mode has is already added to this instance. + */ + add(mode:yfiles.input.IInputMode):void; + /** + * Adjusts the cursor of the {@link yfiles.view.CanvasComponent} according to the current input mutex owner or the first mode in + * the list whose {@link yfiles.input.ConcurrencyController} returns a non-null {@link yfiles.input.ConcurrencyController#preferredCursor}. + *

+ * This method will set {@link yfiles.input.MultiplexingInputMode#defaultCursor} as the current cursor if no other {@link yfiles.input.ConcurrencyController#preferredCursor} has been specified. + *

+ */ + adjustCursor():void; + /** + * Cancels all modes. + */ + cancel():void; + /** + * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.graph.ILookup#lookup} method. + * @param {yfiles.lang.Class} type The type argument passed to {@link yfiles.graph.ILookup#lookup}. + * @returns {Object} The result of the lookup query, or null. + * @see yfiles.input.MultiplexingInputMode#createChildInputModeContext + * @protected + */ + childInputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * 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.MultiplexingInputMode#inputModeContext} property is already set, when this method is called. {@link yfiles.graph.ILookup#lookup} + * calls for the created context will be resolved by this instance's {@link yfiles.input.MultiplexingInputMode#childInputModeContextLookup} + * method. + *

+ * @returns {yfiles.input.IInputModeContext} A new instance that delegates to the {@link yfiles.input.MultiplexingInputMode#inputModeContext parent's context.} + * @protected + */ + createChildInputModeContext():yfiles.input.IInputModeContext; + /** + * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} for this input mode. + * @param {yfiles.input.IInputModeContext} context An input mode context that is available in the {@link yfiles.input.InputModeEventArgs}. + *

+ * Can be null in which case a new context for this instance is created automatically. + *

+ * @returns {yfiles.input.InputModeEventArgs} An input mode event argument that is configured for this instance. + * @protected + */ + createInputModeEventArgs(context:yfiles.input.IInputModeContext):yfiles.input.InputModeEventArgs; + /** + * Returns a list of all modes managed by this instance in sorted order. + * @returns {yfiles.collections.IList.} A list of the modes. + */ + getSortedModes():yfiles.collections.IList; + /** + * 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.MultiplexingInputMode#install installation} of this mode. + *

+ *

+ * This code will be executed only once per instance. The {@link yfiles.input.MultiplexingInputMode#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 yfiles.input.MultiplexingInputMode#install + * @protected + */ + initialize():void; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.input.ConcurrencyController} controller + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Convenience method for subclass implementations that invalidates the canvas this mode is currently installed in. + * @protected + */ + invalidate():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * This implementation reenabled previously disabled concurrent child modes. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * This implementation sets the {@link yfiles.input.ConcurrencyController#preferredCursor} property to null and {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if the mutex is currently owned by this instance. + * Also, all concurrent child modes will be disabled. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Removes the given mode from this compound mode. + * @param {yfiles.input.IInputMode} mode The mode to remove. + */ + remove(mode:yfiles.input.IInputMode):void; + /** + * Called when the {@link yfiles.input.IInputMode#priority} of an {@link yfiles.input.MultiplexingInputMode#add installed} sub mode has changed. + *

+ * This implementation {@link yfiles.input.MultiplexingInputMode#uninstall uninstalls} all sub modes and then re-{@link yfiles.input.MultiplexingInputMode#install installs} them according to their new priorities. + *

+ * @protected + */ + subModePriorityChanged():void; + /** + * Tries to stop all modes. + * @returns {boolean} + */ + tryStop():boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.MultiplexingInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.MultiplexingInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {number} + */ + priority:number; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.MultiplexingInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Gets the {@link yfiles.input.IInputMode} that currently owns the mutex. + * @type {yfiles.input.IInputMode} + */ + mutexOwner:yfiles.input.IInputMode; + /** + * Gets or sets the cursor to use whenever no child mode prefers a different cursor. + *

+ * The default is null + *

+ * @see yfiles.input.MultiplexingInputMode#adjustCursor + * @default null + * @type {yfiles.view.Cursor} + */ + defaultCursor:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} that can be used for an overview {@link yfiles.view.CanvasComponent}. + *

+ * This mode will add navigation capabilities to the control it is installed in. + *

+ * @see yfiles.input.OverviewInputMode#canvasComponent + * @see yfiles.input.OverviewInputMode#handleInputMode + * @see yfiles.input.OverviewInputMode#moveInputMode + * @see yfiles.input.OverviewInputMode#keyboardInputMode + * @see yfiles.input.OverviewInputMode#clickInputMode + * @see yfiles.input.OverviewInputMode#tapInputMode + * @class yfiles.input.OverviewInputMode + * @extends {yfiles.input.MultiplexingInputMode} + */ + export interface OverviewInputMode extends yfiles.input.MultiplexingInputMode{} + export class OverviewInputMode { + /** + * Creates a new instance. + * @constructor + */ + constructor(); + /** + * Factory method for the {@link yfiles.input.OverviewInputMode#clickInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#clickInputMode} property. + *

+ * @returns {yfiles.input.ClickInputMode} a new instance of ClickInputMode + * @protected + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Factory method for the HandleInputMode property. + *

+ * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#handleInputMode} property. + *

+ * @returns {yfiles.input.HandleInputMode} a new instance of HandleInputMode + * @protected + */ + createHandleInputMode():yfiles.input.HandleInputMode; + /** + * Factory method for the KeyboardInputMode property. + *

+ * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#keyboardInputMode} property. + *

+ * @returns {yfiles.input.KeyboardInputMode} a new instance of KeyboardInputMode + * @protected + */ + createKeyboardInputMode():yfiles.input.KeyboardInputMode; + /** + * Factory method for the MoveInputMode property. + *

+ * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#moveInputMode} property. + *

+ * @returns {yfiles.input.MoveInputMode} a new instance of MoveInputMode + * @protected + */ + createMoveInputMode():yfiles.input.MoveInputMode; + /** + * Factory method for the {@link yfiles.input.OverviewInputMode#tapInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.OverviewInputMode#tapInputMode} property. + *

+ * @returns {yfiles.input.TapInputMode} a new instance of TapInputMode + * @protected + */ + createTapInputMode():yfiles.input.TapInputMode; + /** + * Callback method that is used by {@link yfiles.input.OverviewInputMode#createKeyboardInputMode} to determine which of the + * built-in {@link yfiles.input.ICommand}s to install. + *

+ * This implementation unconditionally returns true, subclasses may override this method to adjust the behavior. + *

+ * @param {yfiles.input.ICommand} command The command to install. + * @returns {boolean} Whether to install this command. + * @protected + */ + shouldInstallCommand(command:yfiles.input.ICommand):boolean; + /** + * Updates the {@link yfiles.view.CanvasComponent#zoom zoom} and {@link yfiles.view.CanvasComponent#viewPoint viewpoint} of the overview control. + *

+ * This method is called when the {@link yfiles.view.CanvasComponent#contentRect graph bounds} of the {@link yfiles.input.OverviewInputMode#canvasComponent } have changed. The {@link yfiles.input.OverviewInputMode#margins margins} should be respected. + *

+ * @protected + */ + updateVisibleArea():void; + /** + * 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 to avoid too frequent updates of the overview. + *

+ *

+ * To manually update the overview when this property is false, call the {@link yfiles.view.CanvasComponent#invalidate} method on + * the {@link yfiles.view.GraphOverviewComponent}. + *

+ * @type {boolean} + */ + autoInvalidate:boolean; + /** + * A resource key that should yield a {@link yfiles.view.IVisualTemplate} that will be used by this mode render the viewport. + *

+ * When explicitly setting a {@link yfiles.input.OverviewInputMode#template}, this key will not be used. This is only a fallback if {@link yfiles.input.OverviewInputMode#template} is null. + *

+ * @const + * @static + * @type {string} + */ + static VIEWPORT_TEMPLATE_KEY:string; + /** + * 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. + *

+ *

+ * By default this input mode has a priority of 10. + *

+ * @type {yfiles.input.HandleInputMode} + */ + handleInputMode: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. + *

+ *

+ * By default this input mode has a priority of 20. + *

+ * @type {yfiles.input.MoveInputMode} + */ + moveInputMode:yfiles.input.MoveInputMode; + /** + * Gets the {@link yfiles.input.OverviewInputMode#clickInputMode}. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createClickInputMode} + * will be called. + *

+ *

+ * By default this input mode has a priority of 0. + *

+ * @type {yfiles.input.ClickInputMode} + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Gets the {@link yfiles.input.OverviewInputMode#tapInputMode}. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.OverviewInputMode#createTapInputMode} + * will be called. + *

+ *

+ * By default this input mode has a priority of 30. + *

+ * @type {yfiles.input.TapInputMode} + */ + tapInputMode: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. + *

+ *

+ * By default this input mode has a priority of 0. + *

+ * @type {yfiles.input.KeyboardInputMode} + */ + keyboardInputMode: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.input.ICommand#MOVE_LEFT}
  • + *
  • {@link yfiles.input.ICommand#MOVE_RIGHT}
  • + *
  • {@link yfiles.input.ICommand#MOVE_UP}
  • + *
  • {@link yfiles.input.ICommand#MOVE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#ZOOM}
  • + *
  • {@link yfiles.input.ICommand#INCREASE_ZOOM}
  • + *
  • {@link yfiles.input.ICommand#DECREASE_ZOOM}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_UP}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_LEFT}
  • + *
  • {@link yfiles.input.ICommand#SCROLL_PAGE_RIGHT}
  • + *
  • FitContentCommand
  • + *
  • UpdateContentRectCommand
  • + *
+ * @type {yfiles.collections.ICollection.} + */ + availableCommands:yfiles.collections.ICollection; + /** + * Gets or sets the canvas this canvas should use to navigate. + * @type {yfiles.view.CanvasComponent} + */ + canvasComponent:yfiles.view.CanvasComponent; + /** + * Gets or sets the template that is used for the visualization of the marquee rectangle. + * @type {yfiles.view.IVisualTemplate} + */ + template:yfiles.view.IVisualTemplate; + /** + * Determines whether the mouse wheel can be used to perform zooming in the {@link yfiles.input.OverviewInputMode#canvasComponent}. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + autoMouseWheelZoom:boolean; + /** + * 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.view.CanvasComponent#contentRect content rect} + * of the {@link yfiles.input.OverviewInputMode#canvasComponent} has changed. The default value is (5,5,5,5). + *

+ * @type {yfiles.geometry.Insets} + */ + margins:yfiles.geometry.Insets; + static $class:yfiles.lang.Class; + } + /** + * A specialized subclass of {@link yfiles.input.PopulateMenuEventArgs} that carries the {@link yfiles.input.PopulateItemContextMenuEventArgs.#item} for which the context menu should be + * populated. + * Type parameter TModelItem: The type of the {@link yfiles.input.PopulateItemContextMenuEventArgs.#item model item}. + * @class yfiles.input.PopulateItemContextMenuEventArgs. + * @extends {yfiles.input.PopulateMenuEventArgs} + * @template TModelItem + */ + export interface PopulateItemContextMenuEventArgs extends yfiles.input.PopulateMenuEventArgs{} + export class PopulateItemContextMenuEventArgs { + /** + * 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.Point} queryLocation The query location. + * @param {TModelItem} item The item for which the context menu should be populated, may be null. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point,item:TModelItem); + /** + * Gets the item for which the tool tip is queried. + * @type {TModelItem} + */ + item:TModelItem; + static $class:yfiles.lang.Class; + } + /** + * A specialized subclass of {@link yfiles.input.ToolTipQueryEventArgs} that carries the {@link yfiles.input.QueryItemToolTipEventArgs.#item} for which the tool tip is queried. + * Type parameter TModelItem: The type of the {@link yfiles.input.QueryItemToolTipEventArgs.#item model item}. + * @class yfiles.input.QueryItemToolTipEventArgs. + * @extends {yfiles.input.ToolTipQueryEventArgs} + * @template TModelItem + */ + export interface QueryItemToolTipEventArgs extends yfiles.input.ToolTipQueryEventArgs{} + export class QueryItemToolTipEventArgs { + /** + * 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.Point} queryLocation The query location. + * @param {TModelItem} item The item for which the tool tip is queried.. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.Point,item:TModelItem); + /** + * Gets the item for which the tool tip is queried. + * @type {TModelItem} + */ + item:TModelItem; + static $class:yfiles.lang.Class; + } + /** + * A simple convenience implementation of an {@link yfiles.input.IReshapeHandleProvider} that returns handles that modify a + * {@link yfiles.geometry.IMutableRectangle}. + * @class yfiles.input.RectangleReshapeHandleProvider + * @extends {yfiles.input.ReshapeHandleProviderBase} + */ + export interface RectangleReshapeHandleProvider extends yfiles.input.ReshapeHandleProviderBase{} + export class RectangleReshapeHandleProvider { + /** + * Creates a default instance that provide handles 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=yfiles.input.HandlePositions.BORDER] A bitwise combination of all handle positions this instance should provide a handle for. + * @constructor + */ + constructor(rectangle:yfiles.geometry.IMutableRectangle,handlePositions?:yfiles.input.HandlePositions); + /** + * The rectangle to read the current state from. + * @protected + * @type {yfiles.geometry.IMutableRectangle} + */ + rectangle:yfiles.geometry.IMutableRectangle; + static $class:yfiles.lang.Class; + } + /** + * Abstract base class implementation of the {@link yfiles.input.IReshapeHandleProvider} interface that has properties to restrict + * the size and area of a reshapeable. + * @class yfiles.input.ReshapeHandleProviderBase + * @implements {yfiles.input.IReshapeHandleProvider} + */ + export interface ReshapeHandleProviderBase extends Object,yfiles.input.IReshapeHandleProvider{} + export class ReshapeHandleProviderBase { + constructor(); + /** + * Returns the {@link yfiles.input.ReshapeHandleProviderBase#handlePositions} property. + * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.input.HandlePositions} A bitwise combination of all handle positions this instance provides a handle for if queried in + * {@link yfiles.input.RectangleReshapeHandleProvider#getHandle}. + */ + getAvailableHandles(context: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.ReshapeHandleProviderBase#getAvailableHandles}. + *

+ * @param {yfiles.input.IInputModeContext} context The context for which the handles are queried. + * @param {yfiles.input.HandlePositions} position The position to provide an instance for. + * @returns {yfiles.input.IHandle} A handle implementation. + * @abstract + */ + getHandle(context:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; + /** + * Gets or sets the minimum size allowed for the reshapeable. + *

+ * The default value is {@link yfiles.geometry.Size#ZERO}. + *

+ * @see yfiles.input.RectangleHandle#minimumSize + * @type {yfiles.geometry.ISize} + */ + 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.Size#ZERO}. + *

+ * @see yfiles.input.RectangleHandle#minimumEnclosedArea + * @type {yfiles.geometry.IRectangle} + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets or sets the maximum size allowed for the reshapeable. + *

+ * The default value is {@link yfiles.geometry.Size#INFINITE}. + *

+ * @see yfiles.input.RectangleHandle#maximumSize + * @type {yfiles.geometry.ISize} + */ + maximumSize:yfiles.geometry.ISize; + /** + * Gets or sets the bitwise combination of all handle positions this instance provides a handle for. + * @see yfiles.input.ReshapeHandleProviderBase#getAvailableHandles + * @see yfiles.input.RectangleReshapeHandleProvider#getHandle + * @type {yfiles.input.HandlePositions} + */ + handlePositions:yfiles.input.HandlePositions; + static $class:yfiles.lang.Class; + } + /** + * Event arguments that are used when modifying a {@link yfiles.view.ISelectionModel.} + * Type parameter T: The type of the items in the {@link yfiles.view.ISelectionModel.}. + * @class yfiles.input.SelectionEventArgs. + * @extends {yfiles.input.InputModeEventArgs} + * @template T + */ + export interface SelectionEventArgs extends yfiles.input.InputModeEventArgs{} + export class SelectionEventArgs { + /** + * Creates a new instance. + * @param {yfiles.input.IInputModeContext} context The context the event with these event args is dispatched. + * @param {yfiles.view.ISelectionModel.} selection The selection that is modified. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,selection:yfiles.view.ISelectionModel); + /** + * Gets the selection these event arguments refer to. + * @type {yfiles.view.ISelectionModel.} + */ + selection:yfiles.view.ISelectionModel; + static $class:yfiles.lang.Class; + } + /** + * 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 {@link yfiles.input.SnapContext#handleMove} needs to be called for each incremental + * movement of the user's input device. + *
  • + *
  • + * After {@link yfiles.input.SnapContext#handleMove} has 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 yfiles.input.HandleInputMode#snapContext + * @see yfiles.input.MoveInputMode#snapContext + * @see yfiles.input.SnapContext#createSnapResultsModelManager + * @class yfiles.input.SnapContext + */ + export interface SnapContext extends Object{} + export class SnapContext { + /** + * Initializes a new instance of the {@link yfiles.input.SnapContext} class. + * @constructor + */ + constructor(); + /** + * 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; + /** + * 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}. + *

+ * @protected + */ + cleanUp():void; + /** + * Helper method used by {@link yfiles.input.SnapContext#createSnapResultsModelManager} to create the {@link yfiles.view.ICanvasObjectDescriptor} + * for the {@link yfiles.input.SnapResult} type. + * @returns {yfiles.view.ICanvasObjectDescriptor} An instance that can install {@link yfiles.input.SnapResult}s in a {@link yfiles.view.CanvasComponent}. + */ + createSnapResultCanvasObjectDescriptor():yfiles.view.ICanvasObjectDescriptor; + /** + * Helper method that creates the a {@link yfiles.view.CollectionModelManager.} that can be used to present the current {@link yfiles.input.SnapResult}s in the provided + * {@link yfiles.view.CanvasComponent}. + * @param {yfiles.view.CanvasComponent} canvas The control to initialize the {@link yfiles.view.CollectionModelManager.} with. + * @returns {yfiles.view.CollectionModelManager.} The model manager that manages the visual representation of the {@link yfiles.input.SnapResult}s. + */ + createSnapResultsModelManager(canvas:yfiles.view.CanvasComponent):yfiles.view.CollectionModelManager; + /** + * 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.Point} newLocation The current mouse location. + * @param {boolean} snappingDisabled If set to true snapping is temporarily disabled. This will remove the snap line visualizations and return a {@link yfiles.input.SnapState} + * with the unchanged coordinates and the {@link yfiles.input.SnapTypes#NOT_SNAPPED} {@link yfiles.input.SnapState#snapType}. + * @returns {yfiles.input.SnapState} A {@link yfiles.input.SnapState} that specifies the adjusted coordinates and how they have been adjusted. The unchanged + * coordinates if snapping has been temporarily disabled by setting snappingDisabled to true. + */ + dragFinished(newLocation:yfiles.geometry.Point,snappingDisabled:boolean):yfiles.input.SnapState; + /** + * 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 if snapping has been temporarily disabled by + * calling {@link yfiles.input.SnapContext#handleMove} with its snappingDisabled parameter set to true. + *

+ * @param {yfiles.geometry.Point} 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.Point,finalSnapState:yfiles.input.SnapState):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 at the start of {@link yfiles.input.MoveInputMode}'s or + * {@link yfiles.input.HandleInputMode}'s gesture after all items to be moved or reshaped have been added. + *

+ */ + dragInitialized():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, snappingDisabled has to be set to true. + *

+ * @param {yfiles.geometry.Point} newLocation The current mouse location. + * @param {boolean} snappingDisabled If set to true snapping is temporarily disabled. This will remove the snap line visualizations and return a {@link yfiles.input.SnapState} + * with the unchanged coordinates and the {@link yfiles.input.SnapState#snapType} {@link yfiles.input.SnapTypes#NOT_SNAPPED}. + * @returns {yfiles.input.SnapState} The adjusted coordinates and how they have been adjusted. The unchanged coordinates if snapping has been temporarily + * disabled by setting snappingDisabled to true. + */ + handleMove(newLocation:yfiles.geometry.Point,snappingDisabled:boolean):yfiles.input.SnapState; + /** + * 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.Point} originalLocation The original location of the mouse. + * @throws {Stubs.Exceptions.InvalidOperationError} If this context is already {@link yfiles.input.SnapContext#isInitialized initialized}. + */ + initializeDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Raises the {@link yfiles.input.SnapContext#cleanUp} event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @protected + */ + onCleanUp(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.SnapContext#addCollectSnapResultsListener CollectSnapResults} event. + * @param {yfiles.input.CollectSnapResultsEventArgs} evt The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @protected + */ + onCollectSnapResults(evt:yfiles.input.CollectSnapResultsEventArgs):void; + /** + * Raises the {@link yfiles.input.SnapContext#addInitializedListener Initialized} event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @protected + */ + onInitialized(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.SnapContext#addInitializingListener Initializing} event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @protected + */ + onInitializing(evt:yfiles.input.InputModeEventArgs):void; + /** + * 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.Point} originalLocation The point in world coordinates where the mouse move started. + * @param {yfiles.geometry.Point} newLocation The current mouse location. + * @returns {yfiles.input.SnapState} The adjusted coordinates and how they have been adjusted. + * @protected + */ + processSnapResults(snapResults:yfiles.collections.List,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):yfiles.input.SnapState; + /** + * Helper method that wraps the given context so that a {@link yfiles.graph.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. + * @returns {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; + /** + * Adds the given listener for the CollectSnapResults event that occurs while {@link yfiles.input.IDragHandler#handleMove moving} items and handles. + *

+ * 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. + *

+ * @param {function(Object, yfiles.input.CollectSnapResultsEventArgs): void} listener The listener to add. + * @see yfiles.input.SnapContext#removeCollectSnapResultsListener + */ + addCollectSnapResultsListener(listener:(sender:Object,evt:yfiles.input.CollectSnapResultsEventArgs)=>void):void; + /** + * Removes the given listener for the CollectSnapResults event that occurs while {@link yfiles.input.IDragHandler#handleMove moving} items and handles. + *

+ * 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. + *

+ * @param {function(Object, yfiles.input.CollectSnapResultsEventArgs): void} listener The listener to remove. + * @see yfiles.input.SnapContext#addCollectSnapResultsListener + */ + removeCollectSnapResultsListener(listener:(sender:Object,evt:yfiles.input.CollectSnapResultsEventArgs)=>void):void; + /** + * Adds the given listener for the CleanedUp event that occurs when this instance has been cleaned up. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.SnapContext#cleanUp + * @see yfiles.input.SnapContext#removeCleanedUpListener + */ + addCleanedUpListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the CleanedUp event that occurs when this instance has been cleaned up. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.SnapContext#cleanUp + * @see yfiles.input.SnapContext#addCleanedUpListener + */ + removeCleanedUpListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Initialized event that occurs when this instance has been initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.SnapContext#initializeDrag + * @see yfiles.input.SnapContext#removeInitializedListener + */ + addInitializedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Initialized event that occurs when this instance has been initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.SnapContext#initializeDrag + * @see yfiles.input.SnapContext#addInitializedListener + */ + removeInitializedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Initializing event that occurs when this instance is about to be initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.SnapContext#initializeDrag + * @see yfiles.input.SnapContext#removeInitializingListener + */ + addInitializingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Initializing event that occurs when this instance is about to be initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.SnapContext#initializeDrag + * @see yfiles.input.SnapContext#addInitializingListener + */ + removeInitializingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Gets or sets a value indicating whether to visualize the snap results. + * @see yfiles.input.SnapContext#createSnapResultsModelManager + * @type {boolean} + */ + visualizeSnapResults:boolean; + /** + * Gets or sets a value indicating whether this instance is currently initializing. + * @see yfiles.input.SnapContext#addInitializedListener + * @see yfiles.input.SnapContext#addInitializingListener + * @see yfiles.input.SnapContext#isInitialized + * @type {boolean} + */ + isInitializing:boolean; + /** + * Gets the current input mode context. + * @protected + * @type {yfiles.input.IInputModeContext} + */ + currentInputModeContext:yfiles.input.IInputModeContext; + /** + * The collection of {@link yfiles.input.SnapResult}s. + *

+ * This collection is automatically updated during moving the mouse. + *

+ * @type {yfiles.collections.IObservableCollection.} + */ + snapResults:yfiles.collections.IObservableCollection; + /** + * 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}. + *

+ * @type {boolean} + */ + 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 yfiles.input.CollectSnapResultsEventArgs#snapDistance + * @type {number} + */ + snapDistance:number; + /** + * Gets the original location of the mouse at the time the gesture was initialized. + * @see yfiles.input.SnapContext#initializeDrag + * @type {yfiles.geometry.Point} + */ + originalLocation:yfiles.geometry.Point; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.SnapContext} is enabled. + * @type {boolean} + */ + enabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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 location. + *

+ * It carries a {@link yfiles.input.SnapResult#weight} and can be used to obtain a {@link yfiles.view.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}. + *

+ * @class yfiles.input.SnapResult + * @implements {yfiles.lang.IComparable} + */ + export interface SnapResult extends Object,yfiles.lang.IComparable{} + export class SnapResult { + /** + * Factory method that creates a {@link yfiles.input.SnapResult} to which a {@link yfiles.graph.ILabel} will snap, based on the given + * snapLine. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The {@link yfiles.graph.ILabelModelParameter} which represents the position to snap to. + * @param {number} weight The weight of this result. The higher the weight, the more important it is. + * @param {yfiles.geometry.Point} 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.Point} 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. + * @returns {yfiles.input.SnapResult} + * @static + */ + static createLabelSnapResult(layoutParameter:yfiles.graph.ILabelModelParameter,weight:number,delta:yfiles.geometry.Point,tag:Object,snapLine:yfiles.input.SnapLine,snappedCoordinates:yfiles.geometry.Point,movedObject:Object):yfiles.input.SnapResult; + /** + * Factory method that creates a {@link yfiles.input.SnapResult} that snaps to a given location. + * @param {yfiles.geometry.Point} location The location to snap to. + * @param {number} weight The weight to assign to the 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.view.IVisualCreator} visualCreator The visual creator to use. + * @param {yfiles.input.SnapTypes} snapType The type of the snapping operation to apply. + * @returns {yfiles.input.SnapResult} A result that snaps to the provided location using the provided mode. + * @static + */ + static createPointSnapResult(location:yfiles.geometry.Point,weight:number,tag:Object,visualCreator:yfiles.view.IVisualCreator,snapType:yfiles.input.SnapTypes):yfiles.input.SnapResult; + /** + * Factory method that creates a {@link yfiles.input.SnapResult} which snaps to a given size through a resize operation. + * @param {number} weight The weight of this result. The higher the weight, the more important it is. + * @param {number} 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.collections.IEnumerable.} rectangles The rectangles that have the same width or height as the node will. The rectangle are used for visualization and should + * include all objects for which a visualization should be displayed. Typically, these are all objects which have the same + * size and the object which is currently reshaped. + * @param {number} size The target size to which the resized object will snap. + * @param {boolean} horizontal Indicates whether width or height should snap. true if the width should snap. + * @returns {yfiles.input.SnapResult} + * @static + */ + static createResizeSnapResult(weight:number,delta:number,tag:Object,rectangles:yfiles.collections.IEnumerable,size:number,horizontal:boolean):yfiles.input.SnapResult; + /** + * Factory method that creates a {@link yfiles.input.SnapResult} which represents a {@link yfiles.input.SnapLine} to which the current + * moved item will potentially snap. + * @param {number} weight The weight of this result. The higher the weight, the more important it is. + * @param {yfiles.geometry.Point} 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.Point} snappedLocation 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. + * @returns {yfiles.input.SnapResult} + * @static + */ + static createSnapLineSnapResult(weight:number,delta:yfiles.geometry.Point,tag:Object,snapLine:yfiles.input.SnapLine,snappedLocation:yfiles.geometry.Point,movedObject:Object):yfiles.input.SnapResult; + /** + * Returns a {@link yfiles.view.IVisualCreator} instance that can be used to create a {@link yfiles.view.Visual} for this result. + * @returns {yfiles.view.IVisualCreator} A visual creator which creates a Visual which depicts this snap result. + * @see yfiles.view.VoidVisualCreator#INSTANCE + * @abstract + */ + getVisualCreator():yfiles.view.IVisualCreator; + /** + * Checks whether this instance is still snapped given the final mouse location. + *

+ * This implementation simply returns false. + *

+ * @param {yfiles.geometry.Point} unsnappedLocation The unsnapped location. + * @param {yfiles.input.SnapState} finalSnapState The final snap state that has been used by the client. + * @returns {boolean} Whether the location are still snapped for this instance. + */ + isSnapped(unsnappedLocation:yfiles.geometry.Point,finalSnapState:yfiles.input.SnapState):boolean; + /** + * Core method that performs the actual snapping. + *

+ * This implementation does nothing. + *

+ * @param {yfiles.geometry.Point} unsnappedLocation The location prior to the snapping. + * @param {yfiles.input.SnapState} currentSnapState The currently snapped location and the state of the snapping. This instance can be modified by subclasses. + */ + snap(unsnappedLocation:yfiles.geometry.Point,currentSnapState:yfiles.input.SnapState):void; + /** + * Gets the weight of this result. + *

+ * Higher weights represent more important results. + *

+ * @type {number} + */ + weight:number; + /** + * Gets 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. + *

+ * @type {Object} + */ + tag:Object; + /** + * Gets a {@link yfiles.input.SnapResult} representing that there is no snapping of the x or y coordinate. + * @static + * @type {yfiles.input.SnapResult} + */ + static NULL_RESULT:yfiles.input.SnapResult; + static $class:yfiles.lang.Class; + } + export enum SnapTypes{ + /** + * Indicates that the location has been snapped to its x value. + *

+ * 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 location has been snapped to its y value. + *

+ * 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 location 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 location has not been snapped at all. + *

+ * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. + *

+ */ + NOT_SNAPPED + } + /** + * 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}. + *

+ * @class yfiles.input.SnapState + * @final + */ + export interface SnapState extends Object{} + export class SnapState { + /** + * Initializes a new instance of the {@link yfiles.input.SnapState} class. + * @param {yfiles.geometry.Point} location The initial location. + * @param {yfiles.input.SnapTypes} [snapType=yfiles.input.SnapTypes.NOT_SNAPPED] The current type of the snap. + * @constructor + */ + constructor(location:yfiles.geometry.Point,snapType?:yfiles.input.SnapTypes); + /** + * Sets the {@link yfiles.input.SnapState#location} to the given point and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. + * @param {yfiles.geometry.Point} newLocation The new location. + */ + snapTo(newLocation:yfiles.geometry.Point):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; + /** + * 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; + /** + * Gets the current location. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + /** + * Gets or sets the type of the snap. + * @type {yfiles.input.SnapTypes} + */ + snapType:yfiles.input.SnapTypes; + static $class:yfiles.lang.Class; + } + /** + * Event arguments used by {@link yfiles.input.TapInputMode#addTappedListener Tapped}. + * @class yfiles.input.TapEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface TapEventArgs extends yfiles.input.InputModeEventArgs{} + export class 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.Point} location The location. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point); + /** + * Initializes a new instance of the {@link yfiles.input.TapEventArgs} class. + * @param {yfiles.geometry.Point} location The location. + * @constructor + */ + constructor(location:yfiles.geometry.Point); + /** + * Gets the location of the tap. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + /** + * 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. + *

+ * @type {boolean} + */ + handled:boolean; + static $class:yfiles.lang.Class; + } + export enum TapHandlingPolicy{ + /** + * 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 (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. + *

+ *

+ * This mode is {@link yfiles.input.TapInputMode#exclusive} by default. + *

+ * @see yfiles.input.TapInputMode#tapHandlingPolicy + * @see yfiles.input.TapInputMode#swallowFocusTap + * @class yfiles.input.TapInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface TapInputMode extends Object,yfiles.input.IInputMode{} + export class TapInputMode { + /** + * Creates a new instance of this mode that detects touch taps. + * @constructor + */ + constructor(); + /** + * Cancels the editing of this mode. + *

+ * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls + * {@link yfiles.input.TapInputMode#onCanceled}. + *

+ * @see yfiles.input.TapInputMode#onCanceled + */ + cancel():void; + /** + * Creates the event recognizer that is used to recognize the press event for this instance. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @protected + */ + createPressRecognizer():(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates the event recognizer that is used to recognize the release event for this instance. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @protected + */ + createReleaseRecognizer():(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates the event recognizer that is used to recognize the taps for this instance. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @protected + */ + createTapRecognizer():(eventSource:Object,evt:yfiles.lang.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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.ConcurrencyController} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Determines whether the given event is a press event that occurred at an invalid location. + * @param {Object} eventSource + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @see yfiles.input.TapInputMode#validTapHitTestable + * @protected + */ + isInvalidPress(eventSource:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Determines whether the given event is a valid press event. + * @param {Object} eventSource + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @protected + */ + isValidPress(eventSource:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Determines whether the given event is a valid release event. + * @param {Object} eventSource + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @protected + */ + isValidRelease(eventSource:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Determines whether the given event is a valid tap event. + * @param {Object} eventSource + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @protected + */ + isValidTap(eventSource:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Called after {@link yfiles.input.TapInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():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} evt The arguments. + * @protected + */ + onDoubleTapped(evt:yfiles.input.TapEventArgs):void; + /** + * Called after {@link yfiles.input.TapInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():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} evt The arguments. + * @protected + */ + onTapped(evt: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 yfiles.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. + *

+ * @returns {boolean} + * @protected + */ + queryAndResetPreventNextDoubleTap():boolean; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.TapInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.TapInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.ConcurrencyController}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the Tapped event that occurs once a tap has been detected. + * @param {function(Object, yfiles.input.TapEventArgs): void} listener The listener to add. + * @see yfiles.input.TapEventArgs + * @see yfiles.input.TapInputMode#tapHandlingPolicy + * @see yfiles.input.TapInputMode#removeTappedListener + */ + addTappedListener(listener:(sender:Object,evt:yfiles.input.TapEventArgs)=>void):void; + /** + * Removes the given listener for the Tapped event that occurs once a tap has been detected. + * @param {function(Object, yfiles.input.TapEventArgs): void} listener The listener to remove. + * @see yfiles.input.TapEventArgs + * @see yfiles.input.TapInputMode#tapHandlingPolicy + * @see yfiles.input.TapInputMode#addTappedListener + */ + removeTappedListener(listener:(sender:Object,evt:yfiles.input.TapEventArgs)=>void):void; + /** + * Adds the given listener for the DoubleTapped event that occurs once a double-tap has been detected. + * @param {function(Object, yfiles.input.TapEventArgs): void} listener The listener to add. + * @see yfiles.input.TapEventArgs + * @see yfiles.input.TapInputMode#tapHandlingPolicy + * @see yfiles.input.TapInputMode#removeDoubleTappedListener + */ + addDoubleTappedListener(listener:(sender:Object,evt:yfiles.input.TapEventArgs)=>void):void; + /** + * Removes the given listener for the DoubleTapped event that occurs once a double-tap has been detected. + * @param {function(Object, yfiles.input.TapEventArgs): void} listener The listener to remove. + * @see yfiles.input.TapEventArgs + * @see yfiles.input.TapInputMode#tapHandlingPolicy + * @see yfiles.input.TapInputMode#addDoubleTappedListener + */ + removeDoubleTappedListener(listener:(sender:Object,evt:yfiles.input.TapEventArgs)=>void):void; + /** + * Gets or sets the tap handling policy that determines the triggering behavior of {@link yfiles.input.TapInputMode#addTappedListener Tapped} + * and {@link yfiles.input.TapInputMode#addDoubleTappedListener DoubleTapped}. + * @see yfiles.input.TapInputMode#tapHandlingPolicy + * @default 2 + * @type {yfiles.input.TapHandlingPolicy} + */ + tapHandlingPolicy:yfiles.input.TapHandlingPolicy; + /** + * 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.input.IHitTestable#ALWAYS}. + *

+ * @type {yfiles.input.IHitTestable} + */ + validTapHitTestable:yfiles.input.IHitTestable; + /** + * Whether to {@link yfiles.input.ConcurrencyController#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. + *

+ * @default true + * @type {boolean} + */ + requestMutexOnTap:boolean; + /** + * Gets or sets a property that determines whether taps should be swallowed if they happen within a short amount of time + * after the {@link yfiles.view.CanvasComponent} got focus. + *

+ * The default is false. If set to true taps are discarded within 100 ms after the focus entered. + *

+ * @default false + * @type {boolean} + */ + swallowFocusTap:boolean; + /** + * Gets the location of the last tap. + * @type {yfiles.geometry.Point} + */ + tapLocation:yfiles.geometry.Point; + static $class:yfiles.lang.Class; + } + /** + * A simple {@link yfiles.input.IInputMode} that displays a textarea in the {@link yfiles.view.CanvasComponent} to let the user edit a + * text. + *

+ * Hitting escape or enter will cancel or stop editing. + *

+ *

+ * This mode is {@link yfiles.input.TextEditorInputMode#exclusive} by default. + *

+ * @class yfiles.input.TextEditorInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface TextEditorInputMode extends Object,yfiles.input.IInputMode{} + export class TextEditorInputMode { + /** + * Creates a new instance using a default text box. + * @constructor + */ + constructor(); + /** + * Adjusts the position of the text box in the {@link yfiles.view.CanvasComponent}. + * @protected + */ + adjustPosition():void; + /** + * Adjusts the size of the text box in the {@link yfiles.input.TextEditorInputMode#editorContainer}. + * @param {yfiles.geometry.Size} maxSize The suggested maximum size to use. + * @protected + */ + adjustSize(maxSize:yfiles.geometry.Size):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 canvas. + *

+ * @returns {yfiles.geometry.Size} The maximum size for the textbox. + * @see yfiles.input.TextEditorInputMode#adjustSize + * @protected + */ + calculateMaxTextBoxSize():yfiles.geometry.Size; + /** + * Cancels editing of the text box. + */ + cancel():void; + /** + * Resets the contents of the text box. + */ + clear():void; + /** + * Starts interactive text editing. + * @returns {Promise.} A Promise that will fulfill with the edited text or fulfill with null if editing is cancelled. + */ + edit():Promise; + /** + * Adjusts the {@link yfiles.view.CanvasComponent#viewport} of the canvas such that the text box is in the visible area. + *

+ * Called once when the editing starts. + *

+ * @protected + */ + ensureVisible():void; + /** + * Returns the bounds of the text area in world coordinates. + * @returns {yfiles.geometry.Rect} + * @protected + */ + getTextBoxBounds():yfiles.geometry.Rect; + /** + * 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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.TextEditorInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Installs the text box in the canvas and puts focus into it. + * @protected + */ + installTextBox():void; + /** + * Called when editing starts. + *

+ * Requests the input mutex, and installs the text box. + *

+ * @protected + */ + onBeginEditing():void; + /** + * Called after {@link yfiles.input.TextEditorInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called when editing gets canceled. + *

+ * Removes the text box and releases the input mutex. + *

+ * @protected + */ + onCancelEditing():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Raises the {@link yfiles.input.TextEditorInputMode#addEditingCanceledListener EditingCanceled} event. + * @param {yfiles.input.TextEventArgs} evt The event argument + * @protected + */ + onEditingCanceled(evt:yfiles.input.TextEventArgs):void; + /** + * Raises the {@link yfiles.input.TextEditorInputMode#addEditingStartedListener EditingStarted} event. + * @param {yfiles.input.TextEventArgs} evt The event argument. + * @protected + */ + onEditingStarted(evt:yfiles.input.TextEventArgs):void; + /** + * Called when editing is stopped. + *

+ * Triggers the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event, removes the + * box and releases the input mutex. + *

+ * @protected + */ + onStopEditing():void; + /** + * Called after {@link yfiles.input.TextEditorInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Raises the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event. + * @param {yfiles.input.TextEventArgs} evt The event arguments. + * @protected + */ + onTextEdited(evt:yfiles.input.TextEventArgs):void; + /** + * Stops editing and returns true. + * @returns {boolean} base.Stop() + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Removes the text box. + * @protected + */ + uninstallTextBox():void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.TextEditorInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.TextEditorInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.TextEditorInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the TextEdited event that occurs once the text has been edited. + * @param {function(Object, yfiles.input.TextEventArgs): void} listener The listener to add. + * @see yfiles.input.TextEditorInputMode#removeTextEditedListener + */ + addTextEditedListener(listener:(sender:Object,evt:yfiles.input.TextEventArgs)=>void):void; + /** + * Removes the given listener for the TextEdited event that occurs once the text has been edited. + * @param {function(Object, yfiles.input.TextEventArgs): void} listener The listener to remove. + * @see yfiles.input.TextEditorInputMode#addTextEditedListener + */ + removeTextEditedListener(listener:(sender:Object,evt:yfiles.input.TextEventArgs)=>void):void; + /** + * Adds the given listener for the EditingCanceled event that occurs if the editing has not been finished. + * @param {function(Object, yfiles.input.TextEventArgs): void} listener The listener to add. + * @see yfiles.input.TextEditorInputMode#removeEditingCanceledListener + */ + addEditingCanceledListener(listener:(sender:Object,evt:yfiles.input.TextEventArgs)=>void):void; + /** + * Removes the given listener for the EditingCanceled event that occurs if the editing has not been finished. + * @param {function(Object, yfiles.input.TextEventArgs): void} listener The listener to remove. + * @see yfiles.input.TextEditorInputMode#addEditingCanceledListener + */ + removeEditingCanceledListener(listener:(sender:Object,evt:yfiles.input.TextEventArgs)=>void):void; + /** + * Adds the given listener for the EditingStarted event that occurs when text editing is started. + * @param {function(Object, yfiles.input.TextEventArgs): void} listener The listener to add. + * @see yfiles.input.TextEditorInputMode#removeEditingStartedListener + */ + addEditingStartedListener(listener:(sender:Object,evt:yfiles.input.TextEventArgs)=>void):void; + /** + * Removes the given listener for the EditingStarted event that occurs when text editing is started. + * @param {function(Object, yfiles.input.TextEventArgs): void} listener The listener to remove. + * @see yfiles.input.TextEditorInputMode#addEditingStartedListener + */ + removeEditingStartedListener(listener:(sender:Object,evt:yfiles.input.TextEventArgs)=>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. + *

+ * @default false + * @type {boolean} + */ + autoCommitOnFocusLost:boolean; + /** + * Gets or sets a property that determines whether this mode should try to {@link yfiles.view.CanvasComponent#focus} the canvas + * once the editor is closed via a keyboard gesture. + *

+ * The default is true + *

+ * @default true + * @type {boolean} + */ + autoFocusCanvasOnEditorClosed: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. + *

+ * @default false + * @type {boolean} + */ + autoStartEditing:boolean; + /** + * Gets or sets the event recognizer to detect the key gesture for new line breaks. + *

+ * When the provided {@link yfiles.view.KeyEventArgs} are recognized, a new line break is inserted at the current curret position. + *

+ * @see yfiles.input.TextEditorInputMode#cancelRecognizer + * @see yfiles.input.TextEditorInputMode#stopRecognizer + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + lineBreakRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer to detect when editing the text shall be canceled. + *

+ * When the provided {@link yfiles.view.KeyEventArgs} are recognized, {@link yfiles.input.TextEditorInputMode#cancel} is called. + *

+ * @see yfiles.input.TextEditorInputMode#lineBreakRecognizer + * @see yfiles.input.TextEditorInputMode#stopRecognizer + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer to detect when editing the text shall be stopped. + *

+ * When the provided {@link yfiles.view.KeyEventArgs} are recognized, {@link yfiles.input.TextEditorInputMode#tryStop} is called. + *

+ * @see yfiles.input.TextEditorInputMode#lineBreakRecognizer + * @see yfiles.input.TextEditorInputMode#cancelRecognizer + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + stopRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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. + *

+ * @type {boolean} + */ + editing:boolean; + /** + * Gets or sets the location of the text box in world coordinates. + * @type {yfiles.geometry.IPoint} + */ + 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 yfiles.input.TextEditorInputMode#rotateTextBox + * @type {yfiles.geometry.IPoint} + */ + 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. + *

+ * @type {yfiles.geometry.IPoint} + */ + anchor:yfiles.geometry.IPoint; + /** + * Gets the div-element that contains the text editor. + * @type {HTMLDivElement} + */ + editorContainer:HTMLDivElement; + /** + * Gets or sets the text that is displayed and edited. + *

+ * If customizations change the way the text is edited by providing a custom editor, this property needs to be overridden + * to return the current text contents. + *

+ * @returns The textual contents of the editor. + * @type {string} + */ + editorText:string; + /** + * 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. + *

+ * @type {boolean} + */ + 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. + *

+ * @type {boolean} + */ + rotateTextBox:boolean; + static $class:yfiles.lang.Class; + } + /** + * Event arguments used by {@link yfiles.input.TextEditorInputMode}. + * @class yfiles.input.TextEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface TextEventArgs extends yfiles.input.InputModeEventArgs{} + export class TextEventArgs { + /** + * Creates a new instance. + * @param {yfiles.input.IInputModeContext} context The context in which this text event happened. + * @param {string} text The text that was or will be edited. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,text:string); + /** + * Gets the text that was or will be edited. + * @type {string} + */ + text:string; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} 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.ConcurrencyController#mutexOwner mutex owner} and set the {@link yfiles.view.CanvasComponent#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.view.CanvasComponent#lookup Lookup of the CanvasControl}, so that other clients can make use of its functionality. + *

+ *

+ * This mode uses an {@link yfiles.input.ConcurrencyController#exclusive} controller by default. + *

+ * @see yfiles.input.WaitInputMode#waiting + * @class yfiles.input.WaitInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface WaitInputMode extends Object,yfiles.input.IInputMode{} + export class WaitInputMode { + /** + * Creates a new instance of this mode. + * @constructor + */ + constructor(); + /** + * + */ + cancel():void; + /** + * Returns if this mode can request the mutex when {@link yfiles.input.WaitInputMode#waiting} is set to true. + * @returns {boolean} if this mode can request the mutex when {@link yfiles.input.WaitInputMode#waiting} is set to true. + */ + canStartWaiting():boolean; + /** + * Called when waiting is finished. + *

+ * This will reset the {@link yfiles.input.ConcurrencyController#preferredCursor} and {@link yfiles.input.ConcurrencyController#releaseMutex the mutex is released.} + *

+ * @protected + */ + endWaiting():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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.WaitInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.WaitInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Called after {@link yfiles.input.WaitInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Raises the {@link yfiles.input.WaitInputMode#addWaitingEndedListener WaitingEnded} event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @protected + */ + onWaitingEnded(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.WaitInputMode#addWaitingStartedListener WaitingStarted} event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @protected + */ + onWaitingStarted(evt:yfiles.input.InputModeEventArgs):void; + /** + * This will initiate the waiting process by trying to + * {@link yfiles.input.ConcurrencyController#requestMutex}request the input mutex. + *

+ * This will set the {@link yfiles.input.ConcurrencyController#preferredCursor} to {@link yfiles.input.WaitInputMode#waitCursor} and set the {@link yfiles.view.CanvasComponent#editable} property of the canvas to false. + *

+ * @protected + */ + startWaiting():void; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.WaitInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.WaitInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * 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}. + *

+ * @type {boolean} + */ + waiting:boolean; + /** + * Adds the given listener for the WaitingStarted event that occurs when the waiting started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.WaitInputMode#removeWaitingStartedListener + */ + addWaitingStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the WaitingStarted event that occurs when the waiting started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.WaitInputMode#addWaitingStartedListener + */ + removeWaitingStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the WaitingEnded event that occurs when the waiting ended. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.WaitInputMode#removeWaitingEndedListener + */ + addWaitingEndedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the WaitingEnded event that occurs when the waiting ended. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.WaitInputMode#addWaitingEndedListener + */ + removeWaitingEndedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Gets or sets the WaitCursor property. + * @type {yfiles.view.Cursor} + */ + waitCursor:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * A convenience implementation of the {@link yfiles.input.IPositionHandler} interface that can be used to constrain the position + * of an item. + * @see yfiles.input.ConstrainedDragHandler. + * @see yfiles.input.ConstrainedDragHandler.#constrainNewLocation + * @class yfiles.input.ConstrainedPositionHandler + * @extends {yfiles.input.ConstrainedDragHandler.} + * @implements {yfiles.input.IPositionHandler} + */ + export interface ConstrainedPositionHandler extends yfiles.input.ConstrainedDragHandler,yfiles.input.IPositionHandler{} + export class ConstrainedPositionHandler { + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedPositionHandler} class that delegates to the wrappedHandler. + * @param {yfiles.input.IPositionHandler} wrappedHandler The handler to wrap. + * @protected + * @constructor + */ + constructor(wrappedHandler:yfiles.input.IPositionHandler); + static $class:yfiles.lang.Class; + } + /** + * A convenience implementation of the {@link yfiles.input.IHandle} interface that can be used to constrain the handle of an item. + * @see yfiles.input.ConstrainedDragHandler. + * @see yfiles.input.ConstrainedDragHandler.#constrainNewLocation + * @class yfiles.input.ConstrainedHandle + * @extends {yfiles.input.ConstrainedDragHandler.} + * @implements {yfiles.input.IHandle} + */ + export interface ConstrainedHandle extends yfiles.input.ConstrainedDragHandler,yfiles.input.IHandle{} + export class ConstrainedHandle { + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedHandle} class that delegates to the wrappedHandle. + * @param {yfiles.input.IHandle} wrappedHandle The handle to wrap. + * @protected + * @constructor + */ + constructor(wrappedHandle:yfiles.input.IHandle); + /** + * Delegates to {@link yfiles.input.ConstrainedDragHandler.#wrappedHandler}'s {@link yfiles.input.IHandle#type} property. + * @type {yfiles.input.HandleTypes} + */ + type:yfiles.input.HandleTypes; + /** + * Delegates to {@link yfiles.input.ConstrainedDragHandler.#wrappedHandler}'s {@link yfiles.input.IHandle#cursor} property. + * @type {yfiles.view.Cursor} + */ + cursor:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * A utility implementation of the {@link yfiles.input.IReshapeHandler} interface that can be used to constrain the reshaping of an + * existing instance conveniently. + * @see yfiles.input.ConstrainedHandle + * @see yfiles.input.ConstrainedPositionHandler + * @see yfiles.input.ConstrainedReshapeHandler#constrainNewBounds + * @class yfiles.input.ConstrainedReshapeHandler + * @implements {yfiles.input.IReshapeHandler} + */ + export interface ConstrainedReshapeHandler extends Object,yfiles.input.IReshapeHandler{} + export class ConstrainedReshapeHandler { + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedReshapeHandler} class that delegates to the wrappedHandler. + * @param {yfiles.input.IReshapeHandler} wrappedHandler The handler to wrap. + * @protected + * @constructor + */ + constructor(wrappedHandler:yfiles.input.IReshapeHandler); + /** + * Cancels the move operation and calls {@link yfiles.input.ConstrainedReshapeHandler#onCanceled} + * @param {yfiles.input.IInputModeContext} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Rect} originalBounds The value of the coordinate of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + */ + cancelReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; + /** + * Callback that needs to implement the constraints for the new bounds. + * @param {yfiles.input.IInputModeContext} context The context in which the reshape will be performed. + * @param {yfiles.geometry.Rect} originalBounds The value of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.Rect} 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. + * @returns {yfiles.geometry.Rect} The constrained value of newBounds. + * @protected + * @abstract + */ + constrainNewBounds(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):yfiles.geometry.Rect; + /** + * 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} context The context in which the reshape will be performed. + * @param {yfiles.geometry.Rect} originalBounds The value of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.Rect} 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. + * @returns Whether the reshape had any visual effect. This is a hint to the engine to optimize invalidation. + */ + handleReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * Initializes the reshape operation and subsequently calls {@link yfiles.input.ConstrainedReshapeHandler#onInitialized} + * @param {yfiles.input.IInputModeContext} context The context in which the drag will be performed. + */ + initializeReshape(context:yfiles.input.IInputModeContext):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#cancelReshape} method has been called. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} originalBounds The original bounds. + * @protected + */ + onCanceled(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#reshapeFinished} method has been called. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} originalBounds The original bounds. + * @param {yfiles.geometry.Rect} newBounds The new bounds. + * @protected + */ + onFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape} method has been called. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} originalBounds The original bounds. + * @protected + */ + onInitialized(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#handleReshape} operation has been performed. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} originalBounds The original Bounds. + * @param {yfiles.geometry.Rect} newBounds The new Bounds. + * @protected + */ + onReshaped(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * Handles the finish operation and invokes {@link yfiles.input.ConstrainedReshapeHandler#onFinished} + * @param {yfiles.input.IInputModeContext} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Rect} originalBounds The value of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.Rect} 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} + */ + reshapeFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * Gets the wrapped handler to which calls will be ultimately delegated. + * @protected + * @type {yfiles.input.IReshapeHandler} + */ + wrappedHandler:yfiles.input.IReshapeHandler; + /** + * Delegates to the {@link yfiles.input.ConstrainedReshapeHandler#wrappedHandler}'s {@link yfiles.input.IReshapeHandler#bounds} property. + * @type {yfiles.geometry.IRectangle} + */ + bounds:yfiles.geometry.IRectangle; + static $class:yfiles.lang.Class; + } + /** + * A utility implementation of the {@link yfiles.input.IDragHandler} interface that can be used to constrain the movement of an + * existing instance. + * Type parameter TWrapped: The exact type of the wrapped implementation. + * @see yfiles.input.ConstrainedHandle + * @see yfiles.input.ConstrainedPositionHandler + * @see yfiles.input.ConstrainedDragHandler.#constrainNewLocation + * @class yfiles.input.ConstrainedDragHandler. + * @implements {yfiles.input.IDragHandler} + * @template TWrapped + */ + export interface ConstrainedDragHandler extends Object,yfiles.input.IDragHandler{} + export class ConstrainedDragHandler { + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedDragHandler.} class that delegates to the wrappedHandler. + * @param {TWrapped} wrappedHandler The handler to wrap. + * @protected + * @constructor + */ + constructor(wrappedHandler:TWrapped); + /** + * Cancels the move operation and calls {@link yfiles.input.ConstrainedDragHandler.#onCanceled} + * @param {yfiles.input.IInputModeContext} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Point} originalLocation The value of the coordinate of the {@link yfiles.input.ConstrainedDragHandler.#location} property at the time of {@link yfiles.input.ConstrainedDragHandler.#initializeDrag}. + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * 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.Point} originalLocation The value of the {@link yfiles.input.ConstrainedDragHandler.#location} property at the time of {@link yfiles.input.ConstrainedDragHandler.#initializeDrag}. + * @param {yfiles.geometry.Point} 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. + * @returns {yfiles.geometry.Point} The constrained value of newLocation. + * @protected + * @abstract + */ + constrainNewLocation(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Handles the finish operation and invokes {@link yfiles.input.ConstrainedDragHandler.#onFinished} + * @param {yfiles.input.IInputModeContext} context The context to retrieve information about the drag from. + * @param {yfiles.geometry.Point} originalLocation The value of the {@link yfiles.input.ConstrainedDragHandler.#location} property at the time of {@link yfiles.input.ConstrainedDragHandler.#initializeDrag}. + * @param {yfiles.geometry.Point} 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} + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):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} context The context in which the drag will be performed. + * @param {yfiles.geometry.Point} originalLocation The value of the {@link yfiles.input.ConstrainedDragHandler.#location} property at the time of {@link yfiles.input.ConstrainedDragHandler.#initializeDrag}. + * @param {yfiles.geometry.Point} 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. + * @returns Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Initializes the drag operation and subsequently calls {@link yfiles.input.ConstrainedDragHandler.#onInitialized} + * @param {yfiles.input.IInputModeContext} context The context in which the drag will be performed. + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler.#cancelDrag} method has been called. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} originalLocation The original location. + * @protected + */ + onCanceled(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler.#dragFinished} method has been called. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} originalLocation The original location. + * @param {yfiles.geometry.Point} newLocation The new location. + * @protected + */ + onFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler.#initializeDrag} method has been called. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} originalLocation The original location. + * @protected + */ + onInitialized(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler.#handleMove} operation has been performed. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} originalLocation The original location. + * @param {yfiles.geometry.Point} newLocation The new location. + * @protected + */ + onMoved(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Gets the wrapped handler to which calls will be ultimately delegated. + * @protected + * @type {TWrapped} + */ + wrappedHandler:TWrapped; + /** + * Delegates to the {@link yfiles.input.ConstrainedDragHandler.#wrappedHandler}'s {@link yfiles.input.IDragHandler#location} property. + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + static $class:yfiles.lang.Class; + } + /** + * Interface that is implemented for elements that can be hit or picked in a coordinate system. + *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 05 Hit Test
  • + *
  • Tutorial: 02 Custom Styles, step 17 Edge Hit Test
  • + *
+ * @see yfiles.view.CanvasComponent + * @see yfiles.view.ICanvasObjectDescriptor + * @see yfiles.view.ICanvasObject + * @interface + */ + 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.view.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.input.IInputModeContext} context the context the hit test is performed in + * @param {yfiles.geometry.Point} location the coordinates in world coordinate system + * @returns {boolean} whether something has been hit + * @abstract + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + } + var IHitTestable:{ + /** + * Wrap a handler into an interface. + * @param {function(yfiles.input.IInputModeContext, yfiles.geometry.Point): boolean} handler + * @returns {yfiles.input.IHitTestable} + * @static + */ + create?(handler:(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point)=>boolean):yfiles.input.IHitTestable; + /** + * An {@link yfiles.input.IHitTestable} that always returns false. + * @const + * @static + * @type {yfiles.input.IHitTestable} + */ + NEVER?:yfiles.input.IHitTestable; + /** + * An {@link yfiles.input.IHitTestable} that always returns true. + * @const + * @static + * @type {yfiles.input.IHitTestable} + */ + ALWAYS?:yfiles.input.IHitTestable; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is used to test whether a rendered item is deemed to be inside a rectangular marquee selection. + *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 05 Hit Test
  • + *
+ * @interface + */ + 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.view.ICanvasContext#hitTestRadius} if marquee selections should behave differently on different zoom levels. + *

+ * @param {yfiles.input.IInputModeContext} context the current input mode context + * @param {yfiles.geometry.Rect} rectangle the box describing the marquee's bounds + * @returns {boolean} true if the item is considered to be captured by the marquee + * @abstract + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + } + var IMarqueeTestable:{ + /** + * An implementation that always yields true. + * @const + * @static + * @type {yfiles.input.IMarqueeTestable} + */ + ALWAYS?:yfiles.input.IMarqueeTestable; + /** + * An implementation that always yields false. + * @const + * @static + * @type {yfiles.input.IMarqueeTestable} + */ + NEVER?:yfiles.input.IMarqueeTestable; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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} + * interface which modifies the handle's position. + *

+ * @class yfiles.input.RectangleHandle + * @implements {yfiles.geometry.IMutablePoint} + * @implements {yfiles.input.IHandle} + */ + export interface RectangleHandle extends Object,yfiles.geometry.IMutablePoint,yfiles.input.IHandle{} + export class RectangleHandle { + /** + * 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.IMutableRectangle} rectangle The rectangle to change. + * @constructor + */ + constructor(position:yfiles.input.HandlePositions,rectangle:yfiles.geometry.IMutableRectangle); + /** + * Delegates the original values to {@link yfiles.input.RectangleHandle#set} + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * This implementation does nothing. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Delegates to {@link yfiles.input.RectangleHandle#set}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * This implementation does nothing. + * @param {yfiles.input.IInputModeContext} context + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * Delegates the work to the reshapeable. + * @param {yfiles.geometry.Point} delta + */ + moveBy(delta:yfiles.geometry.Point):void; + /** + * Delegates to {@link yfiles.input.RectangleHandle#moveBy}. + * @param {number} x + * @param {number} y + */ + set(x:number,y:number):void; + /** + * The position of the handle. + * @protected + * @type {yfiles.input.HandlePositions} + */ + position:yfiles.input.HandlePositions; + /** + * The rectangle instance to modify. + * @protected + * @type {yfiles.geometry.IMutableRectangle} + */ + rectangle:yfiles.geometry.IMutableRectangle; + /** + * Gets or sets the minimum size allowed for the reshapeable. + *

+ * The value is stored by reference. The default is {@link yfiles.geometry.Size#ZERO}. + *

+ * @type {yfiles.geometry.ISize} + */ + 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.Size#ZERO}, which does not restrict the area at all. + *

+ * @type {yfiles.geometry.IRectangle} + */ + 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.Size#INFINITE}. + *

+ * @type {yfiles.geometry.ISize} + */ + maximumSize:yfiles.geometry.ISize; + /** + * Returns a view of the center of the handle. + *

+ * The point describes the current world coordinate of the element that can be modified by this handle. + *

+ * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * Gets or sets the type of the handle that can be used by the rendering engine to render types differently. + * @type {yfiles.input.HandleTypes} + */ + type:yfiles.input.HandleTypes; + /** + * Gets or sets the cursor to display when the mouse hovers over or drags this handle. + * @type {yfiles.view.Cursor} + */ + cursor:yfiles.view.Cursor; + /** + * Gets or sets the x coordinate. + *

+ * The setter delegates to {@link yfiles.input.RectangleHandle#moveBy} + *

+ * @type {number} + */ + x:number; + /** + * Gets or sets the y coordinate. + *

+ * The setter delegates to {@link yfiles.input.RectangleHandle#moveBy} + *

+ * @type {number} + */ + y:number; + static $class:yfiles.lang.Class; + } + /** + * 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}. + *

+ * @class yfiles.input.ReshapeHandlerHandle + * @implements {yfiles.input.IHandle} + */ + export interface ReshapeHandlerHandle extends Object,yfiles.input.IHandle{} + export class 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=null] The maximum size allowed for the rectangle. + * @param {yfiles.geometry.ISize} [minimumSize=null] The minimum size allowed for the rectangle. + * @constructor + */ + constructor(position:yfiles.input.HandlePositions,reshapeHandler:yfiles.input.IReshapeHandler,minimumSize?:yfiles.geometry.ISize,maximumSize?:yfiles.geometry.ISize); + /** + * 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 {Object} options The parameters to pass. + * @param {yfiles.input.HandlePositions} options.position The position of the handle. + * @param {yfiles.input.IReshapeHandler} options.reshapeHandler The reshapeable to write the changes to. + * @param {yfiles.geometry.ISize} [options.maximumSize=null] The maximum size allowed for the rectangle. + * @param {yfiles.geometry.ISize} [options.minimumSize=null] The minimum size allowed for the rectangle. + * @constructor + */ + constructor(options:{position:yfiles.input.HandlePositions,reshapeHandler:yfiles.input.IReshapeHandler,minimumSize?:yfiles.geometry.ISize,maximumSize?:yfiles.geometry.ISize}); + /** + * Delegates the cancel request to the {@link yfiles.input.IReshapeHandler}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Delegates the finish request to the {@link yfiles.input.IReshapeHandler}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Delegates the move request to the {@link yfiles.input.IReshapeHandler#handleReshape} method. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * This implementation does nothing. + * @param {yfiles.input.IInputModeContext} context + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * The reshapeable instance to write the changes to. + * @protected + * @type {yfiles.input.IReshapeHandler} + */ + 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.Size#ZERO}. + *

+ * @type {yfiles.geometry.ISize} + */ + 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.Size#ZERO}, which does not restrict the area at all. + *

+ * @type {yfiles.geometry.IRectangle} + */ + 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.Size#INFINITE}. + *

+ * @type {yfiles.geometry.ISize} + */ + maximumSize:yfiles.geometry.ISize; + /** + * Returns a view of the center of the handle. + *

+ * The point describes the current world coordinate of the element that can be modified by this handle. + *

+ * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * Gets or sets the type of the handle that can be used by the rendering engine to render types differently. + * @type {yfiles.input.HandleTypes} + */ + type:yfiles.input.HandleTypes; + /** + * Gets or sets the cursor to display when the mouse hovers over or drags this handle. + * @type {yfiles.view.Cursor} + */ + cursor:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * Utility class that holds implementation singletons and utility methods for simple event recognizers. + * @class yfiles.input.EventRecognizers + * @static + */ + export interface EventRecognizers extends Object{} + export class EventRecognizers { + /** + * Creates an instance that is the logical 'and' combination of the provided recognizers. + * @param {...function(Object, yfiles.lang.EventArgs): boolean} recognizers The recognizers to perform the logical operation on. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} An instance that is the result of the logical 'and' operation of the provided instances. + * @static + */ + static createAndRecognizer(...recognizers:((eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean)[]):(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates an instance that is the logical 'or' combination of the provided recognizers. + * @param {...function(Object, yfiles.lang.EventArgs): boolean} recognizers The recognizers to perform the logical operation on. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} An instance that is the result of the logical 'or' operation of the provided instances. + * @static + */ + static createOrRecognizer(...recognizers:((eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean)[]):(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates an event recognizer instance that yields the boolean inverse of the given event recognizer. + * @param {function(Object, yfiles.lang.EventArgs): boolean} recognizer The recognizer to invert. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} An implementation that performs the logical negation for the argument. + * @static + */ + static inverse(recognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean):(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * A callback that will always return true; + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static ALWAYS:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * A callback that will always return false; + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static NEVER:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + static $class:yfiles.lang.Class; + } + /** + * Utility class with simple event recognizers that work on {@link yfiles.view.KeyEventArgs}. + * @class yfiles.input.KeyEventRecognizers + * @static + */ + export interface KeyEventRecognizers extends Object{} + export class KeyEventRecognizers { + /** + * Creates an event recognizer for a given key and type using a given set of modifiers. + * @param {yfiles.view.KeyEventType} type The type of the event. + * @param {yfiles.view.Key} value The key that is subject of the event. + * @param {yfiles.view.ModifierKeys} [modifiers=yfiles.view.ModifierKeys.NONE] The state of the modifiers that must be set. This is {@link yfiles.view.ModifierKeys#NONE} if not set. + * @returns {function(Object, yfiles.lang.EventArgs): boolean} + * @static + */ + static create(type:yfiles.view.KeyEventType,value:yfiles.view.Key,modifiers?:yfiles.view.ModifierKeys):(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Creates an event recognizer that matches key presses. + * @param {yfiles.view.Key} key + * @param {yfiles.view.ModifierKeys} [modifiers=0] + * @returns {function(Object, yfiles.lang.EventArgs): boolean} An event recognizer that uses the gesture. + * @static + */ + static createKeyPress(key:yfiles.view.Key,modifiers?:yfiles.view.ModifierKeys):(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when escape has been typed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static ESCAPE_TYPED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when any key has been pressed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static KEY_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when any key has been typed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static KEY_TYPED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when any key has been released. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static KEY_RELEASED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when escape has been pressed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static ESCAPE_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when delete has been pressed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static DELETE_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when escape has been released. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static ESCAPE_RELEASED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the shift modifier is active. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static SHIFT_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the alt modifier is active. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static ALT_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the control modifier is active. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static CONTROL_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the shift modifier is being pressed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static SHIFT_DOWN:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the shift modifier is being released. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static SHIFT_UP:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the ctrl modifier is being pressed. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static CTRL_DOWN:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that recognizes when the Ctrl modifier is being released. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static CTRL_UP:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + static $class:yfiles.lang.Class; + } + /** + * A utility class that offers event recognizers that deal with {@link yfiles.view.MouseEventArgs}. + * @class yfiles.input.MouseEventRecognizers + * @static + */ + export interface MouseEventRecognizers extends Object{} + export class MouseEventRecognizers { + /** + * An event recognizer that identifies mouse movements that are not drags. + * @see yfiles.input.MouseEventRecognizers#DRAGGED + * @see yfiles.input.MouseEventRecognizers#MOVED_OR_DRAGGED + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static MOVED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies mouse movements. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static MOVED_OR_DRAGGED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies mouse movements. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies mouse movements. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static RELEASED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer 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.MouseEventRecognizers#LOST_CAPTURE_DURING_DRAG} event recognizer. + *

+ * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LOST_CAPTURE:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer 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.view.MouseEventTypes#UP} events will never be triggered. This + * recognizer is useful for identifying this situation. + *

+ * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LOST_CAPTURE_DURING_DRAG:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies left mouse button clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LEFT_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies button clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies button multi-clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static MULTI_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies right mouse button clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static RIGHT_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies middle mouse button clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static MIDDLE_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies left mouse button double clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LEFT_DOUBLE_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies right mouse button double clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static RIGHT_DOUBLE_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies middle mouse button double clicks. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static MIDDLE_DOUBLE_CLICKED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies left mouse button press events. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LEFT_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies left mouse button release events. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LEFT_RELEASED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies right mouse button press events. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static RIGHT_PRESSED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies right mouse button release events. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static RIGHT_RELEASED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies mouse drag events. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static DRAGGED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies left mouse button drags. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LEFT_DRAGGED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies when the has left the control. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static EXITED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies when the mouse has entered the control. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static ENTERED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies right mouse button drags. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static RIGHT_DRAGGED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies middle mouse button drags. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static MIDDLE_DRAGGED:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + static $class:yfiles.lang.Class; + } + /** + * A utility class that offers event recognizers that deal with {@link yfiles.view.TouchEventArgs}. + * @class yfiles.input.TouchEventRecognizers + * @static + */ + export interface TouchEventRecognizers extends Object{} + export class TouchEventRecognizers { + /** + * An event recognizer that identifies touch movements of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_MOVED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies the loss of touch capture for the any device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LOST_CAPTURE:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies the loss of touch capture for the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LOST_CAPTURE_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies the loss of touch capture for the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static LOST_CAPTURE_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch movements of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_DOWN_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch movements of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_UP_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch taps of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_TAPPED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch double-taps of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_DOUBLE_TAPPED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch multi-taps of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_MULTI_TAPPED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies when the primary device has left the control. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_EXITED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies when the primary device has entered the control. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_ENTERED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies long presses of the primary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_LONG_PRESSED_PRIMARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch movements of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_MOVED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch movements of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_DOWN_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch movements of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_UP_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch taps of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_TAPPED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch double-taps of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_DOUBLE_TAPPED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies touch multi-taps of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_MULTI_TAPPED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies when the secondary device has left the control. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_EXITED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies when the secondary device has entered the control. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_ENTERED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * An event recognizer that identifies long presses of the secondary device. + * @const + * @static + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + static TOUCH_LONG_PRESSED_SECONDARY:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + static $class:yfiles.lang.Class; + } + /** + * Base interface for a command that can be executed. + *

+ * Implementations of this interface are provided by the library. Use {@link yfiles.input.ICommand#createCommand} to conveniently + * create your own implementation of this interface that can then be used with . + *

+ * @see yfiles.input.ICommand#createCommand + * @interface + */ + export interface ICommand extends Object{ + /** + * Determines whether this command be executed with respect to the given parameter and target. + * @param {Object} [parameter=null] The parameter or null + * @param {Object} [target=null] The target to execute the command on or null + * @returns {boolean} Whether {@link yfiles.input.ICommand#execute} can be called with the given parameter and target. + * @abstract + */ + canExecute(parameter?:Object,target?:Object):boolean; + /** + * Determines whether this command be executed with respect to the given parameter and target. + * @param {Object} options The parameters to pass. + * @param {Object} [options.parameter=null] The parameter or null + * @param {Object} [options.target=null] The target to execute the command on or null + * @returns {boolean} Whether {@link yfiles.input.ICommand#execute} can be called with the given parameter and target. + * @abstract + */ + canExecute(options:{parameter?:Object,target?:Object}):boolean; + /** + * Executes this command with respect to the given parameter and target. + * @param {Object} [parameter=null] The parameter or null + * @param {Object} [target=null] The target to execute the command on or null + * @abstract + */ + execute(parameter?:Object,target?:Object):void; + /** + * Executes this command with respect to the given parameter and target. + * @param {Object} options The parameters to pass. + * @param {Object} [options.parameter=null] The parameter or null + * @param {Object} [options.target=null] The target to execute the command on or null + * @abstract + */ + execute(options:{parameter?:Object,target?:Object}):void; + /** + * Adds the given listener for the CanExecuteChanged event that occurs when the result of a call to {@link yfiles.input.ICommand#canExecute} + * may yield a different result. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.input.ICommand#removeCanExecuteChangedListener + * @abstract + */ + addCanExecuteChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the CanExecuteChanged event that occurs when the result of a call to {@link yfiles.input.ICommand#canExecute} + * may yield a different result. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.input.ICommand#addCanExecuteChangedListener + * @abstract + */ + removeCanExecuteChangedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + } + var ICommand:{ + /** + * Creates a new {@link yfiles.input.ICommand} instance that does nothing. + *

+ * The return value serves as a token and does not in itself contain any command handling logic. Use to associate command + * handlers with the instance returned. + *

+ * @param {string} [name=null] The optional name for the command. + * @returns {yfiles.input.ICommand} A new {@link yfiles.input.ICommand} instance. + * @static + */ + createCommand?(name?:string):yfiles.input.ICommand; + /** + * Suggests a requery of the {@link Root.NI#canExecute 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. + *

+ * @static + */ + invalidateRequerySuggested?():void; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to select the item that is + * specified by the parameter. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SELECT_ITEM?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to toggle the selection state of + * the item that is specified by the parameter. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + TOGGLE_ITEM_SELECTION?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to deselect the item that is + * specified by the parameter. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + DESELECT_ITEM?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.GraphEditorInputMode#editLabel edit the label} that is + * specified by the parameter. + *

+ * If no parameter is set, this will trigger the {@link yfiles.input.GraphEditorInputMode#onEditLabel} if {@link yfiles.input.GraphEditorInputMode} + * is used. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + EDIT_LABEL?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.GraphEditorInputMode#addLabel add another label} to the {@link yfiles.graph.ILabelOwner} + * that is specified by the parameter. + *

+ * If no parameter is set, this will trigger the {@link yfiles.input.GraphEditorInputMode#onAddLabel} if {@link yfiles.input.GraphEditorInputMode} + * is used. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + ADD_LABEL?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to + * {@link yfiles.input.GraphEditorInputMode#groupSelection group the currently selected items}. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + GROUP_SELECTION?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} 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. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + ADJUST_GROUP_NODE_SIZE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to + * {@link yfiles.input.GraphEditorInputMode#ungroupSelection ungroup the currently selected items}. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + UNGROUP_SELECTION?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.view.ISelectionModel.#clear clear the selection}. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + DESELECT_ALL?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} 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.collections.IEnumerable.} instance, then all group nodes in that enumeration are + * expanded. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + EXPAND_GROUP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} 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.collections.IEnumerable.} instance, then all group nodes in that enumeration + * are collapsed. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + COLLAPSE_GROUP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.input.NavigationInputMode#toggleExpansionState 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.collections.IEnumerable.} instance, then all group nodes in that enumeration + * are toggled. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + TOGGLE_EXPANSION_STATE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.graph.IFoldingView#localRoot switch the local root} of the + * current {@link yfiles.graph.IFoldingView} view to the given group node. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + ENTER_GROUP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.graph.IFoldingView#localRoot exit the current local root} + * of the current {@link yfiles.graph.IFoldingView} view to the given parent view. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + EXIT_GROUP?:yfiles.input.ICommand; + /** + * This is an {@link yfiles.input.ICommand} that {@link yfiles.input.CreateEdgeInputMode} instances can execute if they have been {@link yfiles.input.IInputMode#install installed} + * in a {@link yfiles.view.CanvasComponent}. + *

+ * If this command gets executed, the 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} will be invoked and the user can finish the edge creation gesture. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + BEGIN_EDGE_CREATION?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that can be {@link yfiles.input.ICommand#execute executed} from within the {@link yfiles.view.GraphComponent} to {@link yfiles.graph.GraphClipboard#duplicate duplicate items} of the + * current {@link yfiles.graph.IGraph}. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + DUPLICATE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that reverses the direction of edges. + *

+ * {@link yfiles.input.GraphEditorInputMode} can execute this command if it is installed in a {@link yfiles.view.GraphComponent}. The 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. + *

+ * @see yfiles.input.GraphEditorInputMode#reverseEdges + * @const + * @static + * @type {yfiles.input.ICommand} + */ + REVERSE_EDGE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to print. + *

+ * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes + * sense in the context of the application, e.g. printing the currently visible portion of the graph. + *

+ *

+ * The default shortcut for this command is Ctrl+P. + *

+ * @see yfiles.input.ICommand#PRINT_PREVIEW + * @const + * @static + * @type {yfiles.input.ICommand} + */ + PRINT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to close a document. + *

+ * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes + * sense in the context of the application, e.g. closing the current window. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + CLOSE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to open help. + *

+ * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes + * sense in the context of the application, e.g. showing the online help. + *

+ *

+ * The default shortcut for this command is F1. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + HELP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to show properties of an item. + *

+ * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes + * sense in the context of the application. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + PROPERTIES?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to create a new document. + *

+ * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes + * sense in the context of the application, e.g. creating a new graph. + *

+ *

+ * The default shortcut for this command is Ctrl+N. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + NEW?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to open a document. + *

+ * {@link yfiles.view.GraphComponent} handles this command to open a dialog prompting to open a GraphML file. + *

+ *

+ * The default shortcut for this command is Ctrl+O. + *

+ * @see yfiles.input.ICommand#SAVE + * @const + * @static + * @type {yfiles.input.ICommand} + */ + OPEN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to select all items. + *

+ * {@link yfiles.input.GraphEditorInputMode} and {@link yfiles.input.GraphViewerInputMode} handle this command to select all items in the + * graph. + *

+ *

+ * The default shortcut for this command is Ctrl+A. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + SELECT_ALL?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to delete an item. + *

+ * {@link yfiles.input.GraphEditorInputMode} handles this command to delete the currently selected items. + *

+ *

+ * The default shortcut for this command is Del. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + DELETE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to save an item. + *

+ * {@link yfiles.view.GraphComponent} handles this command to open a dialog prompting to save the graph as a GraphML file, if the + * graph was never saved before, and simply saving to the previous file name if it was. + *

+ *

+ * The default shortcut for this command is Ctrl+S. + *

+ * @see yfiles.input.ICommand#OPEN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SAVE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to cut an item and place it in the clipboard. + *

+ * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.GraphClipboard}. + *

+ *

+ * The default shortcuts for this command are Ctrl+X and Shift+Del. + *

+ * @see yfiles.input.ICommand#COPY + * @see yfiles.input.ICommand#PASTE + * @const + * @static + * @type {yfiles.input.ICommand} + */ + CUT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to copy to the clipboard. + *

+ * {@link yfiles.input.GraphViewerInputMode} and {@link yfiles.input.GraphEditorInputMode} handle this command in conjunction with + * {@link yfiles.graph.GraphClipboard}. + *

+ *

+ * The default shortcuts for this command are Ctrl+C and Ctrl+Ins. + *

+ * @see yfiles.input.ICommand#CUT + * @see yfiles.input.ICommand#PASTE + * @const + * @static + * @type {yfiles.input.ICommand} + */ + COPY?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to paste from the clipboard. + *

+ * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.GraphClipboard}. The command + * parameter can be an {@link yfiles.geometry.IPoint} to specify a location for pasting. + *

+ *

+ * The default shortcuts for this command are Ctrl+V and Shift+Ins. + *

+ * @see yfiles.input.ICommand#CUT + * @see yfiles.input.ICommand#COPY + * @const + * @static + * @type {yfiles.input.ICommand} + */ + PASTE?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to undo the previous operation. + *

+ * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.UndoEngine}. + *

+ *

+ * The default shortcut for this command is Ctrl+Z. + *

+ * @see yfiles.input.ICommand#REDO + * @const + * @static + * @type {yfiles.input.ICommand} + */ + UNDO?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to redo a previously undone operation. + *

+ * {@link yfiles.input.GraphEditorInputMode} handles this command in conjunction with {@link yfiles.graph.UndoEngine}. + *

+ *

+ * The default shortcut for this command is Ctrl+Y. + *

+ * @see yfiles.input.ICommand#UNDO + * @const + * @static + * @type {yfiles.input.ICommand} + */ + REDO?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that indicates the intention to print and show a preview of what to print beforehand. + *

+ * This command is not necessarily handled by yFiles. Application writers can handle the command in a manner that makes + * sense in the context of the application. + *

+ *

+ * The default shortcut for this command is Ctrl+F2. + *

+ * @see yfiles.input.ICommand#PRINT + * @const + * @static + * @type {yfiles.input.ICommand} + */ + PRINT_PREVIEW?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to scroll up. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to move the viewport upwards. By default this is done by a full + * viewport height. The parameter can be a factor that is applied to the viewport height to move the viewport by a + * different amount. + *

+ *

+ * The default shortcut for this command is Page?. + *

+ * @see yfiles.input.ICommand#SCROLL_PAGE_DOWN + * @see yfiles.input.ICommand#SCROLL_PAGE_LEFT + * @see yfiles.input.ICommand#SCROLL_PAGE_RIGHT + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SCROLL_PAGE_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to scroll down. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to move the viewport downwards. By default this is done by a full + * viewport height. The parameter can be a factor that is applied to the viewport height to move the viewport by a + * different amount. + *

+ *

+ * The default shortcut for this command is Page?. + *

+ * @see yfiles.input.ICommand#SCROLL_PAGE_UP + * @see yfiles.input.ICommand#SCROLL_PAGE_LEFT + * @see yfiles.input.ICommand#SCROLL_PAGE_RIGHT + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SCROLL_PAGE_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to scroll left. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to move the viewport to the left. By default this is done by a full + * viewport width. The parameter can be a factor that is applied to the viewport width to move the viewport by a different + * amount. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @see yfiles.input.ICommand#SCROLL_PAGE_UP + * @see yfiles.input.ICommand#SCROLL_PAGE_DOWN + * @see yfiles.input.ICommand#SCROLL_PAGE_RIGHT + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SCROLL_PAGE_LEFT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to scroll right. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to move the viewport to the right. By default this is done by a full + * viewport width. The parameter can be a factor that is applied to the viewport width to move the viewport by a different + * amount. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @see yfiles.input.ICommand#SCROLL_PAGE_UP + * @see yfiles.input.ICommand#SCROLL_PAGE_DOWN + * @see yfiles.input.ICommand#SCROLL_PAGE_LEFT + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SCROLL_PAGE_RIGHT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the selection left. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to select the next item to the left. + *

+ *

+ * The default shortcut for this command is ?. + *

+ * @see yfiles.input.ICommand#MOVE_UP + * @see yfiles.input.ICommand#MOVE_DOWN + * @see yfiles.input.ICommand#MOVE_RIGHT + * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP + * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_LEFT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the selection right. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to select the next item to the right. + *

+ *

+ * The default shortcut for this command is ?. + *

+ * @see yfiles.input.ICommand#MOVE_UP + * @see yfiles.input.ICommand#MOVE_DOWN + * @see yfiles.input.ICommand#MOVE_LEFT + * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP + * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_RIGHT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the selection up. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to select the next item above. + *

+ *

+ * The default shortcut for this command is ?. + *

+ * @see yfiles.input.ICommand#MOVE_DOWN + * @see yfiles.input.ICommand#MOVE_LEFT + * @see yfiles.input.ICommand#MOVE_RIGHT + * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP + * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the selection down. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to select the next item below. + *

+ *

+ * The default shortcut for this command is ?. + *

+ * @see yfiles.input.ICommand#MOVE_UP + * @see yfiles.input.ICommand#MOVE_LEFT + * @see yfiles.input.ICommand#MOVE_RIGHT + * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP + * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the selection up a page. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to select the parent node, if possible. + *

+ *

+ * The default shortcut for this command is Page?. + *

+ * @see yfiles.input.ICommand#MOVE_UP + * @see yfiles.input.ICommand#MOVE_DOWN + * @see yfiles.input.ICommand#MOVE_LEFT + * @see yfiles.input.ICommand#MOVE_RIGHT + * @see yfiles.input.ICommand#MOVE_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_TO_PAGE_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the selection down a page. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to select the first child node, if possible. + *

+ *

+ * The default shortcut for this command is Page?. + *

+ * @see yfiles.input.ICommand#MOVE_UP + * @see yfiles.input.ICommand#MOVE_DOWN + * @see yfiles.input.ICommand#MOVE_LEFT + * @see yfiles.input.ICommand#MOVE_RIGHT + * @see yfiles.input.ICommand#MOVE_TO_PAGE_UP + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_TO_PAGE_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the focus backwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item to the left. + *

+ *

+ * The default shortcut for this command is Ctrl+?. + *

+ * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD + * @see yfiles.input.ICommand#MOVE_FOCUS_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_FOCUS_BACK?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the focus forwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item to the right. + *

+ *

+ * The default shortcut for this command is Ctrl+?. + *

+ * @see yfiles.input.ICommand#MOVE_FOCUS_BACK + * @see yfiles.input.ICommand#MOVE_FOCUS_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_FOCUS_FORWARD?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the focus upwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item above. + *

+ *

+ * The default shortcut for this command is Ctrl+?. + *

+ * @see yfiles.input.ICommand#MOVE_FOCUS_BACK + * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD + * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_FOCUS_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the focus downwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to focus the next item below. + *

+ *

+ * The default shortcut for this command is Ctrl+?. + *

+ * @see yfiles.input.ICommand#MOVE_FOCUS_BACK + * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD + * @see yfiles.input.ICommand#MOVE_FOCUS_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_FOCUS_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the focus up a page. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to focus the parent node, if possible. + *

+ *

+ * The default shortcut for this command is Ctrl+Page?. + *

+ * @see yfiles.input.ICommand#MOVE_FOCUS_BACK + * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD + * @see yfiles.input.ICommand#MOVE_FOCUS_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_FOCUS_PAGE_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to move the focus up a page. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to focus the first child node, if possible. + *

+ *

+ * The default shortcut for this command is Ctrl+Page?. + *

+ * @see yfiles.input.ICommand#MOVE_FOCUS_BACK + * @see yfiles.input.ICommand#MOVE_FOCUS_FORWARD + * @see yfiles.input.ICommand#MOVE_FOCUS_UP + * @see yfiles.input.ICommand#MOVE_FOCUS_DOWN + * @see yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP + * @const + * @static + * @type {yfiles.input.ICommand} + */ + MOVE_FOCUS_PAGE_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to extend the selection to the left. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item to the left. + *

+ *

+ * The default shortcut for this command is Shift+?. + *

+ * @see yfiles.input.ICommand#EXTEND_SELECTION_UP + * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN + * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT + * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP + * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + EXTEND_SELECTION_LEFT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to extend the selection to the right. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item to the right. + *

+ *

+ * The default shortcut for this command is Shift+?. + *

+ * @see yfiles.input.ICommand#EXTEND_SELECTION_UP + * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN + * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT + * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP + * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + EXTEND_SELECTION_RIGHT?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to extend the selection upwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item above. + *

+ *

+ * The default shortcut for this command is Shift+?. + *

+ * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN + * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT + * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT + * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP + * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + EXTEND_SELECTION_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to extend the selection downwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the next item below. + *

+ *

+ * The default shortcut for this command is Shift+?. + *

+ * @see yfiles.input.ICommand#EXTEND_SELECTION_UP + * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT + * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT + * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP + * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + EXTEND_SELECTION_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to extend the selection a page upwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the parent node, if possible. + *

+ *

+ * The default shortcut for this command is Shift+Page?. + *

+ * @see yfiles.input.ICommand#EXTEND_SELECTION_UP + * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN + * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT + * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT + * @see yfiles.input.ICommand#SELECT_TO_PAGE_DOWN + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SELECT_TO_PAGE_UP?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to extend the selection a page downwards. + *

+ * {@link yfiles.input.NavigationInputMode} handles this command to extend the selection with the first child node, if possible. + *

+ *

+ * The default shortcut for this command is Shift+Page?. + *

+ * @see yfiles.input.ICommand#EXTEND_SELECTION_UP + * @see yfiles.input.ICommand#EXTEND_SELECTION_DOWN + * @see yfiles.input.ICommand#EXTEND_SELECTION_LEFT + * @see yfiles.input.ICommand#EXTEND_SELECTION_RIGHT + * @see yfiles.input.ICommand#SELECT_TO_PAGE_UP + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SELECT_TO_PAGE_DOWN?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to increase the zoom level. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to increase the zoom level by 20 %. A different factor from the default + * 1.2 may be given as the command parameter. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @see yfiles.input.ICommand#DECREASE_ZOOM + * @see yfiles.input.ICommand#ZOOM + * @const + * @static + * @type {yfiles.input.ICommand} + */ + INCREASE_ZOOM?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to decrease the zoom level. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to decrease the zoom level by 20 %. A different factor from the default + * 1.2 may be given as the command parameter. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @see yfiles.input.ICommand#INCREASE_ZOOM + * @see yfiles.input.ICommand#ZOOM + * @const + * @static + * @type {yfiles.input.ICommand} + */ + DECREASE_ZOOM?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} to set the zoom level. + *

+ * {@link yfiles.view.CanvasComponent} handles this command to change the viewport. If the parameter is a {@link yfiles.geometry.Point}, + * the viewport will be centered as that point while not changing the zoom level. If the parameter is a + * {@link yfiles.geometry.Rect}, the viewport will encompass that rectangle and change the zoom level accordingly. If the parameter + * is an instance of {@link yfiles.graph.ILookup} which returns an instance of {@link yfiles.view.IBoundsProvider}, that {@link yfiles.view.IBoundsProvider} + * will be used to obtain a rectangle, which will be used in the same manner as the {@link yfiles.geometry.Rect} mentioned before. + * This can be used to zoom to a specific {@link yfiles.graph.IModelItem}. Finally, if the parameter is {@link yfiles.lang.Number convertible} to + * {@link number}, it will be used as the new zoom level to set. + *

+ *

+ * There is no default shortcut for this command. + *

+ * @see yfiles.input.ICommand#INCREASE_ZOOM + * @see yfiles.input.ICommand#DECREASE_ZOOM + * @const + * @static + * @type {yfiles.input.ICommand} + */ + ZOOM?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that invokes CurrentItem if executed. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + SET_CURRENT_ITEM_COMMAND?:yfiles.input.ICommand; + /** + * The {@link yfiles.input.ICommand} that performs the FitGraphBounds(InsetsD) action. + *

+ * The parameter can be either an {@link yfiles.geometry.Insets} or convertible that will be used to create an appropriately sized + * insets object from. + *

+ * @const + * @static + * @type {yfiles.input.ICommand} + */ + FIT_GRAPH_BOUNDS_COMMAND?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that changes the {@link yfiles.view.CanvasComponent#zoom} and the {@link yfiles.view.CanvasComponent#viewPoint} in an animated fashion such that the {@link yfiles.view.GraphComponent#currentItem} becomes fully visible. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + ZOOM_TO_CURRENT_ITEM_COMMAND?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that invokes FitContent if executed. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + FIT_CONTENT_COMMAND?:yfiles.input.ICommand; + /** + * A {@link yfiles.input.ICommand} that invokes {@link yfiles.view.CanvasComponent#updateContentRect} if executed. + * @const + * @static + * @type {yfiles.input.ICommand} + */ + UPDATE_CONTENT_RECT_COMMAND?:yfiles.input.ICommand; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Event arguments for the {@link yfiles.input.GraphSnapContext#addCollectSnapLinesListener CollectSnapLines} event. + *

+ * Instances of this class are also passed to + * {@link yfiles.input.ISnapLineProvider#addSnapLines}. Implementations of that interface can use the following methods to add snap + * lines for specific purposes: + *

+ *
    + *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedNodeSnapLine} � Adds an orthogonal snap line for nodes.
  • + *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedSegmentSnapLine} � Adds an orthogonal snap line for edge segments and bends.
  • + *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addPortSnapLine} � Adds an orthogonal snap line for ports.
  • + *
  • {@link yfiles.input.CollectGraphSnapLinesEventArgs#addAdditionalSnapLine} � Adds an additional orthogonal snap line to which all element will snap.
  • + *
+ * @class yfiles.input.CollectGraphSnapLinesEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface CollectGraphSnapLinesEventArgs extends yfiles.input.InputModeEventArgs{} + export class CollectGraphSnapLinesEventArgs { + /** + * 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. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,fixedNodeSnapLines:yfiles.collections.ICollection,fixedSegmentSnapLines:yfiles.collections.ICollection,fixedPortSnapLines:yfiles.collections.ICollection,additionalSnapLines:yfiles.collections.ICollection); + /** + * Adds a snap line all elements will 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 yfiles.input.GraphSnapContext#additionalSnapLines + */ + addAdditionalSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + /** + * Adds a snap line for nodes. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that nodes snap to by default. + * @see yfiles.input.GraphSnapContext#fixedNodeSnapLines + */ + addFixedNodeSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + /** + * Adds a snap line for edge segments and bends. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that segments snap to by default. + * @see yfiles.input.GraphSnapContext#fixedSegmentSnapLines + */ + addFixedSegmentSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + /** + * Adds a snap line for ports. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that ports snap to by default. + * @see yfiles.input.GraphSnapContext#fixedPortSnapLines + */ + addPortSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + static $class:yfiles.lang.Class; + } + /** + * Abstract base class for {@link yfiles.input.GraphViewerInputMode} and {@link yfiles.input.GraphEditorInputMode}. + *

+ * This class is not supposed to and in fact cannot be extended from user code. It only exists to provide common + * functionality to the two aforementioned input modes. If customizations are wanted or needed both {@link yfiles.input.GraphViewerInputMode} + * and {@link yfiles.input.GraphEditorInputMode} can be extended. + *

+ * @class yfiles.input.GraphInputMode + * @extends {yfiles.input.MultiplexingInputMode} + */ + export interface GraphInputMode extends yfiles.input.MultiplexingInputMode{} + export class GraphInputMode { + /** + * Clears the selection on the current {@link yfiles.input.GraphInputMode#graphSelection}. + *

+ * This implementation may be overridden for customizations. All it does is call {@link yfiles.view.ISelectionModel.#clear}. + *

+ */ + clearSelection():void; + /** + * Actually performs the click on the given item. + *

+ * This will raise the {@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked}, {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked} + * (depending on the button), and {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} events. If + * either event is unhandled by all its event handlers the item will be {@link yfiles.input.GraphInputMode#setSelected selected} and {@link yfiles.input.GraphInputMode#setCurrentItem focused}. Before selection + * {@link yfiles.input.GraphInputMode#clearSelection the current selection will be cleared}, unless the {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} is triggered. + *

+ * @param {yfiles.graph.IModelItem} item The item that has been clicked. + * @param {yfiles.input.ClickEventArgs} evt The original event arguments for the click. Setting its {@link yfiles.input.ClickEventArgs#handled} property to true will indicate that the click was handled. By + * default this happens when the clicked item is either selected or focused. + * @protected + */ + click(item:yfiles.graph.IModelItem,evt:yfiles.input.ClickEventArgs):void; + /** + * Clears the selection on click if {@link yfiles.view.CanvasComponent#lastMouseEvent the click} is not recognized by {@link yfiles.input.GraphInputMode#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.GraphInputMode#clearSelection} method to deselect all items. + *

+ * @param {yfiles.input.IInputModeContext} context The context where the click appeared + * @returns {boolean} Whether the selection has been cleared by this method. + * @protected + */ + clickClearSelection(context:yfiles.input.IInputModeContext):boolean; + /** + * Copies the currently selected elements to the clipboard. + */ + copy():void; + /** + * Factory method for the ClickInputMode property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#clickInputMode} property. + *

+ *

+ * This implementation {@link yfiles.input.ClickInputMode#activeButtons activates} both {@link yfiles.view.MouseButtons#LEFT} and {@link yfiles.view.MouseButtons#RIGHT} + *

+ * @returns {yfiles.input.ClickInputMode} a new instance of ClickInputMode + * @protected + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Factory method for the {@link yfiles.input.GraphInputMode#contextMenuInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.ContextMenuInputMode} property. + *

+ * @returns {yfiles.input.ContextMenuInputMode} a new instance of ContextMenuInputMode + * @protected + */ + createContextMenuInputMode():yfiles.input.ContextMenuInputMode; + /** + * Factory method for the {@link yfiles.input.GraphInputMode#itemHoverInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#itemHoverInputMode} property. + *

+ * @returns {yfiles.input.ItemHoverInputMode} a new instance of {@link yfiles.input.GraphInputMode#itemHoverInputMode} with the {@link yfiles.input.ItemHoverInputMode#hoverItems} property set to {@link yfiles.graph.GraphItemTypes#NONE}. + * @protected + */ + createItemHoverInputMode():yfiles.input.ItemHoverInputMode; + /** + * Factory method that creates the {@link yfiles.input.GraphInputMode#keyboardInputMode} instance. + * @returns {yfiles.input.KeyboardInputMode} + * @protected + */ + createKeyboardInputMode():yfiles.input.KeyboardInputMode; + /** + * Factory method for the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property. + *

+ * @returns {yfiles.input.MarqueeSelectionInputMode} a new instance of MarqueeSelectionInputMode + * @protected + */ + createMarqueeSelectionInputMode():yfiles.input.MarqueeSelectionInputMode; + /** + * Factory method for the {@link yfiles.input.MouseHoverInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.MouseHoverInputMode} property. + *

+ * @returns {yfiles.input.MouseHoverInputMode} a new instance of {@link yfiles.input.MouseHoverInputMode} + * @protected + */ + createMouseHoverInputMode():yfiles.input.MouseHoverInputMode; + /** + * Factory method for the {@link yfiles.input.GraphInputMode#moveViewportInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#moveViewportInputMode} property. + *

+ * @returns {yfiles.input.MoveViewportInputMode} a new instance of {@link yfiles.input.GraphInputMode#moveViewportInputMode} + * @protected + */ + createMoveViewportInputMode():yfiles.input.MoveViewportInputMode; + /** + * Factory method for the {@link yfiles.input.GraphInputMode#navigationInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#navigationInputMode} property. + *

+ * @returns {yfiles.input.NavigationInputMode} a new instance of NavigationInputMode + * @protected + */ + createNavigationInputMode():yfiles.input.NavigationInputMode; + /** + * Helper method that yields a suitably configured {@link yfiles.input.SelectionEventArgs.} using the {@link yfiles.input.GraphInputMode#graphSelection} for this input mode. + * @param {yfiles.input.IInputModeContext} context An input mode context that is available in the {@link yfiles.input.SelectionEventArgs.}. + *

+ * Can be null in which case a new context for this instance is created automatically. + *

+ * @returns {yfiles.input.SelectionEventArgs.} A selection event argument that is configured for this instance. + * @protected + */ + createSelectionEventArgs(context:yfiles.input.IInputModeContext):yfiles.input.SelectionEventArgs; + /** + * Factory method for the {@link yfiles.input.GraphInputMode#tapInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#tapInputMode} property. + *

+ * @returns {yfiles.input.TapInputMode} a new instance of TapInputMode + * @protected + */ + createTapInputMode():yfiles.input.TapInputMode; + /** + * Factory method for the WaitInputMode property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphInputMode#waitInputMode} property. + *

+ * @returns {yfiles.input.WaitInputMode} a new instance of {@link yfiles.input.GraphInputMode#waitInputMode} + * @protected + */ + createWaitInputMode():yfiles.input.WaitInputMode; + /** + * Actually performs a double-click on the given item. + *

+ * This will raise the {@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} and {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + * (depending on the button), and {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * events. + *

+ * @param {yfiles.graph.IModelItem} item The item that has been double-clicked. + * @param {yfiles.input.ClickEventArgs} evt The original event arguments for the click. Setting its {@link yfiles.input.ClickEventArgs#handled} property to true will indicate that the double-click was + * handled and events on other items in the same location are no longer raised. + * @protected + */ + doubleClick(item:yfiles.graph.IModelItem,evt:yfiles.input.ClickEventArgs):void; + /** + * Actually performs a double-tap on the given item. + *

+ * This will raise the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event. + *

+ * @param {yfiles.graph.IModelItem} item The item that has been double-tapped. + * @param {yfiles.input.TapEventArgs} evt The original event arguments for the tap. Setting its {@link yfiles.input.TapEventArgs#handled} property to true will indicate that the double-tap was handled + * and events on other items in the same location are no longer raised. + * @protected + */ + doubleTap(item:yfiles.graph.IModelItem,evt:yfiles.input.TapEventArgs):void; + /** + * Used as a callback to find the items hit underneath a certain point. + *

+ * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTester} to determine the hit items. + *

+ * @param {yfiles.input.IInputModeContext} context The context to use for to the {@link yfiles.input.IHitTestable#isHit} callback. + * @param {yfiles.geometry.Point} location The location to test. + * @param {Array.} 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.graph.IModelItem): boolean} [filter=null] The predicate that can be used to filter the results. May be null. + * @returns {yfiles.collections.IEnumerable.} An enumerable over the items that have been found for the location. + */ + findItems(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,tests:yfiles.graph.GraphItemTypes[],filter?:(obj:yfiles.graph.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#hitTester} to determine the hit items. + *

+ * @param {yfiles.geometry.Point} location The location to test. + * @param {Array.} 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.graph.IModelItem): boolean} [filter=null] The predicate that can be used to filter the results. May be null. + * @returns {yfiles.collections.IEnumerable.} An enumerable over the items that have been found for the location. + */ + findItems(location:yfiles.geometry.Point,tests:yfiles.graph.GraphItemTypes[],filter?:(obj:yfiles.graph.IModelItem)=>boolean):yfiles.collections.IEnumerable; + /** + * Called by {@link yfiles.input.GraphInputMode#click} to query the item for an {@link yfiles.input.IClickListener} in its {@link yfiles.graph.ILookup#lookup} + * and handle it appropriately. + *

+ * This method will query the {@link yfiles.input.IClickListener} and check whether it was {@link yfiles.input.IClickListener#getHitTestable hit} by the click, and if so, will invoke + * {@link yfiles.input.IClickListener#onClicked} and return true. + *

+ * @param {yfiles.input.IInputModeContext} context The context for the click. + * @param {yfiles.graph.IModelItem} item The item that has been clicked. + * @param {yfiles.geometry.Point} location The click location. + * @returns {boolean} Whether the action has been invoked and handling should be stopped. + * @see yfiles.input.IClickListener + * @see yfiles.input.GraphInputMode#click + * @protected + */ + handleClickListener(context:yfiles.input.IInputModeContext,item:yfiles.graph.IModelItem,location:yfiles.geometry.Point):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.input.IMarqueeTestable} + * using their {@link yfiles.graph.ILookup#lookup}. This instance will be used to determine whether the item should be selected. + *

+ *

+ * This method is, in the default implementation, only called with individual item types in items. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} marqueeRectangle The rectangle in world coordinates. + * @param {yfiles.collections.IEnumerable.} items The items to iterate over. + * @param {function(yfiles.graph.IModelItem): boolean} predicate The predicate that determines whether the provided item should be tested at all. May be null. + * @see yfiles.input.GraphInputMode#setSelected + * @see yfiles.input.GraphInputMode#marqueeSelect + * @protected + */ + marqueeSelect(context:yfiles.input.IInputModeContext,marqueeRectangle:yfiles.geometry.Rect,items:yfiles.collections.IEnumerable,predicate:(obj:yfiles.graph.IModelItem)=>boolean):void; + /** + * Performs marquee-selection with the given rectangle. + *

+ * This method is called internally when either the {@link yfiles.input.GraphInputMode#marqueeSelect} method is called or the user + * performs a marquee-selection gesture via {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode}. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} marqueeRectangle The selection rectangle. + * @protected + */ + marqueeSelect(context:yfiles.input.IInputModeContext,marqueeRectangle:yfiles.geometry.Rect):void; + /** + * Performs marquee-selection with the given rectangle. + *

+ * It delegates directly to the {@link yfiles.input.GraphInputMode#marqueeSelect} overload internally. + *

+ * @param {yfiles.geometry.Rect} marqueeRectangle The selection rectangle. + */ + marqueeSelect(marqueeRectangle:yfiles.geometry.Rect):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#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} evt The {@link yfiles.input.ClickEventArgs} instance that contains the information about the click. + * @protected + */ + onCanvasClicked(evt:yfiles.input.ClickEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#clickInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.ClickInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.ClickInputMode} newMode the new value + * @protected + */ + onClickInputModeChanged(oldMode:yfiles.input.ClickInputMode,newMode:yfiles.input.ClickInputMode):void; + /** + * Called when the {@link yfiles.input.ContextMenuInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.ContextMenuInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.ContextMenuInputMode} newMode the new value + * @protected + */ + onContextMenuInputModeChanged(oldMode:yfiles.input.ContextMenuInputMode,newMode:yfiles.input.ContextMenuInputMode):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event. + *

+ * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. + *

+ * @param {yfiles.input.ItemClickedEventArgs.} evt The {@link yfiles.input.ItemClickedEventArgs.} instance that contains the item that has been clicked. + * @protected + */ + onItemClicked(evt:yfiles.input.ItemClickedEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event. + *

+ * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. + *

+ * @param {yfiles.input.ItemClickedEventArgs.} evt The {@link yfiles.input.ItemClickedEventArgs.} instance that contains the item that has been double clicked. + * @protected + */ + onItemDoubleClicked(evt:yfiles.input.ItemClickedEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#itemHoverInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.ItemHoverInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.ItemHoverInputMode} newMode the new value + * @protected + */ + onItemHoverInputModeChanged(oldMode:yfiles.input.ItemHoverInputMode,newMode:yfiles.input.ItemHoverInputMode):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked} event. + *

+ * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. + *

+ * @param {yfiles.input.ItemClickedEventArgs.} evt The {@link yfiles.input.ItemClickedEventArgs.} instance that contains the item that has been clicked. + * @protected + */ + onItemLeftClicked(evt:yfiles.input.ItemClickedEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} event. + *

+ * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. + *

+ * @param {yfiles.input.ItemClickedEventArgs.} evt The {@link yfiles.input.ItemClickedEventArgs.} instance that contains the item that has been double clicked. + * @protected + */ + onItemLeftDoubleClicked(evt:yfiles.input.ItemClickedEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked} event. + *

+ * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. + *

+ * @param {yfiles.input.ItemClickedEventArgs.} evt The {@link yfiles.input.ItemClickedEventArgs.} instance that contains the item that has been clicked. + * @protected + */ + onItemRightClicked(evt:yfiles.input.ItemClickedEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} event. + *

+ * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true. + *

+ * @param {yfiles.input.ItemClickedEventArgs.} evt The {@link yfiles.input.ItemClickedEventArgs.} instance that contains the item that has been double clicked. + * @protected + */ + onItemRightDoubleClicked(evt:yfiles.input.ItemClickedEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#keyboardInputMode} changed. + * @param {yfiles.input.KeyboardInputMode} oldMode The old {@link yfiles.input.GraphInputMode#keyboardInputMode}. + * @param {yfiles.input.KeyboardInputMode} newMode The new {@link yfiles.input.GraphInputMode#keyboardInputMode}. + * @protected + */ + onKeyboardInputModeChanged(oldMode:yfiles.input.KeyboardInputMode,newMode:yfiles.input.KeyboardInputMode):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.MarqueeSelectionInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.MarqueeSelectionInputMode} newMode the new value + * @protected + */ + onMarqueeSelectionInputModeChanged(oldMode:yfiles.input.MarqueeSelectionInputMode,newMode:yfiles.input.MarqueeSelectionInputMode):void; + /** + * Called when the {@link yfiles.input.MouseHoverInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.MouseHoverInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.MouseHoverInputMode} newMode the new value + * @protected + */ + onMouseHoverInputModeChanged(oldMode:yfiles.input.MouseHoverInputMode,newMode:yfiles.input.MouseHoverInputMode):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#moveViewportInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.MoveViewportInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.MoveViewportInputMode} newMode the new value + * @protected + */ + onMoveViewportInputModeChanged(oldMode:yfiles.input.MoveViewportInputMode,newMode:yfiles.input.MoveViewportInputMode):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addMultiSelectionFinishedListener MultiSelectionFinished} event. + * @param {yfiles.input.SelectionEventArgs.} evt + * @protected + */ + onMultiSelectionFinished(evt:yfiles.input.SelectionEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addMultiSelectionStartedListener MultiSelectionStarted} event. + * @param {yfiles.input.SelectionEventArgs.} evt + * @protected + */ + onMultiSelectionStarted(evt:yfiles.input.SelectionEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#navigationInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.NavigationInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.NavigationInputMode} newMode the new value + * @protected + */ + onNavigationInputModeChanged(oldMode:yfiles.input.NavigationInputMode,newMode:yfiles.input.NavigationInputMode):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event. + * @param {yfiles.input.PopulateItemContextMenuEventArgs.} evt The {@link yfiles.input.PopulateItemContextMenuEventArgs.} instance containing the event data. + * @protected + */ + onPopulateItemContextMenu(evt:yfiles.input.PopulateItemContextMenuEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphInputMode#addQueryItemToolTipListener QueryItemToolTip} event. + * @param {yfiles.input.QueryItemToolTipEventArgs.} evt The {@link yfiles.input.QueryItemToolTipEventArgs.} instance containing the event data. + * @protected + */ + onQueryItemToolTip(evt:yfiles.input.QueryItemToolTipEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#tapInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.TapInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.TapInputMode} newMode the new value + * @protected + */ + onTapInputModeChanged(oldMode:yfiles.input.TapInputMode,newMode:yfiles.input.TapInputMode):void; + /** + * Called when the {@link yfiles.input.GraphInputMode#waitInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.WaitInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.WaitInputMode} newMode the new value + * @protected + */ + onWaitInputModeChanged(oldMode:yfiles.input.WaitInputMode,newMode:yfiles.input.WaitInputMode):void; + /** + * 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.GraphInputMode#keyboardInputMode}. + *

+ * @see yfiles.input.GraphInputMode#clearSelection + * @see yfiles.input.GraphInputMode#setSelected + * @see yfiles.input.ICommand#SELECT_ALL + * @see yfiles.input.GraphInputMode#selectableItems + * @see yfiles.input.GraphInputMode#ignoreVoidStyles + */ + selectAll():void; + /** + * Callback that is used by this instance to set the current item on the {@link yfiles.input.NavigationInputMode#setCurrentItem NavigationInputMode} + * @param {yfiles.graph.IModelItem} item The item to set as the new "current" item. + */ + setCurrentItem(item:yfiles.graph.IModelItem):void; + /** + * Uses the {@link yfiles.input.GraphInputMode#graphSelection} to select the given item. + * @param {yfiles.graph.IModelItem} item The item to set the selection state on. + * @param {boolean} selected The new selection state. + */ + setSelected(item:yfiles.graph.IModelItem,selected:boolean):void; + /** + * Callback predicate method that is used to determine whether the given item can be {@link yfiles.input.GraphInputMode#click clicked}. + *

+ * This implementation uses the {@link yfiles.input.GraphInputMode#clickableItems} value to determine whether the item should be clicked. Note that this method will not be + * called for items that don't match {@link yfiles.input.GraphInputMode#clickableItems} for performance reasons. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether the item should be {@link yfiles.input.GraphInputMode#click clicked} in response to a detected mouse click. + * @protected + */ + shouldClick(item:yfiles.graph.IModelItem):boolean; + /** + * Callback predicate method that is used to determine whether the given item should be selected when + * {@link yfiles.input.GraphInputMode#click clicked with the primary mouse button}. + *

+ * This implementation uses the {@link yfiles.input.GraphInputMode#clickSelectableItems} value to determine whether the item should be selected. Note that this method will not be + * called for items that don't match {@link yfiles.input.GraphInputMode#clickSelectableItems} and {@link yfiles.input.GraphInputMode#selectableItems} for performance reasons. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether the item should be selected in response to a detected mouse click with the primary button. + * @protected + */ + shouldClickSelect(item:yfiles.graph.IModelItem):boolean; + /** + * Callback predicate method that is used to determine whether the given item can be {@link yfiles.input.GraphInputMode#doubleClick double clicked}. + *

+ * This implementation uses the {@link yfiles.input.GraphInputMode#shouldClick} method to determine whether the item should be + * double clicked. Note that this method will not be called for items that don't match {@link yfiles.input.GraphInputMode#clickableItems} for performance reasons. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether the item should be {@link yfiles.input.GraphInputMode#doubleClick double clicked} in response to a detected mouse click. + * @protected + */ + shouldDoubleClick(item:yfiles.graph.IModelItem):boolean; + /** + * Callback that determines whether the provided {@link yfiles.graph.IModelItem} should be {@link yfiles.input.GraphInputMode#setCurrentItem set to the current item}. + *

+ * This implementation uses the {@link yfiles.input.GraphInputMode#focusableItems} property to determine whether the item can be set to the current item. It also honors the + * {@link yfiles.input.GraphInputMode#ignoreVoidStyles} property. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether to set the item as the current item. + * @protected + */ + shouldFocus(item:yfiles.graph.IModelItem):boolean; + /** + * Callback method that is used to determine which of the built-in {@link yfiles.input.ICommand}s to install. + *

+ * This implementation unconditionally returns true, subclasses may override this method to adjust the behavior. + *

+ * @param {yfiles.input.ICommand} command The command to install. + * @returns {boolean} Whether to install this command. + * @protected + */ + shouldInstallCommand(command:yfiles.input.ICommand):boolean; + /** + * Callback method used by {@link yfiles.input.GraphInputMode#marqueeSelect} that takes {@link yfiles.input.GraphInputMode#marqueeSelectableItems} and {@link yfiles.input.GraphInputMode#shouldSelectItem} + * into account. + * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether to possibly marquee select the item. + * @protected + */ + shouldMarqueeSelect(item:yfiles.graph.IModelItem):boolean; + /** + * Determines whether for the given item a context menu should be queried. + *

+ * This implementation uses the {@link yfiles.input.GraphInputMode#contextMenuItems} property to determine whether a context menu should be queried for the given item. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether to raise a {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event for + * the given item. + * @protected + */ + shouldPopulateContextMenu(item:yfiles.graph.IModelItem):boolean; + /** + * Determines whether for the given item a tool tip should be queried. + *

+ * This implementation uses the {@link yfiles.input.GraphInputMode#toolTipItems} property to determine whether tool tip should be queried for the given item. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether to raise a {@link yfiles.input.GraphInputMode#addQueryItemToolTipListener QueryItemToolTip} event for the + * given item. + * @protected + */ + shouldQueryToolTip(item:yfiles.graph.IModelItem):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.GraphInputMode#selectableItems}, {@link yfiles.input.GraphInputMode#ignoreVoidStyles} and {@link yfiles.input.GraphInputMode#selectablePredicate} properties. This method is by default also called by {@link yfiles.input.GraphInputMode#shouldClickSelect} + * and {@link yfiles.input.GraphInputMode#shouldMarqueeSelect}, so turning selection off here also turns it off in other places. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} true if the item is selectable in general, false if not. + * @protected + */ + shouldSelectItem(item:yfiles.graph.IModelItem):boolean; + /** + * Actually performs the tap on the given item. + *

+ * This will raise the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event. If the event + * is unhandled by all its event handlers the item will be {@link yfiles.input.GraphInputMode#setSelected selected} and {@link yfiles.input.GraphInputMode#setCurrentItem focused}. Before selection + * {@link yfiles.input.GraphInputMode#clearSelection the current selection will be cleared}. + *

+ * @param {yfiles.graph.IModelItem} item The item that has been tapped. + * @param {yfiles.input.TapEventArgs} evt The original event arguments for the tap. Setting its {@link yfiles.input.TapEventArgs#handled} property to true will indicate that the tap was handled. By + * default this happens when the tapped item is either selected or focused. + * @protected + */ + tap(item:yfiles.graph.IModelItem,evt:yfiles.input.TapEventArgs):void; + /** + * Gets the graph instance from the {@link yfiles.input.MultiplexingInputMode#inputModeContext}. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Gets the graph selection from the {@link yfiles.input.MultiplexingInputMode#inputModeContext}. + * @type {yfiles.view.IGraphSelection} + */ + graphSelection:yfiles.view.IGraphSelection; + /** + * Gets or sets the order of the types of items that should be used to determine what item has been clicked or tapped. + *

+ * Change this field to adjust which items will be {@link yfiles.input.GraphInputMode#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 yfiles.input.GraphInputMode#clickSelectableItems + * @see yfiles.input.GraphInputMode#selectableItems + * @see yfiles.input.GraphInputMode#findItems + * @type {Array.} + */ + 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 or + * double-tapped. + *

+ * Change this field to adjust which items will be considered when {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener double-clicked} if there are multiple items at a given + * location. The default order is + *

+ *
    + *
  • {@link yfiles.graph.GraphItemTypes#EDGE_LABEL}
  • + *
  • {@link yfiles.graph.GraphItemTypes#NODE_LABEL}
  • + *
  • {@link yfiles.graph.GraphItemTypes#BEND}
  • + *
  • {@link yfiles.graph.GraphItemTypes#EDGE}
  • + *
  • {@link yfiles.graph.GraphItemTypes#NODE}
  • + *
  • {@link yfiles.graph.GraphItemTypes#PORT}
  • + *
+ * @see yfiles.input.GraphInputMode#clickSelectableItems + * @see yfiles.input.GraphInputMode#selectableItems + * @see yfiles.input.GraphInputMode#findItems + * @type {Array.} + */ + doubleClickHitTestOrder:yfiles.graph.GraphItemTypes[]; + /** + * Gets or sets the event recognizer 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 recognizer determines that the user wanted to use the detail clicking behavior, the {@link yfiles.input.GraphEditorInputMode#hitTester} 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.KeyEventRecognizers#SHIFT_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + detailSelectionRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that will be queried to decide if a click should cycle through all the items that are + * currently under the mouse cursor. + *

+ * If the recognizer determines that the user wanted to use the cyclic click selection behavior, the {@link yfiles.input.GraphEditorInputMode#hitTester} 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.KeyEventRecognizers#ALT_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cyclicSelectionRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that will be queried to decide if a click is deemed a multi selection gesture. + *

+ * The default is {@link yfiles.input.KeyEventRecognizers#CONTROL_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + multiSelectionRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Determines which types of items should be reported through the {@link yfiles.input.GraphInputMode#addItemClickedListener item click events}. + *

+ * This also affects taps. + *

+ *

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

+ * @see yfiles.input.GraphInputMode#shouldClick + * @type {yfiles.graph.GraphItemTypes} + */ + clickableItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets the items that can be given focus via the {@link yfiles.input.GraphInputMode#setCurrentItem} method. + *

+ * The focusable items. The default is {@link yfiles.graph.GraphItemTypes#NODE} + *

+ * @default 1 + * @type {yfiles.graph.GraphItemTypes} + */ + focusableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of items should be selectable at all. + *

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

+ * @see yfiles.input.GraphInputMode#setSelected + * @type {yfiles.graph.GraphItemTypes} + */ + selectableItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets a predicate that is queried to determine whether a given {@link yfiles.graph.IModelItem} is selectable. + *

+ * This allows to further restrict which items are selectable, compared to {@link yfiles.input.GraphInputMode#selectableItems}. If this property is set to null the effect is + * the same as a predicate that always returns true. + *

+ * @type {function(yfiles.graph.IModelItem): boolean} + */ + selectablePredicate:(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Determines which types of items should be selectable by mouse clicks. + *

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

+ * @see yfiles.input.GraphInputMode#shouldClickSelect + * @see yfiles.input.GraphInputMode#setSelected + * @type {yfiles.graph.GraphItemTypes} + */ + clickSelectableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of items should be selected during {@link yfiles.input.GraphInputMode#marqueeSelect 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 yfiles.input.GraphInputMode#shouldMarqueeSelect + * @see yfiles.input.GraphInputMode#setSelected + * @type {yfiles.graph.GraphItemTypes} + */ + marqueeSelectableItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets a value indicating whether void styles ({@link yfiles.styles.VoidNodeStyle}, {@link yfiles.styles.VoidEdgeStyle}, + * {@link yfiles.styles.VoidLabelStyle}, and {@link yfiles.styles.VoidPortStyle}) should be ignored when selecting or focusing items. + * @type {boolean} + */ + ignoreVoidStyles:boolean; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#contextMenuInputMode} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createContextMenuInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onContextMenuInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 60. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.ContextMenuInputMode} + */ + contextMenuInputMode:yfiles.input.ContextMenuInputMode; + /** + * Gets or sets the types of items a context menu should be queried for. + *

+ * The items for which a context menu should be {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener queried}. The default value is + * {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}. + *

+ * @default 1 | 2 + * @type {yfiles.graph.GraphItemTypes} + */ + contextMenuItems:yfiles.graph.GraphItemTypes; + /** + * Adds the given listener for the PopulateItemContextMenu event that occurs when the {@link yfiles.input.ContextMenuInputMode context menu} over an item is about to + * be opened to determine the contents of the Menu. + *

+ * This method will only be called for items that match the {@link yfiles.input.GraphInputMode#contextMenuItems} type. + *

+ * @param {function(Object, yfiles.input.PopulateItemContextMenuEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#removePopulateItemContextMenuListener + */ + addPopulateItemContextMenuListener(listener:(sender:Object,evt:yfiles.input.PopulateItemContextMenuEventArgs)=>void):void; + /** + * Removes the given listener for the PopulateItemContextMenu event that occurs when the {@link yfiles.input.ContextMenuInputMode context menu} over an item is about + * to be opened to determine the contents of the Menu. + *

+ * This method will only be called for items that match the {@link yfiles.input.GraphInputMode#contextMenuItems} type. + *

+ * @param {function(Object, yfiles.input.PopulateItemContextMenuEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#addPopulateItemContextMenuListener + */ + removePopulateItemContextMenuListener(listener:(sender:Object,evt:yfiles.input.PopulateItemContextMenuEventArgs)=>void):void; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#mouseHoverInputMode} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createMouseHoverInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onMouseHoverInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 100. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.MouseHoverInputMode} + */ + mouseHoverInputMode:yfiles.input.MouseHoverInputMode; + /** + * 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.GraphInputMode#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}|. + *

+ * @default 1 | 2 | 12 | 16 + * @type {yfiles.graph.GraphItemTypes} + */ + toolTipItems:yfiles.graph.GraphItemTypes; + /** + * Adds the given listener for the QueryItemToolTip event that 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.GraphInputMode#toolTipItems} type. + *

+ * @param {function(Object, yfiles.input.QueryItemToolTipEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#removeQueryItemToolTipListener + */ + addQueryItemToolTipListener(listener:(sender:Object,evt:yfiles.input.QueryItemToolTipEventArgs)=>void):void; + /** + * Removes the given listener for the QueryItemToolTip event that 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.GraphInputMode#toolTipItems} type. + *

+ * @param {function(Object, yfiles.input.QueryItemToolTipEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#addQueryItemToolTipListener + */ + removeQueryItemToolTipListener(listener:(sender:Object,evt:yfiles.input.QueryItemToolTipEventArgs)=>void):void; + /** + * 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.input.IHitTester.} from the {@link yfiles.input.MultiplexingInputMode#inputModeContext} to determine the items being hit. If they match the + * {@link yfiles.input.GraphInputMode#clickableItems} type, the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will be triggered. If + * they {@link yfiles.input.GraphInputMode#shouldFocus}, the item will be {@link yfiles.input.GraphInputMode#setCurrentItem set as the current item}. + *

+ *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createClickInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onClickInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 10. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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 yfiles.input.GraphInputMode#onItemClicked + * @type {yfiles.input.ClickInputMode} + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#tapInputMode} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createTapInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onTapInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 20. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.TapInputMode} + */ + tapInputMode:yfiles.input.TapInputMode; + /** + * Adds the given listener for the ItemClicked event that occurs when an item has been clicked. + *

+ * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. + *

+ *

+ * This event will also be raised for {@link yfiles.input.GraphInputMode#tap taps}. + *

+ *

+ * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked} and + * {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked}) will be raised before this event. + * If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftClickedListener + * @see yfiles.input.GraphInputMode#addItemRightClickedListener + * @see yfiles.input.GraphInputMode#removeItemClickedListener + */ + addItemClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemClicked event that occurs when an item has been clicked. + *

+ * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. + *

+ *

+ * This event will also be raised for {@link yfiles.input.GraphInputMode#tap taps}. + *

+ *

+ * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked} and + * {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked}) will be raised before this event. + * If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftClickedListener + * @see yfiles.input.GraphInputMode#addItemRightClickedListener + * @see yfiles.input.GraphInputMode#addItemClickedListener + */ + removeItemClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Adds the given listener for the ItemLeftClicked event that occurs when an item has been left clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that + * case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#addItemRightClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + * @see yfiles.input.GraphInputMode#removeItemLeftClickedListener + */ + addItemLeftClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemLeftClicked event that occurs when an item has been left clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that + * case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#addItemRightClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftClickedListener + */ + removeItemLeftClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Adds the given listener for the ItemRightClicked event that occurs when an item has been right clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that + * case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + * @see yfiles.input.GraphInputMode#removeItemRightClickedListener + */ + addItemRightClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemRightClicked event that occurs when an item has been right clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} event will not be raised in that + * case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemRightClickedListener + */ + removeItemRightClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Adds the given listener for the ItemDoubleClicked event that occurs when an item has been double clicked. + *

+ * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. + *

+ *

+ * Depending on the value of the {@link yfiles.input.ClickInputMode#doubleClickPolicy} property of {@link yfiles.input.GraphInputMode#clickInputMode} this event may be preceded by no, one, or two {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} + * events (as well as the corresponding button-specific event). + *

+ *

+ * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} and + * {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked}) will be raised before this + * event. If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + * @see yfiles.input.GraphInputMode#removeItemDoubleClickedListener + */ + addItemDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemDoubleClicked event that occurs when an item has been double clicked. + *

+ * If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. + *

+ *

+ * Depending on the value of the {@link yfiles.input.ClickInputMode#doubleClickPolicy} property of {@link yfiles.input.GraphInputMode#clickInputMode} this event may be preceded by no, one, or two {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked} + * events (as well as the corresponding button-specific event). + *

+ *

+ * Button-specific events ({@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} and + * {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked}) will be raised before this + * event. If one of those is marked {@link yfiles.input.ItemClickedEventArgs.#handled} this event will not be raised anymore. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + */ + removeItemDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Adds the given listener for the ItemLeftDoubleClicked event that occurs when an item has been left double clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised + * in that case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + * @see yfiles.input.GraphInputMode#removeItemLeftDoubleClickedListener + */ + addItemLeftDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemLeftDoubleClicked event that occurs when an item has been left double clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised + * in that case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + */ + removeItemLeftDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Adds the given listener for the ItemRightDoubleClicked event that occurs when an item has been right double clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised + * in that case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + * @see yfiles.input.GraphInputMode#removeItemRightDoubleClickedListener + */ + addItemRightDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Removes the given listener for the ItemRightDoubleClicked event that occurs when an item has been right double clicked. + *

+ * This event will be raised before the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * event. If one of the event handlers sets the {@link yfiles.input.ItemClickedEventArgs.#handled} property to true the event will not be propagated anymore. This also means + * that the {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked} event will not be raised + * in that case. + *

+ * @param {function(Object, yfiles.input.ItemClickedEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#clickableItems + * @see yfiles.input.GraphInputMode#addItemDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener + * @see yfiles.input.GraphInputMode#addItemRightDoubleClickedListener + */ + removeItemRightDoubleClickedListener(listener:(sender:Object,evt:yfiles.input.ItemClickedEventArgs)=>void):void; + /** + * Adds the given listener for the CanvasClicked event that 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. + *

+ * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#removeCanvasClickedListener + */ + addCanvasClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Removes the given listener for the CanvasClicked event that 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. + *

+ * @param {function(Object, yfiles.input.ClickEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#addItemClickedListener + * @see yfiles.input.GraphInputMode#addCanvasClickedListener + */ + removeCanvasClickedListener(listener:(sender:Object,evt:yfiles.input.ClickEventArgs)=>void):void; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#marqueeSelectionInputMode} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createMarqueeSelectionInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onMarqueeSelectionInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 50. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.MarqueeSelectionInputMode} + */ + marqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#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.GraphInputMode#createNavigationInputMode} will be + * called. Upon change the {@link yfiles.input.GraphInputMode#onNavigationInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 55. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.NavigationInputMode} + */ + navigationInputMode:yfiles.input.NavigationInputMode; + /** + * Adds the given listener for the MultiSelectionStarted event that occurs when 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. + *

+ * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#removeMultiSelectionStartedListener + */ + addMultiSelectionStartedListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Removes the given listener for the MultiSelectionStarted event that occurs when 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. + *

+ * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#addMultiSelectionStartedListener + */ + removeMultiSelectionStartedListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Adds the given listener for the MultiSelectionFinished event that occurs when 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. + *

+ * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphInputMode#removeMultiSelectionFinishedListener + */ + addMultiSelectionFinishedListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Removes the given listener for the MultiSelectionFinished event that occurs when 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. + *

+ * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphInputMode#addMultiSelectionFinishedListener + */ + removeMultiSelectionFinishedListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * 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.GraphInputMode#createWaitInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onWaitInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of -1. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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 yfiles.input.WaitInputMode#waiting + * @type {yfiles.input.WaitInputMode} + */ + waitInputMode:yfiles.input.WaitInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#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.GraphInputMode#createItemHoverInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onItemHoverInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 55. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.ItemHoverInputMode} + */ + itemHoverInputMode:yfiles.input.ItemHoverInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#moveViewportInputMode} associated with this instance. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphInputMode#createMoveViewportInputMode} + * will be called. Upon change the {@link yfiles.input.GraphInputMode#onMoveViewportInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 39. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.MoveViewportInputMode} + */ + moveViewportInputMode:yfiles.input.MoveViewportInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphInputMode#keyboardInputMode}. + *

+ * By default this input mode has a priority of 0. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.KeyboardInputMode} + */ + keyboardInputMode:yfiles.input.KeyboardInputMode; + /** + * Gets a collection of commands that this input mode will handle. + *

+ * This collection can be modified by removing commands to prevent the input mode from handling them. Previously removed + * commands can also be re-added again to enable them again. However, the input mode will never handle commands that + * weren't in the initial collection. Adding those will do nothing. + *

+ * @type {yfiles.collections.ICollection.} + */ + availableCommands:yfiles.collections.ICollection; + /** + * Gets or sets a property that determines whether clipboard operations with the usual shortcuts are enabled on the + * canvas. + *

+ * Default value is true + *

+ * @default true + * @type {boolean} + */ + allowClipboardOperations:boolean; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} implementation for use in a {@link yfiles.view.GraphComponent} to assign to the {@link yfiles.view.CanvasComponent#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.GraphInputMode#addItemClickedListener clicking on items using the mouse}, + * {@link yfiles.input.GraphInputMode#addQueryItemToolTipListener displaying tool tips for items}, {@link yfiles.input.GraphInputMode#addPopulateItemContextMenuListener showing a context menu}, {@link yfiles.input.NavigationInputMode allowing for easy navigation and traversal}, + * {@link yfiles.input.MoveViewportInputMode moving the view port}, and {@link yfiles.input.GraphInputMode#marqueeSelectableItems optionally doing marquee selection}. Also {@link yfiles.input.ItemHoverInputMode} can be used to get + * notified of the elements that the mouse is hovering over. + *

+ *

+ * Due to the viewer-centric nature of this input mode, collapsing and expanding groups is disabled per default. To enable + * this feature, set {@link yfiles.input.NavigationInputMode#allowCollapseGroup} and {@link yfiles.input.NavigationInputMode#allowExpandGroup} to true. + *

+ *

+ * This input mode manages a set of specialized input modes, each handling a specific part of the interaction with the + * graph. The following list details those along with their default + * {@link yfiles.input.IInputMode#priority priorities}. Lower priorities come earlier when handing events. + *

+ *
    + *
  • {@link yfiles.input.WaitInputMode} (-1) � Disables this input mode when layouts or animations run.
  • + *
  • {@link yfiles.input.KeyboardInputMode} (0) � Handles commands and arbitrary keyboard shortcuts.
  • + *
  • {@link yfiles.input.ClickInputMode} (10) � Handles mouse clicks and double-clicks.
  • + *
  • {@link yfiles.input.TapInputMode} (20) � Handles taps and double-tap.
  • + *
  • {@link yfiles.input.MarqueeSelectionInputMode} (30) � Allows dragging a rectangle to select items within it.
  • + *
  • {@link yfiles.input.MoveViewportInputMode} (39) � Allows panning the viewport.
  • + *
  • {@link yfiles.input.ItemHoverInputMode} (55) � Provides events to indicate that the mouse pointer hovers over an item.
  • + *
  • {@link yfiles.input.NavigationInputMode} (55) � Provides general navigation facilities, such as navigating from one item to another with the arrow keys.
  • + *
  • {@link yfiles.input.ContextMenuInputMode} (60) � Handles querying the context menu contents based on a location as well as preparing the menu for display.
  • + *
  • {@link yfiles.input.MouseHoverInputMode} (100) � Handles tool tips.
  • + *
+ * @class yfiles.input.GraphViewerInputMode + * @extends {yfiles.input.GraphInputMode} + */ + export interface GraphViewerInputMode extends yfiles.input.GraphInputMode{} + export class GraphViewerInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.GraphViewerInputMode} class. + * @constructor + */ + constructor(); + static $class:yfiles.lang.Class; + } + /** + * A simple interface that can be used to react to clicks on regions of {@link yfiles.styles.INodeStyle}s etc. + *

+ * {@link yfiles.input.GraphEditorInputMode} will query the {@link yfiles.graph.IModelItem}'s Lookup method for this interface if it has + * detected {@link yfiles.input.GraphInputMode#click}s. If the item yields an instance of this interface and the click was inside + * the {@link yfiles.input.IClickListener#getHitTestable}, then {@link yfiles.input.IClickListener#onClicked} is invoked. + *

+ * @see yfiles.input.GraphEditorInputMode + * @see yfiles.styles.CollapsibleNodeStyleDecorator + * @interface + */ + export interface IClickListener extends Object{ + /** + * Gets an {@link yfiles.input.IHitTestable} that can be used to check if {@link yfiles.input.IClickListener#onClicked} should be invoked. + * @returns {yfiles.input.IHitTestable} A hit testable that can determine whether {@link yfiles.input.IClickListener#onClicked} should be invoked by a given click. + * @abstract + */ + getHitTestable():yfiles.input.IHitTestable; + /** + * Called by the framework to indicate that the {@link yfiles.graph.IModelItem} has been clicked by the user at the specified + * location. + *

+ * This method is called by {@link yfiles.input.GraphInputMode#click} for the + * {@link yfiles.graph.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.Point} location The location of the click + * @abstract + */ + onClicked(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):void; + } + var IClickListener:{ + $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. + *

+ * @interface + */ + 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. + * @returns {yfiles.input.IHandle} The handle to use for the provided side or null. + * @abstract + */ + getHandle(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceHandle:boolean):yfiles.input.IHandle; + } + var IEdgePortHandleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper interface to customize interactive label editing. + *

+ * Implementations of this interface can be put into the {@link yfiles.graph.ILookup} of {@link yfiles.graph.ILabelOwner}s and + * {@link yfiles.graph.ILabel}s so that it is possible to tweak the behavior on a case by case basis. + *

+ *

+ * Conceptually, in most cases, implementations of this interface behaves like an additional event handler for {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} + * and {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing}. If no event handler + * handled those events, an {@link yfiles.input.IEditLabelHelper} will be queried from the {@link yfiles.graph.ILookup} and the unhandled + * event arguments passed to the respective methods. + *

+ * @see yfiles.input.EditLabelHelper + * @see yfiles.input.GraphEditorInputMode#createLabel + * @see yfiles.input.GraphEditorInputMode#editLabel + * @see yfiles.input.GraphEditorInputMode#addLabel + * @see yfiles.input.GraphEditorInputMode#addLabelAddingListener + * @see yfiles.input.GraphEditorInputMode#addLabelEditingListener + * @interface + */ + export interface IEditLabelHelper extends Object{ + /** + * Helper method that will be called when trying to add a label to an {@link yfiles.graph.ILabelOwner}. + *

+ * Implementations of this method can set the {@link yfiles.graph.ILabel#style}, {@link yfiles.graph.ILabel#layoutParameter}, {@link yfiles.graph.ILabel#preferredSize}, and {@link yfiles.graph.ITagOwner#tag} for newly-added labels by setting the appropriate properties on + * args. + *

+ *

+ * Setting the {@link yfiles.input.LabelEditingEventArgs#cancel} property on args to true will disallow label creation. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The original event arguments. + * @see yfiles.input.IEditLabelHelper#onLabelEditing + * @abstract + */ + onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * Helper method that will be called when trying to edit a label. + *

+ * This method can be called for editing labels for an {@link yfiles.graph.ILabelOwner}, in which case the {@link yfiles.input.LabelEditingEventArgs#label} property on args will + * be null, but the {@link yfiles.input.LabelEditingEventArgs#owner} property will be non-null. It can also be called for editing a specific label, in which case the {@link yfiles.input.LabelEditingEventArgs#label} + * property on args will be non-null, and the {@link yfiles.input.LabelEditingEventArgs#owner} property will be set to the label's owner. + *

+ *

+ * Implementations of this method can set a specific label to be edited, by setting the {@link yfiles.input.LabelEditingEventArgs#label} property of the args to an + * existing label instance. This label does not need to belong to the same owner that is queried for. Setting the {@link yfiles.input.LabelEditingEventArgs#label} property + * to null will not edit an existing label, but instead add a new one on the {@link yfiles.graph.ILabelOwner} set in the {@link yfiles.input.LabelEditingEventArgs#owner} + * property. + *

+ *

+ * When a new label is added, the properties {@link yfiles.input.LabelEditingEventArgs#style}, {@link yfiles.input.LabelEditingEventArgs#layoutParameter}, {@link yfiles.input.LabelEditingEventArgs#preferredSize}, and {@link yfiles.input.LabelEditingEventArgs#tag} are used for the newly-created label, just as in + * {@link yfiles.input.IEditLabelHelper#onLabelAdding}. + *

+ *

+ * Setting the {@link yfiles.input.LabelEditingEventArgs#cancel} property on args to true will disallow label editing and creation. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The original event arguments. + * @see yfiles.input.IEditLabelHelper#onLabelAdding + * @abstract + */ + onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):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 yfiles.input.LabelSnapContext + * @see yfiles.graph.LabelDecorator#labelSnapContextHelperDecorator + * @interface + */ + 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 + * snapContext. + * @param {yfiles.input.LabelSnapContext} snapContext 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} inputModeContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The label that is dragged. + * @abstract + */ + addSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext: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} evt 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. + * @abstract + */ + collectSnapResults(context:yfiles.input.LabelSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.IOrientedRectangle,label:yfiles.graph.ILabel):void; + } + var ILabelSnapContextHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface used by implementations that provide various size constraints for {@link yfiles.graph.INode}s. + *

Related demos:

+ *
    + *
  • Demo: SizeConstraintProvider, demo.yfiles.input.sizeconstraintprovider
  • + *
+ * @see yfiles.input.NodeSizeConstraintProvider + * @interface + */ + export interface INodeSizeConstraintProvider extends Object{ + /** + * Returns the maximum size allowed for the given node. + * @param {yfiles.graph.INode} node The node to return the maximum size for. + * @returns {yfiles.geometry.Size} The maximum size or {@link yfiles.geometry.Size#INFINITE} if there is no constraint on the size. + * @abstract + */ + getMaximumSize(node:yfiles.graph.INode):yfiles.geometry.Size; + /** + * Returns the minimum area that needs to be enclosed by the given node. + * @param {yfiles.graph.INode} node The node to return the area for. + * @returns {yfiles.geometry.Rect} The area to enclose or {@link yfiles.geometry.Rect#EMPTY} if there is no constraint on the size due to an enclosed area. + * @abstract + */ + getMinimumEnclosedArea(node:yfiles.graph.INode):yfiles.geometry.Rect; + /** + * Returns the minimum size allowed for the given node. + * @param {yfiles.graph.INode} node The node to return the minimum size for. + * @returns {yfiles.geometry.Size} The minimum size or {@link yfiles.geometry.Size#EMPTY} if there is no constraint on the size. + * @abstract + */ + getMinimumSize(node:yfiles.graph.INode):yfiles.geometry.Size; + } + var INodeSizeConstraintProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple default implementation of {@link yfiles.input.INodeSizeConstraintProvider} + * @class yfiles.input.NodeSizeConstraintProvider + * @implements {yfiles.input.INodeSizeConstraintProvider} + */ + export interface NodeSizeConstraintProvider extends Object,yfiles.input.INodeSizeConstraintProvider{} + export class NodeSizeConstraintProvider { + /** + * Creates a new instance using the provided size instances as the initial values. + *

+ * Not specifing the minimumEnclosedArea will set it to {@link yfiles.geometry.Rect#EMPTY}. + *

+ * @param {yfiles.geometry.ISize} minimumSize The {@link yfiles.input.NodeSizeConstraintProvider#minimumSize}. + * @param {yfiles.geometry.ISize} maximumSize The {@link yfiles.input.NodeSizeConstraintProvider#maximumSize}. + * @param {yfiles.geometry.IRectangle} [minimumEnclosedArea=null] The {@link yfiles.input.NodeSizeConstraintProvider#minimumEnclosedArea}. + * @constructor + */ + constructor(minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize,minimumEnclosedArea?:yfiles.geometry.IRectangle); + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.geometry.Size} + */ + getMaximumSize(node:yfiles.graph.INode):yfiles.geometry.Size; + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.geometry.Rect} + */ + getMinimumEnclosedArea(node:yfiles.graph.INode):yfiles.geometry.Rect; + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.geometry.Size} + */ + getMinimumSize(node:yfiles.graph.INode):yfiles.geometry.Size; + /** + * Gets or sets the instance to return by {@link yfiles.input.NodeSizeConstraintProvider#getMaximumSize}. + * @type {yfiles.geometry.ISize} + */ + maximumSize:yfiles.geometry.ISize; + /** + * Gets or sets the instance to return by {@link yfiles.input.NodeSizeConstraintProvider#getMinimumEnclosedArea}. + * @type {yfiles.geometry.IRectangle} + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets or sets the instance to return by {@link yfiles.input.NodeSizeConstraintProvider#getMinimumSize}. + * @type {yfiles.geometry.ISize} + */ + minimumSize:yfiles.geometry.ISize; + static $class:yfiles.lang.Class; + } + /** + * Interface used by {@link yfiles.input.OrthogonalEdgeEditingContext} and the like that can be decorated to the {@link yfiles.graph.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 yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper + * @interface + */ + export interface IOrthogonalEdgeHelper extends Object{ + /** + * 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} context 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. + * @abstract + */ + cleanUpEdge(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; + /** + * 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} context 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. + * @returns {yfiles.input.SegmentOrientation} The declared orientation of the segment. + * @abstract + */ + getSegmentOrientation(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; + /** + * Determines whether the provided edge should be edited orthogonally in the specified input mode context. + *

+ * If this method returns false, the other methods will not be queried at all. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context in which the edge is about to be edited. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @returns {boolean} true if the edge should be orthogonally edited in the specified input mode context; false otherwise. + * @abstract + */ + shouldEditOrthogonally(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; + /** + * 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} context 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. + * @returns {boolean} true if the end of the edge can be moved for the specified input mode context; false otherwise, in which case the + * corresponding segment needs to be split to keep the segment orientation orthogonal. + * @abstract + */ + shouldMoveEndImplicitly(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceEnd:boolean):boolean; + } + var IOrthogonalEdgeHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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 default to reparent nodes during the {@link yfiles.input.MoveInputMode dragging of nodes}. + *

+ *

Related demos:

+ *
    + *
  • Demo: ReparentHandler, demo.yfiles.input.reparenthandler
  • + *
+ * @interface + */ + 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. + * @returns {boolean} Whether this is a reparenting gesture. + * @abstract + */ + isReparentGesture(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 null. Can be a group or a non-group node. + * @returns {boolean} Whether newParent is a valid new parent for node. + * @abstract + */ + 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.IGraph#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 null. Can be a group or a non-group node. + * @abstract + */ + reparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):void; + /** + * 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. + * @returns {boolean} Whether the node may be detached and reparented. + * @abstract + */ + shouldReparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + } + 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.graph.ILookup#lookup} of the respective item. + *

+ * @see yfiles.graph.NodeDecorator#snapLineProviderDecorator + * @interface + */ + 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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.IModelItem} item The item to add snap lines for. + * @abstract + */ + addSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.graph.IModelItem):void; + } + var ISnapLineProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides data for the {@link yfiles.input.GraphInputMode#addItemClickedListener ItemClicked}, + * {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener ItemDoubleClicked}, + * {@link yfiles.input.GraphInputMode#addItemLeftClickedListener ItemLeftClicked}, + * {@link yfiles.input.GraphInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked}, {@link yfiles.input.GraphInputMode#addItemRightClickedListener ItemRightClicked} + * and {@link yfiles.input.GraphInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} events. + * Type parameter T: The type of the item this event carries. + * @class yfiles.input.ItemClickedEventArgs. + * @extends {yfiles.collections.ItemEventArgs.} + * @template T + */ + export interface ItemClickedEventArgs extends yfiles.collections.ItemEventArgs{} + export class ItemClickedEventArgs { + /** + * Initializes a new instance of the {@link yfiles.input.ItemClickedEventArgs.} class. + * @param {T} item The item which is the subject of the event. + * @param {yfiles.geometry.Point} location The location of the click. + * @constructor + */ + constructor(item:T,location:yfiles.geometry.Point); + /** + * Gets or sets a value indicating whether this {@link yfiles.input.ItemClickedEventArgs.} 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. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * Gets the location of the click. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + static $class:yfiles.lang.Class; + } + /** + * An input mode for use in a {@link yfiles.view.GraphComponent} that fires events when the mouse enters or leaves the + * visualization of a {@link yfiles.graph.IModelItem graph item}. + *

+ * This mode can be used to determine when the mouse is being moved from one item to the next. + *

+ *

+ * This mode is {@link yfiles.input.ItemHoverInputMode#exclusive} by default. + *

+ * @class yfiles.input.ItemHoverInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface ItemHoverInputMode extends Object,yfiles.input.IInputMode{} + export class ItemHoverInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.ItemHoverInputMode} class. + * @constructor + */ + constructor(); + /** + * + */ + cancel():void; + /** + * Gets the items that have been hit at the given location. + * @param {yfiles.geometry.Point} location The location in world coordinates to query. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all items that have been hit at the given location. + * @protected + */ + getHitItemsAt(location:yfiles.geometry.Point):yfiles.collections.IEnumerable; + /** + * 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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.ItemHoverInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * 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.graph.IModelItem} item The item to check. + * @returns {boolean} true if it is valid to report a hover over the specified item; false otherwise. + * @see yfiles.input.ItemHoverInputMode#discardInvalidItems + * @protected + */ + isValidHoverItem(item:yfiles.graph.IModelItem):boolean; + /** + * Called after {@link yfiles.input.ItemHoverInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Raises the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener HoveredItemChanged} event. + * @param {yfiles.input.HoveredItemChangedEventArgs} evt The {@link yfiles.input.HoveredItemChangedEventArgs} instance containing the event data. + * @protected + */ + onHoveredItemChanged(evt:yfiles.input.HoveredItemChangedEventArgs):void; + /** + * Called after {@link yfiles.input.ItemHoverInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. + * @returns {boolean} true iff this instance does not {@link yfiles.input.ConcurrencyController#hasMutex own the mutex}. + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Forces a reevaluation of the item that the mouse is currently hovering over or at a specific location. + *

+ * 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. + *

+ * @param {yfiles.geometry.Point} [location=null] The query location. + */ + updateHover(location?:yfiles.geometry.Point):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ItemHoverInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.ItemHoverInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.ItemHoverInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the HoveredItemChanged event that occurs when the item that is being hovered over with the + * mouse changes. + *

+ * This event is also fired when the mouse pointer leaves an item. + *

+ * @param {function(Object, yfiles.input.HoveredItemChangedEventArgs): void} listener The listener to add. + * @see yfiles.input.ItemHoverInputMode#removeHoveredItemChangedListener + */ + addHoveredItemChangedListener(listener:(sender:Object,evt:yfiles.input.HoveredItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the HoveredItemChanged event that occurs when the item that is being hovered over with + * the mouse changes. + *

+ * This event is also fired when the mouse pointer leaves an item. + *

+ * @param {function(Object, yfiles.input.HoveredItemChangedEventArgs): void} listener The listener to remove. + * @see yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener + */ + removeHoveredItemChangedListener(listener:(sender:Object,evt:yfiles.input.HoveredItemChangedEventArgs)=>void):void; + /** + * Gets the current item the mouse is hovering over. + * @type {yfiles.graph.IModelItem} + */ + currentHoverItem:yfiles.graph.IModelItem; + /** + * Gets or sets which graph items are considered by this input mode. + *

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

+ * @type {yfiles.graph.GraphItemTypes} + */ + hoverItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets the cursor to use when the mouse is hovering over a {@link yfiles.input.ItemHoverInputMode#isValidHoverItem} valid + * hover item. + * @type {yfiles.view.Cursor} + */ + hoverCursor:yfiles.view.Cursor; + /** + * 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. + * @see yfiles.input.ItemHoverInputMode#isValidHoverItem + * @type {boolean} + */ + discardInvalidItems:boolean; + static $class:yfiles.lang.Class; + } + /** + * Event argument class containing information about which {@link yfiles.graph.IModelItem} the mouse is currently hovering over. + *

+ * This event is used by the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener HoveredItemChanged} + * event. The {@link yfiles.collections.ItemEventArgs.#item} property yields the item that is currently being hovered over. It carries the {@link yfiles.input.HoveredItemChangedEventArgs#oldItem previously hovered item}, too. + *

+ * @class yfiles.input.HoveredItemChangedEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + */ + export interface HoveredItemChangedEventArgs extends yfiles.collections.ItemEventArgs{} + export class HoveredItemChangedEventArgs { + /** + * Initializes a new instance of the {@link yfiles.input.HoveredItemChangedEventArgs} class. + * @param {yfiles.graph.IModelItem} item The model item. + * @param {yfiles.graph.IModelItem} oldItem The old item. + * @constructor + */ + constructor(item:yfiles.graph.IModelItem,oldItem:yfiles.graph.IModelItem); + /** + * The item that was previously hovered, possibly null. + * @see yfiles.collections.ItemEventArgs.#item + * @type {yfiles.graph.IModelItem} + */ + oldItem:yfiles.graph.IModelItem; + static $class:yfiles.lang.Class; + } + /** + * Event arguments for the {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} and {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing} + * events, as well as the {@link yfiles.input.IEditLabelHelper} interface. + * @class yfiles.input.LabelEditingEventArgs + * @extends {yfiles.input.InputModeEventArgs} + * @final + */ + export interface LabelEditingEventArgs extends yfiles.input.InputModeEventArgs{} + export class LabelEditingEventArgs { + /** + * Initializes a new instance of the {@link yfiles.input.LabelEditingEventArgs} class with the given context, owner, and label. + * @param {yfiles.input.IInputModeContext} context The input mode context to use. + * @param {yfiles.graph.ILabelOwner} owner The {@link yfiles.graph.ILabelOwner} whose label should be edited. + * @param {yfiles.graph.ILabel} label The {@link yfiles.graph.ILabel} that should be edited. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel); + /** + * Gets or sets the label to edit. + *

+ * This can be set to an exiting label to edit a specific one, or set to null to add a new label instead (e.g. for + * {@link yfiles.graph.ILabelOwner}s that have no label yet). + *

+ *

+ * If this property is set to null, the properties {@link yfiles.input.LabelEditingEventArgs#style}, {@link yfiles.input.LabelEditingEventArgs#preferredSize}, {@link yfiles.input.LabelEditingEventArgs#layoutParameter}, and {@link yfiles.input.LabelEditingEventArgs#tag} are used for the newly-added label, just like with + * {@link yfiles.input.LabelEditingEventArgs}. + *

+ *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {yfiles.graph.ILabel} + */ + label:yfiles.graph.ILabel; + /** + * Gets or sets a value indicating whether the action (adding or editing a label) should be canceled. + *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {boolean} + */ cancel:boolean; + /** + * Gets or sets a value indicating whether this event has been handled. + *

+ * A handled instance of {@link yfiles.input.LabelEditingEventArgs} will not be passed to further event handlers or an {@link yfiles.input.IEditLabelHelper} + * instance. + *

+ *

+ * Setting any of the other properties implicitly also sets this to true. + *

+ * @type {boolean} + */ + handled:boolean; + /** + * Gets or sets the owner of the label. + *

+ * This property can be null if there is no owner known, e.g. if the event is raised for + * non-{@link yfiles.graph.ILabelOwner}s. Otherwise it is initially set to the item for which the event is raised. + *

+ *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {yfiles.graph.ILabelOwner} + */ + owner:yfiles.graph.ILabelOwner; + /** + * Gets or sets the {@link yfiles.graph.ILabel#style} of the label to add. + *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {yfiles.styles.ILabelStyle} + */ + style:yfiles.styles.ILabelStyle; + /** + * Gets or sets the {@link yfiles.graph.ILabel#preferredSize} of the label to add. + *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {yfiles.geometry.Size} + */ + preferredSize:yfiles.geometry.Size; + /** + * Gets or sets the {@link yfiles.graph.ILabel#layoutParameter} of the label to add. + *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {yfiles.graph.ILabelModelParameter} + */ + layoutParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the {@link yfiles.graph.ITagOwner#tag} of the label to add. + *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {Object} + */ + tag:Object; + /** + * Configures the {@link yfiles.input.TextEditorInputMode} for editing the provided label instance. + *

+ * Setting this property implicitly also sets {@link yfiles.input.LabelEditingEventArgs#handled} to true. + *

+ * @type {function(yfiles.input.IInputModeContext, yfiles.input.TextEditorInputMode, yfiles.graph.ILabel): void} + */ + textEditorInputModeConfigurator:(context:yfiles.input.IInputModeContext,mode:yfiles.input.TextEditorInputMode,label:yfiles.graph.ILabel)=>void; + static $class:yfiles.lang.Class; } - var CancelEventArgs:{ + /** + * 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: + *

+ *

Related demos:

+ *
    + *
  • Tutorial: 01 Getting Started, step 15 Snapping
  • + *
+ * @see yfiles.input.MoveLabelInputMode + * @see yfiles.input.GraphEditorInputMode#snapContext + * @class yfiles.input.LabelSnapContext + * @extends {yfiles.input.SnapContext} + */ + export interface LabelSnapContext extends yfiles.input.SnapContext{} + export class LabelSnapContext { + /** + * Initializes a new instance of the {@link yfiles.input.LabelSnapContext} class. + * @constructor + */ + constructor(); + /** + * 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 yfiles.input.GraphSnapContext#additionalSnapLines + */ + addSnapLine(snapLine:yfiles.input.SnapLine):void; + /** + * Raises the {@link yfiles.input.LabelSnapContext#addCollectSnapLinesListener CollectSnapLines} event. + * @param {yfiles.input.CollectLabelSnapLineEventArgs} evt The {@link yfiles.input.CollectLabelSnapLineEventArgs} instance containing the event data. + * @protected + */ + onCollectSnapLines(evt:yfiles.input.CollectLabelSnapLineEventArgs):void; + /** + * Determines whether this instance should collect snap lines for the initial position of a label. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ *

+ * The default is false. + *

+ * @default false + * @type {boolean} + */ + collectAllNodeDistanceSnapLines:boolean; + /** + * Determines whether this instance should collect snap lines on the edge path. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * The default is false. + *

+ * @default false + * @type {boolean} + */ + collectAllEdgeDistanceSnapLines:boolean; + /** + * Specifies whether this context will automatically snap the node labels to snap lines. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + snapNodeLabels:boolean; + /** + * Specifies whether this context will automatically snap the edge labels to snap lines. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + snapEdgeLabels:boolean; + /** + * Gets or sets 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. + *

+ * @default 40.0 + * @type {number} + */ + 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 yfiles.input.LabelSnapContext#addSnapLine + * @type {yfiles.collections.IEnumerable.} + */ + snapLines:yfiles.collections.IEnumerable; + /** + * Adds the given listener for the CollectSnapLines event that 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}. + *

+ * @param {function(Object, yfiles.input.CollectLabelSnapLineEventArgs): void} listener The listener to add. + * @see yfiles.input.LabelSnapContext#removeCollectSnapLinesListener + */ + addCollectSnapLinesListener(listener:(sender:Object,evt:yfiles.input.CollectLabelSnapLineEventArgs)=>void):void; + /** + * Removes the given listener for the CollectSnapLines event that 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}. + *

+ * @param {function(Object, yfiles.input.CollectLabelSnapLineEventArgs): void} listener The listener to remove. + * @see yfiles.input.LabelSnapContext#addCollectSnapLinesListener + */ + removeCollectSnapLinesListener(listener:(sender:Object,evt:yfiles.input.CollectLabelSnapLineEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * The event arguments used by {@link yfiles.input.LabelSnapContext} to collect custom snap lines for each drag. + * @see yfiles.input.LabelSnapContext#addCollectSnapLinesListener + * @class yfiles.input.CollectLabelSnapLineEventArgs + * @extends {yfiles.input.InputModeEventArgs} + */ + export interface CollectLabelSnapLineEventArgs extends yfiles.input.InputModeEventArgs{} + export class CollectLabelSnapLineEventArgs { + /** + * 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. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,snapLines:yfiles.collections.ICollection); + /** + * 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; + static $class:yfiles.lang.Class; + } + /** + * 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#graphComponent}. + *

+ * This mode is {@link yfiles.input.NavigationInputMode#exclusive} by default. + *

+ * @class yfiles.input.NavigationInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface NavigationInputMode extends Object,yfiles.input.IInputMode{} + export class NavigationInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.NavigationInputMode} class. + * @constructor + */ + constructor(); + /** + * Callback that adjusts the {@link yfiles.view.CanvasComponent#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.NavigationInputMode#inputModeContext}, otherwise the FitGraphBoundsCommand is executed. + *

+ * @protected + */ + adjustContentRect():void; + /** + * 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. + * @protected + */ + adjustGroupNodeLocation(collapse:boolean,groupNode:yfiles.graph.INode):void; + /** + * + */ + cancel():void; + /** + * Clears the selection in the {@link yfiles.input.NavigationInputMode#graphComponent}. + */ + clearSelection():void; + /** + * {@link yfiles.graph.IFoldingView#collapse Collapses} the given group node to hide the contents of the group node from this {@link yfiles.graph.IFoldingView}. + * @param {yfiles.graph.INode} groupNode The group node to collapse. + * @see yfiles.graph.FoldingManager + * @see yfiles.input.NavigationInputMode#allowCollapseGroup + */ + collapseGroup(groupNode:yfiles.graph.INode):void; + /** + * Performs {@link yfiles.input.NavigationInputMode#collapseGroup} for all {@link yfiles.view.IGraphSelection#selectedNodes}. + */ + collapseSelection():void; + /** + * This method allows for entering a group node so that the currently displayed {@link yfiles.graph.IFoldingView}'s {@link yfiles.graph.IFoldingView#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#masterGraph} to allow for switching to group nodes which are currently not being displayed in this + * view. + *

+ * @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#masterGraph}. + * @see yfiles.input.NavigationInputMode#shouldEnterGroup + * @see yfiles.input.NavigationInputMode#allowEnterGroup + * @see yfiles.graph.FoldingManager + */ + enterGroup(node:yfiles.graph.INode):void; + /** + * Performs {@link yfiles.input.NavigationInputMode#enterGroup} for the first valid {@link yfiles.view.IGraphSelection#selectedNodes}. + */ + enterSelectedGroup():void; + /** + * Exits the current {@link yfiles.graph.IFoldingView#localRoot} of the currently displayed {@link yfiles.graph.IFoldingView view} and shows the contents of the parent container. + *

+ * This method will also {@link yfiles.input.GraphInputMode#clearSelection clear the selection} and {@link yfiles.input.GraphInputMode#setSelected select} the exited group node. + *

+ * @see yfiles.graph.FoldingManager + * @see yfiles.input.NavigationInputMode#allowExitGroup + * @see yfiles.input.NavigationInputMode#shouldExitGroup + */ + exitGroup():void; + /** + * {@link yfiles.graph.IFoldingView#expand Expands} the given group node to show the contents of the collapsed group node in this {@link yfiles.graph.IFoldingView}. + * @param {yfiles.graph.INode} groupNode The group node to expand + * @see yfiles.graph.FoldingManager + * @see yfiles.input.NavigationInputMode#allowExpandGroup + */ + expandGroup(groupNode:yfiles.graph.INode):void; + /** + * Performs {@link yfiles.input.NavigationInputMode#expandGroup} for all {@link yfiles.view.IGraphSelection#selectedNodes}. + */ + expandSelection():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; + /** + * 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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.NavigationInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):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; + /** + * 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; + /** + * Called after {@link yfiles.input.NavigationInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupCollapsedListener GroupCollapsed} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupCollapsed(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupCollapsingListener GroupCollapsing} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupCollapsing(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupEnteredListener GroupEntered} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupEntered(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupEnteringListener GroupEntering} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupEntering(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExitedListener GroupExited} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupExited(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExitingListener GroupExiting} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupExiting(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExpandedListener GroupExpanded} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupExpanded(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExpandingListener GroupExpanding} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the event data. + * @protected + */ + onGroupExpanding(evt:yfiles.collections.ItemEventArgs):void; + /** + * Called after {@link yfiles.input.NavigationInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Selects the {@link yfiles.view.GraphComponent#currentItem} current item. + *

+ * This method delegates to {@link yfiles.input.NavigationInputMode#selectItem}. + *

+ */ + selectCurrentItem():void; + /** + * Callback that selects the given item. + * @param {yfiles.view.GraphComponent} graphComponent The {@link yfiles.input.NavigationInputMode#graphComponent}. + * @param {yfiles.graph.IModelItem} item The item to select. + * @param {boolean} extendSelection if set to true the current selection is extended otherwise it is cleared beforehand. + * @see yfiles.input.NavigationInputMode#clearSelection + * @protected + */ + selectItem(graphComponent:yfiles.view.GraphComponent,item:yfiles.graph.IModelItem,extendSelection:boolean):void; + /** + * Callback that actually sets the current item property. + * @param {yfiles.view.GraphComponent} graphComponent The {@link yfiles.input.NavigationInputMode#graphComponent} to set the current item of. + * @param {yfiles.graph.IModelItem} item The item to set. + * @returns {boolean} Whether the operation was actually performed. + * @protected + */ + setCurrentItem(graphComponent:yfiles.view.GraphComponent,item:yfiles.graph.IModelItem):boolean; + /** + * Sets the "current" item to the given one. + * @param {yfiles.graph.IModelItem} item The item to set as the current item. + * @see yfiles.input.NavigationInputMode#setCurrentItem + */ + setCurrentItem(item:yfiles.graph.IModelItem):void; + /** + * Sets the {@link yfiles.input.NavigationInputMode#graphComponent} to use for the various actions. + *

+ * This will register or unregister the commands for the control. This method is called in response to {@link yfiles.input.NavigationInputMode#install} + * and {@link yfiles.input.NavigationInputMode#uninstall}. + *

+ * @param {yfiles.view.GraphComponent} graphComponent The control to use or null. + * @protected + */ + setGraphComponent(graphComponent:yfiles.view.GraphComponent):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#allowCollapseGroup}. + *

+ * @param {yfiles.graph.INode} groupNode + * @returns {boolean} Whether to collapse the given group or not. + * @protected + */ + shouldCollapseGroup(groupNode:yfiles.graph.INode):boolean; + /** + * 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#allowEnterGroup}. + *

+ * @param {yfiles.graph.INode} node The group node to enter. + * @returns {boolean} Whether to enter the group or not. + * @protected + */ + shouldEnterGroup(node:yfiles.graph.INode):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#allowExitGroup}. + *

+ * @returns {boolean} Whether to exit the current group or not. + * @protected + */ + shouldExitGroup():boolean; + /** + * 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#allowExpandGroup}. + *

+ * @param {yfiles.graph.INode} node + * @returns {boolean} Whether to expand the given group or not. + * @protected + */ + shouldExpandGroup(node:yfiles.graph.INode):boolean; + /** + * 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 item can be navigated to. + *

+ * @param {yfiles.graph.IModelItem} item The model item. + * @returns {boolean} Whether the item should be considered for navigational commands. + * @protected + */ + shouldNavigateTo(item:yfiles.graph.IModelItem):boolean; + /** + * 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.ICommand#COLLAPSE_GROUP}, {@link yfiles.input.ICommand#EXPAND_GROUP}, + * {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}, {@link yfiles.input.ICommand#ENTER_GROUP} and {@link yfiles.input.ICommand#EXIT_GROUP}. + *

+ * @returns {boolean} whether the input mode should request the mutex. + * @protected + */ + shouldRequestMutex():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 item should be selected. + *

+ * @param {yfiles.graph.IModelItem} item The model item. + * @returns {boolean} Whether the item should be selected by the navigational commands. + * @protected + */ + shouldSelect(item:yfiles.graph.IModelItem):boolean; + /** + * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#toggleExpansionState toggle} the collapsed state of the given group node. + *

+ * This implementation uses {@link yfiles.input.NavigationInputMode#shouldExpandGroup} and {@link yfiles.input.NavigationInputMode#shouldCollapseGroup} + * respectively. + *

+ * @param {yfiles.graph.INode} node + * @returns {boolean} Whether to expand the given group or not. + * @protected + */ + shouldToggleExpansionState(node:yfiles.graph.INode):boolean; + /** + * Toggles the {@link yfiles.graph.IFoldingView#isExpanded expanded/collapsed} state for the given group node in the {@link yfiles.graph.IFoldingView}. + * @param {yfiles.graph.INode} groupNode The group node to toggle the state for. + * @see yfiles.graph.FoldingManager + */ + toggleExpansionState(groupNode:yfiles.graph.INode):void; + /** + * Overridden to only return true if this instance does not currently {@link yfiles.input.ConcurrencyController#hasMutex have the input mutex}. + * @returns {boolean} true iff this instance does not {@link yfiles.input.ConcurrencyController#hasMutex own the mutex}. + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.NavigationInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.NavigationInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.NavigationInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Gets or sets the item types that can be navigated to by this mode. + * @see yfiles.input.NavigationInputMode#shouldNavigateTo + * @type {yfiles.graph.GraphItemTypes} + */ + 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}. + *

+ * @default 1 + * @type {yfiles.graph.GraphItemTypes} + */ + 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 yfiles.input.NavigationInputMode#expandGroup + * @see yfiles.input.NavigationInputMode#collapseGroup + * @default 0 + * @type {yfiles.input.NodeAlignmentPolicy} + */ + autoGroupNodeAlignmentPolicy:yfiles.input.NodeAlignmentPolicy; + /** + * Gets or sets the {@link yfiles.input.NavigationInputMode#graphComponent} this mode acts on. + * @type {yfiles.view.GraphComponent} + */ + graphComponent:yfiles.view.GraphComponent; + /** + * 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.ICommand#MOVE_LEFT}
  • + *
  • {@link yfiles.input.ICommand#MOVE_RIGHT}
  • + *
  • {@link yfiles.input.ICommand#MOVE_UP}
  • + *
  • {@link yfiles.input.ICommand#MOVE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#MOVE_TO_PAGE_UP}
  • + *
  • {@link yfiles.input.ICommand#MOVE_TO_PAGE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_BACK}
  • + *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_FORWARD}
  • + *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_UP}
  • + *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_DOWN}
  • + *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_PAGE_UP}
  • + *
  • {@link yfiles.input.ICommand#MOVE_FOCUS_PAGE_DOWN}
  • + *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_LEFT}
  • + *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_RIGHT}
  • + *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_UP}
  • + *
  • {@link yfiles.input.ICommand#EXTEND_SELECTION_DOWN}
  • + *
  • {@link yfiles.input.ICommand#SELECT_TO_PAGE_UP}
  • + *
  • {@link yfiles.input.ICommand#SELECT_TO_PAGE_DOWN}
  • + *
+ * @type {yfiles.collections.ICollection.} + */ + availableCommands:yfiles.collections.ICollection; + /** + * Gets or sets a value indicating whether to use the {@link yfiles.view.GraphComponent#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.ICommand#ENTER_GROUP}
  • + *
  • {@link yfiles.input.ICommand#EXPAND_GROUP}
  • + *
  • {@link yfiles.input.ICommand#COLLAPSE_GROUP}
  • + *
  • {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}
  • + *
+ * @default false + * @type {boolean} + */ + useCurrentItemForCommands:boolean; + /** + * Gets or sets the {@link yfiles.view.IGraphSelection} this mode operates on. + * @type {yfiles.view.IGraphSelection} + */ + graphSelection:yfiles.view.IGraphSelection; + /** + * Gets or sets the graph this mode operates on. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * 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.ICommand#ENTER_GROUP}. + *

+ * The default value is true. + *

+ * @see yfiles.input.NavigationInputMode#shouldEnterGroup + * @see yfiles.graph.FoldingManager + * @type {boolean} + */ + allowEnterGroup:boolean; + /** + * Gets or sets a value that determines whether it is allowed to collapse group nodes via the + * {@link yfiles.input.ICommand#COLLAPSE_GROUP}. + *

+ * The default value is true. + *

+ * @see yfiles.input.NavigationInputMode#collapseGroup + * @see yfiles.input.NavigationInputMode#shouldCollapseGroup + * @see yfiles.graph.FoldingManager + * @type {boolean} + */ + allowCollapseGroup: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.ICommand#EXPAND_GROUP}. + *

+ * The default value is true. + *

+ * @see yfiles.input.NavigationInputMode#shouldExpandGroup + * @see yfiles.graph.FoldingManager + * @type {boolean} + */ + allowExpandGroup: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.ICommand#EXIT_GROUP}. + *

+ * The default value is true. + *

+ * @see yfiles.input.NavigationInputMode#shouldExitGroup + * @see yfiles.graph.FoldingManager + * @default true + * @type {boolean} + */ + allowExitGroup:boolean; + /** + * Gets or sets a value that determines whether {@link yfiles.view.CanvasComponent#fitContent} or the FitContentCommand should be + * triggered after a group navigation action. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + fitContentAfterGroupActions:boolean; + /** + * Adds the given listener for the GroupCollapsing event that occurs before a group will be {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupCollapsingListener + */ + addGroupCollapsingListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupCollapsing event that occurs before a group will be {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupCollapsingListener + */ + removeGroupCollapsingListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupCollapsed event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupCollapsedListener + */ + addGroupCollapsedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupCollapsed event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupCollapsedListener + */ + removeGroupCollapsedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupExpanding event that occurs before a group will be {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupExpandingListener + */ + addGroupExpandingListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupExpanding event that occurs before a group will be {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupExpandingListener + */ + removeGroupExpandingListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupExpanded event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupExpandedListener + */ + addGroupExpandedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupExpanded event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupExpandedListener + */ + removeGroupExpandedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupEntering event that occurs before a group will be {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupEnteringListener + */ + addGroupEnteringListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupEntering event that occurs before a group will be {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupEnteringListener + */ + removeGroupEnteringListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupEntered event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupEnteredListener + */ + addGroupEnteredListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupEntered event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupEnteredListener + */ + removeGroupEnteredListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupExiting event that occurs before a group will be {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupExitingListener + */ + addGroupExitingListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupExiting event that occurs before a group will be {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupExitingListener + */ + removeGroupExitingListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupExited event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.NavigationInputMode#removeGroupExitedListener + */ + addGroupExitedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupExited event that occurs whenever a group has been {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.NavigationInputMode#addGroupExitedListener + */ + removeGroupExitedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + 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.IGraph#setParent parent} in the grouped graph. + */ + PARENT, + /** + * In the direction of the {@link yfiles.graph.IGraph#getChildren children} in the grouped graph. + */ + CHILD + } + export enum NodeAlignmentPolicy{ + /** + * Don't fix any specific point, only use the layout from the target state. + */ + 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 + } + export enum OrthogonalEdgeEditingPolicy{ + /** + * Enables orthogonal edge creation or editing for a specific sub-aspect automatically if an {@link yfiles.input.OrthogonalEdgeEditingContext#enabled} {@link yfiles.input.OrthogonalEdgeEditingContext} + * instance is set in the {@link yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext parent input mode}. + */ + AUTO, + /** + * Enables orthogonal edge creation or editing for a specific sub-aspect of edge creation. + */ + ALWAYS, + /** + * Disables orthogonal edge creation or editing for a specific sub-aspect of edge creation. + */ + NEVER + } + export enum SegmentOrientation{ + /** + * The segment has a horizontal orientation, which means that the end points should be moved vertically in synch so that + * the orientation is not destroyed. + */ + HORIZONTAL, + /** + * The segment has a vertical orientation, which means that 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 + } + /** + * 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: + *

+ *

Related demos:

+ *
    + *
  • Tutorial: 01 Getting Started, step 15 Snapping
  • + *
+ * @see yfiles.input.GraphEditorInputMode + * @see yfiles.input.GraphEditorInputMode#snapContext + * @class yfiles.input.GraphSnapContext + * @extends {yfiles.input.SnapContext} + */ + export interface GraphSnapContext extends yfiles.input.SnapContext{} + export class GraphSnapContext { + /** + * Creates a new instance with default settings. + * @constructor + */ + constructor(); + /** + * Adds {@link yfiles.input.MovementInfo} representing an {@link yfiles.graph.IBend} that will be considered for the next drag gesture. + *

+ * The default {@link yfiles.input.IHandle} of an {@link yfiles.graph.IBend} calls this method in its {@link yfiles.input.IDragHandler#initializeDrag} + * method so snap results are calculated when this bend is repositioned. Custom {@link yfiles.input.IHandle} implementations can + * add infos created by {@link yfiles.input.GraphSnapContext#getMovementInfo}. + *

+ * @param {yfiles.input.MovementInfo} info The {@link yfiles.input.MovementInfo} representing the bend to be moved. Can be created with + * {@link yfiles.input.GraphSnapContext#getMovementInfo}. + */ + addBendToBeMoved(info:yfiles.input.MovementInfo):void; + /** + * Adds {@link yfiles.input.MovementInfo} representing the end of an {@link yfiles.graph.IEdge} that will be considered for the next drag + * gesture. + *

+ * The {@link yfiles.input.IHandle} returned by the default {@link yfiles.input.IEdgePortHandleProvider} of an {@link yfiles.graph.IEdge} calls + * this method in its {@link yfiles.input.IDragHandler#initializeDrag} method so snap results are calculated when reparenting this + * edge end. Custom {@link yfiles.input.IHandle} implementations can call {@link yfiles.input.GraphSnapContext#getMovementInfos} and add + * the first or last {@link yfiles.input.MovementInfo} of the returned list. + *

+ * @param {yfiles.input.MovementInfo} info The {@link yfiles.input.MovementInfo} representing the edge end to be reparented. Can be created with + * {@link yfiles.input.GraphSnapContext#getMovementInfos}. + * @param {boolean} sourceEnd true if the info represents the source end of the edge. + */ + addEdgeEndToBeMoved(info:yfiles.input.MovementInfo,sourceEnd:boolean):void; + /** + * Adds an item which will be reshaped. + * @param {yfiles.graph.IModelItem} item The item to be reshaped. + */ + addItemToBeReshaped(item:yfiles.graph.IModelItem):void; + /** + * Adds {@link yfiles.input.MovementInfo} representing an {@link yfiles.graph.INode} that will be considered for the next drag gesture. + *

+ * The default {@link yfiles.input.IPositionHandler} of an {@link yfiles.graph.INode} calls this method in its {@link yfiles.input.IDragHandler#initializeDrag} + * method so snap results are calculated when this node is repositioned. Custom {@link yfiles.input.IPositionHandler} + * implementations can add infos created by {@link yfiles.input.GraphSnapContext#getMovementInfo}. + *

+ * @param {yfiles.input.MovementInfo} info The {@link yfiles.input.MovementInfo} representing the node to be moved. Can be created with + * {@link yfiles.input.GraphSnapContext#getMovementInfo}. + */ + addNodeToBeMoved(info:yfiles.input.MovementInfo):void; + /** + * 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} start The starting point of the manipulated segment. + * @param {yfiles.input.MovementInfo} end The end point of the manipulated segment. + */ + addOrthogonalSegment(start:yfiles.input.MovementInfo,end:yfiles.input.MovementInfo):void; + /** + * Adds {@link yfiles.input.MovementInfo} representing an {@link yfiles.graph.IPort} that will be considered for the next drag gesture. + *

+ * The default {@link yfiles.input.IHandle} of an {@link yfiles.graph.IPort} calls this method in its {@link yfiles.input.IDragHandler#initializeDrag} + * method so snap results are calculated for this port. Custom {@link yfiles.input.IHandle} implementations can add infos created + * by {@link yfiles.input.GraphSnapContext#getMovementInfo}. + *

+ * @param {yfiles.input.MovementInfo} info The {@link yfiles.input.MovementInfo} representing the port to be moved. Can be created with + * {@link yfiles.input.GraphSnapContext#getMovementInfo}. + */ + addPortToBeMoved(info:yfiles.input.MovementInfo):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.Rect} rectangle The rectangle to obtain the height value from. This rectangle will be used for the snap result visualization. + * @see yfiles.input.GraphSnapContext#addSameWidthEntry + */ + addSameHeightEntry(rectangle:yfiles.geometry.Rect):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.Rect} rectangle The rectangle to obtain the width value from. This rectangle will be used for the snap result visualization. + * @see yfiles.input.GraphSnapContext#addSameHeightEntry + */ + addSameWidthEntry(rectangle:yfiles.geometry.Rect):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}. + *

+ * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt + * @protected + */ + collectFixedNodeSnapLines(evt: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}. + *

+ * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt + * @protected + */ + collectFixedPortSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):void; + /** + * 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. + *

+ * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt + * @protected + */ + collectFixedSegmentSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):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}. + *

+ * @protected + */ + collectSameSizeEntries():void; + /** + * Finds pairs of nodes that are visually adjacent to create {@link yfiles.input.GraphSnapContext#collectNodePairCenterSnapLines center} and {@link yfiles.input.GraphSnapContext#collectNodePairSnapLines same distance} snap lines. + * @protected + */ + collectVisibleNodePairs():void; + /** + * Finds the entries ({@link yfiles.geometry.Rect}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. + * @returns {yfiles.collections.IListEnumerable.} The set of rectangles that have been added previously using {@link yfiles.input.GraphSnapContext#addSameHeightEntry}. + */ + findSameHeightEntries(size:number,maxSize:number,minSize:number):yfiles.collections.IListEnumerable; + /** + * Finds the entries ({@link yfiles.geometry.Rect}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. + * @returns {yfiles.collections.IListEnumerable.} The set of rectangles that have been added previously using {@link yfiles.input.GraphSnapContext#addSameWidthEntry}. + */ + findSameWidthEntries(size:number,maxSize:number,minSize:number):yfiles.collections.IListEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#additionalSnapLines} that matches the given orientation, snapType and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapTypes} snapType The snap type to be included. + * @param {yfiles.geometry.Rect} area The area to test for intersection. + * @returns {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getAdditionalSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines} that matches the given orientation, snapType and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapTypes} snapType The snap type to be included. + * @param {yfiles.geometry.Rect} area The area to test for intersection. + * @returns {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getFixedNodeSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedPortSnapLines} that matches the given orientation, snapType and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapTypes} snapType The snap type to be included. + * @param {yfiles.geometry.Rect} area The area to test for intersection. + * @returns {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getFixedPortSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines} that matches the given orientation, snapType and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapTypes} snapType The snap type to be included. + * @param {yfiles.geometry.Rect} area The area to test for intersection. + * @returns {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getFixedSegmentSnapLines(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,area:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + /** + * 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. + * @returns {yfiles.input.MovementInfo} An instance of {@link yfiles.input.MovementInfo} that describes the movement of the port. + */ + getMovementInfo(port:yfiles.graph.IPort):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. + * @returns {yfiles.input.MovementInfo} An instance of {@link yfiles.input.MovementInfo} that describes the movement of the node. + */ + getMovementInfo(node:yfiles.graph.INode):yfiles.input.MovementInfo; + /** + * Gets the movement info for the given bend. + *

+ * This is either the info passed to {@link yfiles.input.GraphSnapContext#addBendToBeMoved} or a dynamically created instance if no + * specific one had been registered. + *

+ * @param {yfiles.graph.IBend} bend The bend to obtain the info for. + * @returns {yfiles.input.MovementInfo} An instance of {@link yfiles.input.MovementInfo} that describes the movement of the bend. + */ + getMovementInfo(bend:yfiles.graph.IBend):yfiles.input.MovementInfo; + /** + * 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 + * enumerable is the source end of the edge, followed by bend like elements and the target side. Note that it cannot in + * general be assumed {@link yfiles.input.MovementInfo#movedItem} of the first and last element is either a {@link yfiles.graph.IPort} or {@link yfiles.graph.IEdge}, also items in + * between may not necessarily be bound to {@link yfiles.graph.IBend}s and therefore their {@link yfiles.input.MovementInfo#movedItem} can be of a different type than + * {@link yfiles.graph.IBend}. + *

+ * @param {yfiles.graph.IEdge} edge The edge to obtain the movement information of. + * @returns {yfiles.collections.IListEnumerable.} An {@link yfiles.collections.IListEnumerable.} of {@link yfiles.input.MovementInfo}s items that describe the geometry of the edge being modified. + */ + getMovementInfos(edge:yfiles.graph.IEdge):yfiles.collections.IListEnumerable; + /** + * Raises the {@link yfiles.input.GraphSnapContext#addCollectSnapLinesListener CollectSnapLines} event. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt The {@link yfiles.input.CollectGraphSnapLinesEventArgs} instance containing the event data. + * @protected + */ + onCollectSnapLines(evt:yfiles.input.CollectGraphSnapLinesEventArgs):void; + /** + * Gets the nodes that stay fixed for the current edit. + * @protected + * @type {yfiles.collections.ICollection.} + */ + fixedNodes:yfiles.collections.ICollection; + /** + * Adds the given listener for the CollectSnapLines event that 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}. + *

+ * @param {function(Object, yfiles.input.CollectGraphSnapLinesEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphSnapContext#removeCollectSnapLinesListener + */ + addCollectSnapLinesListener(listener:(sender:Object,evt:yfiles.input.CollectGraphSnapLinesEventArgs)=>void):void; + /** + * Removes the given listener for the CollectSnapLines event that 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}. + *

+ * @param {function(Object, yfiles.input.CollectGraphSnapLinesEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphSnapContext#addCollectSnapLinesListener + */ + removeCollectSnapLinesListener(listener:(sender:Object,evt:yfiles.input.CollectGraphSnapLinesEventArgs)=>void):void; + /** + * Determines whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines fixed snap lines} for edge segments. + *

+ * The default is true. + *

+ * @see yfiles.input.ISnapLineProvider + * @see yfiles.input.GraphSnapContext#collectFixedSegmentSnapLines + * @default true + * @type {boolean} + */ + collectEdgeSnapLines:boolean; + /** + * Determines whether this instance should collect the sizes of fixed nodes. + *

+ * The default is true. + *

+ * @see yfiles.input.GraphSnapContext#collectSameSizeEntries + * @default true + * @type {boolean} + */ + collectNodeSizes:boolean; + /** + * Determines whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines fixed snap lines} for nodes. + *

+ * The default is true. + *

+ * @see yfiles.input.ISnapLineProvider + * @see yfiles.input.GraphSnapContext#collectFixedNodeSnapLines + * @default true + * @type {boolean} + */ + collectNodeSnapLines:boolean; + /** + * Determines whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedPortSnapLines fixed snap lines} for ports. + *

+ * The default is true. + *

+ * @see yfiles.input.ISnapLineProvider + * @see yfiles.input.GraphSnapContext#collectFixedPortSnapLines + * @default true + * @type {boolean} + */ + 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. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * @default true + * @type {boolean} + */ + snapPortAdjacentSegments:boolean; + /** + * Determines whether this context will automatically snap orthogonal edge segments to snap lines. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + snapSegmentsToSnapLines:boolean; + /** + * Whether this context will automatically snap the bends to snap lines. + *

+ * The default is false. + *

+ * @default false + * @type {boolean} + */ + snapBendsToSnapLines:boolean; + /** + * Whether {@link yfiles.input.INodeSnapResultProvider} implementations should snap nodes to snap lines. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * @default 0.0 + * @type {number} + */ + nodeToNodeDistance:number; + /** + * The preferred distance between node borders and edge segments. T + *

+ * 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. + *

+ * @default -1.0 + * @type {number} + */ + 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. + *

+ * @default 0.0 + * @type {number} + */ + 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. + *

+ * @default false + * @type {boolean} + */ + 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. + *

+ * @default false + * @type {boolean} + */ + 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. + * @default true + * @type {boolean} + */ + 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. + * @default true + * @type {boolean} + */ + 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 yfiles.input.GraphSnapContext#nodeGridConstraintProvider + * @see yfiles.input.GraphSnapContext#bendGridConstraintProvider + * @see yfiles.input.GraphSnapContext#portGridConstraintProvider + * @default 0 + * @type {yfiles.input.GridSnapTypes} + */ + gridSnapType:yfiles.input.GridSnapTypes; + /** + * 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. + *

+ * @default 10.0 + * @type {number} + */ + gridSnapDistance:number; + /** + * Gets or sets the grid constraint provider for the {@link yfiles.graph.INode}s. + * @type {yfiles.input.IGridConstraintProvider.} + */ + nodeGridConstraintProvider:yfiles.input.IGridConstraintProvider; + /** + * Gets or sets the grid constraint provider for the {@link yfiles.graph.IBend}s. + * @type {yfiles.input.IGridConstraintProvider.} + */ + bendGridConstraintProvider:yfiles.input.IGridConstraintProvider; + /** + * Gets or sets the grid constraint provider for the {@link yfiles.graph.IPort}s. + * @type {yfiles.input.IGridConstraintProvider.} + */ + portGridConstraintProvider:yfiles.input.IGridConstraintProvider; + /** + * Gets or sets 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. + *

+ * @default 40.0 + * @type {number} + */ + snapLineExtension:number; + /** + * Gets or sets a value indicating whether to crop the snap lines at obstacles. + *

+ * The default is true + *

+ * @type {boolean} + */ + cropSnapLines: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 yfiles.input.GraphSnapContext#getFixedNodeSnapLines + * @type {yfiles.collections.IEnumerable.} + */ + 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 yfiles.input.GraphSnapContext#getFixedSegmentSnapLines + * @type {yfiles.collections.IEnumerable.} + */ + 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 yfiles.input.GraphSnapContext#getFixedPortSnapLines + * @type {yfiles.collections.IEnumerable.} + */ + 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 yfiles.input.GraphSnapContext#getAdditionalSnapLines + * @type {yfiles.collections.IEnumerable.} + */ + additionalSnapLines:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + 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. + *

+ * A typical example is a port whose position is adjusted during a resize of its owning node. + *

+ *

+ * Elements which do not move linearly with the mouse cannot snap to a defined position. + *

+ */ + ARBITRARY_MOVE_X, + /** + * The element moves in vertical direction but not linearly/predictably with the mouse. + *

+ * A typical example is a port whose position is adjusted during a resize of its owning node. + *

+ *

+ * Elements which do not move linearly with the mouse cannot snap to a defined position. + *

+ */ + ARBITRARY_MOVE_Y, + /** + * The element moves in both directions but not linearly/predictably with the mouse. + *

+ * A typical example is a port whose position is adjusted during a resize of its owning node. + *

+ *

+ * Elements which do not move linearly with the mouse cannot snap to a defined position. + *

+ */ + ARBITRARY_MOVE, + /** + * The bitwise combination of {@link yfiles.input.MoveTypes#LINEAR_MOVE_X} and {@link yfiles.input.MoveTypes#ARBITRARY_MOVE_X} + */ + MOVEMENT_X, + /** + * The bitwise combination of {@link yfiles.input.MoveTypes#LINEAR_MOVE_Y} and {@link yfiles.input.MoveTypes#ARBITRARY_MOVE_Y} + */ + MOVEMENT_Y + } + /** + * A helper class that is used in the context of {@link yfiles.input.GraphSnapContext} to describe the movement of entities during + * the edit process. + * @class yfiles.input.MovementInfo + */ + export interface MovementInfo extends Object{} + export class MovementInfo { + /** + * Initializes a new instance of the {@link yfiles.input.MovementInfo} class. + * @param {yfiles.geometry.Point} originalLocation The original location. + * @param {yfiles.input.MoveTypes} moveType The type of the move. + * @param {yfiles.graph.IModelItem} movedItem The item that is being moved. + * @protected + * @constructor + */ + constructor(originalLocation:yfiles.geometry.Point,moveType:yfiles.input.MoveTypes,movedItem:yfiles.graph.IModelItem); + /** + * 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. + * @returns {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. + * @returns {number} The new y coordinate. + */ + getY(dy:number):number; + /** + * Determines whether this instances moves synchronized with the provided info. + * @param {yfiles.input.MovementInfo} info The info to check. + * @returns {boolean} Whether this info and the given info move horizontally synchronized. + * @see yfiles.input.MovementInfo#horizontalAnchor + */ + movesHorizontallySynchronizedWith(info:yfiles.input.MovementInfo):boolean; + /** + * Determines whether this instances moves synchronized with the provided info. + * @param {yfiles.input.MovementInfo} info The info to check. + * @returns {boolean} Whether this info and the given info move vertically synchronized. + * @see yfiles.input.MovementInfo#verticalAnchor + */ + movesVerticallySynchronizedWith(info:yfiles.input.MovementInfo):boolean; + /** + * Gets the item that is being moved. + * @type {yfiles.graph.IModelItem} + */ + movedItem:yfiles.graph.IModelItem; + /** + * 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#movesHorizontallySynchronizedWith} + * will try to match against the anchors to determine if two infos are moving synchronized. + *

+ * @type {yfiles.input.MovementInfo} + */ + 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#movesVerticallySynchronizedWith} + * will try to match against the anchors to determine if two infos are moving synchronized. + *

+ * @type {yfiles.input.MovementInfo} + */ + verticalAnchor:yfiles.input.MovementInfo; + /** + * Gets the original location of the element at the time the editing started. + * @type {yfiles.geometry.Point} + */ + originalLocation:yfiles.geometry.Point; + /** + * Gets the current location as a live point. + * @abstract + * @type {yfiles.geometry.IPoint} + */ + currentLocation:yfiles.geometry.IPoint; + /** + * Indicates the type of the movement for this instance. + * @type {yfiles.input.MoveTypes} + */ + moveType:yfiles.input.MoveTypes; + /** + * Gets a value indicating whether the y coordinate of the item is fixed during the move operation. + * @type {boolean} + */ + isVerticallyFixed:boolean; + /** + * Gets a value indicating whether the x coordinate of the item is fixed during the move operation. + * @type {boolean} + */ + isHorizontallyFixed:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.input.SnapLine + */ + export interface SnapLine extends Object{} + export class SnapLine { + /** + * Creates a new snap line using the provided attributes. + * @param {yfiles.input.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} coordinates The coordinates of the center point of the snap line. + * @param {yfiles.geometry.Point} from The first location that delimits this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:yfiles.geometry.Point,to:yfiles.geometry.Point,tag:Object,weight:number); + /** + * Resource key which determines a snap line having a fixed visualization independent of the {@link yfiles.input.SnapResult}. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_FIXED_LINE_KEY:string; + /** + * Resource key which determines a snap line with three special locations, for example the start, end and center of an edge + * segment. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_EDGE_SEGMENT_KEY:string; + /** + * Resource key which determines a grid snap line having a fixed visualization independent of the {@link yfiles.input.SnapResult}. + * @const + * @static + * @type {string} + */ + static GRID_LINE_FIXED_LINE_KEY:string; + /** + * Resource key which determines a decorated snap line between the {@link yfiles.input.SnapLine#coordinates} and the snapped coordinates. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_VARIABLE_LINE_KEY:string; + /** + * Resource key which determines a blank line between the {@link yfiles.input.SnapLine#coordinates} and the snapped coordinates. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_BLANK_VARIABLE_LINE_KEY:string; + /** + * Resource key which determines a decorated line between the {@link yfiles.input.SnapLine#coordinates} and the snapped coordinates that is extended on both sides. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_EXTENDED_VARIABLE_LINE_KEY:string; + /** + * Resource key which determines a snap line which lets an item snap in a defined distance to another graph item. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_FIXED_DISTANCE_KEY:string; + /** + * Resource key which determines a snap line which lets an item snap in the center between the bounds of two other items. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_CENTER_BETWEEN_BOUNDS_KEY:string; + /** + * Resource key which determines a snap line which lets an item snap in the center between the centers of two other items. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_CENTER_BETWEEN_CENTERS_KEY:string; + /** + * Resource key which determines a snap line which lets an item snap if it has an equal distance to two other items. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_EQUAL_DISTANCE_BETWEEN_BOUNDS_KEY:string; + /** + * 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. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_EQUAL_DISTANCE_BETWEEN_CENTERS_KEY:string; + /** + * Resource key which determines the snapping of a resized item if it's new width is equal to another item. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_EQUAL_WIDTH_KEY:string; + /** + * Resource key which determines the snapping of a resized item if it's new height is equal to another item. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_EQUAL_HEIGHT_KEY:string; + /** + * Resource key which determines the snapping of an item to a grid position. + * @const + * @static + * @type {string} + */ + static SNAP_TO_GRID_KEY:string; + /** + * Resource key which determines the {@link yfiles.view.Stroke} used for the snap line visualization. + * @const + * @static + * @type {string} + */ + static SNAP_LINE_STROKE_KEY:string; + /** + * The type of the line that describes how other items will snap to this line. + *

+ * his is one of {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, + * {@link yfiles.input.SnapLineSnapTypes#LEFT}, {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + *

+ * @type {yfiles.input.SnapLineSnapTypes} + */ + snapType:yfiles.input.SnapLineSnapTypes; + /** + * The coordinates of the center point of the snap line. + * @type {yfiles.geometry.Point} + */ + coordinates:yfiles.geometry.Point; + /** + * 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}. + * @type {Object} + */ + tag:Object; + /** + * The weight/importance of this snap line. + *

+ * Greater values indicate greater importance. + *

+ * @type {number} + */ + weight:number; + /** + * The first location that delimits this snap line. + * @type {yfiles.geometry.Point} + */ + from:yfiles.geometry.Point; + /** + * The second location that delimits this snap line. + * @type {yfiles.geometry.Point} + */ + to:yfiles.geometry.Point; + /** + * The resource key which determines the visual appearance of the snap line. + * @type {string} + */ + resourceKey:string; + static $class:yfiles.lang.Class; + } + /** + * An orthogonal snap line, in other words, one that is parallel to the x or y axis. + * @class yfiles.input.OrthogonalSnapLine + * @extends {yfiles.input.SnapLine} + */ + export interface OrthogonalSnapLine extends yfiles.input.SnapLine{} + export class 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:Object,weight:number); + /** + * 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:Object,weight:number); + /** + * The orientation of the snap line. + *

+ * This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + *

+ * @type {yfiles.input.SnapLineOrientation} + */ + orientation:yfiles.input.SnapLineOrientation; + static $class:yfiles.lang.Class; + } + /** + * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores a {@link yfiles.input.NodeBasedSnapLine#node} as additional information that can be used for the + * visualization. + * @class yfiles.input.NodeBasedSnapLine + * @extends {yfiles.input.OrthogonalSnapLine} + */ + export interface NodeBasedSnapLine extends yfiles.input.OrthogonalSnapLine{} + export class 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:Object,weight:number); + /** + * 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:Object,weight:number); + /** + * Gets the node that is associated with this snap line. + *

+ * Usually this is the instance that induced this snap line. + *

+ * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.input.NodePairBasedSnapLine#firstNode + * @see yfiles.input.NodePairBasedSnapLine#secondNode + * @class yfiles.input.NodePairBasedSnapLine + * @extends {yfiles.input.OrthogonalSnapLine} + */ + export interface NodePairBasedSnapLine extends yfiles.input.OrthogonalSnapLine{} + export class 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(firstNode:yfiles.graph.INode,secondNode:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:Object,weight:number); + /** + * 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(firstNode:yfiles.graph.INode,secondNode:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:Object,weight:number); + /** + * Gets the first node that is associated with this snap line. + *

+ * Usually this is one of the instances that induced this snap line. + *

+ * @type {yfiles.graph.INode} + */ + 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. + *

+ * @type {yfiles.graph.INode} + */ + secondNode:yfiles.graph.INode; + static $class:yfiles.lang.Class; + } + /** + * 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. + * @class yfiles.input.PointBasedSnapLine + * @extends {yfiles.input.OrthogonalSnapLine} + */ + export interface PointBasedSnapLine extends yfiles.input.OrthogonalSnapLine{} + export class 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(point:yfiles.geometry.IPoint,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,from:number,to:number,tag:Object,weight:number); + /** + * 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.SnapLineSnapTypes} snapType The type of the line that describes how other items will snap to this line. This is one of + * {@link yfiles.input.SnapLineSnapTypes#TOP}, {@link yfiles.input.SnapLineSnapTypes#BOTTOM}, {@link yfiles.input.SnapLineSnapTypes#LEFT}, + * {@link yfiles.input.SnapLineSnapTypes#RIGHT}, or {@link yfiles.input.SnapLineSnapTypes#CENTER}. + * @param {string} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(point:yfiles.geometry.IPoint,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapTypes,resourceKey:string,coordinates:yfiles.geometry.Point,tag:Object,weight:number); + /** + * Gets the point that is associated with this snap line. + *

+ * Usually this is the instance that induced this snap line. + *

+ * @type {yfiles.geometry.IPoint} + */ + point:yfiles.geometry.IPoint; + static $class:yfiles.lang.Class; + } + /** + * 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.SnapLineSnapTypes#CENTER} and + * the {@link yfiles.input.SnapLine#resourceKey} {@link yfiles.input.SnapLine#SNAP_LINE_EDGE_SEGMENT_KEY}. + *

+ * @class yfiles.input.EdgeSegmentSnapLine + * @extends {yfiles.input.SnapLine} + */ + export interface EdgeSegmentSnapLine extends yfiles.input.SnapLine{} + export class 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.Point} from The first location that delimits this snap line. + * @param {yfiles.geometry.Point} to The second location that delimits this snap line. + * @param {yfiles.geometry.Point} segmentSource The location that represents the source of the related segment on this line. + * @param {yfiles.geometry.Point} 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. + * @constructor + */ + constructor(edge:yfiles.graph.IEdge,from:yfiles.geometry.Point,to:yfiles.geometry.Point,segmentSource:yfiles.geometry.Point,segmentTarget:yfiles.geometry.Point,distance:number,segmentIndex:number,tag:Object,weight:number); + /** + * 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.Point} 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.Point} 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. + * @constructor + */ + constructor(edge:yfiles.graph.IEdge,segmentSource:yfiles.geometry.Point,segmentTarget:yfiles.geometry.Point,distance:number,segmentIndex:number); + /** + * Gets the edge that is associated with this snap line. + * @type {yfiles.graph.IEdge} + */ + edge:yfiles.graph.IEdge; + /** + * Gets the direction vector of this snap line. + * @type {yfiles.geometry.Point} + */ + direction:yfiles.geometry.Point; + /** + * Gets the distance of this snap line from its related edge segment. + * @type {number} + */ + distance:number; + /** + * Gets the segment index of the related edge segment. + * @type {number} + */ + segmentIndex:number; + /** + * Gets the location that represents the source of the related segment on this line. + * @type {yfiles.geometry.Point} + */ + segmentSource:yfiles.geometry.Point; + /** + * Gets the location that represents the target of the related segment on this line. + * @type {yfiles.geometry.Point} + */ + segmentTarget:yfiles.geometry.Point; + /** + * 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. + *

+ * @type {yfiles.geometry.Point} + */ + sourceMarker:yfiles.geometry.Point; + /** + * 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. + *

+ * @type {yfiles.geometry.Point} + */ + targetMarker:yfiles.geometry.Point; + static $class:yfiles.lang.Class; + } + 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 + } + export enum SnapLineSnapTypes{ + /** + * 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 + } + /** + * A simple default implementation of an {@link yfiles.input.IPortCandidate}. + *

+ * Subclasses need to override {@link yfiles.input.DefaultPortCandidate#createInstance} if they don't {@link yfiles.input.DefaultPortCandidate#setInstance set} a port instance. + *

+ * @class yfiles.input.DefaultPortCandidate + * @implements {yfiles.input.IPortCandidate} + */ + export interface DefaultPortCandidate extends Object,yfiles.input.IPortCandidate{} + export class DefaultPortCandidate { + /** + * Creates a candidate for the given owner that uses the graph's defaults for the port's style and a default parameter for + * the given model. + *

+ * The {@link yfiles.input.DefaultPortCandidate#locationParameter} is set to the parameter that best matches the {@link yfiles.geometry.Point#ORIGIN origin} for the given model. + *

+ * @param {yfiles.graph.IPortOwner} owner The owner. + * @param {yfiles.graph.IPortLocationModel} model The model. + * @constructor + */ + constructor(owner:yfiles.graph.IPortOwner,model:yfiles.graph.IPortLocationModel); + /** + * Creates a candidate for the given owner that uses the graph's defaults for the port's style and the given + * locationParameter. + *

+ * If no locationParameter is given, the used candidate has a fixed location at {@link yfiles.geometry.Point#ORIGIN} that does not + * depend on the owner. + *

+ * @param {yfiles.graph.IPortOwner} owner The owner. + * @param {yfiles.graph.IPortLocationModelParameter} [locationParameter=null] The location. + * @param {yfiles.input.PortCandidateValidity} [validity=yfiles.input.PortCandidateValidity.VALID] The validity of the port candidate. + * @constructor + */ + constructor(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,validity?:yfiles.input.PortCandidateValidity); + /** + * Creates a candidate for the given owner that uses the graph's defaults for the port's style and the given + * locationParameter. + *

+ * If no locationParameter is given, the used candidate has a fixed location at {@link yfiles.geometry.Point#ORIGIN} that does not + * depend on the owner. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPortOwner} options.owner The owner. + * @param {yfiles.graph.IPortLocationModelParameter} [options.locationParameter=null] The location. + * @param {yfiles.input.PortCandidateValidity} [options.validity=yfiles.input.PortCandidateValidity.VALID] The validity of the port candidate. + * @constructor + */ + constructor(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,validity?:yfiles.input.PortCandidateValidity}); + /** + * Creates a candidate using the given port as the template. + * @param {yfiles.graph.IPort} port The port to use. + * @constructor + */ + constructor(port: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#createPort} on this instance and the + * instances created by {@link yfiles.input.DefaultPortCandidate#getPortCandidateAt}. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The parameter to use. + * @param {yfiles.styles.IPortStyle} style The style to use. + * @param {Object} tag The tag to use. + * @returns {yfiles.graph.IPort} The newly created port. + * @protected + */ + createInstance(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,locationParameter:yfiles.graph.IPortLocationModelParameter,style:yfiles.styles.IPortStyle,tag:Object):yfiles.graph.IPort; + /** + * This implementation will throw a {@link Stubs.Exceptions.NotSupportedError} if the validity is + * {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + *

+ * This implementation will delegate to the {@link yfiles.input.DefaultPortCandidate#createInstance} method. + *

+ * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.graph.IPort} + */ + createPort(context:yfiles.input.IInputModeContext):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#createInstance} using the newly + * calculated {@link yfiles.input.DefaultPortCandidate#locationParameter}. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context for which a concrete candidate is queried. + * @param {yfiles.geometry.Point} location The location for which a candidate should be returned. + * @returns {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 yfiles.input.DefaultPortCandidate#validity + */ + getPortCandidateAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * Sets the instance that will be returned by {@link yfiles.input.DefaultPortCandidate#port} and {@link yfiles.input.DefaultPortCandidate#createPort}. + * @param {yfiles.graph.IPort} port A port that already exists in the graph or null. + */ + setInstance(port:yfiles.graph.IPort):void; + /** + * Determines whether this candidate is a valid one depending on the context it has been obtained from. + * @default 0 + * @type {yfiles.input.PortCandidateValidity} + */ + 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. + *

+ * @default null + * @type {Object} + */ + candidateTag:Object; + /** + * Gets or sets the port tag to create the port with. + * @default null + * @type {Object} + */ + portTag:Object; + /** + * Gets or sets the model parameter that will be used for the {@link yfiles.graph.IPort#locationParameter} if this candidate is chosen. + *

+ * The parameter which may not be null. + *

+ * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * The model that will be used by this instance to determine the new {@link yfiles.input.DefaultPortCandidate#locationParameter} if the {@link yfiles.input.DefaultPortCandidate#getPortCandidateAt} + * is called and the {@link yfiles.input.DefaultPortCandidate#validity} is set to {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @default null + * @type {yfiles.graph.IPortLocationModel} + */ + model:yfiles.graph.IPortLocationModel; + /** + * Gets or sets the style to use for the newly created port. + * @default null + * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * Gets or sets the owner of the port to be created. + * @type {yfiles.graph.IPortOwner} + */ + owner:yfiles.graph.IPortOwner; + /** + * Returns the instance provided to the constructor or to the {@link yfiles.input.DefaultPortCandidate#setInstance setter}. + * @see yfiles.input.DefaultPortCandidate#createPort + * @type {yfiles.graph.IPort} + */ + port:yfiles.graph.IPort; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.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 yfiles.input.GraphEditorInputMode#onCreateBendInputModeBendCreated + * @interface + */ + 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.Point} location The preferred coordinates of the bend. + * @returns {number} The index of the bend in the edges' {@link yfiles.graph.IEdge#bends} or -1 if no bend has been created. + * @abstract + */ + createBend(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.Point):number; + } + var IBendCreator:{ + /** + * A static instance that does not create any bends. + * @const + * @static + * @type {yfiles.input.IBendCreator} + */ + NO_BENDS?:yfiles.input.IBendCreator; $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; - }; + isInstance(o:Object):boolean; }; /** - * 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; + * Interface that can be used to find bends at specific locations in the canvas. + *

+ * This interface is usually provided through the {@link yfiles.graph.ILookup#lookup} of {@link yfiles.graph.IEdge} implementations. + *

+ * @interface + */ + export interface IBendSelectionTester extends Object{ /** - * 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; + * Returns the bends within the given rectangle. + * @param {yfiles.input.IInputModeContext} context The input mode context to use for querying the position. + * @param {yfiles.geometry.Rect} rectangle A rectangle in world coordinates. + * @returns {yfiles.collections.IEnumerable.} The bends inside of rectangle. + * @abstract + */ + getBendsInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + /** + * Returns the bend at the given world coordinate position. + * @param {yfiles.input.IInputModeContext} context The input mode context to use for querying the position. + * @param {yfiles.geometry.Point} location A location in world coordinates. + * @returns {yfiles.graph.IBend} The bend at the position or null if there is no bend. + * @abstract + */ + getHitBend(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.graph.IBend; + } + var IBendSelectionTester:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; /** - * 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{ + * An interface that checks for containment of an {@link yfiles.graph.IBend} in 2D coordinate space. + *

+ * This interface is 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. + *

+ * @interface + */ + export interface IContainsBendTester extends Object{ + /** + * Determines whether the provided bend is deemed to lie within the shape this test is implemented for. + *

+ * This method is 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.input.IContainsBendTester} is present in the node's {@link yfiles.graph.ILookup#lookup}, this + * method is called with the bend 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.input.IInputModeContext} context The input mode context to use. + * @param {yfiles.graph.IBend} bend The bend to test + * @returns {boolean} true iff the bend is contained within the shape. + * @abstract + */ + contains(context:yfiles.input.IInputModeContext,bend:yfiles.graph.IBend):boolean; } - var ErrorHandling:{ + var IContainsBendTester:{ $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; + isInstance(o:Object):boolean; }; /** - * 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{ + * 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.graph.ILookup} of the + * {@link yfiles.graph.INode}s that are being moved during the edit. + *

+ * @see yfiles.input.GraphSnapContext + * @see yfiles.graph.NodeDecorator#nodeSnapResultProviderDecorator + * @interface + */ + 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} evt The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.Rect} 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. + * @abstract + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; } - var ArgumentOutOfRangeException:{ + var INodeSnapResultProvider:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * 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{ + * 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 yfiles.graph.EdgeDecorator#edgeSnapResultProviderDecorator + * @interface + */ + export interface IEdgeSnapResultProvider extends Object{ + /** + * 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} evt The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.collections.IListEnumerable.} 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}. + * @abstract + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,movementInfos:yfiles.collections.IListEnumerable,edge:yfiles.graph.IEdge):void; } - var ArgumentNullException:{ + var IEdgeSnapResultProvider:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * 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{ + * 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.graph.ILookup} of the + * {@link yfiles.graph.IBend}s that are being moved during the edit. + *

+ * @see yfiles.input.GraphSnapContext + * @see yfiles.graph.BendDecorator#bendSnapResultProviderDecorator + * @interface + */ + 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} evt The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.Point} 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. + * @abstract + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLocation:yfiles.geometry.Point,bend:yfiles.graph.IBend):void; } - var ArgumentException:{ + var IBendSnapResultProvider:{ $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; + isInstance(o:Object):boolean; }; /** - * 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{ + * 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.graph.ILookup} of the + * {@link yfiles.graph.IPort}s that are being moved during the edit. + *

+ * @see yfiles.input.GraphSnapContext + * @see yfiles.graph.PortDecorator#portSnapResultProviderDecorator + * @interface + */ + export interface IPortSnapResultProvider extends Object{ /** - * The layout graph being acted upon. - */ + * 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} evt The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.Point} 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 + * @abstract + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLocation:yfiles.geometry.Point,port:yfiles.graph.IPort):void; + } + var IPortSnapResultProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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. + * @interface + */ + 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} evt 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 operation. + * @abstract + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext):void; + } + var INodeReshapeSnapResultProvider:{ + $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}. + *

+ * @class yfiles.input.ReshapeRectangleContext + * @final + */ + export interface ReshapeRectangleContext extends Object{} + export class ReshapeRectangleContext { + /** + * Initializes a new instance of the {@link yfiles.input.ReshapeRectangleContext} class. + * @param {yfiles.geometry.Rect} 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.Point} topLeftChangeFactor The factor by which the top left corner of the node layout changes when the handle is dragged. + * @param {yfiles.geometry.Point} bottomRightChangeFactor The factor by which the bottom right corner of the node layout changes when the handle is dragged. + * @param {yfiles.geometry.Size} sizeChangeFactor The factor by which the size of the node layout changes when the handle is dragged. + * @constructor + */ + constructor(initialBounds:yfiles.geometry.Rect,minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize,minimumEnclosedArea:yfiles.geometry.IRectangle,reshapePosition:yfiles.input.HandlePositions,topLeftChangeFactor:yfiles.geometry.Point,bottomRightChangeFactor:yfiles.geometry.Point,sizeChangeFactor:yfiles.geometry.Size); + /** + * Gets the initial bounds of the node. + * @type {yfiles.geometry.Rect} + */ + initialBounds:yfiles.geometry.Rect; + /** + * Gets the minimum size of the node. + * @type {yfiles.geometry.ISize} + */ + minimumSize:yfiles.geometry.ISize; + /** + * Gets or sets the maximum size of the node. + * @type {yfiles.geometry.ISize} + */ + maximumSize:yfiles.geometry.ISize; + /** + * Gets minimum area the node's layout needs to encompass + * @type {yfiles.geometry.IRectangle} + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets the position of the reshape handle. + * @type {yfiles.input.HandlePositions} + */ + reshapePosition:yfiles.input.HandlePositions; + /** + * Gets the factor by which the top left corner of the node layout changes when the handle is dragged. + * @type {yfiles.geometry.Point} + */ + topLeftChangeFactor:yfiles.geometry.Point; + /** + * Gets the factor by which the bottom right corner of the node layout changes when the handle is dragged. + * @type {yfiles.geometry.Point} + */ + bottomRightChangeFactor:yfiles.geometry.Point; + /** + * Gets the factor by which the size of the node layout changes when the handle is dragged. + * @type {yfiles.geometry.Size} + */ + sizeChangeFactor:yfiles.geometry.Size; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.input.IEdgeReconnectionPortCandidateProvider + * @see yfiles.input.IPortCandidateProvider + * @see yfiles.input.DefaultPortCandidate + * @interface + */ + export interface IPortCandidate extends Object{ + /** + * 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#port instance}. If this instance's {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC} + * this method may throw an {@link Stubs.Exceptions.NotSupportedError}. + *

+ * @param {yfiles.input.IInputModeContext} context 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. + * @returns {yfiles.graph.IPort} The port instance to use if this candidate has been chosen. This method may not return null. + * @throws {Stubs.Exceptions.NotSupportedError} If the {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @see yfiles.input.IInputModeContext#graph + * @see yfiles.input.IPortCandidate#port + * @see yfiles.input.IPortCandidate#getPortCandidateAt + * @abstract + */ + createPort(context:yfiles.input.IInputModeContext):yfiles.graph.IPort; + /** + * 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} context The input mode context for which a concrete candidate is queried. + * @param {yfiles.geometry.Point} location The location for which a candidate should be returned. + * @returns {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 yfiles.input.IPortCandidate#validity + * @abstract + */ + getPortCandidateAt(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * 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. + *

+ * @abstract + * @type {Object} + */ + 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 yfiles.input.IPortCandidate#getPortCandidateAt + * @abstract + * @type {yfiles.input.PortCandidateValidity} + */ + validity:yfiles.input.PortCandidateValidity; + /** + * Returns the model parameter that will be used for the {@link yfiles.graph.IPort#locationParameter} 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. + *

+ * @abstract + * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Returns the possible owner of the port to be created for this candidate. + * @abstract + * @type {yfiles.graph.IPortOwner} + */ + owner:yfiles.graph.IPortOwner; + /** + * Gets the port instance that is already live in the graph if this candidate wraps an existing port or null otherwise. + * @see yfiles.input.IPortCandidate#createPort + * @abstract + * @type {yfiles.graph.IPort} + */ + port:yfiles.graph.IPort; + } + var IPortCandidate:{ + $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 + } + /** + * This interface is used to provide {@link yfiles.input.IPortCandidate}s for a specific {@link yfiles.graph.IPortOwner}. + *

+ * It is used in the context of the items that will later become the owner ({@link yfiles.graph.IPortOwner}) of the ports obtained + * from the candidates. They are mainly used during edge creation where there is no real edge yet (only the dummy edge) and + * thus they need to use the opposite {@link yfiles.input.IPortCandidate} to understand the context. + *

+ *

+ * Implementations of this interface may be queried using the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IPortOwner} + * implementations like {@link yfiles.graph.INode}. + *

+ *

+ * Note that this interface is similar to the interface {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} in the sense + * that they will both provide {@link yfiles.input.IPortCandidate} instances in a certain query context. They are used in different + * query contexts, though. The two interfaces can come together in concrete implementations of + * {@link yfiles.input.IEdgeReconnectionPortCandidateProvider}: an edge could potentially be connected to ports at any given {@link yfiles.graph.IPortOwner} + * and thus the {@link yfiles.input.IPortCandidateProvider} interface can be queried from the respective {@link yfiles.graph.IPortOwner} + * that the edge will be reconnected to. + *

+ *

Related demos:

+ *
    + *
  • Demo: PortCandidateProvider, demo.yfiles.input.portcandidateprovider
  • + *
+ * @see yfiles.graph.NodeDecorator#portCandidateProviderDecorator + * @interface + */ + 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. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @abstract + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):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. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context. + * @abstract + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):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. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @abstract + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):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. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context. + * @abstract + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var IPortCandidateProvider:{ + /** + * Creates a generic composite implementation for the {@link yfiles.input.IPortCandidateProvider} interface. + * @param {yfiles.collections.IEnumerable.} providers The providers to create the composite from. + * @returns {yfiles.input.IPortCandidateProvider} + * @static + */ + combine?(providers:yfiles.collections.IEnumerable):yfiles.input.IPortCandidateProvider; + /** + * Creates an implementation of an {@link yfiles.input.IPortCandidateProvider} that provides only the given port candidates. + * @param {...yfiles.input.IPortCandidate} candidates The port candidates the provider should provide. + * @returns {yfiles.input.PortCandidateProviderBase} A new {@link yfiles.input.IPortCandidateProvider}. + * @static + */ + fromCandidates?(...candidates:yfiles.input.IPortCandidate[]):yfiles.input.PortCandidateProviderBase; + /** + * Creates an implementation of an {@link yfiles.input.IPortCandidateProvider} that provides only the given port candidates. + * @param {yfiles.collections.IEnumerable.} candidates The port candidates the provider should provide. + * @returns {yfiles.input.PortCandidateProviderBase} A new {@link yfiles.input.IPortCandidateProvider}. + * @static + */ + fromCandidates?(candidates:yfiles.collections.IEnumerable):yfiles.input.PortCandidateProviderBase; + /** + * Creates an implementation of the {@link yfiles.input.IPortCandidateProvider} interface that returns the ports that exist in the + * given {@link yfiles.graph.IPortOwner#ports}'s {@link yfiles.graph.IPortOwner} collection. + * @param {yfiles.graph.IPortOwner} owner The owner of the port collection. + * @returns {yfiles.input.IPortCandidateProvider} + * @static + */ + fromExistingPorts?(owner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; + /** + * Creates a 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}. + * @param {yfiles.graph.INode} node The node to get the layout's center from. + * @returns {yfiles.input.PortCandidateProviderBase} + * @static + */ + fromNodeCenter?(node:yfiles.graph.INode):yfiles.input.PortCandidateProviderBase; + /** + * Creates a simple implementation of an {@link yfiles.input.IPortCandidateProvider} that always returns a candidate that uses the + * default {@link yfiles.graph.IPortDefaults#locationParameter} for the corresponding {@link yfiles.graph.IPortDefaults}. + * @param {yfiles.graph.IPortOwner} owner + * @returns {yfiles.input.IPortCandidateProvider} + * @static + */ + fromPortDefaults?(owner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; + /** + * Creates an implementation of {@link yfiles.input.IPortCandidateProvider} that works for {@link yfiles.graph.IPortOwner} implementations + * that have {@link yfiles.styles.IShapeGeometry} instances in their lookup. + * @param {yfiles.graph.IPortOwner} owner The owner to receive the shape geometry from + * @param {number} minimumSegmentLength the minimum length a segment needs to have in order to be used to add port candidates. + * @param {...number} ratios A number of double values that are interpreted as ratio values between 0.0 and 1.0. If none are given, the provider + * inserts a port candidate at the center of each straight line segment. + * @param {boolean} addExistingPortsEnabled determines whether {@link yfiles.input.PortCandidateProviderBase#addExistingPorts existing ports should be added to the list of ports}. + * @returns {yfiles.input.PortCandidateProviderBase} + * @static + */ + fromShapeGeometry?(owner:yfiles.graph.IPortOwner,addExistingPortsEnabled:boolean,minimumSegmentLength:number,...ratios:number[]):yfiles.input.PortCandidateProviderBase; + /** + * Creates an implementation of {@link yfiles.input.IPortCandidateProvider} that works for {@link yfiles.graph.IPortOwner} implementations + * that have {@link yfiles.styles.IShapeGeometry} instances in their lookup. + * @param {yfiles.graph.IPortOwner} owner 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. If none are given, the provider + * inserts a port candidate at the center of each straight line segment. + * @returns {yfiles.input.PortCandidateProviderBase} + * @static + */ + fromShapeGeometry?(owner:yfiles.graph.IPortOwner,...ratios:number[]):yfiles.input.PortCandidateProviderBase; + /** + * Creates a simple implementation of an {@link yfiles.input.IPortCandidateProvider} that returns unoccupied ports at a given + * entity. + * @param {yfiles.graph.IPortOwner} owner The owner to query the ports from. + * @returns {yfiles.input.IPortCandidateProvider} + * @static + */ + fromUnoccupiedPorts?(owner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; + /** + * A generic implementation of the {@link yfiles.input.IPortCandidateProvider} interface that provides no candidates. + * @const + * @static + * @type {yfiles.input.IPortCandidateProvider} + */ + NO_CANDIDATES?:yfiles.input.IPortCandidateProvider; + $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} + *

+ * As the name implies this is only used in the context of reconnecting existing edges. It is queried for existing edges to + * find out about possible alternative port candidates that given edge could connect to. It is used during gestures where + * an edge is reconnected to another port(candidate), i.e. when the source or target port handle of an edge is moved and + * the source or target port properties of the edge get set to the new {@link yfiles.input.IPortCandidate}s. + *

+ *

+ * Implementations of this interface can be queried using the {@link yfiles.graph.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. + *

+ *

+ * Note that this interface is similar to the interface {@link yfiles.input.IPortCandidateProvider} in the sense that they will + * both provide {@link yfiles.input.IPortCandidate} instances in a certain query context. They are used in different query + * contexts, though. The two interfaces can come together in concrete implementations of + * {@link yfiles.input.IEdgeReconnectionPortCandidateProvider}: an edge could potentially be connected to ports at any given {@link yfiles.graph.IPortOwner} + * and thus the {@link yfiles.input.IPortCandidateProvider} interface can be queried from the respective {@link yfiles.graph.IPortOwner} + * that the edge will be reconnected to. + *

+ *

Related demos:

+ *
    + *
  • Demo: EdgePortCandidateProvider, demo.yfiles.input.edgeportcandidateprovider
  • + *
+ * @interface + */ + export interface IEdgeReconnectionPortCandidateProvider 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. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context edge. + * @abstract + */ + 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. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context edge. + * @abstract + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var IEdgeReconnectionPortCandidateProvider:{ + /** + * Creates an implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface that returns the + * candidates provided by the source and target port's owner'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. + *

+ * @param {yfiles.graph.IEdge} edge + * @returns {yfiles.input.IEdgeReconnectionPortCandidateProvider} + * @static + */ + fromSourceAndTarget?(edge:yfiles.graph.IEdge):yfiles.input.IEdgeReconnectionPortCandidateProvider; + /** + * Creates an implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface that returns a union of + * all {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates source port candidates} or {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates target port candidates}, respectively, of nodes 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. + *

+ * @const + * @static + * @type {yfiles.input.IEdgeReconnectionPortCandidateProvider} + */ + ALL_NODE_CANDIDATES?:yfiles.input.IEdgeReconnectionPortCandidateProvider; + /** + * Creates an implementation of the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface that returns a union of + * all {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates source port candidates} or {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates target port candidates}, respectively, of nodse and edges 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. + *

+ * @const + * @static + * @type {yfiles.input.IEdgeReconnectionPortCandidateProvider} + */ + ALL_NODE_AND_EDGE_CANDIDATES?:yfiles.input.IEdgeReconnectionPortCandidateProvider; + $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.graph.ILookup#lookup} of {@link yfiles.graph.IPortOwner} implementations + * such as {@link yfiles.graph.INode}. + *

+ * @interface + */ + export interface IPortSelectionTester extends Object{ + /** + * Returns the port at the given world coordinate position or null if there is no such port. + * @param {yfiles.input.IInputModeContext} context The input mode context to use for querying the position. + * @param {yfiles.geometry.Point} location The coordinates of the position in the world coordinate system. + * @returns {yfiles.graph.IPort} The port at the position or null. + * @abstract + */ + getHitPort(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.graph.IPort; + /** + * Returns the ports for the given marquee rectangle. + * @param {yfiles.input.IInputModeContext} context The input mode context to use for querying the position. + * @param {yfiles.geometry.Rect} rectangle The marquee selection box in the world coordinate system. + * @returns {yfiles.collections.IEnumerable.} An enumerable over the ports inside the marquee selection box. + * @abstract + */ + getPortsInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + } + var IPortSelectionTester:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for implementations that yield insets for a given {@link yfiles.graph.INode}. + *

+ * Implementations of this interface will be queried from an {@link yfiles.graph.INode}'s {@link yfiles.graph.ILookup#lookup} method. The + * default implementation of a graph uses this instance by default to determine the insets of a group node. + *

+ * @interface + */ + export interface INodeInsetsProvider extends Object{ + /** + * Returns the insets for the given node. + * @param {yfiles.graph.INode} node The node to yield insets for. + * @returns {yfiles.geometry.Insets} The insets for the node. + * @abstract + */ + getInsets(node:yfiles.graph.INode):yfiles.geometry.Insets; + } + var INodeInsetsProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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. + *

+ *

+ * This mode is {@link yfiles.input.CreateBendInputMode#exclusive} by default. + *

+ * @class yfiles.input.CreateBendInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface CreateBendInputMode extends Object,yfiles.input.IInputMode{} + export class CreateBendInputMode { + /** + * Creates a new instance that will use the {@link yfiles.graph.IGraph} from the {@link yfiles.input.CreateBendInputMode#inputModeContext} to create bends in. + * @see yfiles.input.CreateBendInputMode#graph + * @constructor + */ + constructor(); + /** + * Called when a bend creation gesture can be started at the current mouse pointer location. + *

+ * This implementation sets the {@link yfiles.input.ConcurrencyController#preferredCursor} to {@link yfiles.input.CreateBendInputMode#armedCursor}. + *

+ * @protected + */ + arm():void; + /** + * Cancels the editing of this mode. + *

+ * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls + * {@link yfiles.input.CreateBendInputMode#onCanceled}. + *

+ * @see yfiles.input.CreateBendInputMode#onCanceled + */ + cancel():void; + /** + * 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.graph.ILookup#lookup}. + *

+ * @param {yfiles.graph.IEdge} edge The hit edge. + * @param {yfiles.geometry.Point} location The coordinates of the hit. + * @returns {yfiles.graph.IBend} The created bend or null. + * @see yfiles.input.CreateBendInputMode#createInputModeContext + * @protected + */ + createBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point):yfiles.graph.IBend; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use with the upcoming {@link yfiles.input.IBendCreator#createBend} call in + * {@link yfiles.input.CreateBendInputMode#createBend}. + * @returns {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + * @protected + */ + createInputModeContext():yfiles.input.IInputModeContext; + /** + * Called when a bend creation gesture can no longer be started at the current mouse pointer location. + *

+ * This implementation sets the {@link yfiles.input.ConcurrencyController#preferredCursor} back to null. + *

+ * @protected + */ + disarm():void; + /** + * 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.Point} dragLocation The location at which the user initiated the gesture. + * @protected + */ + dragSegment(edge:yfiles.graph.IEdge,dragLocation:yfiles.geometry.Point):void; + /** + * Finds the edge at the given coordinate. + * @param {yfiles.geometry.Point} location The coordinates. + * @returns {yfiles.graph.IEdge} The edge that has been hit. + * @protected + */ + getEdge(location:yfiles.geometry.Point):yfiles.graph.IEdge; + /** + * 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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.CreateBendInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Determines whether the current location is valid to begin a bend creation gesture. + * @param {Object} source + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} + * @protected + */ + isValidBegin(source:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Triggers the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event. + * @param {yfiles.graph.BendEventArgs} evt + * @protected + */ + onBendCreated(evt:yfiles.graph.BendEventArgs):void; + /** + * Called after {@link yfiles.input.CreateBendInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Triggers the {@link yfiles.input.CreateBendInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + *

+ * This method triggers the {@link yfiles.input.CreateBendInputMode#addDraggedListener Dragged} event. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragged(evt:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + *

+ * This method triggers the {@link yfiles.input.CreateBendInputMode#addDraggingListener Dragging} event. + *

+ * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragging(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called after {@link yfiles.input.CreateBendInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.CreateBendInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.CreateBendInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.CreateBendInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Adds the given listener for the BendCreated event that occurs once a bend creation gesture has been recognized. + * @param {function(Object, yfiles.graph.BendEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateBendInputMode#removeBendCreatedListener + */ + addBendCreatedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * Removes the given listener for the BendCreated event that occurs once a bend creation gesture has been recognized. + * @param {function(Object, yfiles.graph.BendEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateBendInputMode#addBendCreatedListener + */ + removeBendCreatedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * Gets or sets the cursor to use when this mode is in "armed" state. + * @type {yfiles.view.Cursor} + */ + armedCursor:yfiles.view.Cursor; + /** + * Gets or sets the "pressed" state recognizer. + *

+ * This recognizer instance will be used to determine when the user begins to move the selection. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer. + *

+ * This recognizer instance determines when the user is moving the selection + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer. + *

+ * This instance determines when the user has finished the move. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.TouchEventRecognizers#TOUCH_LONG_PRESSED_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + prepareRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.TouchEventRecognizers#TOUCH_MOVED_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + movedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.TouchEventRecognizers#TOUCH_UP_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the {@link yfiles.input.IHitTestable} that determines where bends may be created. + * @type {yfiles.input.IHitTestable} + */ + beginHitTestable:yfiles.input.IHitTestable; + /** + * Gets the location where the bend creation gesture was initialized. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + /** + * Gets the graph this mode is acting upon. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Adds the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateBendInputMode#removeDraggingListener + */ + addDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateBendInputMode#addDraggingListener + */ + removeDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateBendInputMode#removeDraggedListener + */ + addDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateBendInputMode#addDraggedListener + */ + removeDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateBendInputMode#removeDragCanceledListener + */ + addDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateBendInputMode#addDragCanceledListener + */ + removeDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Gets or sets the event recognizer that determines whether the bend creation should be treated as a split segment + * operation. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + splitOrthogonalSegmentRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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 yfiles.input.CreateBendInputMode#splitOrthogonalSegmentRecognizer + * @type {boolean} + */ + splitOrthogonalSegment:boolean; + /** + * Gets or sets a property that determines whether this mode should use an existing bend in {@link yfiles.input.CreateBendInputMode#createBend} + * if there is one found at the given location. + *

+ * The default is true + *

+ * @default true + * @type {boolean} + */ + useExistingBend:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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}. + *

+ * @class yfiles.input.EditLabelHelper + * @implements {yfiles.input.IEditLabelHelper} + */ + export interface EditLabelHelper extends Object,yfiles.input.IEditLabelHelper{} + export class EditLabelHelper { + /** + * Determines the label model parameter to use for the label, depending on the owner. + *

+ * This method will obtain the default parameter instances from the {@link yfiles.input.EditLabelHelper#graph} considering the type of the current owner. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.graph.ILabelOwner} owner The label's owner. + * @returns {yfiles.graph.ILabelModelParameter} The layout parameter to use or null. + * @protected + */ + getLabelParameter(context:yfiles.input.IInputModeContext,owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; + /** + * Determines the style to use for the label, depending on the owner. + *

+ * This method will obtain the default style instances from the {@link yfiles.input.EditLabelHelper#graph} considering the type of the current owner. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.graph.ILabelOwner} owner The label's owner. + * @returns {yfiles.styles.ILabelStyle} The style to use or null. + * @protected + */ + getLabelStyle(context:yfiles.input.IInputModeContext,owner:yfiles.graph.ILabelOwner):yfiles.styles.ILabelStyle; + /** + * 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} context The input mode context. + * @param {yfiles.graph.ILabel} label The label to get the preferred size from. + * @returns {yfiles.geometry.Size} The size to use or null. + * @protected + */ + getPreferredSize(context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):yfiles.geometry.Size; + /** + * Helper method that will be called for {@link yfiles.graph.ILabelOwner}s. + *

+ * This method delegates to {@link yfiles.input.EditLabelHelper#getLabelParameter}, {@link yfiles.input.EditLabelHelper#getLabelStyle}, and + * {@link yfiles.input.EditLabelHelper#getPreferredSize} to set the appropriate properties on args and sets the {@link yfiles.input.LabelEditingEventArgs#handled} property to + * true. Label creation thus is always possible. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The original event arguments. + */ + onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * Helper method that will be called for {@link yfiles.graph.ILabelOwner}s. + *

+ * This method returns the first of the {@link yfiles.graph.ILabelOwner#labels} that belong to the {@link yfiles.input.LabelEditingEventArgs#owner}, if set. Otherwise, it delegates to + * {@link yfiles.input.EditLabelHelper#getLabelParameter}, {@link yfiles.input.EditLabelHelper#getLabelStyle}, and {@link yfiles.input.EditLabelHelper#getPreferredSize} + * to set the appropriate properties on args. + *

+ *

+ * The arguments are always set as {@link yfiles.input.LabelEditingEventArgs#handled}, so label editing is always possible. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The original event arguments. + */ + onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * 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.graph.ILookup}. + *

+ * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} for interacticely creating edges between nodes and edges in an {@link yfiles.graph.IGraph} displayed + * in a {@link yfiles.view.CanvasComponent} or {@link yfiles.view.GraphComponent}. + *

+ * This class provides a {@link yfiles.input.CreateEdgeInputMode#edgeCreator factory callback} that the final edge creation will be delegated to. The styling of the newly + * created edge can be customized via the {@link yfiles.input.CreateEdgeInputMode#edgeDefaults}. Defaults can be automatically adjusted in response to the various events that + * will be triggered by this instance during the edge creation. Use the {@link yfiles.input.CreateEdgeInputMode#dummyEdgeGraph} property to modify the appearance of the dummy + * edge. This class uses {@link yfiles.input.IPortCandidateProvider} instances found in the {@link yfiles.graph.ILookup} of the {@link yfiles.graph.INode nodes} in + * the graph to display port candidates and to finally create the edges. + *

+ *

+ * This mode is {@link yfiles.input.CreateEdgeInputMode#exclusive} by default. + *

+ * @class yfiles.input.CreateEdgeInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface CreateEdgeInputMode extends Object,yfiles.input.IInputMode{} + export class CreateEdgeInputMode { + /** + * Creates a new instance that will use the {@link yfiles.graph.IGraph} from the {@link yfiles.input.CreateEdgeInputMode#inputModeContext} to create edges in. + *

+ * Setting the {@link yfiles.input.CreateEdgeInputMode#graph} property can be used to optionally set a different graph to work on. + *

+ * @see yfiles.input.CreateEdgeInputMode#graph + * @constructor + */ + constructor(); + /** + * Cancels the editing of this mode. + *

+ * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls + * {@link yfiles.input.CreateEdgeInputMode#onCanceled}. + *

+ * @see yfiles.input.CreateEdgeInputMode#onCanceled + */ + cancel():void; + /** + * Creates the dummy edge that will be displayed by the input mode during the creation. + * @returns {yfiles.graph.IEdge} An {@link yfiles.graph.IEdge} implementation that can be used as a dummy. + * @protected + */ + createDummyEdge():yfiles.graph.IEdge; + /** + * Factory method that will create the dummy graph to hold the preview of the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. + *

+ * Note that the instance returned by this instance must accept any port as valid source and target ports for it's {@link yfiles.graph.IGraph#setEdgePorts} + * method. This will allow the preview edge to be connected to the actual {@link yfiles.input.CreateEdgeInputMode#graph}. + *

+ * @returns {yfiles.graph.IGraph} A graph instance that will be rendered as a preview. + * @protected + */ + createDummyEdgeGraph():yfiles.graph.IGraph; + /** + * 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 first {@link yfiles.input.IPortCandidate#createPort create the new ports} if necessary and then create the edge via the {@link yfiles.input.CreateEdgeInputMode#edgeCreator} callback to the ports. After + * the ports are created the corresponding {@link yfiles.input.CreateEdgeInputMode#addPortAddedListener PortAdded} + * events are triggered. If the edge creation is canceled by the creator callback, newly created ports will be removed + * again. + *

+ * @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. + * @returns {yfiles.graph.IEdge} The edge created or null. + * @protected + */ + createEdge(graph:yfiles.graph.IGraph,sourcePortCandidate:yfiles.input.IPortCandidate,targetPortCandidate:yfiles.input.IPortCandidate):yfiles.graph.IEdge; + /** + * Callback at the end of the edge creation process. + *

+ * This method will actually create the edge using the {@link yfiles.input.CreateEdgeInputMode#createEdge} method. This method will + * ultimately call {@link yfiles.input.CreateEdgeInputMode#onEdgeCreated}. + *

+ * @returns {yfiles.graph.IEdge} The edge created or null. + * @protected + */ + createEdge():yfiles.graph.IEdge; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use with the port candidates queries for the upcoming edge creation + * operation and the actual edge creation + * @returns {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext} that is configured for this mode. + * @protected + */ + createEdgeCreationInputModeContext():yfiles.input.IInputModeContext; + /** + * 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.IInputMode#install installed} and {@link yfiles.input.CreateEdgeInputMode#enabled} and it needs to be able to {@link yfiles.input.ConcurrencyController#canRequestMutex request the input mutex} in order to proceed. If any + * of these conditions are not satisfied, this method will throw an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @param {yfiles.input.IPortCandidate} sourcePortCandidate The source port candidate to use for the edge creation. + */ + doStartEdgeCreation(sourcePortCandidate:yfiles.input.IPortCandidate):void; + /** + * 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.Point} location The location of the mouse in world coordinates. + * @returns {yfiles.input.IPortCandidate} The candidate to use or null if no candidate satisfies the needs + * @protected + */ + getClosestCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):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.Point} location The location of the pointer in world coordinates. + * @returns {yfiles.input.IPortCandidate} The candidate to use or null if no candidate satisfies the needs + * @protected + */ + getClosestSourceCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * 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.Point} location The location of the mouse in world coordinates. + * @returns {yfiles.input.IPortCandidate} The candidate to use or null if no candidate satisfies the needs or {@link yfiles.input.CreateEdgeInputMode#enforceBendCreationRecognizer} yields true. + * @protected + */ + getClosestTargetCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * Gets the snap lines lines that are induced by the current dummy edge. + * @param {yfiles.input.GraphSnapContext} context The graph snap context. + * @param {yfiles.input.ISnapLineProvider} provider The dummy edge segment snap line provider. + * @returns {yfiles.collections.IEnumerable.} The snap lines induced by the current dummy edge. + * @protected + */ + getDummyEdgeSnapLines(context:yfiles.input.GraphSnapContext,provider: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. + *

+ * @returns {yfiles.input.EdgeSegmentDirection} A {@link yfiles.input.EdgeSegmentDirection} defining the direction of the first edge segment. + * @protected + */ + getFirstSegmentDirection():yfiles.input.EdgeSegmentDirection; + /** + * Retrieves the port owner at a given position in world coordinates. + *

+ * If there is a {@link yfiles.input.IHitTester.} for type {@link yfiles.graph.INode} in the lookup of this mode's {@link yfiles.input.CreateEdgeInputMode#inputModeContext} then this instance will be used for the query. + * + *
+ * Otherwise this implementation calls the {@link yfiles.styles.INodeStyleRenderer#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.Point} location The position in world coordinates. + * @returns {yfiles.graph.IPortOwner} The node or null if no suitable node was found. + * @protected + */ + getPortOwner(location:yfiles.geometry.Point):yfiles.graph.IPortOwner; + /** + * Retrieves the port owners from the graph in the order of their importance. + *

+ * This implementation only considers nodes in the graph unless {@link yfiles.input.CreateEdgeInputMode#allowEdgeToEdgeConnections} is set to + * true, in which case edges are also added to the enumerable. + *

+ * @returns {yfiles.collections.IEnumerable.} An enumerable over all {@link yfiles.graph.IPortOwner}s in this graph + * @protected + */ + getPortOwners():yfiles.collections.IEnumerable; + /** + * 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#allowEdgeToEdgeConnections} is set to false. + *
+ * This default implementation simply delegates to {@link yfiles.input.CreateEdgeInputMode#getPortOwner}. + *

+ * @param {yfiles.geometry.Point} sourceLocation The location of the mouse at the beginning of the gesture. + * @returns {yfiles.graph.IPortOwner} The port owner to use for the source node or null. + * @protected + */ + getSource(sourceLocation:yfiles.geometry.Point):yfiles.graph.IPortOwner; + /** + * 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.Point} 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. + * @returns {yfiles.input.IPortCandidate} The candidate to use or null. + * @see yfiles.input.CreateEdgeInputMode#resolveSourcePortCandidates + * @see yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer + * @protected + */ + getSourcePortCandidate(provider:yfiles.input.IPortCandidateProvider,location:yfiles.geometry.Point,resolveCandidates:boolean):yfiles.input.IPortCandidate; + /** + * Finds the best matching source {@link yfiles.input.IPortCandidate port candidate} based on the given location. + *

+ * This implementation will use the {@link yfiles.input.CreateEdgeInputMode#getSource port owner} to look up the {@link yfiles.input.IPortCandidateProvider port candidate provider} and finally delegate to + * {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidate}. + *

+ * @param {yfiles.geometry.Point} location The location where the gesture was initiated. + * @returns {yfiles.input.IPortCandidate} + * @see yfiles.input.CreateEdgeInputMode#getSource + * @see yfiles.input.CreateEdgeInputMode#getSourcePortCandidateProvider + * @see yfiles.input.CreateEdgeInputMode#getSourcePortCandidate + * @protected + */ + getSourcePortCandidate(location:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * Retrieves the port candidate provider instance given a source port owner. + *

+ * This implementations uses the sourceOwner's {@link yfiles.graph.ILookup#lookup} to retrieve an {@link yfiles.input.IPortCandidateProvider} + * implementation. + *

+ * @param {yfiles.graph.IPortOwner} sourceOwner The {@link yfiles.graph.IPortOwner} to find the candidates for. + * @returns {yfiles.input.IPortCandidateProvider} A provider instance or null. + * @protected + */ + getSourcePortCandidateProvider(sourceOwner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; + /** + * Finds the target {@link yfiles.graph.IPortOwner port owner} at the specified location. + *

+ * This always is a target {@link yfiles.graph.INode node} if {@link yfiles.input.CreateEdgeInputMode#allowEdgeToEdgeConnections} is set to false. + *
+ * This default implementation simply delegates to {@link yfiles.input.CreateEdgeInputMode#getPortOwner}. + *

+ * @param {yfiles.geometry.Point} targetLocation The location of the pointer at the beginning of the gesture. + * @returns {yfiles.graph.IPortOwner} The port owner or null. + * @protected + */ + getTarget(targetLocation:yfiles.geometry.Point):yfiles.graph.IPortOwner; + /** + * Retrieves the port candidate provider instance given a source port candidate and a possible target item. + *

+ * This implementations uses the targetOwner's {@link yfiles.graph.ILookup#lookup} to retrieve an {@link yfiles.input.IPortCandidateProvider} + * implementation. + *

+ * @param {yfiles.input.IPortCandidate} sourcePortCandidate The current source port candidate. + * @param {yfiles.graph.IPortOwner} targetOwner The {@link yfiles.graph.IPortOwner} to find the candidates for. + * @param {yfiles.geometry.Point} location The location of the mouse. + * @returns {yfiles.input.IPortCandidateProvider} A provider instance or null. + * @protected + */ + getTargetPortCandidateProvider(sourcePortCandidate:yfiles.input.IPortCandidate,targetOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.input.IPortCandidateProvider; + /** + * 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#useHitItemsCandidatesOnly} is set to true in + * which case the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider} is queried using the current {@link yfiles.input.CreateEdgeInputMode#getTarget target}. + *

+ * @param {yfiles.input.IPortCandidate} sourcePortCandidate The source candidate that has been chosen for the edge creation. + * @param {yfiles.geometry.Point} location The location of the mouse. + * @returns {yfiles.input.IPortCandidateProvider} The provider to get the port candidates from. + * @protected + */ + getTargetPortCandidateProvider(sourcePortCandidate:yfiles.input.IPortCandidate,location:yfiles.geometry.Point):yfiles.input.IPortCandidateProvider; + /** + * 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 location + * or simply be discarded. This implementation delegates to {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider} + * or returns an empty enumerable if no provider has been found. + *

+ * @param {yfiles.geometry.Point} location The location of the mouse in world coordinates. + * @param {boolean} resolveCandidates Determines whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports should be resolved with respect to the location or + * not. + * @returns {yfiles.collections.IEnumerable.} A possibly empty enumeration over all target port candidates. + * @see yfiles.input.CreateEdgeInputMode#sourcePortCandidate + * @see yfiles.input.CreateEdgeInputMode#resolveTargetPortCandidates + * @see yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer + * @protected + */ + getTargetPortCandidates(location:yfiles.geometry.Point,resolveCandidates:boolean):yfiles.collections.IEnumerable; + /** + * 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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.CreateEdgeInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called after {@link yfiles.input.CreateEdgeInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController} property of the installed {@link yfiles.input.ConcurrencyController} has + * been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * 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.graph.EdgeEventArgs} evt The event argument holding the edge. + * @protected + */ + onEdgeCreated(evt:yfiles.graph.EdgeEventArgs):void; + /** + * Raises the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreationStartedListener EdgeCreationStarted} event when + * the gesture for creating an edge has been initialized. + * @param {yfiles.graph.EdgeEventArgs} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the dummy edge that will be used during edge creation. + * @protected + */ + onEdgeCreationStarted(evt:yfiles.graph.EdgeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureCanceledListener GestureCanceled} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onGestureCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureCancelingListener GestureCanceling} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onGestureCanceling(evt: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} evt The event argument that contains context information. + * @protected + */ + onGestureFinished(evt: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} evt The event argument that contains context information. + * @protected + */ + onGestureFinishing(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureStartedListener GestureStarted} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onGestureStarted(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureStartingListener GestureStarting} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onGestureStarting(evt: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} evt The event argument that contains context information. + * @protected + */ + onMoved(evt: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} evt The event argument that contains context information. + * @protected + */ + onMoving(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.CreateEdgeInputMode#addPortAddedListener PortAdded} event if the mode has + * {@link yfiles.graph.IGraph#addPort added a port} for the source or target node to complete the edge creation. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the port that has been added. + * @see yfiles.input.CreateEdgeInputMode#addPortAddedListener + * @protected + */ + onPortAdded(evt:yfiles.collections.ItemEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addSourcePortCandidateChangedListener SourcePortCandidateChanged} + * event. + * @param {yfiles.collections.ItemEventArgs.} evt The event argument that contains context information. + * @protected + */ + onSourcePortCandidateChanged(evt:yfiles.collections.ItemEventArgs):void; + /** + * Called after {@link yfiles.input.CreateEdgeInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addTargetPortCandidateChangedListener TargetPortCandidateChanged} + * event. + * @param {yfiles.collections.ItemEventArgs.} evt The event argument that contains context information. + * @protected + */ + onTargetPortCandidateChanged(evt:yfiles.collections.ItemEventArgs):void; + /** + * 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.Point} location The location to resolve dynamic candidates against or null if they should be discarded instead. + * @returns {yfiles.collections.IEnumerable.} An enumerable of non-{@link yfiles.input.PortCandidateValidity#DYNAMIC} port candidates. + * @protected + */ + resolveCandidates(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.Point):yfiles.collections.IEnumerable; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Updates the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} to reflect the current source port candidate. + *

+ * This implementation creates a self loop of the dummy edge if the sourcePortCandidate is the same as the owner of the {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate}. + *

+ * @param {yfiles.input.IPortCandidate} sourcePortCandidate The new owner target port candidate. + * @protected + */ + updateDummyEdgeSourcePort(sourcePortCandidate:yfiles.input.IPortCandidate):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 targetPortCandidate is the same as the owner of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate}. + *

+ * @param {yfiles.input.IPortCandidate} targetPortCandidate The new owner target port candidate. + * @protected + */ + updateDummyEdgeTargetPort(targetPortCandidate:yfiles.input.IPortCandidate):void; + /** + * Updates the drag point. + *

+ * This method is called when the current target location for the creation gesture is changed. + *

+ * @param {yfiles.geometry.Point} location The new coordinates. + * @protected + */ + updateTargetLocation(location:yfiles.geometry.Point):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.CreateEdgeInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.CreateEdgeInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.CreateEdgeInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * Sets the cursor that indicates a valid place to begin an edge creation. + * @type {yfiles.view.Cursor} + */ + validBeginCursor:yfiles.view.Cursor; + /** + * Sets the cursor that indicates a valid place to create a bend. + * @type {yfiles.view.Cursor} + */ + validBendCursor:yfiles.view.Cursor; + /** + * Sets the cursor that indicates a valid place to finish creation. + * @type {yfiles.view.Cursor} + */ + validEndCursor:yfiles.view.Cursor; + /** + * Gets or sets event recognizer that temporarily disables snapping. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + disableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets event recognizer that reenables temporarily disabled snapping. + * @see yfiles.input.CreateEdgeInputMode#disableSnappingRecognizer + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + enableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that toggles the orientation of the first orthogonally created segment. + * @see yfiles.input.CreateEdgeInputMode#orthogonalEdgeCreation + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + toggleSegmentOrientationRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.MouseEventRecognizers#LEFT_PRESSED} and + * {@link yfiles.input.MouseEventRecognizers#LEFT_RELEASED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + finishRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.MouseEventRecognizers#LEFT_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + prepareRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.MouseEventRecognizers#DRAGGED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * The event recognizer that recognizes the movement of the end point of the edge. + *

+ * The default is {@link yfiles.input.MouseEventRecognizers#MOVED_OR_DRAGGED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + endPointMovedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * The event recognizer that recognizes the creation of a bend. + *

+ * The default is {@link yfiles.input.MouseEventRecognizers#LEFT_RELEASED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + createBendRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the property that determines cancel events. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the property that determines bend removal events. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + removeBendRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the event recognizer that determines whether dynamic port candidates should be resolved. + *

+ * By default this is {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + portCandidateResolutionRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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 {@link yfiles.input.TouchEventRecognizers#TOUCH_UP_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + finishRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.TouchEventRecognizers#TOUCH_LONG_PRESSED_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + prepareRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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.TouchEventRecognizers#TOUCH_MOVED_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * The event recognizer that recognizes the creation of a bend via touch. + *

+ * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_UP_PRIMARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + createBendRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the property that determines cancel events via touch. + *

+ * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_MULTI_TAPPED_SECONDARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the property that determines bend removal events via touch. + *

+ * The default is {@link yfiles.input.TouchEventRecognizers#TOUCH_LONG_PRESSED_SECONDARY}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + removeBendRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Determines whether or not to display possible port candidates during the creation of the edge. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + showPortCandidates:boolean; + /** + * Determines whether or not edges are allowed to connect to other edges. + *

+ * The default is false. + *

+ * @default false + * @type {boolean} + */ + allowEdgeToEdgeConnections: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. + *

+ * @default 20.0 + * @type {number} + */ + snapDistance:number; + /** + * The {@link yfiles.input.CreateEdgeInputMode#snapContext} which manages snapping model items to certain coordinates (for instance, 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. + *

+ * @type {yfiles.input.SnapContext} + */ + snapContext:yfiles.input.SnapContext; + /** + * Gets or sets the {@link yfiles.view.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.view.IVisualCreator} to obtain the visualizations for the candidates that are + * not currently closest. By default an instance of {@link yfiles.view.DefaultPortCandidateDescriptor} is used. + *

+ * @see yfiles.input.CreateEdgeInputMode#closestCandidateDescriptor + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + candidateDescriptor:yfiles.view.ICanvasObjectDescriptor; + /** + * Gets or sets the {@link yfiles.view.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.view.IVisualCreator} to obtain the visualization for the currently closest + * candidate. By default an instance of {@link yfiles.view.DefaultPortCandidateDescriptor} is used. + *

+ * @see yfiles.input.CreateEdgeInputMode#candidateDescriptor + * @type {yfiles.view.ICanvasObjectDescriptor} + */ + closestCandidateDescriptor:yfiles.view.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. + *

+ * @default 5.0 + * @type {number} + */ + orthogonalSnapDistance:number; + /** + * 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#getTarget target}, this property will cause + * the mouse to snap to the nearest valid candidate. The default is true. + *

+ * @default true + * @type {boolean} + */ + 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 yfiles.input.CreateEdgeInputMode#showPortCandidates + * @see yfiles.input.CreateEdgeInputMode#getTarget + * @see yfiles.input.CreateEdgeInputMode#getTargetPortCandidates + * @default true + * @type {boolean} + */ + useHitItemsCandidatesOnly:boolean; + /** + * Gets or sets the the policy that controls whether edges will be create orthogonally. + *

+ * By default orthogonal edge creation is enabled if orthogonal edge editing is enabled on the {@link yfiles.input.GraphEditorInputMode parent input mode}. + *

+ * @see yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext + * @see yfiles.input.OrthogonalEdgeEditingContext#enabled + * @default 0 + * @type {yfiles.input.OrthogonalEdgeEditingPolicy} + */ + orthogonalEdgeCreation:yfiles.input.OrthogonalEdgeEditingPolicy; + /** + * 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. + *

+ * @default 10.0 + * @type {number} + */ + 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 yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer + * @see yfiles.input.CreateEdgeInputMode#resolveCandidates + * @default true + * @type {boolean} + */ + 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 yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer + * @see yfiles.input.CreateEdgeInputMode#resolveCandidates + * @default true + * @type {boolean} + */ + resolveTargetPortCandidates: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 inside a given margin is always pointing away from it. + *

+ * @default 0.1 + * @type {number} + */ + nodeBorderWidthRatio:number; + /** + * Gets or sets the ports based edge creation callback. + *

+ * The default creator will delegate to {@link yfiles.graph.IGraph#createEdge} and obtain the tag from the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. It will then copy over + * all bends, labels, and ports from the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} If the argument is null + * @type {function(yfiles.input.IInputModeContext, yfiles.graph.IGraph, yfiles.input.IPortCandidate, yfiles.input.IPortCandidate, yfiles.graph.IEdge): yfiles.graph.IEdge} + */ + edgeCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,sourcePortCandidate:yfiles.input.IPortCandidate,targetPortCandidate:yfiles.input.IPortCandidate,templateEdge:yfiles.graph.IEdge)=>yfiles.graph.IEdge; + /** + * 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}. + *

+ * @default true + * @type {boolean} + */ + allowSelfloops:boolean; + /** + * Determines whether an edge creation gesture will be canceled when the gesture is ended on an invalid target and no bend + * may be created there. + *

+ * If bend creation is allowed at the target location (i.e. {@link yfiles.input.CreateEdgeInputMode#validBendHitTestable} returns true), the gesture will always continue by creating a + * bend. Otherwise, if this property is true, the gesture will be canceled automatically. + *

+ *

+ * The default is false, meaning that the gesture must always be canceled explicitely. + *

+ * @see yfiles.input.CreateEdgeInputMode#allowCreateBend + * @see yfiles.input.CreateEdgeInputMode#validBendHitTestable + * @type {boolean} + */ + cancelGestureOnInvalidTarget:boolean; + /** + * Determines whether or not to allow the creation of bends. + *

+ * The default is true. + *

+ * @type {boolean} + */ + allowCreateBend:boolean; + /** + * Gets 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. If this property is unset initially, factory + * method {@link yfiles.input.CreateEdgeInputMode#createDummyEdge} will be called. + *

+ * @type {yfiles.graph.IEdge} + */ + dummyEdge:yfiles.graph.IEdge; + /** + * Gets the dummy graph instance that will hold the items that will render a preview of the newly created edge. + *

+ * The dummy edge graph can be used to change the appearance and other properties of the dummy edge, either when starting a + * gesture or during it in response to certain events. Possible actions are: + *

+ *
    + *
  • Changing the style of the dummy edge.
  • + *
  • Adding bends to the dummy edge.
  • + *
  • Adding labels to the dummy edge.
  • + *
  • Changing style and other properties of the added labels.
  • + *
+ *

+ * All changes made to the dummy edge during the gesture will be persisted to the created edge in the original graph. This + * behavior can be changed by setting a custom {@link yfiles.input.CreateEdgeInputMode#edgeCreator}. + *

+ *

+ * The dummy edge graph only allows operations on the dummy edge. + *

+ *

+ * If the property is not set initially, method {@link yfiles.input.CreateEdgeInputMode#createDummyEdgeGraph} will be used as the + * factory method. + *

+ * @see yfiles.input.CreateEdgeInputMode#dummyEdge + * @type {yfiles.graph.IGraph} + */ + dummyEdgeGraph:yfiles.graph.IGraph; + /** + * Convenience property for customizing the appearance of newly created edges. + *

+ * This property directly delegates to the {@link yfiles.graph.IGraph#edgeDefaults} of the {@link yfiles.input.CreateEdgeInputMode#dummyEdgeGraph}. + *

+ * @type {yfiles.graph.IEdgeDefaults} + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Gets or sets the candidate for the {@link yfiles.graph.IEdge#sourcePort} of the edge to be created. + *

+ * This property will be populated automatically when edge creation has started. + *

+ * @type {yfiles.input.IPortCandidate} + */ + sourcePortCandidate:yfiles.input.IPortCandidate; + /** + * Gets or sets the current candidate for the {@link yfiles.graph.IEdge#targetPort} of the edge to be created. + * @type {yfiles.input.IPortCandidate} + */ + targetPortCandidate:yfiles.input.IPortCandidate; + /** + * Adds the given listener for the SourcePortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} property changes. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeSourcePortCandidateChangedListener + */ + addSourcePortCandidateChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the SourcePortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} property + * changes. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addSourcePortCandidateChangedListener + */ + removeSourcePortCandidateChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the TargetPortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} property changes. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeTargetPortCandidateChangedListener + */ + addTargetPortCandidateChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the TargetPortCandidateChanged event that occurs when the value of the {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} property + * changes. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addTargetPortCandidateChangedListener + */ + removeTargetPortCandidateChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Gets or sets whether after calls to {@link yfiles.input.CreateEdgeInputMode#createEdge} the current undo edit should be canceled + * if the method 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#edgeCreator} callback, 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. + *

+ * @default true + * @type {boolean} + */ + cancelEditImplicitly:boolean; + /** + * Adds the given listener for the EdgeCreated event that occurs after an edge has been created by this mode. + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#onEdgeCreated + * @see yfiles.input.CreateEdgeInputMode#removeEdgeCreatedListener + */ + addEdgeCreatedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeCreated event that occurs after an edge has been created by this mode. + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#onEdgeCreated + * @see yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener + */ + removeEdgeCreatedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Adds the given listener for the PortAdded event that occurs when this instance {@link yfiles.graph.IGraph#addPort adds a port} to the source or target node + * during completion of the edge creation gesture. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removePortAddedListener + */ + addPortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the PortAdded event that occurs when this instance {@link yfiles.graph.IGraph#addPort adds a port} to the source or target + * node during completion of the edge creation gesture. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addPortAddedListener + */ + removePortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * 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. This will result in the preview + * edge looking exactly like the edge after creation. + *

+ * @type {boolean} + */ + snapToTargetCandidate:boolean; + /** + * Gets or sets a {@link yfiles.input.IHitTestable} that determines, whether it is valid to start an edge creation gesture here. + *

+ * The default implementation returns true if {@link yfiles.input.CreateEdgeInputMode#getSource} yields a non-null value. + *

+ * @type {yfiles.input.IHitTestable} + */ + beginHitTestable:yfiles.input.IHitTestable; + /** + * Gets or sets a {@link yfiles.input.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. + *

+ * @type {yfiles.input.IHitTestable} + */ + endHitTestable:yfiles.input.IHitTestable; + /** + * Gets or sets a {@link yfiles.input.IHitTestable} that determines, whether it is valid to create a bend here. + *

+ * The default implementation returns always true. + *

+ * @type {yfiles.input.IHitTestable} + */ + validBendHitTestable:yfiles.input.IHitTestable; + /** + * Gets a copy of the starting point at which the edge creation gesture started. + * @type {yfiles.geometry.Point} + */ + startPoint:yfiles.geometry.Point; + /** + * Gets the dynamically updated dragging point for the edge creation. + * @type {yfiles.geometry.IPoint} + */ + dragPoint:yfiles.geometry.IPoint; + /** + * 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#cancel cancelled} or finalized. + *

+ * @type {boolean} + */ + isCreationInProgress:boolean; + /** + * Adds the given listener for the GestureFinishing event that occurs before the gesture will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeGestureFinishingListener + */ + addGestureFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the GestureFinishing event that occurs before the gesture will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addGestureFinishingListener + */ + removeGestureFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the GestureFinished event that occurs once the gesture has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeGestureFinishedListener + */ + addGestureFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the GestureFinished event that occurs once the gesture has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addGestureFinishedListener + */ + removeGestureFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the GestureStarting event that occurs once the gesture is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeGestureStartingListener + */ + addGestureStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the GestureStarting event that occurs once the gesture is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addGestureStartingListener + */ + removeGestureStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the GestureStarted event that occurs once the gesture is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeGestureStartedListener + */ + addGestureStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the GestureStarted event that occurs once the gesture is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addGestureStartedListener + */ + removeGestureStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Moving event that occurs at the start of every drag or move. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeMovingListener + */ + addMovingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Moving event that occurs at the start of every drag or move. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addMovingListener + */ + removeMovingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Moved event that occurs at the end of every drag or move. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeMovedListener + */ + addMovedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Moved event that occurs at the end of every drag or move. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addMovedListener + */ + removeMovedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the GestureCanceled event that occurs when the gesture has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeGestureCanceledListener + */ + addGestureCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the GestureCanceled event that occurs when the gesture has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addGestureCanceledListener + */ + removeGestureCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the GestureCanceling event that occurs before the gesture will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeGestureCancelingListener + */ + addGestureCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the GestureCanceling event that occurs before the gesture will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addGestureCancelingListener + */ + removeGestureCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the EdgeCreationStarted event that occurs when the edge creation has started. + *

+ * The edge that is stored in the {@link yfiles.collections.ItemEventArgs.#item} property is the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} that is used during creation. + *

+ * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to add. + * @see yfiles.input.CreateEdgeInputMode#removeEdgeCreationStartedListener + */ + addEdgeCreationStartedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeCreationStarted event that occurs when the edge creation has started. + *

+ * The edge that is stored in the {@link yfiles.collections.ItemEventArgs.#item} property is the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} that is used during creation. + *

+ * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to remove. + * @see yfiles.input.CreateEdgeInputMode#addEdgeCreationStartedListener + */ + removeEdgeCreationStartedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Gets or sets the event recognizer that will be queried to decide if bend creation is enforced. + *

+ * The default is {@link yfiles.input.KeyEventRecognizers#CONTROL_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + enforceBendCreationRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the Graph this mode is acting upon. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + 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 + } + export enum AdjustContentRectPolicy{ + /** + * The content rectangle is not adjusted automatically after interactive changes. + */ + NEVER, + /** + * The new content rectangle is recalculated with the union of the previous content rectangle and the new + * {@link yfiles.view.GraphComponent#fitGraphBounds bounds of the graph}. + */ + UNION, + /** + * The new content rectangle is recalculated with the new {@link yfiles.view.GraphComponent#fitGraphBounds bounds of the graph}. + */ + ALWAYS + } + /** + * A complex {@link yfiles.input.IInputMode} that can be used in a {@link yfiles.input.GraphEditorInputMode#graphComponent} 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: + *

+ *
    + *
  • {@link yfiles.input.GraphInputMode#selectableItems} � Determines the types of items that can be selected at all.
  • + *
  • {@link yfiles.input.GraphInputMode#selectablePredicate} � Allows to further constrain {@link yfiles.input.GraphInputMode#selectableItems} with a predicate.
  • + *
  • {@link yfiles.input.GraphInputMode#marqueeSelectableItems} � Determines the types of items that can be selected with {@link yfiles.input.MarqueeSelectionInputMode marquee selection}.
  • + *
  • {@link yfiles.input.GraphInputMode#clickSelectableItems} � Determines the types of items that can be selected by {@link yfiles.input.ClickInputMode clicking them}.
  • + *
  • + * {@link yfiles.input.GraphInputMode#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.GraphInputMode#clickHitTestOrder}. + *
  • + *
  • {@link yfiles.input.GraphInputMode#clickHitTestOrder} � Determines the priorities for hit tests during mouse clicks to determine which items should get {@link yfiles.input.GraphInputMode#addItemClickedListener click events}.
  • + *
  • {@link yfiles.input.GraphInputMode#doubleClickHitTestOrder} � Determines the priorities for hit tests when {@link yfiles.input.GraphInputMode#addItemDoubleClickedListener double-clicking items}.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#movableItems} � Determines the type of the items that can be {@link yfiles.input.GraphEditorInputMode#moveInputMode 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.GraphEditorInputMode#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#deletablePredicate} � Allows to further constrain {@link yfiles.input.GraphEditorInputMode#deletableItems} with a predicate.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#labelEditableItems} � Determines the type of the items that can have their labels edited.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} � Determines whether this input mode should allow grouping operations at all.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowGroupSelection} � Determines whether this input mode should allow {@link yfiles.input.GraphEditorInputMode#groupSelection grouping the current selection}.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowUngroupSelection} � Determines whether this input mode should allow {@link yfiles.input.GraphEditorInputMode#ungroupSelection ungrouping the current selection}.
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#allowClearSelection} � Determines whether this input mode should allow {@link yfiles.input.GraphInputMode#clearSelection clearing the selection}. This has implications both for the {@link yfiles.input.ICommand#DESELECT_ALL} + * and for click/marquee selection which usually clear the selection unless the {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} is pressed. + *
  • + *
  • {@link yfiles.input.GraphInputMode#allowClipboardOperations} � Determines whether this input mode should enable {@link yfiles.graph.GraphClipboard graph clipboard operations.}
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowDuplicate} � Determines whether this input mode should enable {@link yfiles.graph.GraphClipboard graph clipboard's} {@link yfiles.graph.GraphClipboard#duplicate} operation.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowEditLabel} � Determines whether this input mode should allow editing labels.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowReparentNodes} � Determines whether this input mode should allow {@link yfiles.input.IReparentNodeHandler reparenting nodes to other groups.}
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowCreateNode} � Determines whether this input mode should allow {@link yfiles.input.GraphEditorInputMode#nodeCreator creating new nodes} via simple mouse clicks.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowCreateEdge} � Determines whether {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} should be {@link yfiles.input.CreateEdgeInputMode#enabled} to allow for creating new edges.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowEditLabelOnDoubleClick} � Determines whether labels should be editable on otherwise unhandled double clicks.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowReverseEdge} � Determines whether edges can be reversed.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#allowCreateBend} � Determines whether the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} should be {@link yfiles.input.CreateBendInputMode#enabled} to allow for creating new bends.
  • + *
  • {@link yfiles.input.NavigationInputMode#allowEnterGroup} � Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#enterGroup entering} group nodes in {@link yfiles.graph.IFoldingView}s.
  • + *
  • {@link yfiles.input.NavigationInputMode#allowExitGroup} � Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#exitGroup exiting} the current group node in {@link yfiles.graph.IFoldingView}s.
  • + *
  • {@link yfiles.input.NavigationInputMode#allowCollapseGroup} � Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#collapseGroup collapsing} group nodes in {@link yfiles.graph.IFoldingView}s.
  • + *
  • {@link yfiles.input.NavigationInputMode#allowExpandGroup} � Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#expandGroup expanding} group nodes in {@link yfiles.graph.IFoldingView}s.
  • + *
  • + * {@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.ItemHoverInputMode}. + *
  • + *
  • {@link yfiles.input.GraphInputMode#shouldInstallCommand} � Determines which of the built-in {@link yfiles.input.ICommand}s this input mode should provide and install.
  • + *
+ *

+ * By default, {@link yfiles.input.GraphEditorInputMode} supports the following commands. Most of them have default keybindings: + *

+ *
    + *
  • {@link yfiles.input.ICommand#UNDO} (Ctrl+Z) � Undoes the last operation. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowUndoOperations}.
  • + *
  • {@link yfiles.input.ICommand#REDO} (Ctrl+Y) � Redoes the last operation that was undone. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowUndoOperations}.
  • + *
  • {@link yfiles.input.ICommand#SELECT_ALL} (Ctrl+A) � Selects all items. Can be configured with {@link yfiles.input.GraphInputMode#selectableItems} and {@link yfiles.input.GraphInputMode#selectablePredicate}.
  • + *
  • {@link yfiles.input.ICommand#DESELECT_ALL} (Ctrl+Shift+A) � Clears the current selection. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowClearSelection}.
  • + *
  • {@link yfiles.input.ICommand#CUT} (Ctrl+X, Shift+Del) � Cuts the current selection and places it in the clipboard. Can be disabled with {@link yfiles.input.GraphInputMode#allowClipboardOperations}.
  • + *
  • {@link yfiles.input.ICommand#COPY} (Ctrl+C, Ctrl+Ins) � Copies the current selection to the clipboard. Can be disabled with {@link yfiles.input.GraphInputMode#allowClipboardOperations}.
  • + *
  • {@link yfiles.input.ICommand#PASTE} (Ctrl+V, Shift+Ins) � Pastes the current clipboard contents into the graph. Can be disabled with {@link yfiles.input.GraphInputMode#allowClipboardOperations}.
  • + *
  • {@link yfiles.input.ICommand#DUPLICATE} (Ctrl+D) � Duplicates the current selection. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowDuplicate}.
  • + *
  • {@link yfiles.input.ICommand#DELETE} (Del) � Deletes the current selection. Can be configured with {@link yfiles.input.GraphEditorInputMode#deletablePredicate} and {@link yfiles.input.GraphEditorInputMode#deletableItems}.
  • + *
  • {@link yfiles.input.ICommand#ADD_LABEL} (Shift+F2) � Adds a new label to the selected item. Can be configured with {@link yfiles.input.GraphEditorInputMode#labelEditableItems} and disabled with {@link yfiles.input.GraphEditorInputMode#allowAddLabel}.
  • + *
  • {@link yfiles.input.ICommand#EDIT_LABEL} (F2) � Edits an existing label or adds a new one to the selected item. Can be configured with {@link yfiles.input.GraphEditorInputMode#labelEditableItems} and disabled with {@link yfiles.input.GraphEditorInputMode#allowEditLabel}.
  • + *
  • {@link yfiles.input.ICommand#REVERSE_EDGE} (Ctrl+R) � Reverses the direction of the selected edges. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowReverseEdge}.
  • + *
  • {@link yfiles.input.ICommand#GROUP_SELECTION} (Ctrl+G) � Creates a new group node and places the currently selected nodes into it. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} and {@link yfiles.input.GraphEditorInputMode#allowGroupSelection}.
  • + *
  • {@link yfiles.input.ICommand#UNGROUP_SELECTION} (Ctrl+U) � Creates a new group node and places the currently selected nodes into it. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} and {@link yfiles.input.GraphEditorInputMode#allowUngroupSelection}.
  • + *
  • {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE} (Ctrl+Shift+G) � Adjusts the sizes of the selected group nodes to fit exactly around their contents. Can be disabled with {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} and {@link yfiles.input.GraphEditorInputMode#allowAdjustGroupNodeSize}.
  • + *
+ *

+ * All commands can also be selectively disabled by using the {@link yfiles.input.GraphInputMode#availableCommands} collection. Furthermore, there are a few commands provided + * by {@link yfiles.input.GraphInputMode#navigationInputMode}: + *

+ *
    + *
  • {@link yfiles.input.ICommand#COLLAPSE_GROUP} (Ctrl+Minus) � Collapses the currently selected group nodes. Can be disabled with {@link yfiles.input.NavigationInputMode#allowCollapseGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}.
  • + *
  • {@link yfiles.input.ICommand#EXPAND_GROUP} (Ctrl+Plus) � Expands the currently selected group nodes. Can be disabled with {@link yfiles.input.NavigationInputMode#allowExpandGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}.
  • + *
  • + * {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE} (Ctrl+Multiply) � Collapses expanded group nodes and expands collapsed group nodes in the current selection. Can be disabled with {@link yfiles.input.NavigationInputMode#allowCollapseGroup} and {@link yfiles.input.NavigationInputMode#allowExpandGroup} of + * {@link yfiles.input.GraphInputMode#navigationInputMode}. + *
  • + *
  • {@link yfiles.input.ICommand#ENTER_GROUP} (Ctrl+Enter) � Replaces the currently displayed graph with the contents of the selected group node. Can be disabled with {@link yfiles.input.NavigationInputMode#allowEnterGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}.
  • + *
  • + * {@link yfiles.input.ICommand#EXIT_GROUP} (Ctrl+Backspace) � Replaces the currently displayed graph with the contents of the parent of the group node whose contents are currently + * displayed. Can be disabled with {@link yfiles.input.NavigationInputMode#allowExitGroup} of {@link yfiles.input.GraphInputMode#navigationInputMode}. + *
  • + *
+ *

+ * {@link yfiles.input.GraphEditorInputMode} can be configured to automatically {@link yfiles.input.GraphEditorInputMode#adjustContentRect adjust the content rectangle} of the {@link yfiles.input.GraphEditorInputMode#graphComponent} 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 disabled, to change the behavior, too. + *

+ *

+ * This input mode manages a set of specialized input modes, each handling a specific part of the interaction with the + * graph. The following list details those along with their default + * {@link yfiles.input.IInputMode#priority priorities}. Lower priorities come earlier when handling events. + *

+ *
    + *
  • {@link yfiles.input.WaitInputMode} (-1) � Disables this input mode when layouts or animations run.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#handleInputMode} (0) � Deals with displaying handles on or around items and interacting with them.
  • + *
  • {@link yfiles.input.KeyboardInputMode} (0) � Handles commands and arbitrary keyboard shortcuts.
  • + *
  • {@link yfiles.input.ClickInputMode} (10) � Handles mouse clicks and double-clicks.
  • + *
  • {@link yfiles.input.TapInputMode} (20) � Handles taps and double-tap.
  • + *
  • {@link yfiles.input.MoveViewportInputMode} (39) � Allows panning the viewport.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} (39) � Allows moving labels to new positions.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#moveInputMode} (40) � Allows moving items that are not labels.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#createBendInputMode} (42) � Allows creating bends on edges.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} (45) � Allows creating edges
  • + *
  • {@link yfiles.input.MarqueeSelectionInputMode} (50) � Allows dragging a rectangle to select items within it.
  • + *
  • {@link yfiles.input.ItemHoverInputMode} (55) � Provides events to indicate that the mouse pointer hovers over an item.
  • + *
  • + * {@link yfiles.input.NavigationInputMode} (55) � Provides general navigation facilities, such as navigating from one item to another with the arrow keys, collapsing, + * expanding, entering or exiting groups, as well as providing commands for those tasks. + *
  • + *
  • {@link yfiles.input.ContextMenuInputMode} (60) � Handles querying the context menu contents based on a location as well as preparing the menu for display.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} (70) � Allows dropping nodes on the {@link yfiles.input.GraphEditorInputMode#graphComponent}, e.g. for dragging items from a palette.
  • + *
  • {@link yfiles.input.MouseHoverInputMode} (100) � Handles tool tips.
  • + *
  • {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} (100) � Handles editing labels.
  • + *
+ *

+ * To enable single selection mode, disable {@link yfiles.input.MarqueeSelectionInputMode} and set {@link yfiles.input.GraphInputMode#multiSelectionRecognizer} to + * {@link yfiles.input.EventRecognizers#NEVER}. Remove {@link yfiles.input.ICommand#SELECT_ALL} and {@link yfiles.input.ICommand#TOGGLE_ITEM_SELECTION} + * from {@link yfiles.input.GraphInputMode#availableCommands} and from {@link yfiles.input.GraphInputMode#navigationInputMode}.{@link yfiles.input.NavigationInputMode#availableCommands}. An example can be found in demo.yfiles.input.singleselection. + *

+ *

+ * An overview of this input mode is given in the section {@link @DGUIDE_PREFIX@/interaction-geim.html Editing Graphs}. Additionally, specific support for graph + * hierarchies is discussed in {@link @DGUIDE_PREFIX@/interaction-support.html#interaction-grouping Supported User Interactions: Grouping}. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleEditorForm, Demo.yFiles.Graph.SimpleEditor
  • + *
  • Demo: SingleSelectionWindow, demo.yfiles.input.singleselection
  • + *
  • Tutorial: 01 Getting Started, step 06 Basic Interaction
  • + *
+ * @see yfiles.input.GraphEditorInputMode#createEdgeInputMode + * @see yfiles.input.GraphEditorInputMode#createBendInputMode + * @see yfiles.input.GraphEditorInputMode#moveLabelInputMode + * @see yfiles.input.GraphEditorInputMode#nodeDropInputMode + * @class yfiles.input.GraphEditorInputMode + * @extends {yfiles.input.GraphInputMode} + */ + export interface GraphEditorInputMode extends yfiles.input.GraphInputMode{} + export class GraphEditorInputMode { + /** + * Creates a new instance that is not bound to an existing graph or selection, initially. + *

+ * The {@link yfiles.graph.IGraph} and {@link yfiles.view.IGraphSelection} 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. + *

+ * @constructor + */ + constructor(); + /** + * 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.graphml.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. + *

+ *

+ * This method works nearly identical to {@link yfiles.input.GraphEditorInputMode#createLabel}. The only difference is when either + * the {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} event is handled, or owner + * has an + * {@link yfiles.input.IEditLabelHelper}, and via those instead of adding a label an existing one should be edited. This method + * will edit that label instead of adding a new one. + *

+ * @param {yfiles.graph.ILabelOwner} owner The item to add a label to. + * @returns {Promise.} A Promise that fulfills with the edited label instance. It will fulfill with null if {@link yfiles.input.TextEditorInputMode#addEditingCanceledListener editing was canceled} or the text + * did not {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validate}. + */ + addLabel(owner:yfiles.graph.ILabelOwner):Promise; + /** + * Updates the {@link yfiles.view.CanvasComponent#contentRect} using {@link yfiles.view.CanvasComponent#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; + /** + * {@link yfiles.graph.IGraph#adjustGroupNodeLayout Adjusts the size} of the group nodes in the enumerable. + *

+ * This action is executed in response to the {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE} if {@link yfiles.input.GraphEditorInputMode#allowAdjustGroupNodeSize} is set to true. + *

+ * @param {yfiles.collections.IEnumerable.} nodes The nodes to adjust their sizes. + * @protected + */ + adjustGroupNodeSize(nodes:yfiles.collections.IEnumerable):void; + /** + * {@link yfiles.graph.IGraph#adjustGroupNodeLayout Adjusts the size} of the selected group nodes. + *

+ * This method delegates to {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSize} with the {@link yfiles.view.IGraphSelection#selectedNodes currently selected nodes}. + *

+ * @see yfiles.input.GraphEditorInputMode#adjustGroupNodeSize + * @see yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE + */ + adjustGroupNodeSizes():void; + /** + * Adjusts the node's {@link yfiles.graph.INode#layout} to adhere to possible {@link yfiles.input.INodeSizeConstraintProvider size constraints}. + *

+ * This method will use the {@link yfiles.input.INodeSizeConstraintProvider} for {@link yfiles.graph.INode} that can be found in their {@link yfiles.graph.ILookup} + * to make sure they are still valid. The actual work of this method will be delegated to + * {@link yfiles.input.GraphEditorInputMode#setNodeLayout}. + *

+ * @param {yfiles.graph.INode} node The node to possibly adjust the size of. + */ + adjustToSizeConstraints(node:yfiles.graph.INode):void; + /** + * Creates a node on click. + *

+ * This method is only called if no item has been and {@link yfiles.input.GraphInputMode#clickClearSelection} returned false. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} location The location of the click. + * @returns {boolean} true if a node was successfully created, otherwise false. + * @see yfiles.input.GraphEditorInputMode#shouldClickCreateNode + * @protected + */ + clickCreateNode(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Closes the label editor if it is currently open. + * @param {boolean} cancel Whether to cancel the editor and discard changes. + */ + closeLabelEditor(cancel:boolean):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. + *

+ * @returns {yfiles.input.CreateBendInputMode} a new instance of CreateBendInputMode + * @protected + */ + createCreateBendInputMode():yfiles.input.CreateBendInputMode; + /** + * Factory method for the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property. + *

+ * @returns {yfiles.input.CreateEdgeInputMode} a new instance of CreateEdgeInputMode + * @protected + */ + createCreateEdgeInputMode():yfiles.input.CreateEdgeInputMode; + /** + * Factory method for the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property. + *

+ * @returns {yfiles.input.HandleInputMode} a new instance of HandleInputMode + * @protected + */ + createHandleInputMode():yfiles.input.HandleInputMode; + /** + * Interactively creates a new label for the provided label owner. + *

+ * 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 label owner. + *

+ *

+ * The text that the user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. + *

+ *

+ * This method works nearly identical to {@link yfiles.input.GraphEditorInputMode#addLabel}. The only difference is when either the + * {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} event is handled, or owner + * has an + * {@link yfiles.input.IEditLabelHelper}, and via those instead of adding a label an existing one should be edited. This method + * will do nothing instead of editing an existing label or adding a new one in that case. + *

+ * @param {yfiles.graph.ILabelOwner} owner The item to create a new label for. + * @returns {Promise.} A Promise that fulfills with the edited label instance. It will fulfill with null if {@link yfiles.input.TextEditorInputMode#addEditingCanceledListener editing was canceled} or the text + * did not {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validate}. + */ + createLabel(owner:yfiles.graph.ILabelOwner):Promise; + /** + * Factory method for the {@link yfiles.input.GraphEditorInputMode#moveInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.MoveInputMode} property. + *

+ * @returns {yfiles.input.MoveInputMode} a new instance of MoveInputMode + * @protected + */ + createMoveInputMode():yfiles.input.MoveInputMode; + /** + * 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. + *

+ * @returns {yfiles.input.MoveLabelInputMode} a new instance of {@link yfiles.input.MoveLabelInputMode} + * @protected + */ + createMoveLabelInputMode():yfiles.input.MoveLabelInputMode; + /** + * 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.GraphEditorInputMode} like this but + * using a smaller {@link yfiles.input.IInputMode#priority priority} value than the {@link yfiles.input.IInputMode#priority priority} of the mode that is {@link yfiles.input.GraphEditorInputMode#moveInputMode installed by default}. + *

+ * @param {function(Object, yfiles.lang.EventArgs): boolean} recognizer Use this instance to make this mode work under certain conditions only. null for default behavior, one of the {@link yfiles.input.KeyEventRecognizers} + * constants, e.g. for alternate behavior. + * @returns {yfiles.input.MoveInputMode} A {@link yfiles.input.GraphEditorInputMode#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(recognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean):yfiles.input.MoveInputMode; + /** + * Creates a node given a certain click point. + *

+ * This implementation delegates to the current node creation callback or simply returns null if there is no such callback + * or {@link yfiles.input.GraphEditorInputMode#allowCreateNode} yields false. Finally, it tries to {@link yfiles.input.GraphInputMode#setCurrentItem set the node as the current item}. + *

+ * @param {yfiles.geometry.Point} location The point where the mouse had been clicked. + * @returns {yfiles.graph.INode} The newly created node or null. + * @see yfiles.input.GraphEditorInputMode#onNodeCreated + * @see yfiles.input.GraphInputMode#setCurrentItem + */ + createNode(location:yfiles.geometry.Point):yfiles.graph.INode; + /** + * Factory method that creates the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} lazily the first time the property is accessed. + * @returns {yfiles.input.NodeDropInputMode} A plain new instance of the {@link yfiles.input.NodeDropInputMode} type, which is initially {@link yfiles.input.DropInputMode#enabled disabled}. + * @protected + */ + createNodeDropInputMode():yfiles.input.NodeDropInputMode; + /** + * Factory method for the ReparentNodeHandler property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property. + *

+ * @returns {yfiles.input.IReparentNodeHandler} a new instance of {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} + * @protected + */ + createReparentNodeHandler():yfiles.input.IReparentNodeHandler; + /** + * Factory method for the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property. + *

+ * This method will be called upon first access to the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property. + *

+ * @returns {yfiles.input.TextEditorInputMode} a new instance of TextEditorInputMode + * @protected + */ + createTextEditorInputMode():yfiles.input.TextEditorInputMode; + /** + * Cuts and inserts the currently selected elements to the clipboard. + */ + cut():void; + /** + * This method deletes the currently selected elements. + *

+ * If the {@link yfiles.view.GraphSelection} 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 yfiles.input.GraphEditorInputMode#addDeletingSelectionListener + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.input.GraphEditorInputMode#addDeletedSelectionListener + */ + deleteSelection():void; + /** + * Initiates the {@link yfiles.input.GraphEditorInputMode#handleInputMode} to drag the given bend. + * @param {yfiles.graph.IBend} bend The bend to drag. + * @see yfiles.input.GraphEditorInputMode#onCreateBendInputModeBendCreated + */ + dragBend(bend:yfiles.graph.IBend):void; + /** + * Duplicates the selected elements. + */ + duplicateSelection():void; + /** + * Starts editing 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. + *

+ *

+ * The label to edit can be a + * {@link yfiles.graph.SimpleLabel}, which will be edited as usual, except that the label text changes will be written directly + * back into the instance. + *

+ *

+ * This method will raise the {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing} + * event and query the {@link yfiles.input.IEditLabelHelper} for the label and its owner, but will ignore the result except for the + * {@link yfiles.input.LabelEditingEventArgs#textEditorInputModeConfigurator} property on the {@link yfiles.input.LabelEditingEventArgs}. Thus editing a label via this method cannot be prevented by event + * handlers or {@link yfiles.input.IEditLabelHelper}s. + *

+ * @param {yfiles.graph.ILabel} label The label to edit. + * @returns {Promise.} A Promise that fulfills with the edited label instance. It will also fulfill with the instance if editing is {@link yfiles.input.TextEditorInputMode#addEditingCanceledListener editing was canceled} + * or the text did not {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validate} and the edit was reverted automatically. + * @see yfiles.input.GraphEditorInputMode#onLabelTextEdited + */ + editLabel(label:yfiles.graph.ILabel):Promise; + /** + * Starts label editing by executing {@link yfiles.input.ICommand#EDIT_LABEL }. + *

+ * The method should return whether the request was satisfied. + *

+ * @param {yfiles.graph.IModelItem} item The item whose label or the label itself that should be edited upon the double click gesture. + * @returns {boolean} true iff the request was handled. + * @see yfiles.input.GraphInputMode#doubleClick + * @see yfiles.input.GraphEditorInputMode#allowEditLabelOnDoubleClick + * @protected + */ + editLabelOnDoubleClick(item:yfiles.graph.IModelItem):boolean; + /** + * Creates a new group for all of the currently selected elements. + *

+ * This method will also clear the selection and select the newly created group node. + *

+ *

+ * The default shortcut for this is Ctrl+G. + *

+ * @returns {yfiles.graph.INode} The newly created group node or null. + * @see yfiles.input.ICommand#GROUP_SELECTION + * @see yfiles.input.GraphInputMode#clearSelection + * @see yfiles.input.GraphInputMode#setSelected + */ + groupSelection():yfiles.graph.INode; + /** + * Callback that is invoked if the shift+F2 key is pressed and {@link yfiles.input.GraphEditorInputMode#allowAddLabel} is set to true. + *

+ * This method determines the label owner to add to and delegates to {@link yfiles.input.GraphEditorInputMode#createLabel}. + *

+ * @returns {boolean} + * @protected + */ + onAddLabel():boolean; + /** + * 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.GraphEditorInputMode#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.graph.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. + *

+ * @param {Object} sender + * @param {yfiles.collections.ItemEventArgs.} evt + * @protected + */ + onCreateBendInputModeBendCreated(sender:Object,evt:yfiles.collections.ItemEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.CreateBendInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.CreateBendInputMode} newMode the new value + * @protected + */ + onCreateBendInputModeChanged(oldMode:yfiles.input.CreateBendInputMode,newMode:yfiles.input.CreateBendInputMode):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.CreateEdgeInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.CreateEdgeInputMode} newMode the new value + * @protected + */ + onCreateEdgeInputModeChanged(oldMode:yfiles.input.CreateEdgeInputMode,newMode:yfiles.input.CreateEdgeInputMode):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} event. + * @param {yfiles.collections.ItemEventArgs.} evt The instance containing the event data. + * @protected + */ + onDeletedItem(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @param {yfiles.input.SelectionEventArgs.} evt The {@link yfiles.input.SelectionEventArgs.} instance containing the event data. + * @protected + */ + onDeletedSelection(evt:yfiles.input.SelectionEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletingSelectionListener DeletingSelection} event. + * @param {yfiles.input.SelectionEventArgs.} evt The {@link yfiles.input.SelectionEventArgs.} instance containing the event data. + * @protected + */ + onDeletingSelection(evt:yfiles.input.SelectionEventArgs):void; + /** + * 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} evt The {@link yfiles.graph.EdgeEventArgs} for the + * {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged}. + * @protected + */ + onEdgePortsChanged(evt:yfiles.graph.EdgeEventArgs):void; + /** + * Callback that is invoked if the F2 key is pressed and {@link yfiles.input.GraphEditorInputMode#allowEditLabel} 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. + *

+ * @returns {boolean} + * @protected + */ + onEditLabel():boolean; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#graphComponent} property changes. + * @param {yfiles.view.GraphComponent} oldGraphComponent The old control. + * @param {yfiles.view.GraphComponent} newGraphComponent The new control. + * @protected + */ + onGraphComponentChanged(oldGraphComponent:yfiles.view.GraphComponent,newGraphComponent:yfiles.view.GraphComponent):void; + /** + * Called when the {@link yfiles.view.GraphSelection} property changes. + *

+ * This will update the internal state of the modes. + *

+ * @param {yfiles.view.IGraphSelection} oldSelection The old selection instance. + * @param {yfiles.view.IGraphSelection} newSelection The new selection instance. + * @protected + */ + onGraphSelectionChanged(oldSelection:yfiles.view.IGraphSelection,newSelection:yfiles.view.IGraphSelection):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.HandleInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.HandleInputMode} newMode the new value + * @protected + */ + onHandleInputModeChanged(oldMode:yfiles.input.HandleInputMode,newMode:yfiles.input.HandleInputMode):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.collections.ItemEventArgs.} instance that contains the {@link yfiles.graph.ILabel} that has been added. + * @protected + */ + onLabelAdded(evt:yfiles.graph.LabelEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelAddingListener LabelAdding} event. + *

+ * Invoking the event handlers stops once one event marks the args as handled. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The event arguments. + * @protected + */ + onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelEditingListener LabelEditing} event. + *

+ * Invoking the event handlers stops once one event marks the args as handled. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The event arguments. + * @protected + */ + onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#labelSnapContext} property context changed. + * @param {yfiles.input.SnapContext} oldContext The old snap context. + * @param {yfiles.input.SnapContext} newContext The new snap context. + * @protected + */ + onLabelSnapContextChanged(oldContext:yfiles.input.SnapContext,newContext:yfiles.input.SnapContext):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextChangedListener LabelTextChanged} event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.collections.ItemEventArgs.} instance that contains the {@link yfiles.graph.ILabel} that has changed the text. + * @protected + */ + onLabelTextChanged(evt: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. + * @protected + */ + onLabelTextEdited(label:yfiles.graph.ILabel,text:string):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextEditingCanceledListener LabelTextEditingCanceled} + * event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + * @protected + */ + onLabelTextEditingCanceled(evt:yfiles.graph.LabelEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextEditingStartedListener LabelTextEditingStarted} + * event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + * @protected + */ + onLabelTextEditingStarted(evt:yfiles.graph.LabelEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#moveInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.MoveInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.MoveInputMode} newMode the new value + * @protected + */ + onMoveInputModeChanged(oldMode:yfiles.input.MoveInputMode,newMode:yfiles.input.MoveInputMode):void; + /** + * Called when {@link yfiles.input.MoveInputMode#addDragCanceledListener DragCanceled} is triggered. + * @param {Object} sender + * @param {yfiles.lang.EventArgs} evt + * @protected + */ + onMoveInputModeDragCanceled(sender:Object,evt:yfiles.lang.EventArgs):void; + /** + * Called when {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} is triggered. + * @param {Object} sender + * @param {yfiles.lang.EventArgs} evt + * @protected + */ + onMoveInputModeDragFinished(sender:Object,evt:yfiles.lang.EventArgs):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.MoveLabelInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.MoveLabelInputMode} newMode the new value + * @protected + */ + onMoveLabelInputModeChanged(oldMode:yfiles.input.MoveLabelInputMode,newMode:yfiles.input.MoveLabelInputMode):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} event. + *

+ * Note that if {@link yfiles.input.NodeDropInputMode#allowFolderNodeAsParent} is set to true, the reported node can actually be part of the {@link yfiles.graph.IFoldingView master graph}. + *

+ * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance containing the created node. + * @protected + */ + onNodeCreated(evt:yfiles.collections.ItemEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.NodeDropInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.NodeDropInputMode} newMode the new value + * @protected + */ + onNodeDropInputModeChanged(oldMode:yfiles.input.NodeDropInputMode,newMode:yfiles.input.NodeDropInputMode):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}'s {@link yfiles.input.ItemDropInputMode.#addItemCreatedListener ItemCreated} 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.GraphInputMode#setCurrentItem current item}. + *

+ * @param {Object} sender The sender. + * @param {yfiles.collections.ItemEventArgs.} evt The event argument instance containing the event data. + * @protected + */ + onNodeDropInputModeNodeCreated(sender:Object,evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addNodeReparentedListener NodeReparented} event. + * @param {yfiles.graph.NodeEventArgs} evt The {@link yfiles.graph.NodeEventArgs} instance containing the event data. + * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler + * @protected + */ + onNodeReparented(evt:yfiles.graph.NodeEventArgs):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property value changes and after initialization of the field. + * @param {yfiles.input.IReparentNodeHandler} oldMode the old value, which may be null the first time + * @param {yfiles.input.IReparentNodeHandler} newMode the new value + * @protected + */ + onReparentNodeHandlerChanged(oldMode:yfiles.input.IReparentNodeHandler,newMode:yfiles.input.IReparentNodeHandler):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#snapContext} property context changed. + * @param {yfiles.input.SnapContext} oldContext The old snap context. + * @param {yfiles.input.SnapContext} newContext The new snap context. + * @protected + */ + onSnapContextChanged(oldContext:yfiles.input.SnapContext,newContext:yfiles.input.SnapContext):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.TextEditorInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.TextEditorInputMode} newMode the new value + * @protected + */ + onTextEditorInputModeChanged(oldMode:yfiles.input.TextEditorInputMode,newMode:yfiles.input.TextEditorInputMode):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} event. + * @param {yfiles.input.LabelTextValidatingEventArgs} evt The {@link yfiles.input.LabelTextValidatingEventArgs} instance containing the event data. + * @protected + */ + onValidateLabelText(evt:yfiles.input.LabelTextValidatingEventArgs):void; + /** + * Pastes the current clipboard contents. + * @see 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.Point} location The location at which the center of the clipboard's contents should be positioned. + */ + pasteAtLocation(location:yfiles.geometry.Point):void; + /** + * Delegates to the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.UndoEngine}'s {@link yfiles.graph.UndoEngine#redo} method. + */ + redo():void; + /** + * Trigger a reevaluation of all visible handles + *

+ * This method is called when the {@link yfiles.input.GraphEditorInputMode#showHandleItems} property is changed. + *

+ * @protected + */ + requeryHandles():void; + /** + * Reverses the given edges. + *

+ * The edge will only be reversed if {@link yfiles.input.GraphEditorInputMode#allowReverseEdge} is set to true and {@link yfiles.input.GraphEditorInputMode#shouldReverseEdge} returns true + * for the edge. A {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event + * will be dispatched after the edge has been reversed. + *

+ * @param {yfiles.graph.IEdge} edge + */ + reverseEdge(edge:yfiles.graph.IEdge):void; + /** + * Reverses the given edges. + *

+ * The edges will only be reversed if {@link yfiles.input.GraphEditorInputMode#allowReverseEdge} is set to true and {@link yfiles.input.GraphEditorInputMode#shouldReverseEdge} returns true + * for the edge. + *

+ *

+ * For each edge a {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event + * will be dispatched. + *

+ * @param {yfiles.collections.IEnumerable.} edges + * @see yfiles.input.ICommand#REVERSE_EDGE + */ + reverseEdges(edges:yfiles.collections.IEnumerable):void; + /** + * Reverses the selected edges. + *

+ * This implementation invokes {@link yfiles.input.GraphEditorInputMode#reverseEdges} providing the {@link yfiles.view.GraphSelection selected edges}. + *

+ *

+ * The edges will only be reversed if {@link yfiles.input.GraphEditorInputMode#shouldReverseEdge} returns true for each edge. + *

+ *

+ * For each edge an {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event + * will be dispatched. + *

+ */ + reverseSelectedEdges():void; + /** + * Selects the node and possible bends of selfloop edges. + *

+ * This method delegates to {@link yfiles.input.GraphInputMode#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; + /** + * 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.INodeSizeConstraintProvider} 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; + /** + * Updates the bounds of the node. + *

+ * This method differs from a simple call to {@link yfiles.graph.IGraph#setNodeLayout} 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.Rect} layout The new node layout. + */ + setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; + /** + * 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#onLabelAdding} + * method. + *

+ * @param {yfiles.graph.IModelItem} item The item to query + * @returns {boolean} true iff a label may be added + * @protected + */ + shouldAddLabel(item:yfiles.graph.IModelItem):boolean; + /** + * Specifies whether a node should be created by + * {@link yfiles.input.ClickInputMode#addClickedListener Clicked}. + *

+ * 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.Point} clickPoint The location of the click. + * @returns {boolean} Whether {@link yfiles.input.GraphEditorInputMode#clickCreateNode} should be called to create a node. + * @see yfiles.input.GraphEditorInputMode#clickCreateNode + * @protected + */ + shouldClickCreateNode(context:yfiles.input.IInputModeContext,clickPoint:yfiles.geometry.Point):boolean; + /** + * Callback method that determines whether the given item should be deleted during + * {@link yfiles.input.GraphEditorInputMode#deleteSelection}. + *

+ * This implementation uses and honors the {@link yfiles.input.GraphEditorInputMode#deletableItems} and {@link yfiles.input.GraphEditorInputMode#deletablePredicate} properties. + *

+ * @param {yfiles.graph.IModelItem} item The item. + * @returns {boolean} Whether to delete that item. + * @protected + */ + shouldDelete(item:yfiles.graph.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.graph.IModelItem} item The item. + * @returns {boolean} Whether to edit the label or the labels for that item. + * @protected + */ + shouldEditLabel(item:yfiles.graph.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.GraphEditorInputMode#moveInputMode}. + *

+ *

+ * This implementation returns the result of the {@link yfiles.input.GraphEditorInputMode#movableItems} property for the given item. + *

+ * @param {yfiles.graph.IModelItem} item The item to check. + * @returns {boolean} Whether or not moving the item is allowed. + * @see yfiles.input.GraphEditorInputMode#movableItems + * @see yfiles.input.GraphEditorInputMode#moveInputMode + * @see yfiles.input.GraphEditorInputMode#moveLabelInputMode + * @protected + */ + shouldMove(item:yfiles.graph.IModelItem):boolean; + /** + * 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#allowReverseEdge}. + *

+ * @param {yfiles.graph.IEdge} edge The edge which should be reversed. + * @returns {boolean} true if the edge should be reversed. + * @protected + */ + shouldReverseEdge(edge:yfiles.graph.IEdge):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.graph.IModelItem} item The item to check. + * @returns {boolean} Whether to select the item after {@link yfiles.input.GraphEditorInputMode#paste} or + * {@link yfiles.input.GraphEditorInputMode#duplicateSelection}. + * @protected + */ + shouldSelectAfterPaste(item:yfiles.graph.IModelItem):boolean; + /** + * Determines whether to show the {@link yfiles.input.GraphEditorInputMode#handleInputMode handles} for the given item. + * @param {yfiles.graph.IModelItem} item The item to check + * @returns {boolean} Whether to show the item based on the setting of the corresponding {@link yfiles.input.GraphEditorInputMode#showHandleItems}, property. + * @protected + */ + shouldShowHandles(item:yfiles.graph.IModelItem):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 yfiles.input.MultiplexingInputMode#createChildInputModeContext + */ + snapToGrid(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):void; + /** + * Delegates to the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.UndoEngine}'s {@link yfiles.graph.UndoEngine#undo} method. + */ + undo():void; + /** + * Makes each of the currently selected nodes a direct child of the root group. + *

+ * The default shortcut for this is Ctrl+U. + *

+ * @see yfiles.input.ICommand#UNGROUP_SELECTION + */ + ungroupSelection():void; + /** + * Gets or sets the orthogonal edge editing context. + *

+ * The default value is null. + *

+ *

Related demos:

+ *
    + *
  • Tutorial: 01 Getting Started, step 17 Orthogonal Edge Creation
  • + *
+ * @default null + * @type {yfiles.input.OrthogonalEdgeEditingContext} + */ + orthogonalEdgeEditingContext:yfiles.input.OrthogonalEdgeEditingContext; + /** + * Gets or sets the policy that controls whether removing bends from an orthogonal edge will keep the edge orthogonal. + *

+ * By default this feature is enabled automatically if an {@link yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext} is set. + *

+ * @see yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext + * @default 0 + * @type {yfiles.input.OrthogonalEdgeEditingPolicy} + */ + orthogonalBendRemoval:yfiles.input.OrthogonalEdgeEditingPolicy; + /** + * Gets or sets the {@link yfiles.input.IReparentNodeHandler} that is used for moving nodes out of group nodes or into other group + * nodes. + *

+ * This setting has no effect if reparenting nodes is generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowReparentNodes} to false. + *

+ *

+ * Child input modes will use this {@link yfiles.input.IReparentNodeHandler} as well, since it is added to + * {@link yfiles.input.GraphEditorInputMode#childInputModeContextLookup}. + *

+ *

+ * If not already initialized, the factory method {@link yfiles.input.GraphEditorInputMode#createReparentNodeHandler} will be + * called on first access. Upon changes, the {@link yfiles.input.GraphEditorInputMode#onReparentNodeHandlerChanged} method will be + * called. + *

+ * @see yfiles.input.GraphEditorInputMode#allowReparentNodes + * @see yfiles.input.ReparentNodeHandler + * @type {yfiles.input.IReparentNodeHandler} + */ + reparentNodeHandler:yfiles.input.IReparentNodeHandler; + /** + * Gets or sets the hitTester property. + *

+ * The enumerator will be queried for hit tests if the user clicks on the canvas. + *

+ * @type {yfiles.input.IHitTester.} + */ + hitTester:yfiles.input.IHitTester; + /** + * 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 yfiles.input.GraphEditorInputMode#shouldSelectAfterPaste + * @see yfiles.input.GraphEditorInputMode#smartPasteSelection + * @see yfiles.input.GraphInputMode#setSelected + * @default 63 + * @type {yfiles.graph.GraphItemTypes} + */ + 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 yfiles.input.GraphEditorInputMode#shouldSelectAfterPaste + * @see yfiles.input.GraphEditorInputMode#pasteSelectableItems + * @see yfiles.input.GraphInputMode#setSelected + * @default true + * @type {boolean} + */ + smartPasteSelection:boolean; + /** + * Determines which types of items should be movable using the {@link yfiles.input.GraphEditorInputMode#moveInputMode} or {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} respectively in case of labels. + *

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

+ * @see yfiles.input.GraphEditorInputMode#shouldMove + * @type {yfiles.graph.GraphItemTypes} + */ + 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 yfiles.input.GraphEditorInputMode#shouldDelete + * @type {yfiles.graph.GraphItemTypes} + */ + deletableItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets a predicate that is queried to determine whether an {@link yfiles.graph.IModelItem} can be deleted or not. + *

+ * This allows to further restrict which items are deletable, compared to {@link yfiles.input.GraphEditorInputMode#deletableItems}. If this property is set to null the effect is + * the same as a predicate that always returns true. + *

+ * @type {function(yfiles.graph.IModelItem): boolean} + */ + deletablePredicate:(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Determines which types of items may have their {@link yfiles.input.GraphEditorInputMode#onEditLabel labels edited}. + *

+ * The default is {@link yfiles.graph.GraphItemTypes#LABEL_OWNER}|{@link yfiles.graph.GraphItemTypes#LABEL}, which allows for editing the + * labels of {@link yfiles.graph.ILabelOwner}s, and existing {@link yfiles.graph.ILabel}s. + *

+ * @see yfiles.input.GraphEditorInputMode#shouldEditLabel + * @type {yfiles.graph.GraphItemTypes} + */ + labelEditableItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#handleInputMode} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createHandleInputMode} + * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onHandleInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 0. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.HandleInputMode} + */ + handleInputMode:yfiles.input.HandleInputMode; + /** + * Determines which types of items should have their {@link yfiles.input.IHandle}s shown. + *

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

+ * @see yfiles.input.GraphEditorInputMode#shouldShowHandles + * @type {yfiles.graph.GraphItemTypes} + */ + showHandleItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets a value indicating whether to use the {@link yfiles.view.GraphComponent#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.ICommand#ADD_LABEL}
  • + *
  • {@link yfiles.input.ICommand#EDIT_LABEL}
  • + *
  • {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE}
  • + *
+ * @default false + * @type {boolean} + */ + useCurrentItemForCommands:boolean; + /** + * The offset for paste operation if clipboard operations are enabled. + *

+ * Default is (15, 15). + *

+ * @default '15,15' + * @type {yfiles.geometry.Point} + */ + pasteDelta:yfiles.geometry.Point; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#EDIT_LABEL} command should be handled. + *

+ * If this flag is set to true pressing F2 will start the label editor. By default this feature is enabled. + *

+ * @see yfiles.input.GraphEditorInputMode#editLabel + * @see yfiles.input.GraphEditorInputMode#onEditLabel + * @type {boolean} + */ + allowEditLabel:boolean; + /** + * Gets or sets a value determining whether double-clicking should start label editing. + *

+ * If enabled, double-clicking an item will automatically execute the {@link yfiles.input.ICommand#EDIT_LABEL} command. + *

+ *

+ * This setting has no effect if label editing is generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowEditLabel} to false. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#allowEditLabel + * @type {boolean} + */ + allowEditLabelOnDoubleClick:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#ADD_LABEL} command should be handled. + *

+ * If this flag is set to true pressing Shift+F2 will start the label editor. By default this feature is enabled. + *

+ * @see yfiles.input.GraphEditorInputMode#createLabel + * @type {boolean} + */ + allowAddLabel:boolean; + /** + * Adds the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#createLabel}. + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#removeLabelAddedListener + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#createLabel}. + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addLabelAddedListener + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is about + * to start. + *

+ * This allows to customize the label editing process. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener + * @see yfiles.input.GraphEditorInputMode#removeLabelTextEditingStartedListener + */ + addLabelTextEditingStartedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is + * about to start. + *

+ * This allows to customize the label editing process. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener + * @see yfiles.input.GraphEditorInputMode#addLabelTextEditingStartedListener + */ + removeLabelTextEditingStartedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is + * canceled. + *

+ * This allows to unconfigure temporary customizations for the actual label editing process. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener + * @see yfiles.input.GraphEditorInputMode#removeLabelTextEditingCanceledListener + */ + addLabelTextEditingCanceledListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is + * canceled. + *

+ * This allows to unconfigure temporary customizations for the actual label editing process. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener + * @see yfiles.input.GraphEditorInputMode#addLabelTextEditingCanceledListener + */ + removeLabelTextEditingCanceledListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the ValidateLabelText event that occurs when a label that is about to be {@link yfiles.input.GraphEditorInputMode#addLabel added} or {@link yfiles.input.GraphEditorInputMode#editLabel edited}. + *

+ * This event that can be used to validate the label text before inserting/updating the actual label. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.input.LabelTextValidatingEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#onValidateLabelText + * @see yfiles.input.GraphEditorInputMode#removeValidateLabelTextListener + */ + addValidateLabelTextListener(listener:(sender:Object,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; + /** + * Removes the given listener for the ValidateLabelText event that occurs when a label that is about to be {@link yfiles.input.GraphEditorInputMode#addLabel added} or + * {@link yfiles.input.GraphEditorInputMode#editLabel edited}. + *

+ * This event that can be used to validate the label text before inserting/updating the actual label. + *

+ *

+ * 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. + *

+ * @param {function(Object, yfiles.input.LabelTextValidatingEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#onValidateLabelText + * @see yfiles.input.GraphEditorInputMode#addValidateLabelTextListener + */ + removeValidateLabelTextListener(listener:(sender:Object,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#editLabel}. + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#removeLabelTextChangedListener + */ + addLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.GraphEditorInputMode#editLabel}. + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addLabelTextChangedListener + */ + removeLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the DeletingSelection event that 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. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#deleteSelection + * @see yfiles.input.GraphEditorInputMode#removeDeletingSelectionListener + */ + addDeletingSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DeletingSelection event that 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. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#deleteSelection + * @see yfiles.input.GraphEditorInputMode#addDeletingSelectionListener + */ + removeDeletingSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DeletedItem event that 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#removeDeletedItemListener + */ + addDeletedItemListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the DeletedItem event that 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + */ + removeDeletedItemListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} + * method has deleted the selection after all selected items have been removed. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#deleteSelection + * @see yfiles.input.GraphEditorInputMode#removeDeletedSelectionListener + */ + addDeletedSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} + * method has deleted the selection after all selected items have been removed. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#deleteSelection + * @see yfiles.input.GraphEditorInputMode#addDeletedSelectionListener + */ + removeDeletedSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#moveInputMode} property. + *

+ * If the field has not yet been initialized upon first access, the factory method {@link yfiles.input.GraphEditorInputMode#createMoveInputMode} + * will be called. Upon change the {@link yfiles.input.GraphEditorInputMode#onMoveInputModeChanged} method will be called. + *

+ *

+ * By default this input mode has a priority of 40. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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 yfiles.input.GraphEditorInputMode#shouldMove + * @type {yfiles.input.MoveInputMode} + */ + moveInputMode:yfiles.input.MoveInputMode; + /** + * Gets or sets a property that determines whether this instance should automatically adjust the {@link yfiles.view.CanvasComponent#contentRect} if the graph changes. + *

+ * The {@link yfiles.input.GraphEditorInputMode#adjustContentRect} method is called whenever the content changes. The default is + * {@link yfiles.input.AdjustContentRectPolicy#UNION}. + *

+ * @default 1 + * @type {yfiles.input.AdjustContentRectPolicy} + */ + adjustContentRectPolicy:yfiles.input.AdjustContentRectPolicy; + /** + * Gets or sets the margins to use for {@link yfiles.view.CanvasComponent#updateContentRect} in {@link yfiles.input.GraphEditorInputMode#adjustContentRect} + * calls. + * @type {yfiles.geometry.Insets} + */ + contentRectMargins:yfiles.geometry.Insets; + /** + * Gets the {@link yfiles.input.GraphEditorInputMode#graphComponent} instance this mode is working on or null. + *

+ * This property is set when this mode is {@link yfiles.input.GraphEditorInputMode#install}ed in a {@link yfiles.input.GraphEditorInputMode#graphComponent}. + *

+ * @type {yfiles.view.GraphComponent} + */ + graphComponent:yfiles.view.GraphComponent; + /** + * The {@link yfiles.input.SnapContext} instance that handles interactive snapping of elements during drag operations like + * movements. + *

+ * Setting this property to a {@link yfiles.input.SnapContext} which is {@link yfiles.input.SnapContext#enabled disabled} 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#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.view.CanvasComponent}. Default is null. + *

+ * @default null + * @type {yfiles.input.SnapContext} + */ + snapContext:yfiles.input.SnapContext; + /** + * 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 null 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.view.CanvasComponent}. Default is null. + *

+ * @default null + * @type {yfiles.input.SnapContext} + */ + labelSnapContext:yfiles.input.SnapContext; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#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. + *

+ *

+ * By default this input mode has a priority of 39. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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 yfiles.input.GraphEditorInputMode#shouldMove + * @type {yfiles.input.MoveLabelInputMode} + */ + moveLabelInputMode:yfiles.input.MoveLabelInputMode; + /** + * Gets or sets a value indicating whether grouping operations like {@link yfiles.input.GraphEditorInputMode#allowGroupSelection grouping selected nodes} or {@link yfiles.input.GraphEditorInputMode#allowReparentNodes moving nodes into group nodes} + * should be enabled. + *

+ * Setting this property to false effectively disables handling of all grouping {@link yfiles.input.ICommand commands}. If this property is set to true + * the related properties {@link yfiles.input.GraphEditorInputMode#allowGroupSelection}, {@link yfiles.input.GraphEditorInputMode#allowUngroupSelection}, and {@link yfiles.input.GraphEditorInputMode#allowReparentNodes} allow for selectively enabling or disabling only certain grouping operations. + *

+ *

+ * The default value is false. + *

+ * @see yfiles.input.GraphEditorInputMode#allowGroupSelection + * @see yfiles.input.GraphEditorInputMode#allowUngroupSelection + * @see yfiles.input.GraphEditorInputMode#allowAdjustGroupNodeSize + * @see yfiles.input.GraphEditorInputMode#allowReparentNodes + * @default false + * @type {boolean} + */ + allowGroupingOperations:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#GROUP_SELECTION} command should be handled. + *

+ * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations + * @see yfiles.input.GraphEditorInputMode#groupSelection + * @default true + * @type {boolean} + */ + allowGroupSelection:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#ADJUST_GROUP_NODE_SIZE} command should be handled. + *

+ * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations + * @see yfiles.input.GraphEditorInputMode#adjustGroupNodeSizes + * @see yfiles.input.GraphEditorInputMode#adjustGroupNodeSize + * @default true + * @type {boolean} + */ + allowAdjustGroupNodeSize:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#UNGROUP_SELECTION} command should be handled. + *

+ * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations + * @see yfiles.input.GraphEditorInputMode#ungroupSelection + * @default true + * @type {boolean} + */ + allowUngroupSelection:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#DESELECT_ALL} command should be handled. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + allowClearSelection:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#PASTE} command should be handled. + *

+ * This setting has no effect if clipboard operations are generally disallowed by setting {@link yfiles.input.GraphInputMode#allowClipboardOperations} to false. + *

+ *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + allowPaste:boolean; + /** + * Gets or sets a value determining whether the {@link yfiles.input.ICommand#DUPLICATE} command should be handled. + *

+ * This setting has no effect if clipboard operations are generally disallowed by setting {@link yfiles.input.GraphInputMode#allowClipboardOperations} to false. + *

+ *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + allowDuplicate:boolean; + /** + * Gets or sets a value indicating whether undo operations, that is, {@link yfiles.input.GraphEditorInputMode#undo} and {@link yfiles.input.GraphEditorInputMode#redo} + * should be enabled. + *

+ * Setting this property to false effectively disables handling of the commands {@link yfiles.input.ICommand#UNDO} and + * {@link yfiles.input.ICommand#REDO}. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#undo + * @see yfiles.input.GraphEditorInputMode#redo + * @default true + * @type {boolean} + */ + allowUndoOperations:boolean; + /** + * Gets or sets a value indicating whether moving nodes out of group nodes or into other group nodes is allowed. + *

+ * If set to false the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} will effectively be disabled and not called anymore for reparenting operations. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler + * @default true + * @type {boolean} + */ + allowReparentNodes:boolean; + /** + * Gets or sets a value indicating whether moving nodes into {@link yfiles.graph.IGraph#isGroupNode non-group nodes} is allowed to convert them into group nodes. + *

+ * If {@link yfiles.input.GraphEditorInputMode#allowReparentNodes reparenting nodes is allowed} in general and this property is enabled, users may reparent nodes not only to groups and + * folders but also to non-group nodes. Still, the decision about the final acceptance of the reparenting and the actual + * execution are delegated to the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}. + *

+ *

+ * This setting has no effect if grouping operations are generally disallowed by setting {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations} to false. + *

+ *

+ * The default value is false. + *

+ * @see yfiles.input.GraphEditorInputMode#allowGroupingOperations + * @default false + * @type {boolean} + */ + allowReparentToNonGroupNodes:boolean; + /** + * Adds the given listener for the NodeReparented event that 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. + *

+ * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler + * @see yfiles.input.GraphEditorInputMode#removeNodeReparentedListener + */ + addNodeReparentedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Removes the given listener for the NodeReparented event that 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. + *

+ * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#reparentNodeHandler + * @see yfiles.input.GraphEditorInputMode#addNodeReparentedListener + */ + removeNodeReparentedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Adds the given listener for the NodeCreated event that 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#allowFolderNodeAsParent} is set to true, the reported node can actually be + * part of the {@link yfiles.graph.IFoldingView master graph}. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#createNode + * @see yfiles.input.GraphEditorInputMode#removeNodeCreatedListener + */ + addNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the NodeCreated event that 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#allowFolderNodeAsParent} is set to true, the reported node can actually be + * part of the {@link yfiles.graph.IFoldingView master graph}. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#createNode + * @see yfiles.input.GraphEditorInputMode#addNodeCreatedListener + */ + removeNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Gets or sets a value determining whether {@link yfiles.input.GraphEditorInputMode#createNode node creation} by clicking on an empty canvas location is enabled. + *

+ * To disable node creation via drag and drop gestures, the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} must be disabled, too. However, it is disabled by default. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.input.GraphEditorInputMode#nodeCreator + * @see yfiles.input.GraphEditorInputMode#createNode + * @type {boolean} + */ + allowCreateNode:boolean; + /** + * Gets or sets a value determining whether {@link yfiles.input.GraphEditorInputMode#createBendInputMode bend creation} should be {@link yfiles.input.CreateBendInputMode#enabled enabled}. + *

+ * This property delegates to {@link yfiles.input.GraphEditorInputMode#createBendInputMode}'s {@link yfiles.input.CreateBendInputMode#enabled} property. + *

+ *

+ * The default value is true. + *

+ * @type {boolean} + */ + allowCreateBend:boolean; + /** + * Gets or sets a value determining whether {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode edge creation} should be {@link yfiles.input.CreateEdgeInputMode#enabled enabled}. + *

+ * This property delegates to {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode}'s {@link yfiles.input.CreateEdgeInputMode#enabled} property. + *

+ *

+ * The default value is true. + *

+ * @type {boolean} + */ + allowCreateEdge:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.input.ICommand#REVERSE_EDGE} command should be handled. + *

+ * If set to false the methods {@link yfiles.input.GraphEditorInputMode#reverseEdge}, + * {@link yfiles.input.GraphEditorInputMode#reverseEdges}, and {@link yfiles.input.GraphEditorInputMode#reverseSelectedEdges} do nothing. + *

+ *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + allowReverseEdge:boolean; + /** + * Adds the given listener for the EdgePortsChanged event that occurs after an edge's source and/or target ports have been + * changed as the result of an input gesture. + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to add. + * @see yfiles.graph.EdgeEventArgs + * @see yfiles.input.GraphEditorInputMode#reverseSelectedEdges + * @see yfiles.input.GraphEditorInputMode#reverseEdges + * @see yfiles.input.GraphEditorInputMode#reverseEdge + * @see yfiles.input.GraphEditorInputMode#removeEdgePortsChangedListener + */ + addEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Removes the given listener for the EdgePortsChanged event that occurs after an edge's source and/or target ports have + * been changed as the result of an input gesture. + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.EdgeEventArgs + * @see yfiles.input.GraphEditorInputMode#reverseSelectedEdges + * @see yfiles.input.GraphEditorInputMode#reverseEdges + * @see yfiles.input.GraphEditorInputMode#reverseEdge + * @see yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener + */ + removeEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Gets or sets the callback that is responsible for creating a new node, for instance, in response to a mouse click. + *

+ * A null value will disable node creation using mouse clicks, just as setting {@link yfiles.input.GraphEditorInputMode#allowCreateNode} to false. + *

+ * @see yfiles.input.GraphEditorInputMode#createNode + * @type {function(yfiles.input.IInputModeContext, yfiles.graph.IGraph, yfiles.geometry.Point, yfiles.graph.INode): yfiles.graph.INode} + */ + nodeCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,location:yfiles.geometry.Point,parent:yfiles.graph.INode)=>yfiles.graph.INode; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#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. + *

+ *

+ * By default this input mode has a priority of 100. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.TextEditorInputMode} + */ + textEditorInputMode:yfiles.input.TextEditorInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#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. + *

+ *

+ * By default this input mode has a priority of 45. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.CreateEdgeInputMode} + */ + createEdgeInputMode:yfiles.input.CreateEdgeInputMode; + /** + * Gets or sets a value indicating whether this mode should automatically {@link yfiles.graph.IGraph#remove remove labels} from the graph when a label text + * has been edited and the label text is empty. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + 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. + *

+ * @default true + * @type {boolean} + */ + 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 label text editor. + *

+ *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + hideLabelDuringEditing:boolean; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#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. + *

+ *

+ * By default this input mode has a priority of 42. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.CreateBendInputMode} + */ + createBendInputMode:yfiles.input.CreateBendInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} property that is responsible for handling drag and drop operations of nodes onto the Canvas. + *

+ * The mode by default is {@link yfiles.input.DropInputMode#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. + *

+ *

+ * By default this input mode has a priority of 70. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.NodeDropInputMode} + */ + nodeDropInputMode:yfiles.input.NodeDropInputMode; + /** + * Uses the {@link yfiles.input.WaitInputMode} to delegate wait requests to. + * @type {boolean} + */ + waiting:boolean; + /** + * Adds the given listener for the LabelAdding event that occurs when a label is about to be added. + *

+ * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be + * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the + * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#removeLabelAddingListener + */ + addLabelAddingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Removes the given listener for the LabelAdding event that occurs when a label is about to be added. + *

+ * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be + * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the + * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addLabelAddingListener + */ + removeLabelAddingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Adds the given listener for the LabelEditing event that occurs when a label is about to be edited. + *

+ * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden + * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, + * event handlers can also specify that instead of editing a label, a new one should be added. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to add. + * @see yfiles.input.GraphEditorInputMode#removeLabelEditingListener + */ + addLabelEditingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Removes the given listener for the LabelEditing event that occurs when a label is about to be edited. + *

+ * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden + * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, + * event handlers can also specify that instead of editing a label, a new one should be added. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to remove. + * @see yfiles.input.GraphEditorInputMode#addLabelEditingListener + */ + removeLabelEditingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.input.DropInputMode} providing a preview of the dragged item. + *

+ * A dragged {@link yfiles.graph.IModelItem} is visualized during the drag operation. In addition, this input mode supports + * snapping of the dragged {@link yfiles.graph.IModelItem} via the {@link yfiles.input.SnapContext} and highlighting the {@link yfiles.input.ItemDropInputMode.#dropTarget}. + *

+ *

+ * Highlighting is done via a {@link yfiles.view.HighlightIndicatorManager.}. + *

+ * @class yfiles.input.ItemDropInputMode. + * @extends {yfiles.input.DropInputMode} + */ + export interface ItemDropInputMode extends yfiles.input.DropInputMode{} + export class ItemDropInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.ItemDropInputMode.} class for the expected data format. + *

+ * This instance fires events only if a drag operation carries data of the expected format. + *

+ * @param {string} expectedFormat This is a format that is used in {@link yfiles.view.DragDropItem#getData}. + * @protected + * @constructor + */ + constructor(expectedFormat:string); + /** + * Cleanup method that calls {@link yfiles.input.ItemDropInputMode.#cleanupSnapContext}, {@link yfiles.input.ItemDropInputMode.#cleanupPreview} and {@link yfiles.input.ItemDropInputMode.#cleanupDropTarget}. + *

+ * This method should be called for cleanup actions after a drag/drop gesture has been finished or canceled. + *

+ * @protected + */ + cleanup():void; + /** + * Cleans up the drop target and its highlighting. + * @protected + */ + cleanupDropTarget():void; + /** + * Cleans up the item preview. + * @protected + */ + cleanupPreview():void; + /** + * Cleans up the snap context. + * @protected + */ + cleanupSnapContext():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} evt The arguments describing the movement {@link yfiles.input.SnapResult}s shall be collected for. + * @protected + */ + collectSnapResults(source:Object,evt:yfiles.input.CollectSnapResultsEventArgs):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.Point} dragLocation The location to return the drop target for. + * @returns {yfiles.graph.IModelItem} The drop target at the specified location or null if no drop target can be found. + * @protected + */ + getDropTarget(dragLocation:yfiles.geometry.Point):yfiles.graph.IModelItem; + /** + * Initializes the drop target. + * @protected + */ + initializeDropTarget():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 preview graph is initialized and {@link yfiles.input.ItemDropInputMode.#populatePreviewGraph} + * is called. + *

+ * @protected + */ + initializePreview():void; + /** + * Initializes the snapping context. + *

+ * This method is called by {@link yfiles.input.ItemDropInputMode.#onDragEntered} + *

+ * @protected + */ + initializeSnapContext():void; + /** + * Called whenever a new item is created + * @param {yfiles.collections.ItemEventArgs.} evt + * @protected + */ + onItemCreated(evt:yfiles.collections.ItemEventArgs):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. + * @protected + */ + populatePreviewGraph(previewGraph:yfiles.graph.IGraph):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.Point} dragLocation The location to update the drop target for. + * @protected + */ + updateDropTarget(dragLocation:yfiles.geometry.Point):void; + /** + * Subclasses shall update the 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.Point} dragLocation The current drag location. + * @protected + */ + updatePreview(previewGraph:yfiles.graph.IGraph,dragLocation:yfiles.geometry.Point):void; + /** + * Adds the given listener for the ItemCreated event that occurs when a new item gets created by this input mode. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.ItemDropInputMode.#removeItemCreatedListener + */ + addItemCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the ItemCreated event that occurs when a new item gets created by this input mode. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.ItemDropInputMode.#addItemCreatedListener + */ + removeItemCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Determines whether a preview of the dragged element is displayed during the drag + * @type {boolean} + */ + showPreview:boolean; + /** + * Switches snapping on and off. + * @type {boolean} + */ + snappingEnabled:boolean; + /** + * Gets or sets event recognizer that temporarily disables snapping. + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + disableSnappingRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Switches highlighting the drop target on and off. + * @type {boolean} + */ + 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. + *

+ * @type {yfiles.input.SnapContext} + */ + 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.view.CanvasComponent} into which this input mode is + * installed. If {@link yfiles.input.ItemDropInputMode.#snappingEnabled} is false, this value corresponds with {@link yfiles.input.DropInputMode#mousePosition}. + *

+ * @type {yfiles.geometry.Point} + */ + snappedMousePosition:yfiles.geometry.Point; + /** + * Gets the drop target at {@link yfiles.input.ItemDropInputMode.#snappedMousePosition} + * @see yfiles.input.ItemDropInputMode.#highlightDropTarget + * @type {yfiles.graph.IModelItem} + */ + dropTarget:yfiles.graph.IModelItem; + /** + * Gets the currently dragged {@link yfiles.graph.IModelItem} instance. + *

+ * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to the type of the dragged items. + *

+ * @protected + * @abstract + * @type {T} + */ + draggedItem:T; + /** + * Gets or sets the callback for item creation. + *

+ * Called by method {@link yfiles.input.ItemDropInputMode.#onDragDropped}. + *

+ * @type {function(yfiles.input.IInputModeContext, yfiles.graph.IGraph, T, yfiles.graph.IModelItem, yfiles.geometry.Point): T} + */ + itemCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,draggedItem:T,dropTarget:yfiles.graph.IModelItem,dropLocation:yfiles.geometry.Point)=>T; + /** + * Returns the graph displayed as item preview. + * @protected + * @type {yfiles.graph.IGraph} + */ + previewGraph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + /** + * 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. + * @class yfiles.input.LabelPositionHandler + * @implements {yfiles.input.IPositionHandler} + */ + export interface LabelPositionHandler extends Object,yfiles.input.IPositionHandler{} + export class LabelPositionHandler { + /** + * Initializes a new instance of the {@link yfiles.input.LabelPositionHandler} class. + * @param {yfiles.graph.ILabel} label The label that shall be moved. + * @constructor + */ + constructor(label:yfiles.graph.ILabel); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Creates an {@link yfiles.view.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. + * @returns {yfiles.view.ICanvasObjectDescriptor} An implementation that will render the given candidate. + * @protected + */ + createCandidateDescriptor(context:yfiles.input.IInputModeContext,highlight:boolean):yfiles.view.ICanvasObjectDescriptor; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Calculates a distance value between a candidate rectangle and the mouse location. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The rectangle candidate. + * @param {yfiles.geometry.Point} location The mouse location. + * @returns {number} A value indicating the closeness of the mouse to the rectangle. + * @protected + */ + getDistance(rectangle:yfiles.geometry.IOrientedRectangle,location:yfiles.geometry.Point):number; + /** + * Callback method that gets the candidates for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @returns {yfiles.collections.IEnumerable.} A possibly empty enumerator over possible label parameter candidates. + * @protected + */ + getParameterCandidates(label:yfiles.graph.ILabel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * 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} layoutParameter The new parameter. + * @protected + */ + setLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * + * @param {yfiles.geometry.Point} location + */ + setPosition(location:yfiles.geometry.Point):void; + /** + * 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} context The context that is currently being used - may be null if the method is called without context. + * @returns {boolean} + * @protected + */ + useParameterFinder(context:yfiles.input.IInputModeContext):boolean; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to represent the rectangular selection. + * @const + * @static + * @type {string} + */ + static CANDIDATE_TEMPLATE_KEY:string; + /** + * A {@link string} that will be used to find the {@link yfiles.view.IVisualTemplate} that will be used to represent the rectangular selection. + * @const + * @static + * @type {string} + */ + static HIGHLIGHT_TEMPLATE_KEY:string; + /** + * Gets or sets the template to use for showing candidates. + * @type {yfiles.view.IVisualTemplate} + */ + candidateTemplate:yfiles.view.IVisualTemplate; + /** + * Gets or sets the template to use for showing highlighted candidates. + * @type {yfiles.view.IVisualTemplate} + */ + highlightTemplate:yfiles.view.IVisualTemplate; + /** + * Gets the graph instance from the {@link yfiles.input.IInputModeContext} that has been passed to the {@link yfiles.input.LabelPositionHandler#initializeDrag} + * method. + * @protected + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Gets the label instance. + * @protected + * @type {yfiles.graph.ILabel} + */ + label:yfiles.graph.ILabel; + /** + * + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * 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 yfiles.input.LabelPositionHandler#useParameterFinder + * @type {boolean} + */ + useFinder:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.input.LabelSnapContext + * @see yfiles.graph.LabelDecorator#labelSnapContextHelperDecorator + * @class yfiles.input.LabelSnapContextHelper + * @implements {yfiles.input.ILabelSnapContextHelper} + */ + export interface LabelSnapContextHelper extends Object,yfiles.input.ILabelSnapContextHelper{} + export class LabelSnapContextHelper { + /** + * Adds snap lines to the snapContext 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} snapContext 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} inputModeContext 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. + * @protected + */ + addEdgePathSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel,distance:number):void; + /** + * Adds snap lines to the snapContext that are parallel to the path segments of the owner edge at particular distances. + *

+ * The corresponding settings of the snapContext specify which snap lines are actually created. + *

+ * @param {yfiles.input.LabelSnapContext} snapContext 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} inputModeContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The edge label that is dragged. + * @protected + */ + addEdgePathSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext: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} snapContext 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} inputModeContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The label that is dragged. + * @protected + */ + addInitialLocationSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * Adds snap lines to the snapContext that are parallel to the owner node's border at particular distances. + *

+ * The corresponding settings of the snapContext specify which snap lines are actually created. + *

+ * @param {yfiles.input.LabelSnapContext} snapContext 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} inputModeContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The node label that is dragged. + * @protected + */ + addNodeShapeSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * 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 + * snapContext. + * @param {yfiles.input.LabelSnapContext} snapContext 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} inputModeContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The label that is dragged. + */ + addSnapLines(snapContext:yfiles.input.LabelSnapContext,inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * + * @param {yfiles.input.LabelSnapContext} context + * @param {yfiles.input.CollectSnapResultsEventArgs} evt + * @param {yfiles.geometry.IOrientedRectangle} suggestedLayout + * @param {yfiles.graph.ILabel} label + */ + collectSnapResults(context:yfiles.input.LabelSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.IOrientedRectangle,label:yfiles.graph.ILabel):void; + /** + * 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. + *

+ * @const + * @static + * @type {yfiles.input.LabelSnapContextHelper} + */ + static INSTANCE:yfiles.input.LabelSnapContextHelper; + static $class:yfiles.lang.Class; + } + /** + * Event arguments for the {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} + * event. + *

+ * Event handlers can set the {@link yfiles.input.LabelTextValidatingEventArgs#cancel} property to true to cancel label editing if validation failed, or set the {@link yfiles.input.LabelTextValidatingEventArgs#newText} property to a + * changed, validated value. + *

+ * @class yfiles.input.LabelTextValidatingEventArgs + * @extends {yfiles.input.InputModeEventArgs} + * @final + */ + export interface LabelTextValidatingEventArgs extends yfiles.input.InputModeEventArgs{} + export class LabelTextValidatingEventArgs { + /** + * 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. + * @constructor + */ + constructor(context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel,newText:string); + /** + * 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. + *

+ * @type {yfiles.graph.ILabel} + */ + label:yfiles.graph.ILabel; + /** + * Gets or sets the new text to use for the label. + * @see yfiles.input.LabelTextValidatingEventArgs#cancel + * @type {string} + */ + newText:string; + /** + * Gets or sets a value indicating whether the edit should be canceled. + * @type {boolean} + */ + cancel:boolean; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.input.IInputMode} that can be used to drag a {@link yfiles.graph.ILabel} in a {@link yfiles.view.GraphComponent}. + *

+ * This implementation shows the possible candidate positions for a given label and allows the user to drag the label to + * one of these positions. + *

+ * @class yfiles.input.MoveLabelInputMode + * @extends {yfiles.input.MoveInputMode} + */ + export interface MoveLabelInputMode extends yfiles.input.MoveInputMode{} + export class MoveLabelInputMode { + /** + * Creates a new instance that will move labels in the graph retrieved from the {@link yfiles.input.MoveInputMode#inputModeContext}. + * @see yfiles.input.MoveLabelInputMode#graph + * @constructor + */ + constructor(); + /** + * 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}. + *

+ * @returns {yfiles.input.IHitTestable} A hit testable. + * @protected + */ + createLabelHitTestable():yfiles.input.IHitTestable; + /** + * 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.graph.ILookup lookup}. If this fails, it creates a new label position handler for the given label. + *

+ * @param {yfiles.graph.ILabel} label The label to create a position handler for. + * @returns {yfiles.input.IPositionHandler} A position handler for the given label. + * @protected + */ + createLabelPositionHandler(label:yfiles.graph.ILabel):yfiles.input.IPositionHandler; + /** + * 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#shouldMove} returns true. Otherwise, null is returned. + *

+ * @param {yfiles.input.IInputModeContext} context The context for the hit test. + * @param {yfiles.geometry.Point} location The coordinates for the hit test. + * @returns {yfiles.graph.ILabel} The label hit at the given location or null. + * @see yfiles.input.MoveLabelInputMode#isValidLabelHit + * @see yfiles.input.MoveLabelInputMode#shouldMove + * @protected + */ + getHitLabel(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):yfiles.graph.ILabel; + /** + * 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.input.IInputModeContext} context The context for the hit test. + * @param {yfiles.geometry.Point} location The coordinates for the hit test. + * @returns {boolean} true if a valid label is hit and the label moving should be started here. Otherwise, false. + * @protected + */ + isValidLabelHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Determines whether or not a label is allowed to be moved. + *

+ * This implementation returns false if the parent input mode {@link yfiles.input.GraphEditorInputMode#shouldMove forbids} moving the label. Overriding implementations should + * query this implementation as base if this feature is desired. + *

+ * @param {yfiles.input.IInputModeContext} context The context. + * @param {yfiles.graph.ILabel} label The label to be checked. + * @returns {boolean} true if the label is allowed to move. + * @see yfiles.input.MoveLabelInputMode#getHitLabel + * @protected + */ + shouldMove(context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):boolean; + /** + * Gets or sets a value indicating 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.graph.ILookup lookup}. + *

+ * @see yfiles.input.MoveLabelInputMode#createLabelPositionHandler + * @type {boolean} + */ + 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. + *

+ * @type {yfiles.graph.ILabel} + */ + movedLabel:yfiles.graph.ILabel; + /** + * Gets the {@link yfiles.view.IGraphSelection} this mode is acting upon. + * @type {yfiles.view.IGraphSelection} + */ + graphSelection:yfiles.view.IGraphSelection; + /** + * Gets the {@link yfiles.graph.IGraph} this mode is acting upon. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + /** + * 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.ItemDropInputMode.#draggedItem dragged node} is dropped, This mode can can drag + * nodes onto {@link yfiles.graph.IGraph#isGroupNode group} and optional {@link yfiles.graph.IFoldingView#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. + *

+ * @see yfiles.input.NodeDropInputMode#startDrag + * @class yfiles.input.NodeDropInputMode + * @extends {yfiles.input.ItemDropInputMode.} + */ + export interface NodeDropInputMode extends yfiles.input.ItemDropInputMode{} + export class NodeDropInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.NodeDropInputMode} class for the expected data format. + * @param {string} expectedFormat This is a format that is used in {@link yfiles.input.NodeDropInputMode#startDrag}. + * @protected + * @constructor + */ + constructor(expectedFormat:string); + /** + * Initializes a new instance of the {@link yfiles.input.NodeDropInputMode} class for {@link yfiles.graph.INode}s. + *

+ * This instance fires events only if the format of the data of the drag operation is the full name of the {@link yfiles.graph.INode} + * type. Such a drag operation can be started for example with {@link yfiles.input.NodeDropInputMode#startDrag}. + *

+ * @constructor + */ + constructor(); + /** + * Creates the node in the graph after it's been dropped. + *

+ * This method is called by the {@link yfiles.input.ItemDropInputMode.#itemCreator} that is set as default on this class. + *

+ * @param {yfiles.input.IInputModeContext} context The context for which the node should be created. + * @param {yfiles.graph.IGraph} graph The {@link yfiles.graph.IGraph Graph} in which to create the item. + * @param {yfiles.graph.INode} node The node that was dragged and should therefore be created. + * @param {yfiles.graph.IModelItem} dropTarget The {@link yfiles.graph.IModelItem} on which the node is dropped. + * @param {yfiles.geometry.Rect} layout The bounds of the new node. + * @returns {yfiles.graph.INode} a newly created node. + * @protected + */ + createNode(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,node:yfiles.graph.INode,dropTarget:yfiles.graph.IModelItem,layout:yfiles.geometry.Rect):yfiles.graph.INode; + /** + * 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.Point} mouseLocation Current mouse position + * @param {yfiles.geometry.Size} size Size of the node + * @returns {yfiles.geometry.Rect} a {@link yfiles.geometry.Rect} with the given size and the mouse location as center. + * @protected + */ + getNodeLayout(mouseLocation:yfiles.geometry.Point,size:yfiles.geometry.Size):yfiles.geometry.Rect; + /** + * Starts a drag and drop operation for a {@link yfiles.graph.INode}. + *

+ * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the node to the {@link yfiles.view.DragDropItem} + * using the corresponding type. + *

+ *

+ * If useCssCursors is 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-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @param {HTMLElement} dragSource The source of the drag operation. + * @param {yfiles.graph.INode} node The node to drag. + * @param {yfiles.view.DragDropEffects} [dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. + * @param {boolean} [useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. + * @see yfiles.view.DragSource#startDrag + * @see yfiles.view.DragDropItem + * @static + */ + static startDrag(dragSource:HTMLElement,node:yfiles.graph.INode,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean):void; + /** + * Starts a drag and drop operation for a {@link yfiles.graph.INode}. + *

+ * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the node to the {@link yfiles.view.DragDropItem} + * using the corresponding type. + *

+ *

+ * If useCssCursors is 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-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @param {Object} options The parameters to pass. + * @param {HTMLElement} options.dragSource The source of the drag operation. + * @param {yfiles.graph.INode} options.node The node to drag. + * @param {yfiles.view.DragDropEffects} [options.dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. + * @param {boolean} [options.useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. + * @see yfiles.view.DragSource#startDrag + * @see yfiles.view.DragDropItem + * @static + */ + static startDrag(options:{dragSource:HTMLElement,node:yfiles.graph.INode,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean}):void; + /** + * Gets or sets the callback for testing whether a {@link yfiles.input.ItemDropInputMode.#draggedItem dragged node} should be created as a {@link yfiles.graph.IGraph#isGroupNode group node}. + *

+ * The default implementation returns false always. Can be set to a different value to implement custom group node + * detection. + *

+ * @type {function(yfiles.graph.INode): boolean} + */ + 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 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 yfiles.input.NodeDropInputMode#allowNonGroupNodeAsParent + * @see yfiles.input.NodeDropInputMode#allowFolderNodeAsParent + * @type {function(yfiles.graph.INode): boolean} + */ + isValidParentPredicate:(obj:yfiles.graph.INode)=>boolean; + /** + * Gets or sets a value indicating whether nodes can be dropped on {@link yfiles.graph.IFoldingView#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} event will yield the node in the {@link yfiles.graph.FoldingManager#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. + *

+ * @type {boolean} + */ + allowFolderNodeAsParent:boolean; + /** + * Gets or sets a value indicating whether nodes can be dropped onto nodes that are no {@link yfiles.graph.IGraph#isGroupNode group nodes}. + *

+ * If this property is enabled, dropping a node on a non-group node will effectively convert the non-group 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. + *

+ * @type {boolean} + */ + allowNonGroupNodeAsParent:boolean; + /** + * Gets the currently dragged {@link yfiles.graph.IModelItem} instance. + *

+ * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to {@link yfiles.graph.INode}. + *

+ * @protected + * @type {yfiles.graph.INode} + */ + draggedItem:yfiles.graph.INode; + static $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.graph.IEdge 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 yfiles.input.IOrthogonalEdgeHelper + * @see yfiles.input.OrthogonalEdgeEditingContext#enabled + * @see yfiles.input.OrthogonalEdgeEditingContext#movePorts + * @class yfiles.input.OrthogonalEdgeEditingContext + */ + export interface OrthogonalEdgeEditingContext extends Object{} + export class OrthogonalEdgeEditingContext { + /** + * Initializes a new instance of the {@link yfiles.input.OrthogonalEdgeEditingContext} class that is initially {@link yfiles.input.OrthogonalEdgeEditingContext#enabled}. + * @constructor + */ + constructor(); + /** + * 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.MovementInfo} movementInfo The movement info that describes the movement of the bend. + */ + addExplicitlyMovedBend(movementInfo:yfiles.input.MovementInfo):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.MovementInfo} movementInfo The movement info for the bend. + * @returns {yfiles.input.MovementInfo} The info that has been registered with this instance. + */ + addImplicitlyMovedBend(movementInfo:yfiles.input.MovementInfo):yfiles.input.MovementInfo; + /** + * 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.MovementInfo} movementInfo The movement info that describes the movement of the end of the edge. The {@link yfiles.input.MovementInfo#movedItem} must be an {@link yfiles.graph.IEdge}. + * @param {boolean} sourceEnd true if the movementInfo represents the source end of the edge. + * @see yfiles.input.IEdgePortHandleProvider + */ + addMovedEdgeEnd(movementInfo:yfiles.input.MovementInfo,sourceEnd:boolean):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.MovementInfo} movementInfo The movement info that describes the movement of the port. + */ + addMovedPort(movementInfo:yfiles.input.MovementInfo):void; + /** + * 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#ARBITRARY_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} owner The item that will be transformed. + */ + addTransformedPortOwner(owner:yfiles.graph.IPortOwner):void; + /** + * 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; + /** + * 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}. + *

+ * @protected + */ + cleanUp():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} edge The modified edge. + * @see yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper + * @protected + */ + cleanUpEdgePath(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):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 yfiles.input.OrthogonalEdgeEditingContext#cleanUpEdgePath + * @protected + */ + cleanupEdgePaths(graph:yfiles.graph.IGraph):void; + /** + * Creates or obtains a previously created {@link yfiles.input.MovementInfo} 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} bend 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. + * @returns {yfiles.input.MovementInfo} The info to be used by clients that requested it. + */ + createImplicitlyMovedBendInfo(bend:yfiles.graph.IBend,horizontalAdjacentInfo:yfiles.input.MovementInfo,verticalAdjacentInfo:yfiles.input.MovementInfo):yfiles.input.MovementInfo; + /** + * 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 yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener + */ + dragFinished():void; + /** + * Needs to be called by client editing code after {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} has been called + * and all {@link yfiles.input.IDragHandler}s have been initialized. + *

+ * This method will update the {@link yfiles.input.OrthogonalEdgeEditingContext#isInitializing} and {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized} properties accordingly and will {@link yfiles.input.OrthogonalEdgeEditingContext#prepareEdgePaths prepare} the edge paths. Finally, the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} + * event is raised so that registered handlers can perform their post-initialization process. + *

+ */ + dragInitialized():void; + /** + * 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. + * @returns {yfiles.collections.IListEnumerable.} 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. + * @protected + */ + getMovementInfos(edge:yfiles.graph.IEdge):yfiles.collections.IListEnumerable; + /** + * 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.graph.ILookup#lookup} of the edge. + *

+ * @param {yfiles.graph.IEdge} edge The edge to obtain the helper instance for. + * @returns {yfiles.input.IOrthogonalEdgeHelper} The helper instance to use or null, in which case the default behavior will be used. + * @see yfiles.input.OrthogonalEdgeHelper + * @protected + */ + 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. + * @returns {yfiles.input.SegmentOrientation} The orientation of the segment. + */ + getSegmentOrientation(edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; + /** + * 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 {Stubs.Exceptions.InvalidOperationError} If this context is already {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} + * or currently + * {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing}. + * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized + */ + initializeDrag(context:yfiles.input.IInputModeContext):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 it is {@link yfiles.input.OrthogonalEdgeEditingContext#enabled disabled}. Otherwise {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} + * will be used to delegate the query to {@link yfiles.input.IOrthogonalEdgeHelper#shouldEditOrthogonally}. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context which is editing the edge. + * @param {yfiles.graph.IEdge} edge The edge that will be edited. + * @returns {boolean} true if this edge should be orthogonally edited for the specified input mode context; false otherwise. + * @see yfiles.input.OrthogonalEdgeEditingContext#enabled + * @see yfiles.input.IOrthogonalEdgeHelper#shouldEditOrthogonally + */ + isOrthogonallyEditedEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; + /** + * Locks the movement of the ports of the edges so that {@link yfiles.input.OrthogonalEdgeEditingContext#shouldMoveEndImplicitly} + * 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 yfiles.input.OrthogonalEdgeEditingContext#lockedPortEdges + */ + lockPortMovement(edge:yfiles.graph.IEdge):void; + /** + * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener CleanedUp} + * event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @protected + */ + onCleanedUp(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} + * event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener + * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized + * @protected + */ + onInitialized(evt:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing} + * event. + * @param {yfiles.input.InputModeEventArgs} evt The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener + * @see yfiles.input.OrthogonalEdgeEditingContext#initializeDrag + * @protected + */ + onInitializing(evt:yfiles.input.InputModeEventArgs):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. + * @protected + */ + 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.collections.IListEnumerable.} orientations The orientations of the segments - the array is of length (edge.Bends.Count + 1). + * @param {yfiles.collections.IListEnumerable.} infos The {@link yfiles.input.MovementInfo} instances for the source end, the bends, and the target end. This array contains {@link yfiles.input.MovementInfo} + * instances representing either edge ends or ports at the first and last position and {@link yfiles.input.MovementInfo}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). + * @protected + */ + prepareOrthogonalEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,orientations:yfiles.collections.IListEnumerable,infos:yfiles.collections.IListEnumerable):void; + /** + * Can be used by subclasses during PrepareOrthogonalEdge(IGraph,IEdge,SegmentOrientation[],MovementInfo[]) 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. + * @protected + */ + registerAddedBend(bend:yfiles.graph.IBend):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 yfiles.input.OrthogonalEdgeEditingContext#addedBends + * @see yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend + * @protected + */ + removeAddedBends(graph:yfiles.graph.IGraph,addedBends:yfiles.collections.IEnumerable):void; + /** + * 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 the {@link yfiles.input.IOrthogonalEdgeHelper#shouldMoveEndImplicitly} method of the + * {@link yfiles.input.IOrthogonalEdgeHelper} instance returned by {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} + * 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. + * @returns {boolean} true if the specified side of the edge can be moved; false otherwise, in which case the segment should be split to + * maintain orthogonality. + * @see yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper + * @see yfiles.input.IOrthogonalEdgeHelper#shouldMoveEndImplicitly + * @see yfiles.input.OrthogonalEdgeEditingContext#movePorts + */ + shouldMoveEndImplicitly(edge:yfiles.graph.IEdge,sourceSide:boolean):boolean; + /** + * Adds the given listener for the CleanedUp event that occurs when the recent edit operation has been cleaned up. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.OrthogonalEdgeEditingContext#cleanUp + * @see yfiles.input.OrthogonalEdgeEditingContext#onCleanedUp + * @see yfiles.input.OrthogonalEdgeEditingContext#removeCleanedUpListener + */ + addCleanedUpListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the CleanedUp event that occurs when the recent edit operation has been cleaned up. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.OrthogonalEdgeEditingContext#cleanUp + * @see yfiles.input.OrthogonalEdgeEditingContext#onCleanedUp + * @see yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener + */ + removeCleanedUpListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Initializing event that occurs when the edit is about to be initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.OrthogonalEdgeEditingContext#initializeDrag + * @see yfiles.input.OrthogonalEdgeEditingContext#onInitializing + * @see yfiles.input.OrthogonalEdgeEditingContext#removeInitializingListener + */ + addInitializingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Initializing event that occurs when the edit is about to be initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.OrthogonalEdgeEditingContext#initializeDrag + * @see yfiles.input.OrthogonalEdgeEditingContext#onInitializing + * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener + */ + removeInitializingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Initialized event that occurs when the edit has been initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized + * @see yfiles.input.OrthogonalEdgeEditingContext#onInitialized + * @see yfiles.input.OrthogonalEdgeEditingContext#removeInitializedListener + */ + addInitializedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Initialized event that occurs when the edit has been initialized. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.OrthogonalEdgeEditingContext#dragInitialized + * @see yfiles.input.OrthogonalEdgeEditingContext#onInitialized + * @see yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener + */ + removeInitializedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Gets or sets a value indicating whether this instance is currently initializing. + * @type {boolean} + */ + isInitializing:boolean; + /** + * Gets or sets a value indicating whether orthogonal edge editing is enabled at all. + *

+ * The default value is true. + *

+ * @see yfiles.input.OrthogonalEdgeEditingContext#isOrthogonallyEditedEdge + * @see yfiles.input.IOrthogonalEdgeHelper#shouldEditOrthogonally + * @default true + * @type {boolean} + */ + enabled:boolean; + /** + * Gets or sets a value indicating ports are allowed to be moved at all. + *

+ * The default value is true. + *

+ * @see yfiles.input.OrthogonalEdgeEditingContext#shouldMoveEndImplicitly + * @see yfiles.input.IOrthogonalEdgeHelper#shouldMoveEndImplicitly + * @default true + * @type {boolean} + */ + movePorts:boolean; + /** + * Gets the current input mode context that is in effect for the current edit. + * @protected + * @type {yfiles.input.IInputModeContext} + */ + currentInputModeContext:yfiles.input.IInputModeContext; + /** + * 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}. + *

+ * @type {boolean} + */ + isInitialized:boolean; + /** + * Gets the previously {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend registered added} bends. + * @protected + * @type {yfiles.collections.IEnumerable.} + */ + addedBends:yfiles.collections.IEnumerable; + /** + * 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. + *

+ * @see yfiles.input.MoveTypes#ARBITRARY_MOVE + * @protected + * @type {yfiles.collections.IEnumerable.} + */ + 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#shouldMoveEndImplicitly} + * returns false for these edges. Note that this collection is reset for each edit. + *

+ * @see yfiles.input.MoveTypes#ARBITRARY_MOVE + * @type {yfiles.collections.IEnumerable.} + */ + lockedPortEdges:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.input.OrthogonalEdgeHelper + * @implements {yfiles.input.IOrthogonalEdgeHelper} + */ + export interface OrthogonalEdgeHelper extends Object,yfiles.input.IOrthogonalEdgeHelper{} + export class OrthogonalEdgeHelper { + /** + * Returns whether the given bend can be removed. + *

+ * This implementation always returns true. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.graph.IBend} bend The bend that is designated for removal. + * @returns {boolean} + * @protected + */ + canRemoveBend(context:yfiles.input.IInputModeContext,bend:yfiles.graph.IBend):boolean; + /** + * Callback method that is invoked after the provided edge has been edited orthogonally. + *

+ * The default implementation in this class removes duplicate and collinear bends, as well as segments of zero length. + *

+ * @param {yfiles.input.IInputModeContext} context 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. + */ + cleanUpEdge(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; + /** + * 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} context 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. + * @returns {yfiles.input.SegmentOrientation} The declared orientation of the segment. + */ + getSegmentOrientation(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; + /** + * Determines whether the provided edge should be edited orthogonally in the specified input mode context. + *

+ * If this method returns false, the other methods will not be queried at all. + *

+ *

+ * The default implementation in this class always returns true. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context in which the edge is about to be edited. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @returns {boolean} true if the edge should be orthogonally edited in the specified input mode context; false otherwise. + */ + shouldEditOrthogonally(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; + /** + * 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. + *

+ *

+ * The default implementation in this class always returns false. + *

+ * @param {yfiles.input.IInputModeContext} context 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. + * @returns {boolean} true if the end of the edge can be moved for the specified input mode context; false otherwise, in which case the + * corresponding segment needs to be split to keep the segment orientation orthogonal. + */ + shouldMoveEndImplicitly(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceEnd:boolean):boolean; + static $class:yfiles.lang.Class; + } + /** + * 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#locationParameter} + *

+ * 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}. + *

+ * @class yfiles.input.PortLocationModelParameterHandle + * @implements {yfiles.input.IHandle} + */ + export interface PortLocationModelParameterHandle extends Object,yfiles.input.IHandle{} + export class PortLocationModelParameterHandle { + /** + * 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. + * @constructor + */ + constructor(port:yfiles.graph.IPort); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * 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} evt The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @protected + */ + collectSnapResults(source:Object,evt:yfiles.input.CollectSnapResultsEventArgs):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Gets the graph to use for {@link yfiles.graph.IGraph#setPortLocationParameter setting the parameter} from the context. + * @param {yfiles.input.IInputModeContext} context The input mode context to use. + * @returns {yfiles.graph.IGraph} The graph or null if the graph could not be obtained. + * @see yfiles.input.IInputModeContext#graph + * @protected + */ + getGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IGraph; + /** + * Determines the type of the movement for the given port. + *

+ * This is used for the {@link yfiles.input.MovementInfo} that is passed to the {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedPort} + * method. + *

+ * @param {yfiles.graph.IPort} port The port to determine the move type for. + * @returns {yfiles.input.MoveTypes} This implementation returns {@link yfiles.input.MoveTypes#LINEAR_MOVE} for models of type {@link yfiles.graph.FreeNodePortLocationModel} + * and {@link yfiles.input.MoveTypes#ARBITRARY_MOVE} for all others. + * @protected + */ + getMoveType(port:yfiles.graph.IPort):yfiles.input.MoveTypes; + /** + * 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.Point} location The new location. + * @returns {yfiles.graph.IPortLocationModelParameter} The new parameter to use. + * @protected + */ + getNewParameter(port:yfiles.graph.IPort,model:yfiles.graph.IPortLocationModel,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * 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} locationParameter The new parameter to apply. + * @protected + */ + setParameter(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * Gets the port this instance acts on. + * @protected + * @type {yfiles.graph.IPort} + */ + port:yfiles.graph.IPort; + /** + * Gets or sets the type of the handle that can be used by the rendering engine to render types differently. + * @type {yfiles.input.HandleTypes} + */ + type:yfiles.input.HandleTypes; + /** + * Gets or sets the cursor to display when the mouse hovers over or drags this handle. + * @type {yfiles.view.Cursor} + */ + cursor:yfiles.view.Cursor; + static $class:yfiles.lang.Class; + } + /** + * Simple default implementation of {@link yfiles.input.IReparentNodeHandler} that treats shift key presses as reparent gestures + * and allows for reparenting all nodes. + * @class yfiles.input.ReparentNodeHandler + * @implements {yfiles.input.IReparentNodeHandler} + */ + export interface ReparentNodeHandler extends Object,yfiles.input.IReparentNodeHandler{} + export class ReparentNodeHandler { + constructor(); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.graph.INode} node + * @returns {boolean} + */ + isReparentGesture(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.graph.INode} node + * @param {yfiles.graph.INode} newParent + * @returns {boolean} + */ + isValidParent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.graph.INode} node + * @param {yfiles.graph.INode} newParent + */ + reparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.graph.INode} node + * @returns {boolean} + */ + shouldReparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + /** + * Gets or sets the event recognizer that will be queried to determine whether the gesture is a reparent gesture. + *

+ * The default is {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED} + *

+ * @see yfiles.input.ReparentNodeHandler#isReparentGesture + * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + reparentRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.input.NodeSnapLineProvider + * @implements {yfiles.input.ISnapLineProvider} + */ + export interface NodeSnapLineProvider extends Object,yfiles.input.ISnapLineProvider{} + export class NodeSnapLineProvider { + /** + * 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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.Rect} layout The layout of the node to use for adding the snap lines. + * @protected + */ + addCenterSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.Rect} layout The layout of the node to use for adding the snap lines. + * @protected + */ + addFixedNodeBorderSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.Rect} layout The layout of the node to use for adding the snap lines. + * @protected + */ + addNodeToNodeSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; + /** + * 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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.Rect} layout The layout of the node to use for adding the snap lines. + * @protected + */ + addNodeToSegmentSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.Rect} layout The layout of the node to use for adding the snap lines. + * @protected + */ + addPortSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; + /** + * 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} evt The argument to use for adding snap lines. + * @param {yfiles.graph.IModelItem} item The item to add snap lines for. + */ + addSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.graph.IModelItem):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} orientation The snap line orientation. + * @param {yfiles.geometry.Point} location The location of the snap line. + * @returns {yfiles.input.OrthogonalSnapLine} A snap line that other centers can snap to. + * @protected + */ + createCenterSnapLine(context:yfiles.input.GraphSnapContext,node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,location:yfiles.geometry.Point):yfiles.input.OrthogonalSnapLine; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.ILookup#lookup} of an {@link yfiles.graph.IEdge}. + *

+ * @see yfiles.graph.EdgeDecorator#snapLineProviderDecorator + * @class yfiles.input.EdgeSnapLineProvider + * @implements {yfiles.input.ISnapLineProvider} + */ + export interface EdgeSnapLineProvider extends Object,yfiles.input.ISnapLineProvider{} + export class EdgeSnapLineProvider { + /** + * 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.Point} segmentStart The start of the segment. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt The argument to use for adding snap lines. + * @param {yfiles.geometry.Point} segmentEnd The end of the segment. + * @see yfiles.input.EdgeSnapLineProvider#addVerticalSegmentSnapLines + * @protected + */ + addHorizontalSegmentSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,edge:yfiles.graph.IEdge,segmentStart:yfiles.geometry.Point,segmentEnd:yfiles.geometry.Point):void; + /** + * 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.graph.IModelItem} item The item to add snap lines for. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt The argument to use for adding snap lines. + */ + addSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.graph.IModelItem):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.Point} segmentStart The start of the segment. + * @param {yfiles.geometry.Point} segmentEnd The end of the segment. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} evt The argument to use for adding snap lines. + * @see yfiles.input.EdgeSnapLineProvider#addHorizontalSegmentSnapLines + * @protected + */ + addVerticalSegmentSnapLines(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectGraphSnapLinesEventArgs,edge:yfiles.graph.IEdge,segmentStart:yfiles.geometry.Point,segmentEnd:yfiles.geometry.Point):void; + static $class:yfiles.lang.Class; + } + /** + * The default implementation of the {@link yfiles.input.INodeSnapResultProvider} interface. + * @class yfiles.input.NodeSnapResultProvider + * @implements {yfiles.input.INodeSnapResultProvider} + */ + export interface NodeSnapResultProvider extends Object,yfiles.input.INodeSnapResultProvider{} + export class NodeSnapResultProvider { + /** + * 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 location 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} evt The arguments to add the results to. + * @param {yfiles.geometry.Point} location 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. + * @protected + */ + addGridSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,location:yfiles.geometry.Point,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 location 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} evt The arguments to add the results to. + * @param {yfiles.geometry.Point} location 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.input.GridSnapTypes} 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. + * @protected + */ + addGridSnapResultCore(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,location:yfiles.geometry.Point,node:yfiles.graph.INode,gridSnapType:yfiles.input.GridSnapTypes,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):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} evt The arguments to add the results to. + * @param {yfiles.geometry.Rect} suggestedLayout The layout of the node if it would move without snapping. + * @param {yfiles.graph.INode} node The node that is currently being processed. + * @protected + */ + collectGridSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,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} evt The {@link yfiles.input.CollectSnapResultsEventArgs} instance to which the results should be {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult added}. + * @param {yfiles.geometry.Rect} suggestedLayout The suggested layout of the node. + * @param {yfiles.graph.INode} node The node that is being dragged. + * @protected + */ + collectSnapLineSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; + /** + * + * @param {yfiles.input.GraphSnapContext} context + * @param {yfiles.input.CollectSnapResultsEventArgs} evt + * @param {yfiles.geometry.Rect} suggestedLayout + * @param {yfiles.graph.INode} node + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.Rect,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.SnapResult} for a {@link yfiles.input.SnapLine} will be created and added to the event + * argument. + *

+ * @param {yfiles.input.CollectSnapResultsEventArgs} evt The arguments to add the results to. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to test snapping for. + * @param {yfiles.geometry.Rect} suggestedLayout The layout of the node if it would move without snapping. + * @param {yfiles.graph.INode} node The node that is currently being processed. + * @protected + */ + collectSnapResultsForSnapLine(evt:yfiles.input.CollectSnapResultsEventArgs,snapLine:yfiles.input.OrthogonalSnapLine,suggestedLayout:yfiles.geometry.Rect,node:yfiles.graph.INode):void; + /** + * Yields the static shared instance of this class. + * @const + * @static + * @type {yfiles.input.INodeSnapResultProvider} + */ + static INSTANCE:yfiles.input.INodeSnapResultProvider; + static $class:yfiles.lang.Class; + } + /** + * The default implementation of the {@link yfiles.input.INodeReshapeSnapResultProvider} interface. + * @class yfiles.input.NodeReshapeSnapResultProvider + * @implements {yfiles.input.INodeReshapeSnapResultProvider} + */ + export interface NodeReshapeSnapResultProvider extends Object,yfiles.input.INodeReshapeSnapResultProvider{} + export class NodeReshapeSnapResultProvider { + /** + * 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} evt 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.Point} snappedLocation The location of the mouse that is associated with the grid point. + * @param {yfiles.input.SnapLineSnapTypes} 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.Point} snapLinePoint A point of interest on the snap line that can be highlighted. + * @protected + */ + addGridLineSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,snapLineType:yfiles.input.SnapLineSnapTypes,snapLineLocation:yfiles.geometry.IPoint,delta:number,snappedLocation:yfiles.geometry.Point,from:number,to:number,snapLinePoint:yfiles.geometry.Point):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} evt 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.Point} gridSnappedPoint The point on the grid that should be highlighted. + * @param {yfiles.geometry.Point} snappedLocation The location of the mouse that is associated with the grid point. + * @protected + */ + addGridSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,provider:yfiles.input.IGridConstraintProvider,gridSnappedPoint:yfiles.geometry.Point,snappedLocation:yfiles.geometry.Point):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} evt 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. + * @protected + */ + addSameSizeSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,rectangles:yfiles.collections.IEnumerable,finalSize:number,snapDelta:number):void; + /** + * 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} evt 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.Point} snapPoint The point of interest that can be highlighted on the snap line. + * @protected + */ + addSnaplineSnapResult(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,snapLine:yfiles.input.OrthogonalSnapLine,delta:number,snapPoint:yfiles.geometry.Point):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} evt 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.Rect} suggestedLayout The suggested layout of the node. + * @protected + */ + collectGridSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):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} evt 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.Rect} suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. + * @protected + */ + collectSameSizeSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):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} evt 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.Rect} suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. + * @protected + */ + collectSnapLineResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):void; + /** + * 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} evt 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. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,evt:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext):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.Rect} suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. + * @returns {yfiles.collections.IEnumerable.} + * @protected + */ + getSnapLines(context:yfiles.input.GraphSnapContext,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.Rect):yfiles.collections.IEnumerable; + /** + * A shared singleton instance of this type. + * @const + * @static + * @type {yfiles.input.INodeReshapeSnapResultProvider} + */ + static INSTANCE:yfiles.input.INodeReshapeSnapResultProvider; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.ILookup#lookup} of an edge, e.g. + *

+ * @class yfiles.input.DefaultBendCreator + * @implements {yfiles.input.IBendCreator} + */ + export interface DefaultBendCreator extends Object,yfiles.input.IBendCreator{} + export class DefaultBendCreator { + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.graph.IGraph} graph + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.geometry.Point} location + * @returns {number} + */ + createBend(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.Point):number; + static $class:yfiles.lang.Class; + } + /** + * An abstract convenience implementation of the {@link yfiles.input.IPortCandidateProvider} interface. + * @class yfiles.input.PortCandidateProviderBase + * @implements {yfiles.input.IPortCandidateProvider} + */ + export interface PortCandidateProviderBase extends Object,yfiles.input.IPortCandidateProvider{} + export class PortCandidateProviderBase { + /** + * Convenience method for subclasses that adds all existing {@link yfiles.graph.IPortOwner#ports} of the owner to the provided list. + * @param {yfiles.graph.IPortOwner} owner The port owner whose ports should be added. + * @param {yfiles.collections.IList.} list The list to add candidates for existing ports to. + * @protected + */ + addExistingPorts(owner:yfiles.graph.IPortOwner,list:yfiles.collections.IList):void; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.PortCandidateProviderBase#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createPort} queries to. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter 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=true] Whether the port should be {@link yfiles.input.PortCandidateValidity#VALID}. + * @returns {yfiles.input.DefaultPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createPort} method delegates to this instance's + * {@link yfiles.input.PortCandidateProviderBase#createInstance}. + * @protected + */ + createCandidate(owner:yfiles.graph.IPortOwner,locationParameter:yfiles.graph.IPortLocationModelParameter,valid?:boolean):yfiles.input.DefaultPortCandidate; + /** + * Callback method used by the ports created using the factory methods + * CreateCandidate(IPortOwner,IPortLocationModelParameter). + *

+ * 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. + * @returns {yfiles.graph.IPort} The new port. + * @protected + */ + createInstance(context:yfiles.input.IInputModeContext,candidate:yfiles.input.DefaultPortCandidate):yfiles.graph.IPort; + /** + * Callback method used by the ports created using the factory methods + * CreateCandidate(IPortOwner,IPortLocationModelParameter). + *

+ * 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.Point} suggestedLocation The location to get a candidate for. + * @returns {yfiles.input.IPortCandidate} The new candidate whose {@link yfiles.input.IPortCandidate#validity} may not be {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @protected + */ + getPortCandidateAt(context:yfiles.input.IInputModeContext,candidate:yfiles.input.DefaultPortCandidate,suggestedLocation:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * 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. + * @returns {yfiles.collections.IEnumerable.} An enumerable collection of port candidates. + * @protected + * @abstract + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.input.IPortCandidate} target + * @returns {yfiles.collections.IEnumerable.} + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. + * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.collections.IEnumerable.} + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.input.IPortCandidate} source + * @returns {yfiles.collections.IEnumerable.} + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.PortCandidateProviderBase#getPortCandidates}. + * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.collections.IEnumerable.} + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Gets or sets the style to use for the creation of the port in {@link yfiles.input.PortCandidateProviderBase#createInstance}. + *

+ * A value of null will make the implementation use the corresponding current default port style. + *

+ * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * The tag to assign to the port in {@link yfiles.input.PortCandidateProviderBase#createInstance} + * @type {Object} + */ + tag:Object; + static $class:yfiles.lang.Class; + } + /** + * 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.IEdgeReconnectionPortCandidateProvider} that is queried from the {@link yfiles.graph.IEdge} + * this handle is acting on. + *

+ * @see yfiles.input.PortRelocationHandle#getPortCandidates + * @see yfiles.graph.EdgeDecorator#edgeReconnectionPortCandidateProviderDecorator + * @class yfiles.input.PortRelocationHandle + * @implements {yfiles.input.IHandle} + */ + export interface PortRelocationHandle extends Object,yfiles.input.IHandle{} + export class PortRelocationHandle { + /** + * 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. + * @constructor + */ + constructor(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourceEnd:boolean); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Factory method that creates the {@link yfiles.view.ICanvasObjectDescriptor} that will be used to paint the "current" + * {@link yfiles.input.IPortCandidate}. + * @returns {yfiles.view.ICanvasObjectDescriptor} The descriptor to use for the rendering in the {@link yfiles.view.CanvasComponent}. + * @protected + */ + createCurrentPortCandidateDescriptor():yfiles.view.ICanvasObjectDescriptor; + /** + * Factory method that creates the dummy edge that will be shown during the drag operation. + * @param {yfiles.graph.IEdge} edge The edge to be represented by the dummy edge. + * @returns {yfiles.graph.SimpleEdge} The dummy edge instance to use. + * @see yfiles.input.PortRelocationHandle#showDummyEdge + * @protected + */ + createDummyEdge(edge:yfiles.graph.IEdge):yfiles.graph.SimpleEdge; + /** + * Factory method that creates a dummy paintable for the dummy edge during the drag operation. + * @param {yfiles.graph.SimpleEdge} dummy The dummy to create a paintable for. + * @returns {yfiles.view.IVisualCreator} A paintable that shows the dummy. + * @see yfiles.input.PortRelocationHandle#showDummyEdge + * @protected + */ + createDummyEdgeVisualCreator(dummy:yfiles.graph.SimpleEdge):yfiles.view.IVisualCreator; + /** + * Factory method that creates the candidate for the existing port. + * @param {yfiles.graph.IPort} port The port to create a candidate for. + * @returns {yfiles.input.IPortCandidate} The candidate or null. + * @see yfiles.input.PortRelocationHandle#getPortCandidates + * @see yfiles.input.PortRelocationHandle#addExistingPort + * @protected + */ + createExistingPortCandidate(port:yfiles.graph.IPort):yfiles.input.IPortCandidate; + /** + * Factory method that creates the {@link yfiles.view.ICanvasObjectDescriptor} that will be used to paint the + * {@link yfiles.input.IPortCandidate}s. + * @returns {yfiles.view.ICanvasObjectDescriptor} The descriptor to use for the rendering in the {@link yfiles.view.CanvasComponent}. + * @protected + */ + createPortCandidateDescriptor():yfiles.view.ICanvasObjectDescriptor; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):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.Point} location The location for which to find a candidate. + * @param {yfiles.collections.IEnumerable.} candidates The list of possible candidates. + * @returns {yfiles.input.IPortCandidate} The closes candidate or null. + * @protected + */ + getClosestCandidate(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,candidates:yfiles.collections.IEnumerable):yfiles.input.IPortCandidate; + /** + * Gets the graph to use from the context. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @returns {yfiles.graph.IGraph} A graph instance or null. + * @protected + */ + getGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IGraph; + /** + * 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#createPort} or calls {@link yfiles.graph.IGraph#addPort} if + * the result was null. + *

+ * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.input.IPortCandidate} portCandidate The candidate to get a port instance from. + * @param {yfiles.geometry.Point} suggestedLocation The suggested location for the port. + * @returns {yfiles.graph.IPort} A non-null port instance. + * @see yfiles.input.PortRelocationHandle#setPorts + * @protected + */ + getPort(context:yfiles.input.IInputModeContext,portCandidate:yfiles.input.IPortCandidate,suggestedLocation:yfiles.geometry.Point):yfiles.graph.IPort; + /** + * Gets the possible candidates for the given edge. + *

+ * This implementation uses the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} from the edge's {@link yfiles.graph.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. + * @returns {yfiles.collections.IEnumerable.} A non-null enumerable over the candidates. + * @protected + */ + getPortCandidates(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourcePort:boolean):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * 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 yfiles.input.PortRelocationHandle#unhideOriginalEdge + * @see yfiles.input.PortRelocationHandle#showDummyEdge + * @protected + */ + hideOriginalEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * Determines whether {@link yfiles.input.PortRelocationHandle#resolveCandidate port candidate resolution} is enabled for the current gesture. + *

+ * This implementation checks whether the the parent input mode is an instance of {@link yfiles.input.HandleInputMode}, the {@link yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer} + * recognizes its {@link yfiles.view.MouseEventArgs}, and the {@link yfiles.input.HandleInputMode#currentHandle}'s location is equal to this {@link yfiles.input.PortRelocationHandle#location}. + *

+ * @param {yfiles.input.IInputModeContext} context The context to inspect. + * @returns {boolean} true if port candidates may be resolved; false otherwise. + * @protected + */ + isPortCandidateResolutionEnabled(context:yfiles.input.IInputModeContext):boolean; + /** + * 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} portCandidate The candidate. + * @param {yfiles.geometry.Point} location The current location. + * @returns {yfiles.input.IPortCandidate} A candidate. + * @protected + */ + resolveCandidate(context:yfiles.input.IInputModeContext,portCandidate:yfiles.input.IPortCandidate,location:yfiles.geometry.Point):yfiles.input.IPortCandidate; + /** + * Updates the closest candidate for visual feedback. + * @param {yfiles.input.IPortCandidate} portCandidate + * @protected + */ + setClosestCandidate(portCandidate:yfiles.input.IPortCandidate):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.Point} suggestedLocation The suggested location for the port. + * @protected + */ + setPort(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,setSourcePort:boolean,portCandidate:yfiles.input.IPortCandidate,suggestedLocation:yfiles.geometry.Point):void; + /** + * 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. + * @protected + */ + setPorts(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Updates the position of the handle. + * @param {yfiles.geometry.Point} location The new location of the handle. + * @protected + */ + setPosition(location:yfiles.geometry.Point):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} portCandidate The new candidate to indicate. + * @protected + */ + setToPortCandidate(dummy:yfiles.graph.SimpleEdge,source:boolean,portCandidate:yfiles.input.IPortCandidate):void; + /** + * Unhides the original edge that was hidden during the drag operation. + * @param {yfiles.graph.IEdge} edge The edge to unhide. + * @param {yfiles.view.CanvasComponent} canvas The canvas the edge was hidden from. + * @see yfiles.input.PortRelocationHandle#hideOriginalEdge + * @see yfiles.input.PortRelocationHandle#showDummyEdge + * @protected + */ + unhideOriginalEdge(edge:yfiles.graph.IEdge,canvas:yfiles.view.CanvasComponent):void; + /** + * Gets or sets a value indicating whether to show the candidates of hit {@link yfiles.graph.IPortOwner}s only. + * @type {boolean} + */ + showHitPortOwnerCandidatesOnly:boolean; + /** + * 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. + *

+ * @type {number} + */ + maximumSnapDistance:number; + /** + * Determines whether or not edges are allowed to connect to other edges. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + allowEdgeToEdgeConnections:boolean; + /** + * Determines whether or not cyclic port dependencies are allowed. + *

+ * If {@link yfiles.input.PortRelocationHandle#allowEdgeToEdgeConnections 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. + *

+ * @default false + * @type {boolean} + */ + allowCyclicPortDependencies: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. + *

+ * @type {boolean} + */ + addExistingPort:boolean; + /** + * + * @type {yfiles.input.HandleTypes} + */ + type:yfiles.input.HandleTypes; + /** + * + * @type {yfiles.view.Cursor} + */ + cursor:yfiles.view.Cursor; + /** + * Gets or sets a value indicating whether a {@link yfiles.input.PortCandidateValidity#DYNAMIC dynamic port candidate} 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 {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED holds the shift modifier} + * during the gesture. + *

+ * @see yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer + * @see yfiles.input.PortRelocationHandle#resolveCandidate + * @default true + * @type {boolean} + */ + resolvePortCandidates:boolean; + /** + * Gets or sets the event recognizer that determines whether a {@link yfiles.input.PortCandidateValidity#DYNAMIC dynamic port candidate} should be resolved. + *

+ * Note that this property has no effect if {@link yfiles.input.PortRelocationHandle#resolvePortCandidates} is set to false. + *

+ *

+ * By default this is set to {@link yfiles.input.KeyEventRecognizers#SHIFT_PRESSED}. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + portCandidateResolutionRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets a value indicating whether the source end of the edge is handled by this instance. + * @protected + * @type {boolean} + */ + sourceEnd:boolean; + /** + * Gets the edge this instance acts upon. + * @protected + * @type {yfiles.graph.IEdge} + */ + edge:yfiles.graph.IEdge; + /** + * Gets the dummy edge this instance uses during the edit. + * @see yfiles.input.PortRelocationHandle#showDummyEdge + * @protected + * @type {yfiles.graph.SimpleEdge} + */ + dummyEdge:yfiles.graph.SimpleEdge; + /** + * Gets or sets a value indicating whether to show a dummy edge during the drag operation. + *

+ * The default is true. + *

+ * @default true + * @type {boolean} + */ + showDummyEdge:boolean; + /** + * Gets or sets the context to operate on. + * @protected + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns a view of the location of the item. + *

+ * This implementation returns this. + *

+ * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + static $class:yfiles.lang.Class; + } + /** + * 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.DefaultGraph#defaultEdgeLookup}) will use the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} interface to collect the + * source and target port handles. + *

+ * @class yfiles.input.PortRelocationHandleProvider + * @implements {yfiles.input.IHandleProvider} + * @implements {yfiles.input.IEdgePortHandleProvider} + */ + export interface PortRelocationHandleProvider extends Object,yfiles.input.IHandleProvider,yfiles.input.IEdgePortHandleProvider{} + export class PortRelocationHandleProvider { + /** + * 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. + * @constructor + */ + constructor(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge); + /** + * Factory method that creates the handle for this provider. + * @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. + * @returns {yfiles.input.IHandle} A handle or null. + * @protected + */ + createPortRelocationHandle(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourcePort:boolean):yfiles.input.IHandle; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.collections.IEnumerable.} + */ + getHandles(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * The graph this provider is working on. + * @protected + * @const + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * The edge this provider is working on. + * @protected + * @const + * @type {yfiles.graph.IEdge} + */ + edge:yfiles.graph.IEdge; + static $class:yfiles.lang.Class; + } + /** + * 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#remove}. 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. + *

+ * @class yfiles.input.PortsHandleProvider + * @implements {yfiles.input.IHandleProvider} + */ + export interface PortsHandleProvider extends Object,yfiles.input.IHandleProvider{} + export class PortsHandleProvider { + /** + * Creates an instance using the given owner as the provider for the ports. + * @param {yfiles.graph.IPortOwner} owner + * @constructor + */ + constructor(owner:yfiles.graph.IPortOwner); + /** + * Retrieves the handle implementation from the port's lookup. + * @param {yfiles.graph.IPort} port + * @returns {yfiles.input.IHandle} + * @protected + */ + getHandle(port:yfiles.graph.IPort):yfiles.input.IHandle; + /** + * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations that are associated with the ports of this + * context. + * @param {yfiles.input.IInputModeContext} context + * @returns {yfiles.collections.IEnumerable.} A collection of handles. + */ + getHandles(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * The owner of the ports. + * @protected + * @const + * @type {yfiles.graph.IPortOwner} + */ + portOwner:yfiles.graph.IPortOwner; + static $class:yfiles.lang.Class; + } + /** + * 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}. + *

+ *

+ * This mode is {@link yfiles.input.ResizeStripeInputMode#exclusive} by default. + *

+ * @class yfiles.input.ResizeStripeInputMode + * @implements {yfiles.input.IInputMode} + */ + export interface ResizeStripeInputMode extends Object,yfiles.input.IInputMode{} + export class ResizeStripeInputMode { + /** + * Creates a new instance of this input mode. + * @constructor + */ + constructor(); + /** + * Cancels the editing of this mode. + *

+ * This implementation {@link yfiles.input.ConcurrencyController#releaseMutex releases} the mutex if it is currently owned by this instance and calls + * {@link yfiles.input.ResizeStripeInputMode#onCanceled}. + *

+ * @see yfiles.input.ResizeStripeInputMode#onCanceled + */ + cancel():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. + *

+ *

+ * Overriding implementations should call the base implementation, first. + *

+ * @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. + * @param {yfiles.input.ConcurrencyController} controller The {@link yfiles.input.ResizeStripeInputMode#controller} for this mode. + * @see yfiles.input.IInputMode#uninstall + */ + install(context:yfiles.input.IInputModeContext,controller:yfiles.input.ConcurrencyController):void; + /** + * Called to determine whether it is valid to begin the gesture + *

+ * This implementation checks whether a stripe border has been hit at the latest {@link yfiles.view.MouseEventArgs} + *

+ * @param {Object} source + * @param {yfiles.lang.EventArgs} evt + * @returns {boolean} true iff a stripe border has been hit at the latest {@link yfiles.view.MouseEventArgs} + * @protected + */ + isValidBegin(source:Object,evt:yfiles.lang.EventArgs):boolean; + /** + * Called after {@link yfiles.input.ResizeStripeInputMode#cancel} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been canceled. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onCanceled():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to true. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been activated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerActivated():void; + /** + * Called after the {@link yfiles.input.ConcurrencyController#active} property of the installed {@link yfiles.input.ConcurrencyController} has been set to false. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been deactivated. + *

+ *

+ * Overriding implementations should call the base implementation. + *

+ * @protected + */ + onConcurrencyControllerDeactivated():void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceled(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragCanceling(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinished(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragFinishing(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragged(evt: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} evt The event argument that contains context information. + * @protected + */ + onDragging(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarted(evt:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} evt The event argument that contains context information. + * @protected + */ + onDragStarting(evt:yfiles.input.InputModeEventArgs):void; + /** + * Called after {@link yfiles.input.ResizeStripeInputMode#tryStop} has been called. + *

+ * Can be overridden in subclasses to perform additional actions after the mode has been stopped. + *

+ *

+ * This implementation does nothing. + *

+ * @protected + */ + onStopped():void; + /** + * + * @returns {boolean} + */ + tryStop():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. + *

+ *

+ * Overriding implementations should call the base implementation after their own code. + *

+ * @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. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * + * @type {number} + */ + priority:number; + /** + * Gets or sets a value indicating whether this mode will be the only one running when it has the mutex. + *

+ * The value of this property will be delegated to the {@link yfiles.input.ConcurrencyController#exclusive} property of the {@link yfiles.input.ResizeStripeInputMode#controller}. + *

+ *

+ * If this mode is marked as exclusive and has the mutex, all other modes {@link yfiles.input.MultiplexingInputMode#add added} to the same {@link yfiles.input.MultiplexingInputMode} + * will be deactivated. Otherwise it will always run concurrently with all other modes. + *

+ * @type {boolean} + */ + exclusive:boolean; + /** + * Gets or sets the enabled state of this input mode. + *

+ * Clients can use this property to disable or reenable this instance. This will set the {@link yfiles.input.ConcurrencyController#enabled Enabled} property of the installed + * {@link yfiles.input.ResizeStripeInputMode#controller} so a disabled instance should never try to acquire the input mutex. + *

+ * @type {boolean} + */ + enabled:boolean; + /** + * + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Returns the installed {@link yfiles.input.ResizeStripeInputMode#controller}. + * @protected + * @type {yfiles.input.ConcurrencyController} + */ + controller:yfiles.input.ConcurrencyController; + /** + * 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. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer for touch input. + *

+ * This recognizer instance determines when the user is moving a handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer for touch input. + *

+ * This instance determines when the user has finished moving the handle. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizerTouch:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "pressed" state recognizer. + *

+ * This recognizer instance will be used to determine when the user begins to resize the stripe. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + pressedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "dragged" recognizer. + *

+ * This recognizer instance determines when the user is dragging the mouse to resize the stripe. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + draggedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "cancel" recognizer. + *

+ * This recognizer recognizes a cancel action during the resize operation. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + cancelRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets the "released" recognizer. + *

+ * This instance determines when the user has finished the resize operation. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + releasedRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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). + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + resizeNeighborsRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * 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. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + ignoreContentRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Adds the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDragFinishingListener + */ + addDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinishing event that occurs before the drag will be finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDragFinishingListener + */ + removeDragFinishingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDragFinishedListener + */ + addDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragFinished event that occurs once the drag has been finished. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDragFinishedListener + */ + removeDragFinishedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDragStartingListener + */ + addDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarting event that occurs once the drag is starting. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDragStartingListener + */ + removeDragStartingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDragStartedListener + */ + addDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragStarted event that occurs once the drag is initialized and has started. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDragStartedListener + */ + removeDragStartedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDraggingListener + */ + addDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragging event that occurs at the start of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDraggingListener + */ + removeDraggingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDraggedListener + */ + addDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the Dragged event that occurs at the end of every drag. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDraggedListener + */ + removeDraggedListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDragCanceledListener + */ + addDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceled event that occurs when the drag has been canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDragCanceledListener + */ + removeDragCanceledListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Adds the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to add. + * @see yfiles.input.ResizeStripeInputMode#removeDragCancelingListener + */ + addDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + /** + * Removes the given listener for the DragCanceling event that occurs before the drag will be canceled. + * @param {function(Object, yfiles.input.InputModeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ResizeStripeInputMode#addDragCancelingListener + */ + removeDragCancelingListener(listener:(sender:Object,evt:yfiles.input.InputModeEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Interface used for implementations that recognize, approve and disapprove stripe reparenting gestures, as well as + * actually performs the reparenting. + * @see yfiles.input.ReparentStripePositionHandler + * @interface + */ + export interface IReparentStripeHandler extends Object{ + /** + * 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.StripeReparentPolicy} reparentPosition Where to place the stripe as a result of the gesture that would be used for the {@link yfiles.input.IReparentStripeHandler#reparent } + * operation. + * @returns {boolean} Whether newParent is a valid new parent for stripe for the given index and gesture. + * @abstract + */ + isValidParent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):boolean; + /** + * Performs the actual reparenting after the reparent gesture has been finalized. + *

+ * Implementations should use SetParent or SetParent 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.StripeReparentPolicy} reparentPosition Where to place the stripe as a result of the gesture that triggered the reparent operation. + * @abstract + */ + reparent(context:yfiles.input.IInputModeContext,movedStripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):void; + /** + * 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. + * @returns {boolean} Whether the stripe may be detached and reparented. + * @abstract + */ + shouldReparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):boolean; + } + var IReparentStripeHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Default implementation of the {@link yfiles.input.IReparentStripeHandler} interface. + *

+ * This implementation allows to specify a maximal nesting depth for reparent operations. + *

+ * @class yfiles.input.ReparentStripeHandler + * @implements {yfiles.input.IReparentStripeHandler} + */ + export interface ReparentStripeHandler extends Object,yfiles.input.IReparentStripeHandler{} + export class ReparentStripeHandler { + constructor(); + /** + * Adjust the size of the source or the target stripe. + *

+ * This implementation adjusts the size of stripe to Math.Max(originalStripeSize, originalParentSize) if reparentPosition + * is an {@link yfiles.input.StripeReparentPolicy#ADD_CHILD} operation + *

+ * @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 should be inserted. + * @param {yfiles.input.StripeReparentPolicy} reparentPosition Where to place the stripe as a result of the gesture that triggered the reparent operation. + * @param {number} originalStripeSize The original size of stripe + * @param {number} originalParentSize The original size of newParent + * @protected + */ + adjustSize(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,reparentPosition:yfiles.input.StripeReparentPolicy,index:number,originalStripeSize:number,originalParentSize:number):void; + /** + * 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.StripeReparentPolicy} reparentPosition Where to place the stripe as a result of the gesture that would be used for the {@link yfiles.input.ReparentStripeHandler#reparent } + * operation. + * @returns {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. + */ + isValidParent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):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} stripe 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.StripeReparentPolicy} reparentPosition Where to place the stripe as a result of the gesture that triggered the reparent operation. + */ + reparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,reparentPosition:yfiles.input.StripeReparentPolicy):void; + /** + * 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. + * @returns {boolean} This implementation returns always true. + */ + shouldReparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):boolean; + /** + * 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 + * 0x7FFFFFFF, which effectively means an unlimited nesting depth. + *

+ * @type {number} + */ + 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 + * 0x7FFFFFFF, which effectively means an unlimited nesting depth. + *

+ * @type {number} + */ + maxColumnLevel:number; + static $class:yfiles.lang.Class; + } + /** + * 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} + *

+ * @class yfiles.input.ReparentStripeInputMode + * @extends {yfiles.input.MoveInputMode} + */ + export interface ReparentStripeInputMode extends yfiles.input.MoveInputMode{} + export class ReparentStripeInputMode { + constructor(); + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @see yfiles.input.StripeDropInputMode#startDrag + * @class yfiles.input.StripeDropInputMode + * @extends {yfiles.input.ItemDropInputMode.} + */ + export interface StripeDropInputMode extends yfiles.input.ItemDropInputMode{} + export class StripeDropInputMode { + /** + * Initializes a new instance of the {@link yfiles.input.StripeDropInputMode} class for the expected data format. + *

+ * You might want to adjust the {@link yfiles.input.StripeDropInputMode#draggedItem} getter, too. + *

+ * @param {string} expectedFormat This is a format that is used in {@link yfiles.input.StripeDropInputMode#startDrag}. + * @protected + * @constructor + */ + constructor(expectedFormat:string); + /** + * Initializes a new instance of the {@link yfiles.input.NodeDropInputMode} class for {@link yfiles.graph.INode}s. + *

+ * This instance fires events only if the format of the data of the drag operation is the full name of the {@link yfiles.graph.IStripe} + * type. Such a drag operation can be started for example with {@link yfiles.input.StripeDropInputMode#startDrag}. + *

+ * @constructor + */ + constructor(); + /** + * Create a preview version of the table that is temporarily used to show the dragged stripe. + * @returns {yfiles.graph.ITable} + * @protected + */ + createPreviewTable():yfiles.graph.ITable; + /** + * Create a new stripe as the result of a drag and drop gesture. + *

+ * This method is called by the {@link yfiles.input.ItemDropInputMode.#itemCreator} that is set as default on this class. + *

+ * @param {yfiles.graph.IStripe} newParent The parent for which to create the stripe. + * @param {yfiles.input.IInputModeContext} context The context for which the stripe should be created. + * @returns {yfiles.graph.IStripe} a newly created stripe. + * @protected + */ + createStripe(context:yfiles.input.IInputModeContext,newParent:yfiles.graph.IStripe):yfiles.graph.IStripe; + /** + * 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.Point} location Current mouse position + * @param {yfiles.geometry.Size} size Size of the table + * @returns {yfiles.geometry.Rect} a {@link yfiles.geometry.Rect} with the given size and the mouse location as center. + * @protected + */ + getPreviewTableLayout(location:yfiles.geometry.Point,size:yfiles.geometry.Size):yfiles.geometry.Rect; + /** + * Called whenever a new stripe is created + * @param {yfiles.collections.ItemEventArgs.} evt + * @protected + */ + onStripeCreated(evt:yfiles.collections.ItemEventArgs):void; + /** + * Starts a drag and drop operation for an {@link yfiles.graph.IStripe}. + *

+ * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the stripe to the {@link yfiles.view.DragDropItem} + * using the corresponding type. + *

+ *

+ * If useCssCursors is 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-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @param {HTMLElement} dragSource The source of the drag operation. + * @param {yfiles.graph.IStripe} stripe The stripe to drag. + * @param {yfiles.view.DragDropEffects} [dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. + * @param {boolean} [useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. + * @see yfiles.view.DragSource#startDrag + * @see yfiles.view.DragDropItem + * @static + */ + static startDrag(dragSource:HTMLElement,stripe:yfiles.graph.IStripe,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean):void; + /** + * Starts a drag and drop operation for an {@link yfiles.graph.IStripe}. + *

+ * This convenience implementation delegates to {@link yfiles.view.DragSource#startDrag} passing the stripe to the {@link yfiles.view.DragDropItem} + * using the corresponding type. + *

+ *

+ * If useCssCursors is 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-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @param {Object} options The parameters to pass. + * @param {HTMLElement} options.dragSource The source of the drag operation. + * @param {yfiles.graph.IStripe} options.stripe The stripe to drag. + * @param {yfiles.view.DragDropEffects} [options.dragDropEffects=yfiles.view.DragDropEffects.ALL] The allowed drag drop effects. + * @param {boolean} [options.useCssCursors=true] Whether to adjust the classes of elements being hovered over during the drag. The default is true. + * @see yfiles.view.DragSource#startDrag + * @see yfiles.view.DragDropItem + * @static + */ + static startDrag(options:{dragSource:HTMLElement,stripe:yfiles.graph.IStripe,dragDropEffects?:yfiles.view.DragDropEffects,useCssCursors?:boolean}):void; + /** + * Gets the currently dragged {@link yfiles.graph.IModelItem} instance. + *

+ * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to {@link yfiles.graph.INode}. + *

+ * @protected + * @type {yfiles.graph.IStripe} + */ + draggedItem:yfiles.graph.IStripe; + /** + * Adds the given listener for the StripeCreated event that occurs when a new stripe gets created by this input mode. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.StripeDropInputMode#removeStripeCreatedListener + */ + addStripeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the StripeCreated event that occurs when a new stripe gets created by this input mode. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.StripeDropInputMode#addStripeCreatedListener + */ + removeStripeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.input.ReparentStripePositionHandler + * @implements {yfiles.input.IPositionHandler} + */ + export interface ReparentStripePositionHandler extends Object,yfiles.input.IPositionHandler{} + export class ReparentStripePositionHandler { + /** + * Creates a new instance of this position handler which moves movedStripe + * @param {yfiles.graph.IStripe} movedStripe + * @constructor + */ + constructor(movedStripe:yfiles.graph.IStripe); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + */ + cancelDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point):void; + /** + * Create a visualization for the source region of the reparent gesture. + *

+ * The default implementation uses the return value of {@link yfiles.input.IStripeInputVisualizationHelper#getVisualCreator} with + * type {@link yfiles.input.StripeVisualizationType#DRAG_SOURCE}. + *

+ * @param {yfiles.input.IInputModeContext} context The current input mode context + * @returns {yfiles.view.ICanvasObject} A canvas object that is used to visualize the target region. + * @see yfiles.input.ReparentStripePositionHandler#updateSourceVisualization + * @protected + */ + createSourceGhostVisualization(context:yfiles.input.IInputModeContext):yfiles.view.ICanvasObject; + /** + * Create a visualization for the target region of the reparent gesture. + *

+ * The default implementation uses the return value of {@link yfiles.input.IStripeInputVisualizationHelper#getVisualCreator} with + * type {@link yfiles.input.StripeVisualizationType#DROP_TARGET}. + *

+ * @param {yfiles.input.IInputModeContext} context The current input mode context + * @param {yfiles.graph.IStripe} stripe The stripe for which the visualization should be created. + * @returns {yfiles.view.ICanvasObject} A canvas object that is used to visualize the target region. + * @see yfiles.input.ReparentStripePositionHandler#updateTargetVisualization + * @protected + */ + createTargetGhostVisualization(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):yfiles.view.ICanvasObject; + /** + * 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} context The current input mode context + * @param {yfiles.geometry.IPoint} location The current drag location + * @param {yfiles.graph.IStripe} sourceStripe The stripe that is moved + * @param {yfiles.input.StripeSubregion} targetSubregion The stripe subregion for the target. + * @param {yfiles.geometry.Rect} targetBounds The target bounds + * @returns {yfiles.input.StripeReparentPolicy} A {@link yfiles.input.StripeReparentPolicy} that specifies the operation to perform. + * @protected + */ + determineGesture(context:yfiles.input.IInputModeContext,location:yfiles.geometry.IPoint,sourceStripe:yfiles.graph.IStripe,targetSubregion:yfiles.input.StripeSubregion,targetBounds:yfiles.geometry.Rect):yfiles.input.StripeReparentPolicy; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + dragFinished(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * Finds the target stripe subregion at location and its associated owner node. + * @param {yfiles.geometry.Point} location The hit location. + * @returns {yfiles.input.StripeSubregion} A {@link yfiles.input.StripeSubregion} that lies at location, or null if no such region could be found. + * @protected + */ + getTargetSubregion(location:yfiles.geometry.Point):yfiles.input.StripeSubregion; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} originalLocation + * @param {yfiles.geometry.Point} newLocation + */ + handleMove(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.Point,newLocation:yfiles.geometry.Point):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * Called whenever a change in the oldTable hierarchy occurs through this position handler + * @param {yfiles.graph.StripeEventArgs} evt + * @protected + */ + onStripeChanged(evt:yfiles.graph.StripeEventArgs):void; + /** + * + * @param {yfiles.geometry.Point} location + */ + setPosition(location:yfiles.geometry.Point):void; + /** + * Modifies the source visualization itself + *

+ * The default does not change targetVisualization. + *

+ * @param {yfiles.input.IInputModeContext} context The current input mode context. + * @param {yfiles.view.ICanvasObject} targetVisualization The canvas object for the target visualization + * @param {yfiles.graph.IStripe} targetStripe The target for the reparent gesture + * @param {yfiles.input.StripeReparentPolicy} reparentPosition Where to place the stripe after reparenting. + * @returns {yfiles.view.ICanvasObject} + * @protected + */ + updateSourceVisualization(context:yfiles.input.IInputModeContext,targetVisualization:yfiles.view.ICanvasObject,targetStripe:yfiles.graph.IStripe,reparentPosition:yfiles.input.StripeReparentPolicy):yfiles.view.ICanvasObject; + /** + * Modifies the target visualization itself. + *

+ * The default implementation only hides targetVisualization iff reparentPosition is + * {@link yfiles.input.StripeReparentPolicy#INVALID}. + *

+ * @param {yfiles.input.IInputModeContext} context The current input mode context. + * @param {yfiles.view.ICanvasObject} targetVisualization The canvas object for the target visualization. + * @param {yfiles.graph.IStripe} targetStripe The target for the reparent gesture. + * @param {yfiles.input.StripeReparentPolicy} reparentPosition The mode the describes the results of the reparent gesture. + * @param {yfiles.geometry.Rect} targetBounds The current visualization bounds that have been computed with + * {@link yfiles.input.ReparentStripePositionHandler#updateTargetVisualizationBounds} + * @returns {yfiles.view.ICanvasObject} + * @protected + */ + updateTargetVisualization(context:yfiles.input.IInputModeContext,targetVisualization:yfiles.view.ICanvasObject,targetStripe:yfiles.graph.IStripe,reparentPosition:yfiles.input.StripeReparentPolicy,targetBounds:yfiles.geometry.Rect):yfiles.view.ICanvasObject; + /** + * Updates the visualization bounds for the target visualization depending on the provided values. + * @param {yfiles.geometry.Rect} originalTargetBounds The target bounds prior to this method call. + * @param {yfiles.input.StripeReparentPolicy} reparentPosition Where to place the stripe after the reparenting operations according to the reparent gesture. + * @param {yfiles.graph.IStripe} targetStripe The target stripe which has been determined by the input mode. + * @returns {yfiles.geometry.Rect} Updated bounds for the target visualization. + * @protected + */ + updateTargetVisualizationBounds(originalTargetBounds:yfiles.geometry.Rect,reparentPosition:yfiles.input.StripeReparentPolicy,targetStripe:yfiles.graph.IStripe):yfiles.geometry.Rect; + /** + * + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * Allows to query the moved stripe. + * @type {yfiles.graph.IStripe} + */ + movedStripe:yfiles.graph.IStripe; + /** + * The current {@link yfiles.input.IInputModeContext} + * @protected + * @type {yfiles.input.IInputModeContext} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Adds the given listener for the StripeChanged event that occurs when a stripe state is changed by this input mode. + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener The listener to add. + * @see yfiles.input.ReparentStripePositionHandler#removeStripeChangedListener + */ + addStripeChangedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * Removes the given listener for the StripeChanged event that occurs when a stripe state is changed by this input mode. + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener The listener to remove. + * @see yfiles.input.ReparentStripePositionHandler#addStripeChangedListener + */ + removeStripeChangedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * 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.GraphInputMode#graphSelection}. + *

+ * @class yfiles.input.TableEditorInputMode + * @extends {yfiles.input.MultiplexingInputMode} + */ + export interface TableEditorInputMode extends yfiles.input.MultiplexingInputMode{} + export class TableEditorInputMode { + /** + * Default constructor. + * @constructor + */ + constructor(); + /** + * Adds a new label to the given stripe interactively. + *

+ * This will activate the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} to let the user interactively enter the label's text and unless the user cancels label creation + * the returned {@link yfiles.graphml.Future.} will contain the label. + *

+ *

+ * The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. + *

+ *

+ * This method is similar to {@link yfiles.input.TableEditorInputMode#createLabel}. It differs only when either the {@link yfiles.input.TableEditorInputMode#addLabelAddingListener LabelAdding} + * event is handled or the stripe has an {@link yfiles.input.IEditLabelHelper} requests editing an existing label instead of + * creating a new one. In this case, this method will edit that label instead of adding a new one. + *

+ * @param {yfiles.graph.ILabelOwner} owner The item. + * @returns {Promise.} A future of the label that will be notified of the newly created label or a null if the creation was canceled. + */ + addLabel(owner:yfiles.graph.ILabelOwner):Promise; + /** + * Clears the current selection. + * @see yfiles.input.TableEditorInputMode#selectableItems + */ + clearSelection():void; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#keyboardInputMode} instance. + * @returns {yfiles.input.ClickInputMode} + * @protected + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#keyboardInputMode} instance. + * @returns {yfiles.input.KeyboardInputMode} + * @protected + */ + createKeyboardInputMode():yfiles.input.KeyboardInputMode; + /** + * 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 label owner. + *

+ *

+ * The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. + *

+ *

+ * This method is similar to {@link yfiles.input.TableEditorInputMode#addLabel}. It differs only when either the {@link yfiles.input.TableEditorInputMode#addLabelAddingListener LabelAdding} + * event is handled or the stripe has an {@link yfiles.input.IEditLabelHelper} requests editing an existing label instead of + * creating a new one. In both cases, this method will do nothing and neither adds a new label nor edits an existing one. + *

+ * @param {yfiles.graph.IStripe} stripe The item to create a new label for. + * @returns {Promise.} 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):Promise; + /** + * 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. + *

+ * @returns {yfiles.input.IReparentStripeHandler} a new instance of {@link yfiles.input.IReparentStripeHandler} + * @protected + */ + createReparentStripeHandler():yfiles.input.IReparentStripeHandler; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} lazily the first time the property is accessed. + * @returns {yfiles.input.ReparentStripeInputMode} A plain new instance of the {@link yfiles.input.ReparentStripeInputMode} type, which is initially {@link yfiles.input.MoveInputMode#enabled enabled}. + * @protected + */ + createReparentStripeInputMode():yfiles.input.ReparentStripeInputMode; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} lazily the first time the property is accessed. + * @returns {yfiles.input.ResizeStripeInputMode} A plain new instance of the {@link yfiles.input.ResizeStripeInputMode} type, which is initially {@link yfiles.input.ResizeStripeInputMode#enabled enabled}. + * @protected + */ + createResizeStripeInputMode():yfiles.input.ResizeStripeInputMode; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} lazily the first time the property is accessed. + * @returns {yfiles.input.StripeDropInputMode} A plain new instance of the {@link yfiles.input.StripeDropInputMode} type, which is initially {@link yfiles.input.DropInputMode#enabled disabled}. + * @protected + */ + createStripeDropInputMode():yfiles.input.StripeDropInputMode; + /** + * Create a new instance of {@link yfiles.view.IStripeSelection} the first time property {@link yfiles.input.TableEditorInputMode#stripeSelection} is accessed. + *

+ * By default, the {@link yfiles.view.IStripeSelection#allowMixedSelection} property is false. + *

+ * @returns {yfiles.view.IStripeSelection} A new {@link yfiles.view.IStripeSelection} instance. + * @protected + */ + createStripeSelection():yfiles.view.IStripeSelection; + /** + * 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. + *

+ * @returns {yfiles.input.TextEditorInputMode} a new instance of {@link yfiles.input.TextEditorInputMode} + * @protected + */ + createTextEditorInputMode():yfiles.input.TextEditorInputMode; + /** + * 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 yfiles.input.TableEditorInputMode#addDeletingSelectionListener + * @see yfiles.input.TableEditorInputMode#addDeletedItemListener + * @see yfiles.input.TableEditorInputMode#addDeletedSelectionListener + */ + deleteSelection():void; + /** + * Deletes a single stripe + * @param {yfiles.graph.IStripe} stripe The stripe to delete. + */ + deleteStripe(stripe:yfiles.graph.IStripe):void; + /** + * Starts 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. + *

+ *

+ * This method will raise the {@link yfiles.input.TableEditorInputMode#addLabelEditingListener LabelEditing} + * event and query the {@link yfiles.input.IEditLabelHelper} for the label and its owner, but will ignore the result except for the + * {@link yfiles.input.LabelEditingEventArgs#textEditorInputModeConfigurator} property on the {@link yfiles.input.LabelEditingEventArgs}. Thus editing a label via this method cannot be prevented by event + * handlers or {@link yfiles.input.IEditLabelHelper}s. + *

+ * @param {yfiles.graph.ILabel} label The label to edit. + * @returns {Promise.} + * @see yfiles.input.TableEditorInputMode#onLabelTextEdited + */ + editLabel(label:yfiles.graph.ILabel):Promise; + /** + * Used as a callback to find the items underneath a certain point. + * @param {yfiles.geometry.Point} 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.input.StripeSubregionTypes} subregionTypes An enumeration value of {@link yfiles.input.StripeSubregionTypes} to further restrict the stripe region. + * @param {function(yfiles.input.StripeSubregion): boolean} [filter=null] Additional predicate to further restrict the hit test results. + * @returns {yfiles.input.StripeSubregion} The stripe subregions that have been found for the location or null. + */ + findStripe(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,filter?:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.input.StripeSubregion; + /** + * Used as a callback to find the items underneath a certain point. + * @param {yfiles.geometry.Point} 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.input.StripeSubregionTypes} subregionTypes An enumeration value of {@link yfiles.input.StripeSubregionTypes} to further restrict the stripe region. + * @param {function(yfiles.input.StripeSubregion): boolean} [filter=null] Additional predicate to further restrict the hit test results. + * @returns {yfiles.collections.IEnumerable.} The stripe subregions that have been found for the location. + */ + findStripes(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,filter?:(obj:yfiles.input.StripeSubregion)=>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 an initial size and otherwise the default settings of the table where owner belongs to. If size is entered + * as 0, the owners default size is used. + *

+ * @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=null] The initial size of the stripe + * @returns {yfiles.graph.IStripe} A new stripe at the given index. + */ + insertChild(owner:yfiles.graph.IStripe,index:number,size?:number):yfiles.graph.IStripe; + /** + * Callback that is invoked if the shift+F2 key is pressed and {@link yfiles.input.TableEditorInputMode#allowAddLabel} is set to true. + *

+ * This method determines the label owner to add to and delegates to {@link yfiles.input.TableEditorInputMode#createLabel}. + *

+ * @returns {boolean} + * @protected + */ + onAddLabel():boolean; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#clickInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.ClickInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.ClickInputMode} newMode the new value + * @protected + */ + onClickInputModeChanged(oldMode:yfiles.input.ClickInputMode,newMode:yfiles.input.ClickInputMode):void; + /** + * Callback that gets triggered once {@link yfiles.input.TableEditorInputMode#clickInputMode} triggers the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} + * event. + * @param {Object} sender + * @param {yfiles.input.ClickEventArgs} evt + * @protected + */ + onClickInputModeClicked(sender:Object,evt:yfiles.input.ClickEventArgs):void; + /** + * Callback that gets triggered once {@link yfiles.input.TableEditorInputMode#clickInputMode} triggers the {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked} + * event. + * @param {Object} sender + * @param {yfiles.input.ClickEventArgs} evt + * @protected + */ + onClickInputModeDoubleClicked(sender:Object,evt:yfiles.input.ClickEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} event. + * @param {yfiles.collections.ItemEventArgs.} evt The instance containing the event data. + * @protected + */ + onDeletedItem(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @param {yfiles.input.SelectionEventArgs.} evt The {@link yfiles.input.SelectionEventArgs.} instance containing the event data. + * @protected + */ + onDeletedSelection(evt:yfiles.input.SelectionEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addDeletingSelectionListener DeletingSelection} event. + * @param {yfiles.input.SelectionEventArgs.} evt The {@link yfiles.input.SelectionEventArgs.} instance containing the event data. + * @protected + */ + onDeletingSelection(evt:yfiles.input.SelectionEventArgs):void; + /** + * Callback that is invoked if the F2 key is pressed and {@link yfiles.input.TableEditorInputMode#allowEditLabel} 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. + *

+ * @returns {boolean} + * @protected + */ + onEditLabel():boolean; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#keyboardInputMode} changed. + * @param {yfiles.input.KeyboardInputMode} oldMode The old {@link yfiles.input.TableEditorInputMode#keyboardInputMode}. + * @param {yfiles.input.KeyboardInputMode} newMode The new {@link yfiles.input.TableEditorInputMode#keyboardInputMode}. + * @protected + */ + onKeyboardInputModeChanged(oldMode:yfiles.input.KeyboardInputMode,newMode:yfiles.input.KeyboardInputMode):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelAddedListener LabelAdded} event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.collections.ItemEventArgs.} instance that contains the {@link yfiles.graph.ILabel} that has been added. + * @protected + */ + onLabelAdded(evt:yfiles.graph.LabelEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelAddingListener LabelAdding} event. + *

+ * Invoking the event handlers stops once one event marks the args as handled. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The event arguments. + * @protected + */ + onLabelAdding(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelEditingListener LabelEditing} event. + *

+ * Invoking the event handlers stops once one event marks the args as handled. + *

+ * @param {yfiles.input.LabelEditingEventArgs} evt The event arguments. + * @protected + */ + onLabelEditing(evt:yfiles.input.LabelEditingEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextChangedListener LabelTextChanged} event. + * @param {yfiles.collections.ItemEventArgs.} evt The {@link yfiles.collections.ItemEventArgs.} instance that contains the {@link yfiles.graph.ILabel} that has changed the text. + * @protected + */ + onLabelTextChanged(evt:yfiles.collections.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. + * @protected + */ + onLabelTextEdited(label:yfiles.graph.ILabel,text:string):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextEditingCanceledListener LabelTextEditingCanceled} + * event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + * @protected + */ + onLabelTextEditingCanceled(evt:yfiles.graph.LabelEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextEditingStartedListener LabelTextEditingStarted} + * event. + * @param {yfiles.graph.LabelEventArgs} evt The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + * @protected + */ + onLabelTextEditingStarted(evt:yfiles.graph.LabelEventArgs):void; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property value changes and after initialization of the field. + * @param {yfiles.input.IReparentStripeHandler} oldHandler the old value, which may be null the first time + * @param {yfiles.input.IReparentStripeHandler} newHandler the new value + * @protected + */ + onReparentStripeHandlerChanged(oldHandler:yfiles.input.IReparentStripeHandler,newHandler:yfiles.input.IReparentStripeHandler):void; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.ReparentStripeInputMode} oldHandler the old value, which may be null the first time + * @param {yfiles.input.ReparentStripeInputMode} newHandler the new value + * @protected + */ + onReparentStripeInputModeChanged(oldHandler:yfiles.input.ReparentStripeInputMode,newHandler:yfiles.input.ReparentStripeInputMode):void; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.ResizeStripeInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.ResizeStripeInputMode} newMode the new value + * @protected + */ + onResizeStripeInputModeChanged(oldMode:yfiles.input.ResizeStripeInputMode,newMode:yfiles.input.ResizeStripeInputMode):void; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.StripeDropInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.StripeDropInputMode} newMode the new value + * @protected + */ + onStripeDropInputModeChanged(oldMode:yfiles.input.StripeDropInputMode,newMode:yfiles.input.StripeDropInputMode):void; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property value changes and after initialization of the field. + * @param {yfiles.input.TextEditorInputMode} oldMode the old value, which may be null the first time + * @param {yfiles.input.TextEditorInputMode} newMode the new value + * @protected + */ + onTextEditorInputModeChanged(oldMode:yfiles.input.TextEditorInputMode,newMode:yfiles.input.TextEditorInputMode):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener ValidateLabelText} event. + * @param {yfiles.input.LabelTextValidatingEventArgs} evt The {@link yfiles.input.LabelTextValidatingEventArgs} instance containing the event data. + * @protected + */ + onValidateLabelText(evt:yfiles.input.LabelTextValidatingEventArgs):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 yfiles.input.ICommand#SELECT_ALL + * @see yfiles.input.TableEditorInputMode#selectableItems + */ + selectAll():void; + /** + * 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#onLabelAdding} + * method. + *

+ * @param {yfiles.graph.IModelItem} item The item to query + * @returns {boolean} true iff a label may be added + * @protected + */ + shouldAddLabel(item:yfiles.graph.IModelItem):boolean; + /** + * 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} stripe The item. + * @returns {boolean} Whether to delete that item. + * @protected + */ + shouldDelete(stripe:yfiles.graph.IStripe):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.graph.IModelItem} item The item. + * @returns {boolean} Whether to edit the label or the labels for that item. + * @protected + */ + shouldEditLabel(item:yfiles.graph.IModelItem):boolean; + /** + * Callback method that is used by {@link yfiles.input.TableEditorInputMode#onKeyboardInputModeChanged} to determine which of the + * built-in {@link yfiles.input.ICommand}s to install. + *

+ * This implementation unconditionally returns true, subclasses may override this method to adjust the behavior. + *

+ * @param {yfiles.input.ICommand} command The command to install. + * @returns {boolean} Whether to install this command. + * @protected + */ + shouldInstallCommand(command:yfiles.input.ICommand):boolean; + /** + * Gets or sets the {@link yfiles.input.ResizeStripeInputMode} that is used to change the size of a stripe interactively. + *

+ * The mode by default is {@link yfiles.input.ResizeStripeInputMode#enabled enabled} with a priority of 0. 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 {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.ResizeStripeInputMode} + */ + resizeStripeInputMode:yfiles.input.ResizeStripeInputMode; + /** + * 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 yfiles.input.ReparentStripeHandler + * @type {yfiles.input.IReparentStripeHandler} + */ + reparentStripeHandler:yfiles.input.IReparentStripeHandler; + /** + * Gets or sets the {@link yfiles.input.ReparentStripeInputMode} that is used to change a stripes position in the table hierarchy. + *

+ * The mode by default is {@link yfiles.input.MoveInputMode#enabled enabled} with a priority of 0. 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 {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.ReparentStripeInputMode} + */ + reparentStripeInputMode:yfiles.input.ReparentStripeInputMode; + /** + * 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.DropInputMode#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. + *

+ *

+ * By default this input mode has a priority of 70. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.StripeDropInputMode} + */ + stripeDropInputMode:yfiles.input.StripeDropInputMode; + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#keyboardInputMode}. + *

+ * 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.GraphInputMode#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. + *

+ *

+ * By default this input mode has a priority of 0. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.KeyboardInputMode} + */ + keyboardInputMode:yfiles.input.KeyboardInputMode; + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#textEditorInputMode}. + *

+ * 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. + *

+ *

+ * By default this input mode has a priority of 100. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.TextEditorInputMode} + */ + textEditorInputMode:yfiles.input.TextEditorInputMode; + /** + * 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.ILabelOwner}s, and + * existing {@link yfiles.graph.ILabel}s. + *

+ * @see yfiles.input.TableEditorInputMode#shouldEditLabel + * @type {yfiles.graph.StripeTypes} + */ + labelEditableItems:yfiles.graph.StripeTypes; + /** + * Adds the given listener for the LabelAdding event that occurs when a label is about to be added. + *

+ * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be + * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the + * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#removeLabelAddingListener + */ + addLabelAddingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Removes the given listener for the LabelAdding event that occurs when a label is about to be added. + *

+ * Event handlers for this event can customize the behavior for adding a new label extensively. Adding a label can be + * forbidden entirely, or the properties of the added label can be changed, by setting the appropriate properties on the + * {@link yfiles.input.LabelEditingEventArgs}. It is even possible to forbid adding a label, but edit an existing one instead. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#addLabelAddingListener + */ + removeLabelAddingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Adds the given listener for the LabelEditing event that occurs when a label is about to be edited. + *

+ * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden + * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, + * event handlers can also specify that instead of editing a label, a new one should be added. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#removeLabelEditingListener + */ + addLabelEditingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Removes the given listener for the LabelEditing event that occurs when a label is about to be edited. + *

+ * Event handlers for this event can customize the behavior for editing an existing label. Editing can be forbidden + * entirely, or redirected to a different label, even on a different owner. In case editing existing labels is unwanted, + * event handlers can also specify that instead of editing a label, a new one should be added. + *

+ * @param {function(Object, yfiles.input.LabelEditingEventArgs): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#addLabelEditingListener + */ + removeLabelEditingListener(listener:(sender:Object,evt:yfiles.input.LabelEditingEventArgs)=>void):void; + /** + * Adds the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#createLabel}. + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#removeLabelAddedListener + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelAdded event that occurs when this mode has triggered the addition of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#createLabel}. + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#addLabelAddedListener + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#editLabel}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#removeLabelTextChangedListener + */ + addLabelTextChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextChanged event that occurs when this mode has triggered the edit of an + * {@link yfiles.graph.ILabel}, for instance, in response to {@link yfiles.input.TableEditorInputMode#editLabel}. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#addLabelTextChangedListener + */ + removeLabelTextChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is about + * to start. + *

+ * This allows to customize the actual label editing process further. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#onValidateLabelText + * @see yfiles.input.TableEditorInputMode#removeLabelTextEditingStartedListener + */ + addLabelTextEditingStartedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextEditingStarted event that occurs when the actual label editing process is + * about to start. + *

+ * This allows to customize the actual label editing process further. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#onValidateLabelText + * @see yfiles.input.TableEditorInputMode#addLabelTextEditingStartedListener + */ + removeLabelTextEditingStartedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is + * canceled. + *

+ * This allows to unconfigure temporary customizations for the actual label editing process. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#onValidateLabelText + * @see yfiles.input.TableEditorInputMode#removeLabelTextEditingCanceledListener + */ + addLabelTextEditingCanceledListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextEditingCanceled event that occurs when the actual label editing process is + * canceled. + *

+ * This allows to unconfigure temporary customizations for the actual label editing process. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#onValidateLabelText + * @see yfiles.input.TableEditorInputMode#addLabelTextEditingCanceledListener + */ + removeLabelTextEditingCanceledListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the ValidateLabelText event that occurs after label editing 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. + *

+ * @param {function(Object, yfiles.input.LabelTextValidatingEventArgs): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#onValidateLabelText + * @see yfiles.input.TableEditorInputMode#removeValidateLabelTextListener + */ + addValidateLabelTextListener(listener:(sender:Object,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; + /** + * Removes the given listener for the ValidateLabelText event that occurs after label editing 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. + *

+ * @param {function(Object, yfiles.input.LabelTextValidatingEventArgs): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#onValidateLabelText + * @see yfiles.input.TableEditorInputMode#addValidateLabelTextListener + */ + removeValidateLabelTextListener(listener:(sender:Object,evt:yfiles.input.LabelTextValidatingEventArgs)=>void):void; + /** + * Gets or sets a value indicating whether this mode should automatically {@link yfiles.graph.ITable#remove 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. + *

+ * @default true + * @type {boolean} + */ + autoRemoveEmptyLabels:boolean; + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#clickInputMode}. + *

+ * 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.GraphInputMode#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. + *

+ *

+ * By default this input mode has a priority of 0. + *

+ * @throws {Stubs.Exceptions.NotSupportedError} If an attempt is made to change the instance while this mode is {@link yfiles.input.IInputMode#install 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. + * @type {yfiles.input.ClickInputMode} + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Adds the given listener for the DeletingSelection event that 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. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#deleteSelection + * @see yfiles.input.TableEditorInputMode#removeDeletingSelectionListener + */ + addDeletingSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DeletingSelection event that 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. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#deleteSelection + * @see yfiles.input.TableEditorInputMode#addDeletingSelectionListener + */ + removeDeletingSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Adds the given listener for the DeletedItem event that occurs when an item has been deleted interactively by this mode. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#removeDeletedItemListener + */ + addDeletedItemListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the DeletedItem event that occurs when an item has been deleted interactively by this + * mode. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#addDeletedItemListener + */ + removeDeletedItemListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} + * method has deleted the selection after all selected items have been removed. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to add. + * @see yfiles.input.TableEditorInputMode#deleteSelection + * @see yfiles.input.TableEditorInputMode#removeDeletedSelectionListener + */ + addDeletedSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):void; + /** + * Removes the given listener for the DeletedSelection event that occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} + * method has deleted the selection after all selected items have been removed. + * @param {function(Object, yfiles.input.SelectionEventArgs.): void} listener The listener to remove. + * @see yfiles.input.TableEditorInputMode#deleteSelection + * @see yfiles.input.TableEditorInputMode#addDeletedSelectionListener + */ + removeDeletedSelectionListener(listener:(sender:Object,evt:yfiles.input.SelectionEventArgs)=>void):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 yfiles.input.TableEditorInputMode#shouldDelete + * @type {yfiles.graph.StripeTypes} + */ + deletableItems:yfiles.graph.StripeTypes; + /** + * 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 yfiles.input.GraphInputMode#setSelected + * @type {yfiles.graph.StripeTypes} + */ + 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 yfiles.input.GraphInputMode#setSelected + * @type {yfiles.graph.StripeTypes} + */ + clickSelectableItems:yfiles.graph.StripeTypes; + /** + * Gets or sets 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#allowEditLabel} are + * true. If label editing is allowed, pressing F2 will start the label editor. By default this feature is enabled. + *

+ * @see yfiles.input.TableEditorInputMode#editLabel + * @default true + * @type {boolean} + */ + allowEditLabel:boolean; + /** + * Gets or sets 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#allowAddLabel} are true. If label adding + * is allowed, true pressing Shift+F2 will start the label editor. By default this feature is enabled. + *

+ * @see yfiles.input.TableEditorInputMode#createLabel + * @default true + * @type {boolean} + */ + allowAddLabel:boolean; + /** + * Gets or sets the event recognizer that will be queried to decide if a click is deemed a multi selection gesture. + *

+ * The default is {@link yfiles.input.KeyEventRecognizers#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.GraphInputMode#multiSelectionRecognizer} is used instead. + *

+ * @type {function(Object, yfiles.lang.EventArgs): boolean} + */ + multiSelectionRecognizer:(eventSource:Object,evt:yfiles.lang.EventArgs)=>boolean; + /** + * Gets or sets clicks on which {@link yfiles.input.StripeSubregionTypes}(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.input.StripeSubregionTypes#HEADER} are handled. + *

+ * @default 6 + * @type {yfiles.input.StripeSubregionTypes} + */ + clickSelectableRegions:yfiles.input.StripeSubregionTypes; + /** + * Gets or sets a value indicating whether {@link yfiles.input.TableEditorInputMode#stripeSelection} should be synchronized with the {@link yfiles.input.GraphInputMode#graphSelection} if this instance is installed as a child of a + * {@link yfiles.input.GraphEditorInputMode} instance. + *

+ * This feature needs to be disabled temporarily if the {@link yfiles.view.GraphComponent#selection} is changed. + *

+ *

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

+ * @default true + * @type {boolean} + */ + synchronizeWithGraphSelection:boolean; + /** + * Whether to allow mixed selections of graph elements and table elements + *

+ * Default is true. Changing this property only has an effetc if {@link yfiles.input.TableEditorInputMode#synchronizeWithGraphSelection} is enabled. + *

+ * @type {boolean} + */ + allowMixedSelection:boolean; + /** + * Returns the {@link yfiles.view.IStripeSelection selected stripes} + * @type {yfiles.view.IStripeSelection} + */ + stripeSelection:yfiles.view.IStripeSelection; + static $class:yfiles.lang.Class; + } + /** + * {@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. + *

+ * @class yfiles.input.TableReshapeHandler + * @implements {yfiles.input.IReshapeHandler} + */ + export interface TableReshapeHandler extends Object,yfiles.input.IReshapeHandler{} + export class TableReshapeHandler { + /** + * 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. + * @constructor + */ + constructor(coreHandler:yfiles.input.IReshapeHandler,tableNode:yfiles.graph.INode,table:yfiles.graph.ITable); + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} originalBounds + */ + cancelReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} originalBounds + * @param {yfiles.geometry.Rect} newBounds + */ + handleReshape(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + */ + initializeReshape(context:yfiles.input.IInputModeContext):void; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} originalBounds + * @param {yfiles.geometry.Rect} newBounds + */ + reshapeFinished(context:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.Rect,newBounds:yfiles.geometry.Rect):void; + /** + * The core reshape handler wrapped by this instance. + * @type {yfiles.input.IReshapeHandler} + */ + coreHandler:yfiles.input.IReshapeHandler; + /** + * The node this handler is used for. + * @type {yfiles.graph.INode} + */ + tableNode:yfiles.graph.INode; + /** + * The table used for additional constraints. + * @type {yfiles.graph.ITable} + */ + table:yfiles.graph.ITable; + /** + * + * @type {yfiles.geometry.IRectangle} + */ + bounds:yfiles.geometry.IRectangle; + static $class:yfiles.lang.Class; + } + export enum StripeReparentPolicy{ + /** + * 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 + } + /** + * Helper interface that allows to bundle {@link yfiles.input.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. + *

+ * @interface + */ + export interface IStripeHitTestHelper extends Object{ + /** + * Return a {@link yfiles.input.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}. + *

+ * @returns {yfiles.input.IHitTestable} a {@link yfiles.input.IHitTestable} that should report hits on the far border region of the stripe. + * @see yfiles.input.StripeSubregion + * @see yfiles.input.StripeSubregionTypes#FAR_BORDER + * @abstract + */ + getFarBorderHitTestable():yfiles.input.IHitTestable; + /** + * Return a {@link yfiles.input.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. + *

+ * @returns {yfiles.input.IHitTestable} a {@link yfiles.input.IHitTestable} that should report hits on the header region of the stripe. + * @see yfiles.input.StripeSubregion + * @see yfiles.input.StripeSubregionTypes#HEADER + * @abstract + */ + getLeadingHeaderHitTestable():yfiles.input.IHitTestable; + /** + * Return a {@link yfiles.input.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}. + *

+ * @returns {yfiles.input.IHitTestable} a {@link yfiles.input.IHitTestable} that should report hits on the near border region of the stripe. + * @see yfiles.input.StripeSubregion + * @see yfiles.input.StripeSubregionTypes#NEAR_BORDER + * @abstract + */ + getNearBorderHitTestable():yfiles.input.IHitTestable; + /** + * Return a {@link yfiles.input.IHitTestable} that should report hits on the whole stripe. + * @returns {yfiles.input.IHitTestable} a {@link yfiles.input.IHitTestable} that should report hits on the whole stripe. + * @see yfiles.input.StripeSubregion + * @see yfiles.input.StripeSubregionTypes#STRIPE + * @abstract + */ + getStripeHitTestable():yfiles.input.IHitTestable; + /** + * Return a {@link yfiles.input.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. + *

+ * @returns {yfiles.input.IHitTestable} a {@link yfiles.input.IHitTestable} that should report hits on the header region of the stripe. + * @see yfiles.input.StripeSubregion + * @see yfiles.input.StripeSubregionTypes#HEADER + * @abstract + */ + getTrailingHeaderHitTestable():yfiles.input.IHitTestable; + } + var IStripeHitTestHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum StripeSubregionTypes{ + /** + * No active hotspot region. + */ + NONE, + /** + * The hot spot region includes the stripe itself. + * @see yfiles.input.IStripeHitTestHelper#getStripeHitTestable + */ + STRIPE, + /** + * The hot spot region includes the leading stripe header. + *

+ * 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. + *

+ * @see yfiles.input.IStripeHitTestHelper#getLeadingHeaderHitTestable + */ + LEADING_HEADER, + /** + * The hot spot region includes the trailing stripe header. + *

+ * 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. + *

+ * @see yfiles.input.IStripeHitTestHelper#getTrailingHeaderHitTestable + */ + TRAILING_HEADER, + /** + * The hot spot region includes both stripe headers. + *

+ * This is a bitwise combination of {@link yfiles.input.StripeSubregionTypes#LEADING_HEADER} and + * {@link yfiles.input.StripeSubregionTypes#TRAILING_HEADER} + *

+ * @see yfiles.input.IStripeHitTestHelper#getTrailingHeaderHitTestable + */ + HEADER, + /** + * The hot spot region includes 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}. + *

+ * @see yfiles.input.IStripeHitTestHelper#getNearBorderHitTestable + */ + NEAR_BORDER, + /** + * The hot spot region includes the stripe far-border region. + *

+ * 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}. + *

+ * @see yfiles.input.IStripeHitTestHelper#getFarBorderHitTestable + */ + FAR_BORDER, + /** + * Flag for any stripe region. + */ + ALL + } + /** + * 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.input.StripeHitTester} implementation. + *

+ * @class yfiles.input.StripeSubregion + * @final + */ + export interface StripeSubregion extends Object{} + export class StripeSubregion { + /** + * Create a new instance that describes the specific subregion. + * @param {yfiles.input.StripeSubregionTypes} subregionType The specific subregion + * @param {yfiles.graph.IStripe} stripe The stripe + * @constructor + */ + constructor(subregionType:yfiles.input.StripeSubregionTypes,stripe:yfiles.graph.IStripe); + /** + * Gets the specific subregion type that this instance describes. + * @type {yfiles.input.StripeSubregionTypes} + */ + subregionType:yfiles.input.StripeSubregionTypes; + /** + * Gets the stripe that this instance describes. + * @type {yfiles.graph.IStripe} + */ + stripe:yfiles.graph.IStripe; + /** + * Gets or sets the node the region is associated to. + * @type {yfiles.graph.INode} + */ + targetTableNode:yfiles.graph.INode; + static $class:yfiles.lang.Class; + } + /** + * Default implementation of {@link yfiles.input.IStripeInputVisualizationHelper} that uses + * {@link yfiles.view.IVisualTemplate}s for the actual visualization. + *

+ * If you want to change the global behavior, you can just provide a different {@link yfiles.view.IVisualTemplate} 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.view.IVisualTemplate} to the instance that is already present in the stripe's lookup. + *

+ * @class yfiles.input.DefaultStripeInputVisualizationHelper + * @implements {yfiles.input.IStripeInputVisualizationHelper} + */ + export interface DefaultStripeInputVisualizationHelper extends Object,yfiles.input.IStripeInputVisualizationHelper{} + export class DefaultStripeInputVisualizationHelper { + /** + * Default constructor + * @param {yfiles.graph.IStripe} stripe The stripe for which the visualizations are intended + * @constructor + */ + constructor(stripe:yfiles.graph.IStripe); + /** + * Provide a {@link yfiles.view.IVisualTemplate} that is used to visualize type. + * @param {yfiles.input.IInputModeContext} context The input mode context. Allows you to access the {@link yfiles.view.CanvasComponent} to retrieve the resources. + * @param {yfiles.input.StripeVisualizationType} type The visualization type + * @returns {yfiles.view.IVisualTemplate} A {@link yfiles.view.IVisualTemplate} that is used to visualize type. + * @protected + */ + findTemplate(context:yfiles.input.IInputModeContext,type:yfiles.input.StripeVisualizationType):yfiles.view.IVisualTemplate; + /** + * Return an {@link yfiles.view.IVisualCreator} that is used to visualize the input operation specified by type. + *

+ * This implementation uses {@link yfiles.view.IVisualTemplate}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.input.StripeVisualizationType} type The actual visualization type + * @returns {yfiles.view.IVisualCreator} A {@link yfiles.view.IVisualCreator} instance that renders a representation for the current operation. + * @see yfiles.input.DefaultStripeInputVisualizationHelper#resizeStripeTemplate + */ + getVisualCreator(context:yfiles.input.IInputModeContext,tableNode:yfiles.graph.INode,type:yfiles.input.StripeVisualizationType):yfiles.view.IVisualCreator; + /** + * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} 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.input.StripeVisualizationType#RESIZE} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @const + * @static + * @type {string} + */ + static RESIZE_STRIPE_TEMPLATE_KEY:string; + /** + * Data template that is used to visualize the current stripe resize operation. + *

+ * This template is used for {@link yfiles.input.StripeVisualizationType#RESIZE} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @type {yfiles.view.IVisualTemplate} + */ + resizeStripeTemplate:yfiles.view.IVisualTemplate; + /** + * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} 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.input.StripeVisualizationType#SELECTION} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @const + * @static + * @type {string} + */ + static SELECTED_STRIPE_TEMPLATE_KEY:string; + /** + * Data template that is used to visualize the current stripe resize operation. + *

+ * This template is used for {@link yfiles.input.StripeVisualizationType#SELECTION} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @type {yfiles.view.IVisualTemplate} + */ + selectedStripeTemplate:yfiles.view.IVisualTemplate; + /** + * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} 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.input.StripeVisualizationType#DRAG_SOURCE} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @const + * @static + * @type {string} + */ + static DRAG_SOURCE_STRIPE_TEMPLATE_KEY:string; + /** + * Data template that is used to visualize the current source of a stripe reparent operation. + *

+ * This template is used for {@link yfiles.input.StripeVisualizationType#DRAG_SOURCE} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @type {yfiles.view.IVisualTemplate} + */ + dragSourceStripeTemplate:yfiles.view.IVisualTemplate; + /** + * A {@link string} that can be used to store a {@link yfiles.view.IVisualTemplate} 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.input.StripeVisualizationType#DROP_TARGET} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @const + * @static + * @type {string} + */ + static DROP_TARGET_STRIPE_TEMPLATE_KEY:string; + /** + * Data template that is used to visualize the current target of a stripe reparent operation. + *

+ * This template is used for {@link yfiles.input.StripeVisualizationType#DROP_TARGET} + *

+ * @see yfiles.input.DefaultStripeInputVisualizationHelper#getVisualCreator + * @type {yfiles.view.IVisualTemplate} + */ + dropTargetStripeTemplate:yfiles.view.IVisualTemplate; + static $class:yfiles.lang.Class; + } + export enum StripeVisualizationType{ + /** + * Visualization for a selected stripe. + */ + SELECTION, + /** + * Visualization for the source stripe of a reparent operation. + * @see yfiles.input.ReparentStripeInputMode + */ + DRAG_SOURCE, + /** + * Visualization for the target stripe of a reparent or drag and drop operation. + * @see yfiles.input.ReparentStripeInputMode + * @see 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. + *

+ * @interface + */ + export interface IStripeInputVisualizationHelper extends Object{ + /** + * Return an {@link yfiles.view.IVisualCreator} 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.input.StripeVisualizationType} type The actual visualization type + * @returns {yfiles.view.IVisualCreator} A {@link yfiles.view.IVisualCreator} instance that renders a representation for the current operation. + * @abstract + */ + getVisualCreator(context:yfiles.input.IInputModeContext,tableNode:yfiles.graph.INode,type:yfiles.input.StripeVisualizationType):yfiles.view.IVisualCreator; + } + var IStripeInputVisualizationHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Support class that allows to iterate over hits on table elements or subregions of table elements. + * @class yfiles.input.StripeHitTester + */ + export interface StripeHitTester extends Object{} + export class StripeHitTester { + /** + * 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.styles.TableRenderingOrder} tableRenderingOrder The hit test order. This determines the order in which stripes are returned by + * {@link yfiles.input.StripeHitTester#enumerateHits} + * @constructor + */ + constructor(table:yfiles.graph.ITable,tableRenderingOrder:yfiles.styles.TableRenderingOrder); + /** + * Return a collection of hits at location. + *

+ * This implementation returns the hits in the following order: + *

+ *
    + *
  1. 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.input.StripeHitTester#tableRenderingOrder} property.
  2. + *
  3. For each stripe type, the stripes are returned in bottom up order, i.e. children are returned before their parents.
  4. + *
  5. + * For each stripe, the subregions are returned in the order {@link yfiles.input.StripeSubregionTypes#NEAR_BORDER}, + * {@link yfiles.input.StripeSubregionTypes#FAR_BORDER}, {@link yfiles.input.StripeSubregionTypes#LEADING_HEADER}, + * {@link yfiles.input.StripeSubregionTypes#TRAILING_HEADER},{@link yfiles.input.StripeSubregionTypes#STRIPE}, e.g. a header hit is always + * returned before a hit on the whole stripe. + *
  6. + *
+ * @param {yfiles.input.IInputModeContext} context The input mode context to use. + * @param {yfiles.geometry.Point} location The location in absolute coordinates. + * @param {yfiles.graph.INode} node The node where the table instance is currently bound to. + * @returns {yfiles.collections.IEnumerable.} A collection of {@link yfiles.input.StripeSubregion}s at location + */ + enumerateHits(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,node:yfiles.graph.INode):yfiles.collections.IEnumerable; + /** + * Return the hit test order that is currently used by this instance + * @type {yfiles.styles.TableRenderingOrder} + */ + tableRenderingOrder:yfiles.styles.TableRenderingOrder; + static $class:yfiles.lang.Class; + } + }export namespace graph{ + /** + * Base interface for items that can be used in a {@link yfiles.view.CanvasComponent}. + *

+ * Most prominently this is the interface all graph elements used in {@link yfiles.graph.IGraph} implement. + *

+ *

+ * It adds no functionality over the {@link yfiles.graph.ILookup} and {@link yfiles.graph.ITagOwner} interfaces it inherits. + *

+ *

+ * To add custom visuals to a {@link yfiles.view.CanvasComponent} it is not necessary to implement this interface. Instead, any + * object can be {@link yfiles.view.ICanvasObjectGroup#addChild added directly to the canvas}, provided there is a suitable {@link yfiles.view.ICanvasObjectDescriptor} + * implementation for rendering it. + *

+ * @interface + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.graph.ITagOwner} + */ + export interface IModelItem extends Object,yfiles.graph.ILookup,yfiles.graph.ITagOwner{ + } + var IModelItem:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A group of {@link yfiles.graph.IUndoUnit}s that are undone/redone as a single unit. + *

+ * Clients can use this class to build an {@link yfiles.graph.IUndoUnit} that groups together multiple {@link yfiles.graph.IUndoUnit}s. The + * {@link yfiles.graph.IUndoUnit}s added to this unit are undone/redone in the order in which they were added. This implementation + * will try to {@link yfiles.graph.IUndoUnit#tryMergeUnit merge} or {@link yfiles.graph.IUndoUnit#tryReplaceUnit replace} units that are {@link yfiles.graph.CompositeUndoUnit#add added}. + *

+ * @class yfiles.graph.CompositeUndoUnit + * @implements {yfiles.graph.IUndoUnit} + */ + export interface CompositeUndoUnit extends Object,yfiles.graph.IUndoUnit{} + export class CompositeUndoUnit { + /** + * Creates a new instance using the provided names. + * @param {string} [undoName=null] + * @param {string} [redoName=null] + * @constructor + */ + constructor(undoName?:string,redoName?:string); + /** + * Creates a new instance using the provided names. + * @param {Object} options The parameters to pass. + * @param {string} [options.undoName=null] + * @param {string} [options.redoName=null] + * @constructor + */ + constructor(options:{undoName?:string,redoName?:string}); + /** + * Adds a new {@link yfiles.graph.IUndoUnit} to the queue. + * @param {yfiles.graph.IUndoUnit} unit The unit of work to add. + */ + add(unit:yfiles.graph.IUndoUnit):void; + /** + * Determines whether a call to {@link yfiles.graph.CompositeUndoUnit#redo} can be made. + * @returns {boolean} + */ + canRedo():boolean; + /** + * Determines whether a call to {@link yfiles.graph.CompositeUndoUnit#undo} can be made. + * @returns {boolean} + */ + canUndo():boolean; + /** + * Clears the internal collection of units. + */ + clear():void; + /** + * Disposes this unit and all of its contents. + *

+ * This unit cannot be used anymore after this has been invoked. + *

+ */ + dispose():void; + /** + * Redoes the next {@link yfiles.graph.IUndoUnit}. + * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.graph.CompositeUndoUnit#canRedo} would yield false. + */ + 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.graph.IUndoUnit#dispose Dispose} removed units. + *

+ * @param {yfiles.graph.IUndoUnit} unit The unit to remove. + * @returns {boolean} true iff the unit has been removed from this instance. + */ + removeUnit(unit:yfiles.graph.IUndoUnit):boolean; + /** + * Undoes the next {@link yfiles.graph.IUndoUnit}. + * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.graph.CompositeUndoUnit#canUndo} would yield false. + */ + undo():void; + /** + * Yields the number of units that are contained in this compound unit. + * @type {number} + */ + count:number; + /** + * Returns the current redo name. + * @type {string} + */ + redoName:string; + /** + * Returns the current redo name. + * @type {string} + */ + undoName:string; + /** + * Determines whether this instance has been {@link yfiles.graph.CompositeUndoUnit#dispose disposed.} + *

+ * An instance that has been disposed cannot be {@link yfiles.graph.CompositeUndoUnit#undo undone} or {@link yfiles.graph.CompositeUndoUnit#redo redone}. + *

+ * @type {boolean} + */ + disposed:boolean; + static $class:yfiles.lang.Class; + } + /** + * This interface is a means to bracket several + * {@link yfiles.graph.IUndoUnit}s, that is a collection of units that are treated as one (e.g. they are always undone or redone as + * a single unit). + *

+ * {@link yfiles.graph.ICompoundEdit}s have two states: active and settled. Whenever an {@link yfiles.graph.ICompoundEdit} is retrieved from the {@link yfiles.graph.UndoEngine} + * or the graph instance, it automatically is active. While an edit is in the active state, it gathers {@link yfiles.graph.IUndoUnit}s until + * the {@link yfiles.graph.ICompoundEdit#commit} or {@link yfiles.graph.ICompoundEdit#cancel} methods are called. Calling the {@link yfiles.graph.ICompoundEdit#commit} + * method commits all gathered {@link yfiles.graph.IUndoUnit}s to the {@link yfiles.graph.UndoEngine}, while canceling will {@link yfiles.graph.IUndoUnit#dispose dispose} them. + * Calling either method will put the edit in the settled state. In this state, the edit does not gather units anymore and is not + * reusable. + *

+ *

+ * {@link yfiles.graph.ICompoundEdit}s can also be nested, in this case the changes of the inner edit are not committed directly to + * the {@link yfiles.graph.UndoEngine} but to the outer edit. Only when the outer edit is committed, the units are committed to the + * {@link yfiles.graph.UndoEngine}. + *

+ * @see yfiles.graph.UndoEngine + * @see yfiles.graph.IUndoUnit + * @interface + */ + export interface ICompoundEdit extends Object{ + /** + * This method cancels the compound editing process. + *

+ * The recorded {@link yfiles.graph.IUndoUnit}s are {@link yfiles.graph.IUndoUnit#dispose disposed} and the edit is not usable anymore. + *

+ * @abstract + */ + cancel():void; + /** + * This method commits the compound editing process. + *

+ * The {@link yfiles.graph.IUndoUnit}s are enqueued into the corresponding {@link yfiles.graph.UndoEngine} instance and the edit is not + * usable anymore. + *

+ * @abstract + */ + commit():void; + } + var ICompoundEdit:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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. + *

+ * @interface + */ + 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 + * @returns {Object} an instance that is assignable to type or null + * @abstract + */ + lookup(type:yfiles.lang.Class):Object; + } + var ILookup:{ + /** + * 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.graph.ILookup} basicLookup the fallback lookup implementation + * @param {yfiles.graph.ILookup} additionalLookup the lookup that has precedence over the fallback + * @returns {yfiles.graph.ILookup} an implementation that decorates the first with the latter + * @static + */ + createCascadingLookup?(basicLookup:yfiles.graph.ILookup,additionalLookup:yfiles.graph.ILookup):yfiles.graph.ILookup; + /** + * 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 + * @returns {yfiles.graph.ILookup} an instance that will either yield subject or null + * @static + */ + createDynamicLookup?(subject:Object):yfiles.graph.ILookup; + /** + * Creates a simple mutable {@link yfiles.graph.ILookup} implementation that is backed by an {@link yfiles.collections.IMap.}. + *

+ * The {@link yfiles.graph.ILookup#lookup lookup} method uses the specified type as key when delegating to the backingDictionary. + *

+ * @param {yfiles.collections.Map.} backingDictionary The backing {@link yfiles.collections.Map.} that is used in the {@link yfiles.graph.ILookup#lookup lookup} calls. + * @returns {yfiles.graph.ILookup} A simple mutable {@link yfiles.graph.ILookup} implementation that is backed by a dictionary. + * @static + */ + createMapLookup?(backingDictionary:yfiles.collections.Map):yfiles.graph.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 + * @returns {yfiles.graph.ILookup} an ILookup implementation + * @static + */ + createSingleLookup?(subject:Object,type:yfiles.lang.Class):yfiles.graph.ILookup; + /** + * An ILookup instance that always returns null. + * @const + * @static + * @type {yfiles.graph.ILookup} + */ + EMPTY?:yfiles.graph.ILookup; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for instances that can provide a {@link yfiles.graph.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 yfiles.graph.ILookup + * @interface + */ + 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 + * @returns {Object} an implementation or null + * @see yfiles.graph.ILookup#lookup + * @abstract + */ + contextLookup(item:Object,type:yfiles.lang.Class):Object; + } + var IContextLookup:{ + /** + * An ILookupContext instance that always returns null. + * @const + * @static + * @type {yfiles.graph.IContextLookup} + */ + EMPTY_CONTEXT_LOOKUP?:yfiles.graph.IContextLookup; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for instances that can be used to chain lookup operations. + *

+ * Implementations will perform the lookup in the {@link yfiles.graph.IContextLookup#contextLookup} method and delegate to the next + * implementation in the chain if they cannot satisfy the request. + *

+ * @interface + * @implements {yfiles.graph.IContextLookup} + */ + export interface IContextLookupChainLink extends Object,yfiles.graph.IContextLookup{ + /** + * This method is called by the framework to register the fallback lookup implementation that should be used during a call + * to {@link yfiles.graph.IContextLookup#contextLookup}. + *

+ * 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.graph.IContextLookup} next The context to use as a fallback. + * @abstract + */ + setNext(next:yfiles.graph.IContextLookup):void; + } + var 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 type is being looked up. + * @returns {yfiles.graph.IContextLookupChainLink} An instance that can be used in a lookup chain. + * @static + */ + addingLookupChainLink?(type:yfiles.lang.Class,instance:Object):yfiles.graph.IContextLookupChainLink; + /** + * Factory method for a lookup chain element that adds an {@link yfiles.graph.ILookup} layer to a lookup chain. + *

+ * If the lookup returns null, the call will be propagated to the chain. + *

+ * @param {yfiles.graph.ILookup} lookup The lookup to use. + * @returns {yfiles.graph.IContextLookupChainLink} An instance that can be used in a lookup chain. + * @static + */ + addingLookupChainLink?(lookup:yfiles.graph.ILookup):yfiles.graph.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. + * @returns {yfiles.graph.IContextLookupChainLink} An instance that can be used in a lookup chain. + * @static + */ + addingLookupChainLink?(instance:Object):yfiles.graph.IContextLookupChainLink; + /** + * 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. + * @returns {yfiles.graph.IContextLookupChainLink} The implementation of the link that uses the callback. + * @static + */ + createContextLookupChainLink?(callback:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.graph.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.graph.IContextLookup#contextLookup 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.graph.IContextLookupChainLink#setNext next} chain link will be delegated the request to. + *

+ * Type parameter TContext. + * Type parameter TResult. + * @param {function(TContext): TResult} factory The factory delegate to use that yields the result for a given context. + * @returns {yfiles.graph.IContextLookupChainLink} An instance that can be used in a lookup chain. + * @template TContext,TResult + * @static + */ + factoryLookupChainLink?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(arg:TContext)=>TResult):yfiles.graph.IContextLookupChainLink; + /** + * 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. + * @returns {yfiles.graph.IContextLookupChainLink} An instance that can be used in a lookup chain. + * @static + */ + hidingLookupChainLink?(type:yfiles.lang.Class):yfiles.graph.IContextLookupChainLink; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that can be used to decorate the lookup result for a set of types. + * @see yfiles.graph.ILookup + * @see yfiles.graph.IContextLookupChainLink + * @interface + */ + export interface ILookupDecorator extends Object{ + /** + * Adds a lookup implementation for a given type using a function of type function(TContext, TResult). + *

+ * This method is closely related to the {@link yfiles.graph.ILookupDecorator#add} 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. + *

+ * Type parameter TContext: The type of the context subject. + * Type parameter TResult: The type of the query, which is a base type or the type of the result. + * @param {function(TContext, TResult): TResult} wrapperFactory The factory delegate that will be used to satisfy queries of type TResult + * @param {boolean} [decorateNull=true] Whether to 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. + * @returns {yfiles.graph.IContextLookupChainLink} The {@link yfiles.graph.IContextLookupChainLink} instance as returned by the {@link yfiles.graph.ILookupDecorator#addLookup} call or + * null, if either decorator was null, or it {@link yfiles.graph.ILookupDecorator#canDecorate could not decorate} the TContext type. + * @template TContext,TResult + */ + add?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(arg1:TContext,arg2:TResult)=>TResult,decorateNull?:boolean):yfiles.graph.IContextLookupChainLink; + /** + * Adds a lookup implementation for a given type using a func. + * Type parameter TContext: The type of the context subject. + * Type parameter TResult: The type of the query, which is a base type or the type of the result. + * @param {function(TContext): TResult} factory The factory delegate that will be used to satisfy queries of type TResult. + * @param {boolean} [nullIsFallback=true] 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. + * @returns {yfiles.graph.IContextLookupChainLink} The {@link yfiles.graph.IContextLookupChainLink} instance as returned by the {@link yfiles.graph.ILookupDecorator#addLookup} call or + * null, if either decorator was null, or it {@link yfiles.graph.ILookupDecorator#canDecorate could not decorate} the TContext type. + * @template TContext,TResult + */ + add?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(arg:TContext)=>TResult,nullIsFallback?:boolean):yfiles.graph.IContextLookupChainLink; + /** + * Add a lookup implementation for a given type that always yields a constant result. + * Type parameter TContext: The type of the context subject. + * Type parameter TResult: The type of the query, which is a base type or the type of the result. + * @param {TResult} result The constant value to yield if the chain is queried for an implementation of type TResult. + * @returns {yfiles.graph.IContextLookupChainLink} The {@link yfiles.graph.IContextLookupChainLink} instance as returned by the {@link yfiles.graph.ILookupDecorator#addLookup} call or + * null, if either decorator was null, or it {@link yfiles.graph.ILookupDecorator#canDecorate could not decorate} the TContext type. + * @template TContext,TResult + */ + addConstant?(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,result:TResult):yfiles.graph.IContextLookupChainLink; + /** + * 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.graph.ILookupDecorator#canDecorate} + * yields true for t. + *

+ * @param {yfiles.lang.Class} t The type to decorate the lookup. + * @param {yfiles.graph.IContextLookupChainLink} lookup The chain element to add to the lookup of the given type. + * @see yfiles.graph.ILookupDecorator#removeLookup + * @see yfiles.graph.ILookupDecorator#add + * @see yfiles.graph.ILookupDecorator#add + * @see yfiles.graph.ILookupDecorator#addConstant + * @abstract + */ + addLookup(t:yfiles.lang.Class,lookup:yfiles.graph.IContextLookupChainLink):void; + /** + * 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. + * @returns {boolean} + * @abstract + */ + canDecorate(t:yfiles.lang.Class):boolean; + /** + * 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.graph.IContextLookupChainLink} lookup The chain element to remove from the lookup of the given type. + * @see yfiles.graph.ILookupDecorator#addLookup + * @abstract + */ + removeLookup(t:yfiles.lang.Class,lookup:yfiles.graph.IContextLookupChainLink):void; + } + var ILookupDecorator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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. + *

+ * @interface + */ + export interface ITagOwner extends Object{ + /** + * Gets or sets the tag 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. + *

+ * @abstract + * @type {Object} + */ + tag:Object; + } + var ITagOwner:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of a chain of {@link yfiles.graph.IContextLookupChainLink}s. + * @class yfiles.graph.LookupChain + * @implements {yfiles.graph.IContextLookup} + * @implements {yfiles.lang.IPropertyObservable} + */ + export interface LookupChain extends Object,yfiles.graph.IContextLookup,yfiles.lang.IPropertyObservable{} + export class LookupChain { + constructor(); + /** + * A convenience method that adds a {@link yfiles.graph.IContextLookupChainLink} to the given chain that is based on a function of + * type function(TContext, TResult). + *

+ * Depending on decorateNull, null results of the underlying chain will be passed to the + * wrapperFactory, or simply yielded as the final result. + *

+ * Type parameter TContext: The type of the context. + * Type parameter TResult: The type of the result. + * @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=false] 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. + * @returns {yfiles.graph.IContextLookupChainLink} The link that has been registered with the chain. + * @template TContext,TResult + */ + add(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(arg1:TContext,arg2:TResult)=>TResult,decorateNull?:boolean):yfiles.graph.IContextLookupChainLink; + /** + * A convenience method that adds a {@link yfiles.graph.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. + *

+ * Type parameter TContext: The type of the context. + * Type parameter TResult: The type of the result. + * @param {function(TContext): TResult} factory The factory that will be called for queries to TResult. + * @param {boolean} [nullIsFallback=true] 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. + * @returns {yfiles.graph.IContextLookupChainLink} The link that has been registered with the chain. + * @template TContext,TResult + */ + add(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(arg:TContext)=>TResult,nullIsFallback?:boolean):yfiles.graph.IContextLookupChainLink; + /** + * Adds the given link to the end of the chain. + * @param {yfiles.graph.IContextLookupChainLink} lookup The link to add. + * @see yfiles.graph.LookupChain#remove + */ + add(lookup:yfiles.graph.IContextLookupChainLink):void; + /** + * Convenience method that can be used instead of the {@link yfiles.graph.LookupChain#add} method to easily add a lookup + * implementation for a given type that always yields a constant result. + * Type parameter TResult: The type of the query, which is a base type or the type of the result. + * @param {TResult} result The constant value to yield if the chain is queried for an implementation of type TResult. + * @returns {yfiles.graph.IContextLookupChainLink} The {@link yfiles.graph.IContextLookupChainLink} instance that has been added to the chain. + * @template TResult + */ + addConstant(resultType:yfiles.lang.Class,result:TResult):yfiles.graph.IContextLookupChainLink; + /** + * 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. + * @returns {Object} The result of the query. + */ + contextLookup(item:Object,type:yfiles.lang.Class):Object; + /** + * Can be called by client code to trigger the {@link yfiles.graph.LookupChain#addPropertyChangedListener PropertyChanged} + * event manually. + */ + notifyChange():void; + /** + * Notifies client code that the lookup of this instance might have changed. + * @param {yfiles.lang.PropertyChangedEventArgs} evt The arguments + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Removes the link that has previously been added to this instance from this chain. + * @param {yfiles.graph.IContextLookupChainLink} link The link to remove. + */ + remove(link:yfiles.graph.IContextLookupChainLink):void; + /** + * Adds the given listener for the PropertyChanged event that occurs when the lookup of this instance has changed for some + * or all of the types or items. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.graph.LookupChain#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when the lookup of this instance has changed for + * some or all of the types or items. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.graph.LookupChain#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * The main class to provide undo and redo functionality. + *

+ * The {@link yfiles.graph.UndoEngine} is in charge of {@link yfiles.graph.UndoEngine#beginCompoundEdit recording}, {@link yfiles.graph.UndoEngine#addUnit managing} and {@link yfiles.graph.UndoEngine#undo executing} single units of work that can be undone + * and redone, represented by the interface {@link yfiles.graph.IUndoUnit}. + *

+ *

+ * These units are managed in a queue-like structure and can be added manually to the queue by calling the {@link yfiles.graph.UndoEngine#addUnit} + * method. + *

+ *

+ * Executing the units is done by client code or commands by calling {@link yfiles.graph.UndoEngine#undo} or + * {@link yfiles.graph.UndoEngine#redo}. The engine automatically manages the queue so that calling these two methdos will + * consistently move the units in the queue. + *

+ *

+ * The {@link yfiles.graph.UndoEngine#beginCompoundEdit} method allows to record units by bracketing serveral changes in an + * {@link yfiles.graph.ICompoundEdit}. Implementations of the {@link yfiles.graph.ICompoundEdit} interface record all subsequent changes + * until it is {@link yfiles.graph.ICompoundEdit#commit committed} and therefore all recorded units are added to the engine. For more information and examples see + * {@link yfiles.graph.ICompoundEdit}. + *

+ *

+ * Depending on the properties {@link yfiles.graph.UndoEngine#mergeUnits} and {@link yfiles.graph.UndoEngine#autoMergeTime}, the engine tries to collapse added {@link yfiles.graph.IUndoUnit}s if possible. This enhances + * the performance and reduces the required memory for undo changes. For example, when a node is moved interactively, + * instead of saving every position that the node had when being dragged the engine will only hold one {@link yfiles.graph.IUndoUnit} + * at the end to undo the entire movement. + *

+ *

+ *
Customizing Undo/Redo + *

    + *
  • + * In general, to be able to undo or redo certain work client code can implement {@link yfiles.graph.IUndoUnit} or subclass + * {@link yfiles.graph.UndoUnitBase UndoUnitBase}. The client application needs to encapsulate + * changes in this implementation and provide the logic to completely undo and redo these changes. + * Instances of your custom {@link yfiles.graph.IUndoUnit} implementations need to be added to the {@link yfiles.graph.UndoEngine} + * manually via {@link yfiles.graph.UndoEngine#addUnit}. + *
  • + *
  • + * In certain cases it is difficult or not efficient to track and save the changes between certain states, + * and better to save the states themselves and to restore these. For example when there are potentially + * many intermediate steps between two states of interest and it would be complicated + * to produce {@link yfiles.graph.IUndoUnit}s for each intermediate step and merge them in the end. + * In such cases client code should implement {@link yfiles.graph.IMementoSupport} instead. + * See the documentation of {@link yfiles.graph.IMementoSupport} for examples and guidelines on how to implement + * this memento design pattern concept. + *
  • + *
  • + * It is generally not necessary to subclass {@link yfiles.graph.UndoEngine} unless you want to customize the internal + * handling of the units, which is both complicated and prone to errors. In most use cases it is sufficient + * to provide custom {@link yfiles.graph.IUndoUnit}s or {@link yfiles.graph.IMementoSupport}. + *
  • + *
+ *

+ * @see yfiles.graph.IUndoUnit + * @see yfiles.graph.UndoUnitBase + * @see yfiles.graph.IMementoSupport + * @see yfiles.graph.ICompoundEdit + * @class yfiles.graph.UndoEngine + * @implements {yfiles.lang.IPropertyObservable} + */ + export interface UndoEngine extends Object,yfiles.lang.IPropertyObservable{} + export class UndoEngine { + /** + * Initializes a new instance of the {@link yfiles.graph.UndoEngine} class. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} options.mergeUnits A value that indicates whether or not this instance should try to merge newly added units. + *

+ * This option sets the {@link yfiles.graph.UndoEngine#mergeUnits} property on the created object. + *

+ * @param {yfiles.lang.TimeSpan} options.autoMergeTime The duration during which the engine will try to merge newly added units. + *

+ * This option sets the {@link yfiles.graph.UndoEngine#autoMergeTime} property on the created object. + *

+ * @param {number} options.size The maximum size of the undo queue this instance is managing. + *

+ * This option sets the {@link yfiles.graph.UndoEngine#size} property on the created object. + *

+ * @constructor + */ + constructor(options?:{mergeUnits?:boolean,autoMergeTime?:yfiles.lang.TimeSpan,size?:number}); + /** + * Adds a new {@link yfiles.graph.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.graph.UndoEngine#autoMergeTime}. + *

+ * @param {yfiles.graph.IUndoUnit} unit The unit of work to add. + */ + addUnit(unit:yfiles.graph.IUndoUnit):void; + /** + * Begins a compound edit that will use the provided name. + *

+ * This will create a new edit that can independently be {@link yfiles.graph.ICompoundEdit#cancel canceled} or {@link yfiles.graph.ICompoundEdit#commit committed}. Note that only if the outer-most instances + * is committed, the corresponding {@link yfiles.graph.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. + * @returns {yfiles.graph.ICompoundEdit} A compound edit implementation that needs to be {@link yfiles.graph.ICompoundEdit#cancel canceled} or {@link yfiles.graph.ICompoundEdit#commit committed} later. + */ + beginCompoundEdit(undoName:string,redoName:string):yfiles.graph.ICompoundEdit; + /** + * Determines whether a call to {@link yfiles.graph.UndoEngine#redo} can be made. + * @returns {boolean} + */ + canRedo():boolean; + /** + * Determines whether a call to {@link yfiles.graph.UndoEngine#undo} can be made. + * @returns {boolean} + */ + canUndo():boolean; + /** + * Clears the internal queue and {@link yfiles.graph.IUndoUnit#dispose disposes} all units in it. + */ + clear():void; + /** + * 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. + *

+ * @returns {Object} An object that can be checked against other tokens via the {@link Object#equals} method. + */ + getToken():Object; + /** + * This will trigger the corresponding {@link yfiles.graph.UndoEngine#addPropertyChangedListener PropertyChanged} event. + * @param {string} name The name of the property that changed. + * @protected + */ + onPropertyChanged(name:string):void; + /** + * Redoes the next {@link yfiles.graph.IUndoUnit}. + * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.graph.UndoEngine#canRedo} would yield false. + */ + redo():void; + /** + * Undoes the next {@link yfiles.graph.IUndoUnit}. + * @throws {Stubs.Exceptions.NotSupportedError} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.graph.UndoEngine#canUndo} would yield false. + */ + undo():void; + /** + * Gets or sets a value that indicates whether or not this instance should try to merge newly added units. + *

+ * If true this instance will try to {@link yfiles.graph.IUndoUnit#tryMergeUnit merge} or {@link yfiles.graph.IUndoUnit#tryReplaceUnit replace} units in the queue. Note that when the {@link yfiles.graph.UndoEngine#autoMergeTime} property is set to {@link yfiles.lang.TimeSpan#ZERO} + * and this property is set to true, the engine will always try to merge incoming units. Otherwise the {@link yfiles.graph.UndoEngine#autoMergeTime} dictates whether + * the engine will try to merge a unit or not. + *

+ * @see yfiles.graph.UndoEngine#autoMergeTime + * @type {boolean} + */ + mergeUnits:boolean; + /** + * Gets or sets the duration during which the engine will try to merge newly added units. + *

+ * If this is set to {@link yfiles.lang.TimeSpan#ZERO}, the engine will try to merge incoming units depending on the {@link yfiles.graph.UndoEngine#mergeUnits} property. + * Otherwise, if the time span between the last added unit and the new unit exceeds the set value, the engine does not try + * to merge the units regardless what the {@link yfiles.graph.UndoEngine#mergeUnits} property is set to. Likewise, if the time span is smaller than the set value, + * the engine will always try to merge units. + *

+ * @type {yfiles.lang.TimeSpan} + */ + autoMergeTime:yfiles.lang.TimeSpan; + /** + * Gets or sets the maximum size of the undo queue this instance is managing. + *

+ * A size of 0 effectively disables this implementation. + *

+ * @type {number} + */ + size:number; + /** + * Returns the {@link yfiles.graph.IUndoUnit#undoName} of the next {@link yfiles.graph.UndoEngine#undo} operation. + * @type {string} + */ + undoName:string; + /** + * Returns the {@link yfiles.graph.IUndoUnit#redoName} of the next {@link yfiles.graph.UndoEngine#redo} operation. + * @type {string} + */ + redoName:string; + /** + * Indicates whether this instance is currently performing an undo operation. + * @type {boolean} + */ + performingUndo:boolean; + /** + * Indicates whether this instance is currently performing a redo operation. + * @type {boolean} + */ + performingRedo:boolean; + /** + * Adds the given listener for the PropertyChanged event that occurs when {@link yfiles.graph.UndoEngine#canUndo}, + * {@link yfiles.graph.UndoEngine#canRedo}, {@link yfiles.graph.UndoEngine#undoName}, or {@link yfiles.graph.UndoEngine#redoName} changed its value. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.graph.UndoEngine#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when {@link yfiles.graph.UndoEngine#canUndo}, + * {@link yfiles.graph.UndoEngine#canRedo}, {@link yfiles.graph.UndoEngine#undoName}, or {@link yfiles.graph.UndoEngine#redoName} changed its value. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.graph.UndoEngine#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Adds the given listener for the UnitUndone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#undo} + * operation of an {@link yfiles.graph.IUndoUnit}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.graph.UndoEngine#removeUnitUndoneListener + */ + addUnitUndoneListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the UnitUndone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#undo} + * operation of an {@link yfiles.graph.IUndoUnit}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.graph.UndoEngine#addUnitUndoneListener + */ + removeUnitUndoneListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the UnitRedone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#redo} + * operation of an {@link yfiles.graph.IUndoUnit}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.graph.UndoEngine#removeUnitRedoneListener + */ + addUnitRedoneListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the UnitRedone event that occurs when the engine has successfully executed the {@link yfiles.graph.IUndoUnit#redo} + * operation of an {@link yfiles.graph.IUndoUnit}. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.graph.UndoEngine#addUnitRedoneListener + */ + removeUnitRedoneListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * Represents a unit of work that can be undone and redone. + *

+ * Clients should use this interface when certain actions, changes or events should be monitored and have undoability + * provided for them. If you simply want to track the state of certain items between two states of interest, you should + * consider using {@link yfiles.graph.IMementoSupport mementos} instead. + *

+ *

+ * The central methods of this interface are {@link yfiles.graph.IUndoUnit#undo} and {@link yfiles.graph.IUndoUnit#redo} which contain the + * logic to undo or redo a unit of work. Keep in mind that undo/redo are sensible operations and should maintain a + * consistent state before and after each operation since they may be executed potentially often one after another. + *

+ *

+ * The requirement for an {@link yfiles.graph.IUndoUnit} is that when a program is in a certain state and a call to {@link yfiles.graph.IUndoUnit#undo} + * is followed by a call to {@link yfiles.graph.IUndoUnit#redo} then the program is in the exact same state as before (the same + * holds true for the other way around). + *

+ *

+ * A default implementation of this interface is the abstract class {@link yfiles.graph.UndoUnitBase} which forces only the + * implementation of the undo/redo logic and defaults the other methods. Clients should primarily extend this class instead + * of implementing the whole interface. + *

+ *

+ * IUndoUnits are managed by the {@link yfiles.graph.UndoEngine}. Custom units can always be added to the engine using the method + * {@link yfiles.graph.UndoEngine#addUnit}. Also consider to use one of the convenience implementations: {@link yfiles.graph.DelegateUndoUnit.} takes delegates for the + * undo/redo operations and {@link yfiles.graph.CompositeUndoUnit} creates a bracketing unit comprising several other units. + *

+ *

+ * Also note that in order to keep a consistent state, methods of objects of this type should not be called by clientcode + * directly but use the {@link yfiles.graph.UndoEngine} instead. + *

+ * @interface + */ + export interface IUndoUnit extends Object{ + /** + * Called by the {@link yfiles.graph.UndoEngine} and client code to let the unit dispose of references aren't needed anymore. + *

+ * When this method is called, the other methods of this interface will not be called anymore by the undo engine. The undo + * engine calls this method on instances that it will not use anymore to enable the instances to release instances and + * memory actively. + *

+ * @abstract + */ + dispose():void; + /** + * Redoes the work that is represented by this unit. + *

+ * Undo/redo are sensible operations and should maintain a consistent state before and after each operation since they may + * be executed potentially often one after another. + *

+ * @see yfiles.graph.IUndoUnit#redoName + * @abstract + */ + redo():void; + /** + * Tries to merge the given unit with this one. + *

+ * This method is called when this unit is the head of an {@link yfiles.graph.UndoEngine}'s or {@link yfiles.graph.CompositeUndoUnit}'s + * queue and a new unit is added. It is meant to try to incorporate the change of the given unit into this and if + * successful return true. This should be the case when the end state of this unit is equal to the start state of the given + * unit. + *

+ *

+ * For example, if this unit is the head of the queue and represents the work from state A to state B and the given unit + * the work from state B to state C, then this method should try to make this unit shift from state A to state C. If this + * is successful, the method is expected to return true. The other unit is then {@link yfiles.graph.IUndoUnit#dispose disposed} by the {@link yfiles.graph.UndoEngine} + * afterwards. + *

+ *

+ * Clients don't necessarily have to implement this method if the unit doesn't happen very often. In fact, the default + * implementation of {@link yfiles.graph.UndoUnitBase#tryMergeUnit} simply returns false. Implementing this method faithfully will + * cause multiple units of work to inseparably appear as one and undoing/redoing it will undo/redo the work of all + * collapsed units. Depending on the situation this may be reasonable, for example when there are potentially a lot of + * changes where not every intermediate step is required to be recorded. In this case implementing this method faithfully + * will greatly improve the performance and reduce the required amount of memory of the undo process. If you want to group + * together multiple units as a single block but still want to be able to separate each step, consider to use a {@link yfiles.graph.CompositeUndoUnit} + * instead. + *

+ * @param {yfiles.graph.IUndoUnit} unit The unit to incorporate that happened after this unit. + * @returns {boolean} Whether the state change of unit has been incorporated into this unit and unit can be disposed of. + * @abstract + */ + tryMergeUnit(unit:yfiles.graph.IUndoUnit):boolean; + /** + * Tries to replace the given unit with this one. + *

+ * This method is called if a newly added unit couldn't be {@link yfiles.graph.IUndoUnit#tryMergeUnit merged} with the head unit of the queue (i.e. returned false). + * Instead of trying to merge a newly added unit, this method tries to replace the given unit (which is the head of the + * queue) with this by incorporating the change of the given unit into this and if successful return true. This should be + * the case when the start state of this unit is equal to the end state of the given unit. + *

+ *

+ * For example, if the given unit represents the work from state A to state B and this unit the work from state B to state + * C, then this method should try to make this unit shift from state A to state C. If this is successful, the method is + * expected to return true. The given unit is then {@link yfiles.graph.IUndoUnit#dispose disposed} by the {@link yfiles.graph.UndoEngine} afterwards and replaced with this + * unit in the queue. + *

+ *

+ * Clients don't necessarily have to implement this method if the unit doesn't happen very often. In fact, the default + * implementation of {@link yfiles.graph.UndoUnitBase#tryReplaceUnit} simply returns false. Implementing this method faithfully + * will cause multiple units of work to inseparably appear as one and undoing/redoing it will undo/redo the work of all + * collapsed units. Depending on the situation this may be reasonable, for example when there are potentially a lot of + * changes where not every intermediate step is required to be recorded. In this case implementing this method faithfully + * will greatly improve the performance and reduce the required amount of memory of the undo process. If you want to group + * together multiple units as a single block but still want to be able to separate each step, consider to use a {@link yfiles.graph.CompositeUndoUnit} + * instead. + *

+ * @param {yfiles.graph.IUndoUnit} unit The unit to incorporate that happened before this unit. + * @returns {boolean} Whether the state change of this unit has been incorporated into the given unit and this can be disposed of. + * @abstract + */ + tryReplaceUnit(unit:yfiles.graph.IUndoUnit):boolean; + /** + * Undoes the work that is represented by this unit. + *

+ * Undo/redo are sensible operations and should maintain a consistent state before and after each operation since they may + * be executed potentially often one after another. + *

+ * @see yfiles.graph.IUndoUnit#undoName + * @abstract + */ + undo():void; + /** + * 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. + *

+ * @abstract + * @type {string} + */ + 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. + *

+ * @abstract + * @type {string} + */ + redoName:string; + } + var IUndoUnit:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface provides access to the memento design pattern to provide undoability for arbitrary models. + *

+ * By implementing this interface as well as {@link yfiles.graph.ILookup}, clients can add undoability for changes to their model + * classes. The yFiles undo mechanism uses the return value of {@link yfiles.graph.IMementoSupport#getState} to retrieve a state of + * an item at the beginning of the compound editing process. When the process ends, another state will be retrieved of the + * same item and compared to the original state. If they differ, an {@link yfiles.graph.IUndoUnit} is created that uses the {@link yfiles.graph.IMementoSupport#applyState} + * method to apply either state to the item in case of {@link yfiles.graph.IUndoUnit#undo undo} or {@link yfiles.graph.IUndoUnit#redo redo}. This represents an abstraction to the undo mechanism + * where it is only needed to define "states" of items and hides the more complicated mechanism of creating and inserting + * {@link yfiles.graph.IUndoUnit}s. + *

+ *

+ * The following is an example implementation of an item that is being managed using {@link yfiles.graph.IMementoSupport}: + *

+ *

+ * A collection of items from this type can then be watched using the following code snippet: + *

+ *

+ * Implementing the {@link yfiles.graph.IMementoSupport} interface is quite unrestrained, the type of the state returned by {@link yfiles.graph.IMementoSupport#getState} + * method can by anything as long as the {@link yfiles.graph.IMementoSupport#applyState} and {@link yfiles.graph.IMementoSupport#stateEquals} + * methods can deal with it: + *

+ *

+ * In summary, use this concept when you want to track the state of items during certain operations for undo/redo. This is + * efficient if it's easier to handle an item's state than the changes to the item themselves. If you want to focus on the + * changes or on certain events, you should use custom {@link yfiles.graph.IUndoUnit} implementations instead. + *

+ * @see yfiles.graph.ILookup + * @see yfiles.graph.ICompoundEdit + * @see yfiles.graph.UndoEngine + * @interface + */ + export interface IMementoSupport extends Object{ + /** + * Reapplies a previously queried state object to a given subject. + *

+ * The state object has been created using the {@link yfiles.graph.IMementoSupport#getState} method. + *

+ * @param {Object} subject The subject to modify the state. + * @param {Object} state The state object as returned by {@link yfiles.graph.IMementoSupport#getState} + * @abstract + */ + applyState(subject:Object,state:Object):void; + /** + * Retrieves an object representing the state at the moment this method is called. + *

+ * The returned state may be reapplied later to the subject in the {@link yfiles.graph.IMementoSupport#applyState} method. + *

+ * @param {Object} subject The subject to read the state from + * @returns {Object} An object that describes the current state of subject. + * @abstract + */ + getState(subject:Object):Object; + /** + * Determines whether two state objects are equal. + *

+ * The undo mechanism in yFiles calls this method to determine if the subject has changed and whether an {@link yfiles.graph.IUndoUnit} + * should be created for these changes. If this method returns false, an {@link yfiles.graph.IUndoUnit} is created for the two + * states that can reapply either state (for either undo or redo). If this method returns true the state is considered not + * to have changed and no undo unit will be created. Conservative implementations my simply return false. + *

+ * @param {Object} state1 The first state as obtained from {@link yfiles.graph.IMementoSupport#getState} + * @param {Object} state2 The second state as obtained from {@link yfiles.graph.IMementoSupport#getState} + * @returns {boolean} true if the states are equal; false otherwise. + * @abstract + */ + stateEquals(state1:Object,state2:Object):boolean; + } + var IMementoSupport:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A convenience implementation of the {@link yfiles.graph.IUndoUnit} interface that uses simple delegates for the actual undo and + * redo operations. + * Type parameter T: The type of the single parameter that is passed to the delegate. + * @class yfiles.graph.DelegateUndoUnit. + * @extends {yfiles.graph.UndoUnitBase} + * @template T + * @final + */ + export interface DelegateUndoUnit extends yfiles.graph.UndoUnitBase{} + export class 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): void} undo The undo handler delegate. + * @param {function(T): void} 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. + * @constructor + */ + constructor(undoName:string,undo:(param:T)=>void,redo:(param:T)=>void,undoParam:T,redoParam:T); + /** + * 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): void} 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. + * @constructor + */ + constructor(undoName:string,undoRedo:(param:T)=>void,undoParam:T,redoParam:T); + static $class:yfiles.lang.Class; + } + /** + * An abstract convenience implementation of {@link yfiles.graph.IUndoUnit}. + *

+ * This class defaults most methods required by the {@link yfiles.graph.IUndoUnit} interface. Subclasses only have to implement the + * undo/redo logic. Most notably, {@link yfiles.graph.IUndoUnit#tryMergeUnit} and {@link yfiles.graph.IUndoUnit#tryReplaceUnit} are + * implemented to return + * false. Subclasses are of course allowed to override more methods if clients want to enable additional functionality. + *

+ *

+ * Use this class for simple custom implementations of {@link yfiles.graph.IUndoUnit}. + *

+ * @see yfiles.graph.IUndoUnit + * @see yfiles.graph.UndoEngine + * @class yfiles.graph.UndoUnitBase + * @implements {yfiles.graph.IUndoUnit} + */ + export interface UndoUnitBase extends Object,yfiles.graph.IUndoUnit{} + export class UndoUnitBase { + /** + * Creates a new instance using the given name as undo and redo name. + * @param {string} undoName The undo name. + * @param {string} [redoName=null] The redo name. + * @protected + * @constructor + */ + constructor(undoName:string,redoName?:string); + /** + * + */ + dispose():void; + /** + * + * @abstract + */ + redo():void; + /** + * + * @param {yfiles.graph.IUndoUnit} unit + * @returns {boolean} + */ + tryMergeUnit(unit:yfiles.graph.IUndoUnit):boolean; + /** + * + * @param {yfiles.graph.IUndoUnit} unit + * @returns {boolean} + */ + tryReplaceUnit(unit:yfiles.graph.IUndoUnit):boolean; + /** + * + * @abstract + */ + undo():void; + /** + * + * @type {string} + */ + undoName:string; + /** + * + * @type {string} + */ + redoName:string; + static $class:yfiles.lang.Class; + } + /** + * 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. + * @class yfiles.graph.BendAnchoredPortLocationModel + * @implements {yfiles.graph.IPortLocationModel} + * @final + */ + export interface BendAnchoredPortLocationModel extends Object,yfiles.graph.IPortLocationModel{} + export class BendAnchoredPortLocationModel { + /** + * 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. + * @returns {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. + * @returns {yfiles.graph.IPortLocationModelParameter} A parameter that anchors the port at a bend. + */ + createFromTarget(bendIndex:number):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @param {yfiles.geometry.Point} location + * @returns {yfiles.graph.IPortLocationModelParameter} + */ + createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.geometry.Point} + */ + getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; + /** + * This implementation has nothing in its lookup and will always yield null + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A static immutable global instance of this class. + * @const + * @static + * @type {yfiles.graph.BendAnchoredPortLocationModel} + */ + static INSTANCE:yfiles.graph.BendAnchoredPortLocationModel; + /** + * A convenience instance of a parameter that is bound to the first {@link yfiles.graph.IBend} of the edge. + * @see yfiles.graph.BendAnchoredPortLocationModel#createFromSource + * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static 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 yfiles.graph.BendAnchoredPortLocationModel#createFromTarget + * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static LAST_BEND:yfiles.graph.IPortLocationModelParameter; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.CompositeLabelModel#getParameters}. A custom model can easily be created that way: + *

+ * @class yfiles.graph.CompositeLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + * @implements {yfiles.graph.ILabelModelParameterFinder} + */ + export interface CompositeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{} + export class CompositeLabelModel { + /** + * Creates a new instance of this label model with an empty {@link yfiles.graph.CompositeLabelModel#labelModels} collection. + * @constructor + */ + constructor(); + /** + * Creates a default parameter that can be used for this model. + *

+ * If {@link yfiles.graph.CompositeLabelModel#labelModels} is not empty, the default parameter for the first model in that list is returned. Otherwise, the default parameter + * for {@link yfiles.graph.FreeLabelModel#createDefaultParameter} is returned. + *

+ * @returns {yfiles.graph.ILabelModelParameter} a parameter for this model instance + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * 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.graph.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} layout The anticipated layout for the label. + * @returns {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):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. + *

+ * This implementation returns all parameters from all models in {@link yfiles.graph.CompositeLabelModel#labelModels} + *

+ * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @returns {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets a list of {@link yfiles.graph.ILabelModel} implementations that are wrapped by this instance. + * @type {yfiles.collections.IList.} + */ + labelModels:yfiles.collections.IList; + static $class:yfiles.lang.Class; + } + /** + * 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 them to {@link yfiles.graph.SimpleBend} will 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 create two {@link yfiles.graph.SimpleNode}s, a + * {@link yfiles.graph.SimpleEdge} to connect the two nodes and add instances of this class to the edge's {@link yfiles.graph.SimpleEdge#bends} model. Then render the + * edge. + *

+ * @class yfiles.graph.SimpleBend + * @implements {yfiles.graph.IBend} + */ + export interface SimpleBend extends Object,yfiles.graph.IBend{} + export class 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 bend's location. + * @constructor + */ + constructor(owner:yfiles.graph.IEdge,location:yfiles.geometry.IPoint); + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @type {yfiles.graph.IEdge} + */ + owner:yfiles.graph.IEdge; + /** + * Gets or sets the location of this bend. + * @see yfiles.graph.SimpleBend#x + * @see yfiles.graph.SimpleBend#y + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * Gets the current x coordinate of this bend. + *

+ * This delegates to the {@link yfiles.graph.SimpleBend#location} instance. + *

+ * @type {number} + */ + x:number; + /** + * Gets the current y coordinate of this bend. + *

+ * This delegates to the {@link yfiles.graph.SimpleBend#location} instance. + *

+ * @type {number} + */ + y:number; + /** + * + * @type {Object} + */ + tag:Object; + /** + * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleBend#lookup} on this instance. + * @type {yfiles.graph.ILookup} + */ + lookupImplementation:yfiles.graph.ILookup; + static $class:yfiles.lang.Class; + } + /** + * 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 them to {@link yfiles.graph.SimpleEdge} will 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 create a + * {@link yfiles.graph.SimpleEdge}, associate a style with it and use the style's renderer instance to obtain a rendering for the + * edge. + *

+ * @class yfiles.graph.SimpleEdge + * @implements {yfiles.graph.IEdge} + */ + export interface SimpleEdge extends Object,yfiles.graph.IEdge{} + export class SimpleEdge { + /** + * Creates an edge with a {@link yfiles.graph.DefaultGraph#defaultEdgeLookup default lookup}, and the given source and target ports. + *

+ * While technically the source and target port can be null here, this will cause all kinds of issues, e.g. with {@link yfiles.styles.IEdgeStyle styles} or + * {@link yfiles.graph.ILabelModel label models} that require the ports to be non-null to work properly. + *

+ * @param {yfiles.graph.IPort} sourcePort The source port for the edge. + * @param {yfiles.graph.IPort} targetPort The target port for the edge. + * @constructor + */ + constructor(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort); + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @type {yfiles.styles.IEdgeStyle} + */ + style:yfiles.styles.IEdgeStyle; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + bends:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.graph.IPort} + */ + sourcePort:yfiles.graph.IPort; + /** + * + * @type {yfiles.graph.IPort} + */ + targetPort:yfiles.graph.IPort; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + /** + * Gets or sets the collection for the labels. + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + /** + * + * @type {Object} + */ + tag:Object; + /** + * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleEdge#lookup} on this instance. + * @type {yfiles.graph.ILookup} + */ + lookupImplementation:yfiles.graph.ILookup; + static $class:yfiles.lang.Class; + } + /** + * Central implementation of the {@link yfiles.graph.IGraph} interface. + *

+ * 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.graph.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.graph.UndoEngine} to do so. The current instance of {@link yfiles.graph.UndoEngine} + * can be queried using the {@link yfiles.graph.ILookup#lookup} method of this instance. Also there are several protected methods Create...UndoUnit + * 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 units they can create a subclass of {@link yfiles.graph.DefaultGraph} and override these + * methods. + *
+ * Finally this implementation supports grouped graphs. + *

+ *

+ * DefaultGraph is {@link yfiles.graph.IGraph}'s default implementation as described in the section {@link @DGUIDE_PREFIX@/graph_model-graph.html The Graph Model - IGraph}. + *

+ *

Related demos:

+ *
    + *
  • Demo: Simple Editor Demo, Demo.yFiles.Graph.SimpleEditor
  • + *
+ * @see yfiles.graph.DefaultGraph#createUndoEngine + * @see yfiles.graph.DefaultGraph#lookup + * @see yfiles.graph.DefaultGraph + * @see yfiles.graph.FoldingManager + * @class yfiles.graph.DefaultGraph + * @implements {yfiles.graph.IGraph} + */ + export interface DefaultGraph extends Object,yfiles.graph.IGraph{} + export class DefaultGraph { + /** + * Creates a new instance of a graph that provides an {@link yfiles.graph.ILookupDecorator} for all of its entities. + * @param {Object} [options=null] The parameters to pass. + * @param options.nodes An array of nodes to create in this graph. Each item will be passed to the {@link yfiles.graph.DefaultGraph#createNode} method. + * @param {yfiles.graph.IEdgeDefaults} [options.edgeDefaults=null] Sets the edgeDefaults property. + * @param {yfiles.graph.INodeDefaults} [options.groupNodeDefaults=null] Sets the groupNodeDefaults property. + * @param {yfiles.graph.IMapperRegistry} options.mapperRegistry The mapper registry that is associated with this graph instance. + *

+ * This option sets the {@link yfiles.graph.DefaultGraph#mapperRegistry} property on the created object. + *

+ * @param {yfiles.graph.INodeDefaults} [options.nodeDefaults=null] Sets the nodeDefaults property. + * @param {Object} [options.tag=null] Sets the tag property. + * @param {boolean} options.undoEngineEnabled Whether or not the {@link yfiles.graph.UndoEngine} used for this instance should be enabled. + *

+ * This option sets the {@link yfiles.graph.DefaultGraph#undoEngineEnabled} property on the created object. + *

+ * @constructor + */ + constructor(options?:{edgeDefaults?:yfiles.graph.IEdgeDefaults,groupNodeDefaults?:yfiles.graph.INodeDefaults,mapperRegistry?:yfiles.graph.IMapperRegistry,nodeDefaults?:yfiles.graph.INodeDefaults,tag?:Object,undoEngineEnabled?:boolean,nodes?:Array}); + /** + * + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.geometry.Point} location + * @param {number} [index=-1] + * @returns {yfiles.graph.IBend} + */ + addBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point,index?:number):yfiles.graph.IBend; + /** + * + * @param {yfiles.graph.ILabelOwner} owner + * @param {string} text + * @param {yfiles.graph.ILabelModelParameter} [layoutParameter=null] + * @param {yfiles.styles.ILabelStyle} [style=null] + * @param {yfiles.geometry.Size} [preferredSize=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.ILabel} + */ + addLabel(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object):yfiles.graph.ILabel; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.ILabelOwner} options.owner + * @param {string} options.text + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] + * @param {yfiles.styles.ILabelStyle} [options.style=null] + * @param {yfiles.geometry.Size} [options.preferredSize=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.ILabel} + */ + addLabel(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; + /** + * Adds the chain element to the lookup for this instance. + * @param {yfiles.graph.IContextLookupChainLink} lookup The lookup to decorate the current instance with. + */ + addLookup(lookup:yfiles.graph.IContextLookupChainLink):void; + /** + * Add a port to the given port owner using the coordinates as the new initial position of the port anchor. + * @param {yfiles.graph.IPortOwner} owner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} [locationParameter=null] the parameter to use for the port to determine its location. + * @param {yfiles.styles.IPortStyle} [style=null] the style to assign initially to the port, e.g. {@link yfiles.styles.VoidPortStyle#INSTANCE}. + * @param {Object} [tag=null] The tag to associate with the port, may be null. + * @returns {yfiles.graph.IPort} the newly created port + * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. + * @see yfiles.graph.DefaultGraph#addPortAddedListener + */ + addPort(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object):yfiles.graph.IPort; + /** + * Add a port to the given port owner using the coordinates as the new initial position of the port anchor. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPortOwner} options.owner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} [options.locationParameter=null] the parameter to use for the port to determine its location. + * @param {yfiles.styles.IPortStyle} [options.style=null] the style to assign initially to the port, e.g. {@link yfiles.styles.VoidPortStyle#INSTANCE}. + * @param {Object} [options.tag=null] The tag to associate with the port, may be null. + * @returns {yfiles.graph.IPort} the newly created port + * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. + * @see yfiles.graph.DefaultGraph#addPortAddedListener + */ + addPort(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.graph.IModelItem} item The item. + * @returns {boolean} true if this graph contains the specified item; otherwise, false. + */ + contains(item:yfiles.graph.IModelItem):boolean; + /** + * + * @param {yfiles.graph.IPort} sourcePort + * @param {yfiles.graph.IPort} targetPort + * @param {yfiles.styles.IEdgeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.IEdge} + */ + createEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object):yfiles.graph.IEdge; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPort} options.sourcePort + * @param {yfiles.graph.IPort} options.targetPort + * @param {yfiles.styles.IEdgeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.IEdge} + */ + createEdge(options:{sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.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. 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.styles.IEdgeStyle} [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.IEdge} the newly created edge instance + * @see yfiles.graph.DefaultGraph#addEdgeCreatedListener + * @see yfiles.graph.DefaultGraph#getNewSourcePort + * @see yfiles.graph.DefaultGraph#getNewTargetPort + * @see yfiles.graph.DefaultGraph#createEdge + */ + createEdge(source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.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 {Object} options The parameters to pass. + * @param {yfiles.graph.INode} options.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} options.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.styles.IEdgeStyle} [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [options.tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.IEdge} the newly created edge instance + * @see yfiles.graph.DefaultGraph#addEdgeCreatedListener + * @see yfiles.graph.DefaultGraph#getNewSourcePort + * @see yfiles.graph.DefaultGraph#getNewTargetPort + * @see yfiles.graph.DefaultGraph#createEdge + */ + createEdge(options:{source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; + /** + * + * @param {yfiles.graph.INode} [parent=null] + * @param {yfiles.geometry.Rect} [layout=null] + * @param {yfiles.styles.INodeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.INode} + */ + createGroupNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] + * @param {yfiles.geometry.Rect} [options.layout=null] + * @param {yfiles.styles.INodeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.INode} + */ + createGroupNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * + * @param {yfiles.geometry.Rect} layout + * @param {yfiles.styles.INodeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.Rect} options.layout + * @param {yfiles.styles.INodeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(options:{layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * + * @param {yfiles.graph.INode} [parent=null] + * @param {yfiles.geometry.Rect} [layout=null] + * @param {yfiles.styles.INodeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] + * @param {yfiles.geometry.Rect} [options.layout=null] + * @param {yfiles.styles.INodeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * Creates an {@link yfiles.graph.UndoEngine} instance that automatically triggers {@link yfiles.graph.DefaultGraph#invalidateDisplays} + * upon each invocation of {@link yfiles.graph.UndoEngine#undo} and {@link yfiles.graph.UndoEngine#redo} + * @returns {yfiles.graph.UndoEngine} An {@link yfiles.graph.UndoEngine} instance. + * @protected + */ + createUndoEngine():yfiles.graph.UndoEngine; + /** + * Creates the bend addition {@link yfiles.graph.IUndoUnit undo unit} for the given bend. + * @param {yfiles.graph.IBend} bend The bend that has been added. + * @param {number} index The index at which the bend has been added. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the creation. + * @protected + */ + createUndoUnitForBendAddition(bend:yfiles.graph.IBend,index:number):yfiles.graph.IUndoUnit; + /** + * Creates the bend removal {@link yfiles.graph.IUndoUnit undo unit} for the given bend. + * @param {yfiles.graph.IBend} bend The bend that will be removed. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the removal. + * @protected + */ + createUndoUnitForBendRemoval(bend:yfiles.graph.IBend):yfiles.graph.IUndoUnit; + /** + * Creates the edge creation {@link yfiles.graph.IUndoUnit undo unit} for the given edge. + * @param {yfiles.graph.IEdge} edge The edge that has been created. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the creation. + * @protected + */ + createUndoUnitForEdgeCreation(edge:yfiles.graph.IEdge):yfiles.graph.IUndoUnit; + /** + * Creates the edge reconnection {@link yfiles.graph.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. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the port change operation. + * @protected + */ + createUndoUnitForEdgeReconnection(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):yfiles.graph.IUndoUnit; + /** + * Creates the edge removal {@link yfiles.graph.IUndoUnit undo unit} for the given edge. + * @param {yfiles.graph.IEdge} edge The edge that will be removed. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the removal. + * @protected + */ + createUndoUnitForEdgeRemoval(edge:yfiles.graph.IEdge):yfiles.graph.IUndoUnit; + /** + * Creates the {@link yfiles.graph.IUndoUnit undo unit} for changing whether the given node is a group node. + * @param {yfiles.graph.INode} node The node whose group node status has been changed. + * @param {boolean} isGroupNode The new group node status. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the group node status change. + * @protected + */ + createUndoUnitForIsGroupNodeChange(node:yfiles.graph.INode,isGroupNode:boolean):yfiles.graph.IUndoUnit; + /** + * Creates the label addition {@link yfiles.graph.IUndoUnit undo unit} for the given label. + * @param {yfiles.graph.ILabel} label The label that has been added. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the creation. + * @protected + */ + createUndoUnitForLabelAddition(label:yfiles.graph.ILabel):yfiles.graph.IUndoUnit; + /** + * Creates the label removal {@link yfiles.graph.IUndoUnit undo unit} for the given label. + * @param {yfiles.graph.ILabel} label The label that will be removed. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the removal. + * @protected + */ + createUndoUnitForLabelRemoval(label:yfiles.graph.ILabel):yfiles.graph.IUndoUnit; + /** + * Creates the node creation {@link yfiles.graph.IUndoUnit undo unit} for the given node. + * @param {yfiles.graph.INode} node The node that has been created. + * @param {yfiles.graph.INode} parent + * @param {boolean} isGroupNode + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the creation. + * @protected + */ + createUndoUnitForNodeCreation(node:yfiles.graph.INode,parent:yfiles.graph.INode,isGroupNode:boolean):yfiles.graph.IUndoUnit; + /** + * Creates the node removal {@link yfiles.graph.IUndoUnit undo unit} for the given node. + * @param {yfiles.graph.INode} node The node that will be removed. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the removal. + * @protected + */ + createUndoUnitForNodeRemoval(node:yfiles.graph.INode):yfiles.graph.IUndoUnit; + /** + * Creates the parent change {@link yfiles.graph.IUndoUnit undo unit} for the given node. + * @param {yfiles.graph.INode} node The node whose parent has been changed. + * @param {yfiles.graph.INode} oldParent + * @param {yfiles.graph.INode} newParent The node which is the new parent. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the parent change. + * @protected + */ + createUndoUnitForParentChange(node:yfiles.graph.INode,oldParent:yfiles.graph.INode,newParent:yfiles.graph.INode):yfiles.graph.IUndoUnit; + /** + * Creates the port addition {@link yfiles.graph.IUndoUnit undo unit} for the given port. + * @param {yfiles.graph.IPort} port The port that has been added. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the creation. + * @protected + */ + createUndoUnitForPortAddition(port:yfiles.graph.IPort):yfiles.graph.IUndoUnit; + /** + * Creates the port removal {@link yfiles.graph.IUndoUnit undo unit} for the given port. + * @param {yfiles.graph.IPort} port The port that will be removed. + * @returns {yfiles.graph.IUndoUnit} The unit that can be used to undo and redo the removal. + * @protected + */ + createUndoUnitForPortRemoval(port:yfiles.graph.IPort):yfiles.graph.IUndoUnit; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @param {yfiles.graph.AdjacencyTypes} [type=3] + * @returns {yfiles.collections.IListEnumerable.} + */ + edgesAt(owner:yfiles.graph.IPortOwner,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.AdjacencyTypes} [type=3] + * @returns {yfiles.collections.IListEnumerable.} + */ + edgesAt(port:yfiles.graph.IPort,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.collections.IListEnumerable.} + */ + getChildren(node:yfiles.graph.INode):yfiles.collections.IListEnumerable; + /** + * Returns the lookup implementation that is used for {@link yfiles.graph.DefaultGraph#lookup} calls. + * @returns {yfiles.graph.ILookup} The replacing lookup instance or null if the internal lookup mechanism is used. + * @see yfiles.graph.DefaultGraph#setLookupImplementation + */ + getLookup():yfiles.graph.ILookup; + /** + * 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 {@link yfiles.graph.DefaultGraph#addPort add a new center anchored port} to the node. + *

+ * @param {yfiles.graph.IPortOwner} source The source node to find a port for. + * @returns {yfiles.graph.IPort} The port to use for a newly created edge. + * @see yfiles.graph.DefaultGraph#createEdge + * @protected + */ + getNewSourcePort(source:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * 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 {@link yfiles.graph.DefaultGraph#addPort add a new center anchored port} to the node. + *

+ * @param {yfiles.graph.IPortOwner} targetOwner The target node to find a port for. + * @returns {yfiles.graph.IPort} The port to use for a newly created edge. + * @see yfiles.graph.DefaultGraph#createEdge + * @protected + */ + getNewTargetPort(targetOwner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.graph.INode} + */ + getParent(node:yfiles.graph.INode):yfiles.graph.INode; + /** + * The last element in the lookup chain is implemented by this method. + * @param {yfiles.lang.Class} type + * @returns {Object} + * @protected + */ + innerLookup(type:yfiles.lang.Class):Object; + /** + * 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}. + *

+ */ + invalidateDisplays():void; + /** + * + * @param {yfiles.graph.INode} node + * @returns {boolean} + */ + isGroupNode(node:yfiles.graph.INode):boolean; + /** + * 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.graph.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 + * @returns {Object} An instance that is assignable to type or null + */ + lookup(type:yfiles.lang.Class):Object; + /** + * 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. + * @protected + */ + onAddingBend(edge:yfiles.graph.IEdge,bend:yfiles.graph.IBend,index:number):void; + /** + * Callback method that will be called just before an edge label is added to an edge. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.graph.ILabel} label + * @protected + */ + onAddingEdgeLabel(edge:yfiles.graph.IEdge,label:yfiles.graph.ILabel):void; + /** + * Callback method that will be called just before a node label is added to a node. + * @param {yfiles.graph.INode} node + * @param {yfiles.graph.ILabel} label + * @protected + */ + onAddingNodeLabel(node:yfiles.graph.INode,label:yfiles.graph.ILabel):void; + /** + * Called when a port is going to be added to a node. + * @param {yfiles.graph.IPortOwner} owner The node. + * @param {yfiles.graph.IPort} port The port to be added. + * @protected + */ + onAddingPort(owner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort):void; + /** + * Callback that after a bend has been added to this graph's structure. + *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.IBend} bend The bend that has been added to the edge. + * @protected + */ + onBendAdded(bend:yfiles.graph.IBend):void; + /** + * Callback that is invoked after a bend location has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addBendLocationChangedListener BendLocationChanged} event. + *

+ * @param {yfiles.graph.IBend} bend The bend whose location has changed. + * @param {yfiles.geometry.Point} oldLocation The bend location before the change + * @protected + */ + onBendLocationChanged(bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point):void; + /** + * Callback method that is invoked just after a bend has been removed from its edge. + *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @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. + * @protected + */ + onBendRemoved(owner:yfiles.graph.IEdge,bend:yfiles.graph.IBend,index:number):void; + /** + * Callback that is invoked after a bend tag has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addBendTagChangedListener BendTagChanged} event. + *

+ * @param {yfiles.graph.IBend} bend The bend whose tag has changed. + * @param {Object} oldTag The bend tag before the change + * @protected + */ + onBendTagChanged(bend:yfiles.graph.IBend,oldTag:Object):void; + /** + * Callback that is invoked before the ports of an edge are being changed. + * @param {yfiles.graph.IEdge} edge An edge whose the ports are to be changed. + * @param {yfiles.graph.IPort} newSource The new source port + * @param {yfiles.graph.IPort} newTarget The new target port + * @protected + */ + onChangingEdgePorts(edge:yfiles.graph.IEdge,newSource:yfiles.graph.IPort,newTarget:yfiles.graph.IPort):void; + /** + * Callback that is invoked before an edge style is being changed. + * @param {yfiles.graph.IEdge} edge An edge whose the style is going to be changed. + * @param {yfiles.styles.IEdgeStyle} newStyle The new edge style. + * @protected + */ + onChangingEdgeStyle(edge:yfiles.graph.IEdge,newStyle:yfiles.styles.IEdgeStyle):void; + /** + * Callback that is invoked before the graph's tag is being changed. + * @param {Object} newTag The new port tag + * @protected + */ + onChangingGraphTag(newTag:Object):void; + /** + * Callback that is invoked before the {@link yfiles.graph.ILabel#layoutParameter} of a label is being changed. + * @param {yfiles.graph.ILabel} label A label whose {@link yfiles.graph.ILabel#layoutParameter} is to be changed. + * @param {yfiles.graph.ILabelModelParameter} newLayoutParameter The new label model parameter + * @protected + */ + onChangingLabelLayoutParameter(label:yfiles.graph.ILabel,newLayoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * Callback that is invoked before the preferred size of a label is being changed. + * @param {yfiles.graph.ILabel} label A label whose preferred size is going to be changed. + * @param {yfiles.geometry.Size} newSize The new preferred size + * @protected + */ + onChangingLabelPreferredSize(label:yfiles.graph.ILabel,newSize:yfiles.geometry.Size):void; + /** + * Callback that is invoked before a label style is being changed. + * @param {yfiles.graph.ILabel} label A label whose the style is going to be changed. + * @param {yfiles.styles.ILabelStyle} newStyle The new label style. + * @protected + */ + onChangingLabelStyle(label:yfiles.graph.ILabel,newStyle:yfiles.styles.ILabelStyle):void; + /** + * Callback that is invoked before the text of a label is being changed. + * @param {yfiles.graph.ILabel} label A label whose text is going to be changed. + * @param {string} newText The new label text + * @protected + */ + onChangingLabelText(label:yfiles.graph.ILabel,newText:string):void; + /** + * Callback that is invoked before a node style is being changed. + * @param {yfiles.graph.INode} node A node whose the style is going to be changed. + * @param {yfiles.styles.INodeStyle} newStyle The new node style. + * @protected + */ + onChangingNodeStyle(node:yfiles.graph.INode,newStyle:yfiles.styles.INodeStyle):void; + /** + * Callback that is invoked before the {@link yfiles.graph.IPort#locationParameter} of a port is being changed. + * @param {yfiles.graph.IPort} port A port whose {@link yfiles.graph.IPort#locationParameter} is to be changed. + * @param {yfiles.graph.IPortLocationModelParameter} newLocationParameter The new location model parameter + * @protected + */ + onChangingPortLocationModelParameter(port:yfiles.graph.IPort,newLocationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Callback that is invoked before a port style is being changed. + * @param {yfiles.graph.IPort} port A port whose the style is going to be changed. + * @param {yfiles.styles.IPortStyle} newStyle The new port style. + * @protected + */ + onChangingPortStyle(port:yfiles.graph.IPort,newStyle:yfiles.styles.IPortStyle):void; + /** + * 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. + * @protected + */ + onCreatingEdge(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * 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. + * @protected + */ + onCreatingNode(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. + * @protected + */ + onEdgeCreated(edge:yfiles.graph.IEdge):void; + /** + * Called after a label has been added to an edge. + *

+ * This method triggers the {@link yfiles.graph.DefaultGraph#addLabelAddedListener LabelAdded} event. + *

+ *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.ILabel} label The label that has just been added. + * @protected + */ + onEdgeLabelAdded(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been removed from its edge. + *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.ILabel} label The label that has just been removed. + * @param {yfiles.graph.ILabelOwner} owner The previous owner of the label. + * @protected + */ + onEdgeLabelRemoved(owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel):void; + /** + * Callback that is invoked after the ports of an edge has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgePortsChangedListener EdgePortsChanged} event. + *

+ * @param {yfiles.graph.IEdge} edge The edge whose ports have 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. + * @protected + */ + onEdgePortsChanged(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):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. + * @protected + */ + onEdgeRemoved(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):void; + /** + * Callback that is invoked after the style of an edge has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgeStyleChangedListener EdgeStyleChanged} event. + *

+ * @param {yfiles.graph.IEdge} edge The edge whose style that has changed. + * @param {yfiles.styles.IEdgeStyle} oldStyle The edge style before the change + * @protected + */ + onEdgeStyleChanged(edge:yfiles.graph.IEdge,oldStyle:yfiles.styles.IEdgeStyle):void; + /** + * Callback that is invoked after the tag of an edge has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgeTagChangedListener EdgeTagChanged} event. + *

+ * @param {yfiles.graph.IEdge} edge The edge whose tag has changed. + * @param {Object} oldTag The edge tag before the change. + * @protected + */ + onEdgeTagChanged(edge:yfiles.graph.IEdge,oldTag:Object):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addGraphTagChangedListener GraphTagChanged} event. + * @param {Object} oldTag The graph tag before the change. + * @protected + */ + onGraphTagChanged(oldTag:Object):void; + /** + * Triggers the {@link yfiles.graph.DefaultGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. + * @param {yfiles.lang.EventArgs} evt The event arguments. + * @protected + */ + onInvalidateDisplays(evt:yfiles.lang.EventArgs):void; + /** + * Callback that is invoked after a label model parameter has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelLayoutParameterChangedListener LabelLayoutParameterChanged} event. + *

+ * @param {yfiles.graph.ILabel} label The label whose model parameter has changed. + * @param {yfiles.graph.ILabelModelParameter} oldLayoutParamater The label model parameter before the change + * @protected + */ + onLabelLayoutParameterChanged(label:yfiles.graph.ILabel,oldLayoutParamater:yfiles.graph.ILabelModelParameter):void; + /** + * Callback that is invoked after the preferred size of a label has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelPreferredSizeChangedListener LabelPreferredSizeChanged} event. + *

+ * @param {yfiles.graph.ILabel} label The label whose preferred size has changed. + * @param {yfiles.geometry.Size} oldSize The preferred size of the label before the change + */ + onLabelPreferredSizeChanged(label:yfiles.graph.ILabel,oldSize:yfiles.geometry.Size):void; + /** + * Callback that is invoked after a label style has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelStyleChangedListener LabelStyleChanged} event. + *

+ * @param {yfiles.graph.ILabel} label The label whose style has changed. + * @param {yfiles.styles.ILabelStyle} oldStyle The label style before the change. + * @protected + */ + onLabelStyleChanged(label:yfiles.graph.ILabel,oldStyle:yfiles.styles.ILabelStyle):void; + /** + * Callback that is invoked after a label tag has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelTagChangedListener LabelTagChanged} event. + *

+ * @param {yfiles.graph.ILabel} label The label whose tag has changed. + * @param {Object} oldTag The label tag before the change + */ + onLabelTagChanged(label:yfiles.graph.ILabel,oldTag:Object):void; + /** + * Callback that is invoked after a label text has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelTextChangedListener LabelTextChanged} event. + *

+ * @param {yfiles.graph.ILabel} label The label whose text has changed. + * @param {string} oldText The label text before the change. + */ + onLabelTextChanged(label:yfiles.graph.ILabel,oldText:string):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addNodeCreatedListener NodeCreated} event. + * @param {yfiles.graph.INode} node The node that has been created. + * @protected + */ + onNodeCreated(node:yfiles.graph.INode):void; + /** + * Called after a label has been added to a node. + *

+ * This method triggers the {@link yfiles.graph.DefaultGraph#addLabelAddedListener LabelAdded} event. + *

+ *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.ILabel} label The label that has just been added. + * @protected + */ + onNodeLabelAdded(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been removed from its node. + *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.ILabel} label The label that has just been removed. + * @param {yfiles.graph.ILabelOwner} owner The old owner of the label. + * @protected + */ + onNodeLabelRemoved(owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel):void; + /** + * Callback that is invoked after a node layout has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeLayoutChangedListener NodeLayoutChanged} event. + *

+ * @param {yfiles.graph.INode} node The node whose layout has changed. + * @param {yfiles.geometry.Rect} oldLayout The node layout before the change + * @protected + */ + onNodeLayoutChanged(node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addNodeRemovedListener NodeRemoved} event. + * @param {yfiles.graph.INode} node The node that got removed + * @param {yfiles.graph.INode} oldParent + * @param {boolean} oldIsGroupNode + * @protected + */ + onNodeRemoved(node:yfiles.graph.INode,oldParent:yfiles.graph.INode,oldIsGroupNode:boolean):void; + /** + * Callback that is invoked after a node style has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeStyleChangedListener NodeStyleChanged} event. + *

+ * @param {yfiles.graph.INode} node The node whose style has changed. + * @param {yfiles.styles.INodeStyle} oldStyle The node style before the change + * @protected + */ + onNodeStyleChanged(node:yfiles.graph.INode,oldStyle:yfiles.styles.INodeStyle):void; + /** + * Callback that is invoked after a node tag has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeTagChangedListener NodeTagChanged} event. + *

+ * @param {yfiles.graph.INode} node The node whose tag has changed. + * @param {Object} oldTag The node tag before the change + * @protected + */ + onNodeTagChanged(node:yfiles.graph.INode,oldTag:Object):void; + /** + * Called when a port has been added to a node. + *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.IPort} port The port that has just been added to its owner. + * @protected + */ + onPortAdded(port:yfiles.graph.IPort):void; + /** + * Callback that is invoked after a port location model parameter has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addPortLocationParameterChangedListener PortLocationParameterChanged} + * event. + *

+ * @param {yfiles.graph.IPort} port The port whose location model parameter has changed. + * @param {yfiles.graph.IPortLocationModelParameter} oldLocationParameter The port location model parameter before the change + */ + onPortLocationParameterChanged(port:yfiles.graph.IPort,oldLocationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Callback method that is called just after a port has been removed from its owner. + *

+ * When overriding this method it is mandatory to call the base implementation. + *

+ * @param {yfiles.graph.IPort} port The port that has been removed. + * @param {yfiles.graph.IPortOwner} oldOwner The previous owner of the port. + * @protected + */ + onPortRemoved(oldOwner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort):void; + /** + * Callback that is invoked after a port style has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addPortStyleChangedListener PortStyleChanged} event. + *

+ * @param {yfiles.graph.IPort} port The port whose style has changed. + * @param {yfiles.styles.IPortStyle} oldStyle The port style before the change + * @protected + */ + onPortStyleChanged(port:yfiles.graph.IPort,oldStyle:yfiles.styles.IPortStyle):void; + /** + * Callback that is invoked after a port tag has changed. + *

+ * This will trigger the {@link yfiles.graph.DefaultGraph#addPortTagChangedListener PortTagChanged} event. + *

+ * @param {yfiles.graph.IPort} port The port whose tag has changed. + * @param {Object} oldTag The port tag before the change + * @protected + */ + onPortTagChanged(port:yfiles.graph.IPort,oldTag:Object):void; + /** + * Callback method that is invoked just before a bend is removed. + * @param {yfiles.graph.IBend} bend The bend that will be removed. + * @protected + */ + onRemovingBend(bend:yfiles.graph.IBend):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. + * @protected + */ + onRemovingEdge(edge:yfiles.graph.IEdge):void; + /** + * Callback method that will be called just before an edge label is removed from its edge. + * @param {yfiles.graph.ILabel} label + * @protected + */ + onRemovingEdgeLabel(label:yfiles.graph.ILabel):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. + * @protected + */ + onRemovingNode(node:yfiles.graph.INode):void; + /** + * Callback method that will be called just before a node label is removed from its node. + * @param {yfiles.graph.ILabel} label + * @protected + */ + onRemovingNodeLabel(label:yfiles.graph.ILabel):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. + * @protected + */ + onRemovingPort(port:yfiles.graph.IPort):void; + /** + * + * @param {yfiles.graph.IModelItem} item + */ + remove(item:yfiles.graph.IModelItem):void; + /** + * Removes a previously added lookup chain element from the lookup of this. + * @param {yfiles.graph.IContextLookupChainLink} lookup The element to remove. + */ + removeLookup(lookup:yfiles.graph.IContextLookupChainLink):void; + /** + * Modifies the location of the given bend. + *

+ * This implementation 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.Point} location the new coordinates of the bend + * @see yfiles.graph.DefaultGraph#addBend + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.Point):void; + /** + * Sets the ports of the given edge to the new values. + *

+ * This will trigger an {@link yfiles.graph.DefaultGraph#addEdgePortsChangedListener EdgePortsChanged} 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. + */ + setEdgePorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * + * @param {yfiles.graph.INode} node + * @param {boolean} isGroupNode + */ + setIsGroupNode(node:yfiles.graph.INode,isGroupNode:boolean):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + */ + setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.geometry.Size} size + */ + setLabelPreferredSize(label:yfiles.graph.ILabel,size:yfiles.geometry.Size):void; + /** + * Sets the label text of the given label. + *

+ * This implementation will {@link yfiles.graph.IGraph#adjustLabelPreferredSize 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 yfiles.graph.ILabel#text + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * 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.graph.ILookup} lookup The lookup instance to delegate lookup calls to. + * @see yfiles.graph.DefaultGraph#addLookup + * @see yfiles.graph.DefaultGraph#getLookup + * @protected + */ + setLookupImplementation(lookup:yfiles.graph.ILookup):void; + /** + * Sets the layout of the given node to the new values. + *

+ * 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.Rect} layout the new absolute layout in world coordinates of the node + * @see yfiles.graph.INode#layout + */ + setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.graph.INode} parent + */ + setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + */ + setPortLocationParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + */ + setStyle(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):void; + /** + * + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + */ + setStyle(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + */ + setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):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.styles.INodeStyle} style The style instance that will be assigned to the node. + * @see yfiles.graph.INode#style + * @see yfiles.graph.DefaultGraph#onChangingNodeStyle + * @see yfiles.graph.DefaultGraph#addNodeStyleChangedListener + */ + setStyle(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):void; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.INode}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the node lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultNodeLookup:yfiles.graph.IContextLookup; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.IEdge}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the edge lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultEdgeLookup:yfiles.graph.IContextLookup; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.ILabel}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the label lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultLabelLookup:yfiles.graph.IContextLookup; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.IPort}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the port lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultPortLookup:yfiles.graph.IContextLookup; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.IBend}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the bend lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultBendLookup:yfiles.graph.IContextLookup; + /** + * 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. This field is populated upon first + * access. Also this property provides write access. + *

+ * @see yfiles.graph.IMapperRegistry + * @see yfiles.graph.IModelItem + * @see yfiles.graph.ITagOwner#tag + * @type {yfiles.graph.IMapperRegistry} + */ + mapperRegistry:yfiles.graph.IMapperRegistry; + /** + * Gets or sets whether or not the {@link yfiles.graph.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.graph.UndoEngine} type. Disabling this property clears and removes the current {@link yfiles.graph.UndoEngine} (and + * all enqueued IUndoUnits). + *

+ * @default false + * @type {boolean} + */ + undoEngineEnabled:boolean; + /** + * + * @type {yfiles.graph.IEdgeDefaults} + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * + * @type {yfiles.graph.INodeDefaults} + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + nodes:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + edges:yfiles.collections.IListEnumerable; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addGraphTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeGraphTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + addNodeRemovedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + removeNodeRemovedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addNodeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeNodeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.INode, yfiles.geometry.Rect): void} listener + */ + addNodeLayoutChangedListener(listener:(source:Object,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.INode, yfiles.geometry.Rect): void} listener + */ + removeNodeLayoutChangedListener(listener:(source:Object,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addNodeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeNodeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addEdgeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeEdgeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + addEdgeRemovedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + removeEdgeRemovedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addEdgeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeEdgeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + addEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + removeEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addEdgeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeEdgeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addBendAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeBendAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.BendEventArgs): void} listener + */ + addBendRemovedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.BendEventArgs): void} listener + */ + removeBendRemovedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.IBend, yfiles.geometry.Point): void} listener + */ + addBendLocationChangedListener(listener:(source:Object,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.IBend, yfiles.geometry.Point): void} listener + */ + removeBendLocationChangedListener(listener:(source:Object,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addBendTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeBendTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener + */ + addLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener + */ + removeLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelPreferredSizeChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelPreferredSizeChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelLayoutParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelLayoutParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addPortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removePortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.PortEventArgs): void} listener + */ + addPortRemovedListener(listener:(sender:Object,evt:yfiles.graph.PortEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.PortEventArgs): void} listener + */ + removePortRemovedListener(listener:(sender:Object,evt:yfiles.graph.PortEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addPortStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removePortStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addPortLocationParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removePortLocationParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addPortTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removePortTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.lang.EventArgs): void} listener + */ + addDisplaysInvalidatedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.lang.EventArgs): void} listener + */ + removeDisplaysInvalidatedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * + * @type {yfiles.graph.INodeDefaults} + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + addParentChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + removeParentChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + addIsGroupNodeChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + removeIsGroupNodeChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @type {Object} + */ + tag:Object; + static $class:yfiles.lang.Class; + } + /** + * 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 them to {@link yfiles.graph.SimpleLabel} will 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 create a + * {@link yfiles.graph.SimpleLabel}, associate a style with it and use the style's renderer instance to obtain a rendering for the + * label. + *

+ * @class yfiles.graph.SimpleLabel + * @implements {yfiles.graph.ILabel} + */ + export interface SimpleLabel extends Object,yfiles.graph.ILabel{} + export class SimpleLabel { + /** + * Creates an instance of the {@link yfiles.graph.SimpleLabel} class with default {@link yfiles.graph.DefaultGraph#defaultLabelLookup lookup}, an instance of {@link yfiles.styles.VoidLabelStyle} + * and the given {@link yfiles.graph.ILabelModelParameter parameter}, text, and owner. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter that describes the label's layout. + * @param {string} text The label's text. + * @param {yfiles.graph.ILabelOwner} owner The label's owner. + * @constructor + */ + constructor(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter:yfiles.graph.ILabelModelParameter); + /** + * Gets the {@link yfiles.styles.ILabelStyleRenderer#getPreferredSize} from the labels style and sets the {@link yfiles.graph.SimpleLabel#preferredSize} to that value. + */ + adoptPreferredSizeFromStyle():void; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @type {yfiles.graph.ILabelModelParameter} + */ + layoutParameter:yfiles.graph.ILabelModelParameter; + /** + * + * @type {string} + */ + text:string; + /** + * + * @type {yfiles.styles.ILabelStyle} + */ + style:yfiles.styles.ILabelStyle; + /** + * + * @type {yfiles.graph.ILabelOwner} + */ + owner:yfiles.graph.ILabelOwner; + /** + * + * @type {yfiles.geometry.Size} + */ + preferredSize:yfiles.geometry.Size; + /** + * + * @type {Object} + */ + tag:Object; + /** + * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleLabel#lookup} on this + * instance. + * @type {yfiles.graph.ILookup} + */ + lookupImplementation:yfiles.graph.ILookup; + static $class:yfiles.lang.Class; + } + /** + * 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 them to {@link yfiles.graph.SimpleNode} will 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 create a + * {@link yfiles.graph.SimpleNode}, associate a style with it and use the style's renderer instance to obtain a rendering for the + * node. + *

+ * @class yfiles.graph.SimpleNode + * @implements {yfiles.graph.INode} + */ + export interface SimpleNode extends Object,yfiles.graph.INode{} + export class SimpleNode { + /** + * Creates a default node with default {@link yfiles.graph.DefaultGraph#defaultNodeLookup lookup}, an instance of {@link yfiles.styles.VoidNodeStyle}, empty {@link yfiles.graph.SimpleNode#layout} and no labels or ports. + *

+ * The instances assigned to {@link yfiles.graph.SimpleNode#layout}, {@link yfiles.graph.SimpleNode#ports} and {@link yfiles.graph.SimpleNode#labels} are immutable by default. To modify the values of those properties, first assign an + * instance of a mutable class. + *

+ * @constructor + */ + constructor(); + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * + * @type {yfiles.styles.INodeStyle} + */ + style:yfiles.styles.INodeStyle; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + /** + * Gets or sets the collection for the labels. + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + /** + * + * @type {Object} + */ + tag:Object; + /** + * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimpleNode#lookup} on this instance. + * @type {yfiles.graph.ILookup} + */ + lookupImplementation:yfiles.graph.ILookup; + static $class:yfiles.lang.Class; + } + /** + * 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 them to {@link yfiles.graph.SimplePort} will 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 create a + * {@link yfiles.graph.SimplePort}, associate a style with it and use the style's renderer instance to obtain a rendering for the + * port. + *

+ * @class yfiles.graph.SimplePort + * @implements {yfiles.graph.IPort} + */ + export interface SimplePort extends Object,yfiles.graph.IPort{} + export class SimplePort { + /** + * Creates a port with a {@link yfiles.graph.DefaultGraph#defaultPortLookup default lookup} using the given location and owner. + *

+ * While technically the owner can be null here, this can cause issues, e.g. with {@link yfiles.graph.IPortLocationModel port location models} that position the + * port relative to its owner. + *

+ * @param {yfiles.graph.IPortOwner} owner The port's owner. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The port's location model parameter. + * @constructor + */ + constructor(owner:yfiles.graph.IPortOwner,locationParameter:yfiles.graph.IPortLocationModelParameter); + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Sets the location of this port. + * @param {yfiles.geometry.Point} location + */ + setLocation(location:yfiles.geometry.Point):void; + /** + * + * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * + * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * + * @type {yfiles.graph.IPortOwner} + */ + owner:yfiles.graph.IPortOwner; + /** + * + * @type {Object} + */ + tag:Object; + /** + * Gets or sets the {@link yfiles.graph.ILookup} implementation used for calls to {@link yfiles.graph.SimplePort#lookup} on this instance. + * @type {yfiles.graph.ILookup} + */ + lookupImplementation:yfiles.graph.ILookup; + static $class:yfiles.lang.Class; + } + /** + * A label model that wraps an existing label model and decorates it with a {@link yfiles.graph.ILabelCandidateDescriptor descriptor}. + * @class yfiles.graph.DescriptorWrapperLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelCandidateDescriptorProvider} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface DescriptorWrapperLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelCandidateDescriptorProvider,yfiles.graph.ILabelModelParameterProvider{} + export class DescriptorWrapperLabelModel { + /** + * Initializes a new instance of the {@link yfiles.graph.DescriptorWrapperLabelModel} class. + * @param {yfiles.graph.ILabelModel} innerModel The wrapped label model. + * @constructor + */ + constructor(innerModel:yfiles.graph.ILabelModel); + /** + * Initializes a new instance of the {@link yfiles.graph.DescriptorWrapperLabelModel} class. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.ILabelModel} options.innerModel The wrapped label model. + * @param {yfiles.graph.ILabelCandidateDescriptor} options.descriptor The descriptor. + *

+ * This option sets the {@link yfiles.graph.DescriptorWrapperLabelModel#descriptor} property on the created object. + *

+ * @constructor + */ + constructor(options:{innerModel:yfiles.graph.ILabelModel,descriptor?:yfiles.graph.ILabelCandidateDescriptor}); + /** + * Creates a new instance that uses {@link yfiles.graph.FreeLabelModel#INSTANCE} as inner model. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.graph.ILabelCandidateDescriptor} options.descriptor The descriptor. + *

+ * This option sets the {@link yfiles.graph.DescriptorWrapperLabelModel#descriptor} property on the created object. + *

+ * @param {yfiles.graph.ILabelModel} options.innerModel The inner label model + *

+ * This option sets the {@link yfiles.graph.DescriptorWrapperLabelModel#innerModel} property on the created object. + *

+ * @constructor + */ + constructor(options?:{descriptor?:yfiles.graph.ILabelCandidateDescriptor,innerModel?:yfiles.graph.ILabelModel}); + /** + * Creates a default parameter that can be used for this model. + * @returns {yfiles.graph.ILabelModelParameter} The default parameter from {@link yfiles.graph.DescriptorWrapperLabelModel#innerModel} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILabelCandidateDescriptor} + */ + getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets the descriptor. + * @type {yfiles.graph.ILabelCandidateDescriptor} + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + /** + * Gets or sets the inner label model + * @type {yfiles.graph.ILabelModel} + */ + innerModel:yfiles.graph.ILabelModel; + static $class:yfiles.lang.Class; + } + /** + * A data holder that can be used to describe a {@link yfiles.graph.IFoldingView#isInFoldingState folding} edge that connects to nodes inside a collapsed group or to other + * folder nodes in a {@link yfiles.graph.IFoldingView}. + *

+ * 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.IFoldingView}s. A folding edge is identified through the master edge, which is an + * edge in the {@link yfiles.graph.FoldingManager#masterGraph} and a source and target node. Also whether those source and target nodes are currently {@link yfiles.graph.IFoldingView#isInFoldingState folder} 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.IGraph#getParent ancestor} group nodes in the {@link yfiles.graph.FoldingManager#masterGraph}. In the latter case these folding edges are used to describe the state of + * the folding edges that are present in the views of the corresponding group nodes are in {@link yfiles.graph.IFoldingView#collapse collapsed} state, so that the + * true source and target nodes are not currently visible in the view. As such the {@link yfiles.graph.FoldingEdgeStateId#currentMasterSource} and {@link yfiles.graph.FoldingEdgeStateId#currentMasterTarget} nodes represent the {@link yfiles.graph.IFoldingView#getMasterItem masters} of the + * nearest ancestors in the {@link yfiles.graph.FoldingManager#masterGraph} that are visible in the {@link yfiles.graph.IFoldingView folding view} graph. + *

+ * @see yfiles.graph.FoldingManager#hasFoldingEdgeState + * @see yfiles.graph.FoldingManager#getFoldingEdgeState + * @see yfiles.graph.IFoldingView#isInFoldingState + * @class yfiles.graph.FoldingEdgeStateId + */ + export interface FoldingEdgeStateId extends Object{} + export class FoldingEdgeStateId { + /** + * Initializes an id for a folding edge in a {@link yfiles.graph.IFoldingView 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 folding edge. + * @param {yfiles.graph.INode} currentMasterSource The source node of the edge or one of its ancestors to which the folding edge connects in the view, if the actual parent + * is currently {@link yfiles.graph.IFoldingView#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.IFoldingView#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.IFoldingView#collapse collapsed/dummy} state. + * @param {yfiles.graph.INode} currentMasterTarget The target node of the edge or one of its ancestors to which the folding edge connects in the view, if the actual parent + * is currently {@link yfiles.graph.IFoldingView#collapse collapsed in an ancestor node}. + * @constructor + */ + constructor(masterEdge:yfiles.graph.IEdge,currentMasterSource:yfiles.graph.INode,sourceCollapsed:boolean,currentMasterTarget:yfiles.graph.INode,targetCollapsed:boolean); + /** + * Initializes an id for a folding edge that is currently part of the given view. + * @param {yfiles.graph.IFoldingView} foldingView The view the folding edge is part of. + * @param {yfiles.graph.IEdge} foldingEdge The instance that is part of the {@link yfiles.graph.IFoldingView#graph folding view graph}. + * @constructor + */ + constructor(foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge); + /** + * The edge instance in the {@link yfiles.graph.FoldingManager#masterGraph} that is represented by the folding edge in a view. + * @type {yfiles.graph.IEdge} + */ + masterEdge:yfiles.graph.IEdge; + /** + * The source node of the edge or an ancestor (both in the {@link yfiles.graph.FoldingManager#masterGraph}). + *

+ * This may be an ancestor of the true source node if this ancestor is {@link yfiles.graph.IFoldingView#collapse collapsed}. More specific it is the source node of + * the {@link yfiles.graph.FoldingEdgeStateId#masterEdge} if the source node is represented in the view and otherwise the first ancestor of the source node which is + * represented in the view. + *

+ * @type {yfiles.graph.INode} + */ + currentMasterSource:yfiles.graph.INode; + /** + * The target node of the edge or an ancestor (both in the {@link yfiles.graph.FoldingManager#masterGraph}). + *

+ * This may be an ancestor of the true target node if this ancestor is {@link yfiles.graph.IFoldingView#collapse collapsed}. More precisely it is the target node of + * the {@link yfiles.graph.FoldingEdgeStateId#masterEdge} if the target node is represented in the view and otherwise the first ancestor of the target node which is + * represented in the view. + *

+ * @type {yfiles.graph.INode} + */ + currentMasterTarget:yfiles.graph.INode; + /** + * Specifies whether the {@link yfiles.graph.FoldingEdgeStateId#currentMasterSource} node {@link yfiles.graph.IFoldingView#isInFoldingState is in folder state}. + *

+ * Since an edge will be converted to a folding edge if the adjacent node itself will be {@link yfiles.graph.IFoldingView#collapse collapsed} to a folder node, this + * property determines which state the source node is in for this folding edge. + *

+ * @type {boolean} + */ + sourceIsCollapsed:boolean; + /** + * Specifies whether the {@link yfiles.graph.FoldingEdgeStateId#currentMasterTarget} node {@link yfiles.graph.IFoldingView#isInFoldingState is in folder state}. + *

+ * Since an edge will be converted to a folding edge if the adjacent node itself will be {@link yfiles.graph.IFoldingView#collapse collapsed} to a folder node, this + * property determines which state the source node is in for this folding edge. + *

+ * @type {boolean} + */ + targetIsCollapsed:boolean; + static $class:yfiles.lang.Class; + } + /** + * An edge label model that allows placement of labels along the edge path at a set of continuous positions at specified + * {@link yfiles.graph.EdgePathLabelModel#sideOfEdge sides of the edge path}. + *

+ * The set of positions can be influenced by specifying the {@link yfiles.graph.EdgePathLabelModel#sideOfEdge} value that controls on which side of the edge labels positions + * should be considered. Furthermore, it's possible to specify distance values that control the distance between label and + * edge and between label and nodes. + *

+ *

+ * If a label model parameter is created {@link yfiles.graph.EdgeSides#ON_EDGE}, the label's center is usually placed on the edge. + * It can be shifted by specifying a {@link yfiles.graph.EdgePathLabelModel#offset} value but the {@link yfiles.graph.EdgePathLabelModel#distance} value is ignored. For all other values of {@link yfiles.graph.EdgeSides} the + * total distance between the label bounds and the edge path is the sum of {@link yfiles.graph.EdgePathLabelModel#offset} and {@link yfiles.graph.EdgePathLabelModel#distance}. + *

+ *

+ * The label placements use a {@link yfiles.graph.EdgePathLabelModel#createRatioParameter ratio} value as fraction of the full edge path length. This is the main difference to the {@link yfiles.graph.EdgePathLabelModel} + * which uses a specified segment index from the {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromSource source} or {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromTarget target} side and a ratio on this segment. + *

+ * @class yfiles.graph.EdgePathLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + * @implements {yfiles.graph.ILabelModelParameterFinder} + */ + export interface EdgePathLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{} + export class EdgePathLabelModel { + /** + * Initializes a new instance of the {@link yfiles.graph.EdgePathLabelModel} class. + * @param {number} distance the distance to the edge. + * @param {number} offset the offset to the default placement. + * @param {number} angle the angle of the label's rotation in radians. + * @param {boolean} autoRotationEnabled if set to true auto rotation is enabled. + * @param {yfiles.graph.EdgeSides} sideOfEdge the side of the edge labels. + * @constructor + */ + constructor(distance:number,offset:number,angle:number,autoRotationEnabled:boolean,sideOfEdge:yfiles.graph.EdgeSides); + /** + * Returns a new instance of {@link yfiles.graph.EdgePathLabelModel} class. + * @param {Object} [options=null] The parameters to pass. + * @param {number} options.angle The rotation angle of all labels with this model in radians. + *

+ * This option sets the {@link yfiles.graph.EdgePathLabelModel#angle} property on the created object. + *

+ * @param {boolean} options.autoRotationEnabled Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment. + *

+ * This option sets the {@link yfiles.graph.EdgePathLabelModel#autoRotationEnabled} property on the created object. + *

+ * @param {number} options.distance The distance between the label box and the edge path. + *

+ * This option sets the {@link yfiles.graph.EdgePathLabelModel#distance} property on the created object. + *

+ * @param {number} options.offset Pr sets the offset of the label box and the edge path relative to the default placement. + *

+ * This option sets the {@link yfiles.graph.EdgePathLabelModel#offset} property on the created object. + *

+ * @param {yfiles.graph.EdgeSides} options.sideOfEdge The side placement specifiers for edge labels. + *

+ * This option sets the {@link yfiles.graph.EdgePathLabelModel#sideOfEdge} property on the created object. + *

+ * @constructor + */ + constructor(options?:{angle?:number,autoRotationEnabled?:boolean,distance?:number,offset?:number,sideOfEdge?:yfiles.graph.EdgeSides}); + /** + * 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. + *

+ * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter at the provided edge path ratio. + * @param {number} edgePathRatio The ratio at which to place the label at the edge path. A ratio of 0.0 will place the label at the source side of the + * edge path, a ratio of 1.0 at the target side. + * @param {yfiles.graph.EdgeSides} sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. + * @returns {yfiles.graph.ILabelModelParameter} A label parameter at the provided edge path ratio for this model instance. + */ + createRatioParameter(edgePathRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; + /** + * Returns an empty context. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to use for the label in the context. + * @returns {yfiles.graph.ILookup} An empty context. + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets the side placement specifiers for edge labels. + *

+ * The label model parameter {@link yfiles.graph.ILabelModelParameterFinder finder} and {@link yfiles.graph.ILabelModelParameterProvider provider} returned by {@link yfiles.graph.EdgePathLabelModel#lookup} consider the specified + * sides. + *

+ * @see yfiles.graph.EdgeSides + * @default 'OnEdge, LeftOfEdge, RightOfEdge' + * @type {yfiles.graph.EdgeSides} + */ + sideOfEdge:yfiles.graph.EdgeSides; + /** + * Gets or sets the distance between the label box and the edge path. + *

+ * The interpretation of the values depends on the {@link yfiles.graph.EdgePathLabelModel#sideOfEdge} of the individual {@link yfiles.graph.ILabelModelParameter}. + *

+ *

+ * Note that for {@link yfiles.graph.EdgeSides#ON_EDGE} this property is ignored. For all other values of {@link yfiles.graph.EdgeSides} + * the {@link yfiles.graph.EdgePathLabelModel#offset} property is added to this distance. + *

+ * @see yfiles.graph.EdgePathLabelModel#sideOfEdge + * @see yfiles.graph.EdgeSides + * @see yfiles.graph.EdgePathLabelModel#offset + * @default 0.0 + * @type {number} + */ + distance:number; + /** + * Gets pr sets the offset of the label box and the edge path relative to the default placement. + *

+ * For {@link yfiles.graph.EdgeSides#ON_EDGE} this is the offset between the center of the label box and the edge path. For all + * other {@link yfiles.graph.EdgeSides} values this offset is added to the {@link yfiles.graph.EdgePathLabelModel#distance} property which results in the total distance between + * the label box and the edge path. + *

+ * @see yfiles.graph.EdgePathLabelModel#sideOfEdge + * @see yfiles.graph.EdgeSides + * @default 0.0 + * @type {number} + */ + offset:number; + /** + * Gets or sets whether edge labels are automatically rotated according to the angle of the corresponding reference edge + * segment. + *

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

+ * @default true + * @type {boolean} + */ + autoRotationEnabled:boolean; + /** + * Gets or sets the rotation angle of all labels with this model in radians. + * @default 0.0 + * @type {number} + */ + angle:number; + static $class:yfiles.lang.Class; + } + /** + * An edge label model that allows placement of labels relative to an edge segment at a set of continuous positions at + * specified {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge sides of the edge path}. + *

+ * The set of positions can be influenced by specifying the {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge} value that controls on which side of the edge labels positions + * should be considered. Furthermore, it's possible to specify distance values that control the distance between label and + * edge and between label and nodes. + *

+ *

+ * If a label model parameter is created {@link yfiles.graph.EdgeSides#ON_EDGE}, the label's center is usually placed on the edge. + * It can be shifted by specifying a {@link yfiles.graph.EdgeSegmentLabelModel#offset} value but the {@link yfiles.graph.EdgeSegmentLabelModel#distance} value is ignored. For all other values of {@link yfiles.graph.EdgeSides} the + * total distance between the label bounds and the edge path is the sum of {@link yfiles.graph.EdgeSegmentLabelModel#offset} and {@link yfiles.graph.EdgeSegmentLabelModel#distance}. + *

+ *

+ * The label placements use a specified segment index from the {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromSource source} or {@link yfiles.graph.EdgeSegmentLabelModel#createParameterFromTarget target} side and a ratio on this segment. This is + * the main difference to the {@link yfiles.graph.EdgePathLabelModel} which only uses a ratio value of the full edge path. + *

+ * @class yfiles.graph.EdgeSegmentLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + * @implements {yfiles.graph.ILabelModelParameterFinder} + */ + export interface EdgeSegmentLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{} + export class EdgeSegmentLabelModel { + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeSegmentLabelModel} class. + * @param {number} distance the distance to the edge. + * @param {number} offset the offset to the default placement. + * @param {number} angle the angle of the label's rotation in radians. + * @param {boolean} autoRotationEnabled if set to true auto rotation is enabled. + * @param {yfiles.graph.EdgeSides} sideOfEdge the side of the edge labels. + * @constructor + */ + constructor(distance:number,offset:number,angle:number,autoRotationEnabled:boolean,sideOfEdge:yfiles.graph.EdgeSides); + /** + * Returns a new instance of {@link yfiles.graph.EdgeSegmentLabelModel}. + * @param {Object} [options=null] The parameters to pass. + * @param {number} options.angle The rotation angle of all labels with this model in radians. + *

+ * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#angle} property on the created object. + *

+ * @param {boolean} options.autoRotationEnabled Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment. + *

+ * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#autoRotationEnabled} property on the created object. + *

+ * @param {number} options.distance The distance between the label box and the edge path. + *

+ * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#distance} property on the created object. + *

+ * @param {number} options.offset The offset of the label box and the edge path relative to the default placement. + *

+ * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#offset} property on the created object. + *

+ * @param {yfiles.graph.EdgeSides} options.sideOfEdge The side placement specifiers for edge labels. + *

+ * This option sets the {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge} property on the created object. + *

+ * @constructor + */ + constructor(options?:{angle?:number,autoRotationEnabled?:boolean,distance?:number,offset?:number,sideOfEdge?:yfiles.graph.EdgeSides}); + /** + * 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. + *

+ * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter where the label is attached to the edge segment that contains the edge's midpoint. + * @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. + * @param {yfiles.graph.EdgeSides} sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. + * @returns {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromCenter(segmentRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; + /** + * 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. + * @param {yfiles.graph.EdgeSides} sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. + * @returns {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromSource(segmentIndex:number,segmentRatio:number,sideOfEdge:yfiles.graph.EdgeSides):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. + * @param {yfiles.graph.EdgeSides} sideOfEdge The side of the edge the label is placed on. Note that only single enum values but no combined ones are allowed. + * @returns {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromTarget(segmentIndex:number,segmentRatio:number,sideOfEdge:yfiles.graph.EdgeSides):yfiles.graph.ILabelModelParameter; + /** + * Returns an empty context. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to use for the label in the context. + * @returns {yfiles.graph.ILookup} An empty context. + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets the side placement specifiers for edge labels. + *

+ * The label model parameter {@link yfiles.graph.ILabelModelParameterFinder finder} and {@link yfiles.graph.ILabelModelParameterProvider provider} returned by {@link yfiles.graph.EdgeSegmentLabelModel#lookup} consider the + * specified sides. + *

+ * @see yfiles.graph.EdgeSides + * @default 'OnEdge, LeftOfEdge, RightOfEdge' + * @type {yfiles.graph.EdgeSides} + */ + sideOfEdge:yfiles.graph.EdgeSides; + /** + * Gets or sets the distance between the label box and the edge path. + *

+ * The interpretation of the values depends on the {@link yfiles.graph.EdgeSegmentLabelModel#sideOfEdge} of the individual {@link yfiles.graph.ILabelModelParameter}. + *

+ *

+ * Note that for {@link yfiles.graph.EdgeSides#ON_EDGE} this property is ignored. For all other values of {@link yfiles.graph.EdgeSides} + * the {@link yfiles.graph.EdgeSegmentLabelModel#offset} property is added to this distance. + *

+ * @see yfiles.graph.EdgeSegmentLabelModel#sideOfEdge + * @see yfiles.graph.EdgeSides + * @see yfiles.graph.EdgeSegmentLabelModel#offset + * @default 0.0 + * @type {number} + */ + distance:number; + /** + * Gets or sets the offset of the label box and the edge path relative to the default placement. + *

+ * For {@link yfiles.graph.EdgeSides#ON_EDGE} this is the offset between the center of the label box and the edge path. For all + * other {@link yfiles.graph.EdgeSides} values this offset is added to the {@link yfiles.graph.EdgeSegmentLabelModel#distance} property which results in the total distance between + * the label box and the edge path. + *

+ * @see yfiles.graph.EdgeSegmentLabelModel#sideOfEdge + * @see yfiles.graph.EdgeSides + * @default 0.0 + * @type {number} + */ + offset:number; + /** + * Gets or sets whether edge labels are automatically rotated according to the angle of the corresponding reference edge + * segment. + *

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

+ * @default true + * @type {boolean} + */ + autoRotationEnabled:boolean; + /** + * Gets or sets the rotation angle of all labels with this model in radians. + * @default 0.0 + * @type {number} + */ + angle:number; + static $class:yfiles.lang.Class; + } + export enum EdgeSides{ + /** + * The label should be placed on the path of the edge. + */ + ON_EDGE, + /** + * 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, + /** + * 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, + /** + * The label should be placed above the edge (in geometric sense). + */ + ABOVE_EDGE, + /** + * The label should be placed below the edge (in geometric sense). + */ + BELOW_EDGE + } + export enum PlaceAlongEdge{ + /** + * The segment index is counted from the edge source. + */ + AT_SOURCE, + /** + * The segment index is counted from the edge target. + */ + AT_TARGET, + /** + * The label is at the center of the edge and the segment index is ignored. + */ + AT_CENTER + } + export enum ExteriorLabelModelPosition{ + /** + * Encodes a position outside the node at the top + */ + NORTH, + /** + * Encodes a position outside the node at the right side + */ + EAST, + /** + * Encodes a position outside the node at the bottom + */ + SOUTH, + /** + * Encodes a position outside the node at the left side + */ + WEST, + /** + * Encodes a position outside the node at the upper right corner + */ + NORTH_EAST, + /** + * Encodes a position outside the node at the lower right corner + */ + SOUTH_EAST, + /** + * Encodes a position outside the node at the upper left corner + */ + NORTH_WEST, + /** + * Encodes a position outside the node at the lower left corner + */ + SOUTH_WEST + } + /** + * 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. + *

+ * @class yfiles.graph.ExteriorLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface ExteriorLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class ExteriorLabelModel { + /** + * Creates a new instance of this model + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Insets} options.insets The insets to use by this model. + *

+ * This option sets the {@link yfiles.graph.ExteriorLabelModel#insets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{insets?:yfiles.geometry.Insets}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a new parameter that is associated with this instance for the provided position. + * @param {yfiles.graph.ExteriorLabelModelPosition} position The position constant that describes the position of the label. + * @returns {yfiles.graph.ILabelModelParameter} A new parameter instance. + */ + createParameter(position:yfiles.graph.ExteriorLabelModelPosition):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.ExteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * 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. + *

+ * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.graph.IGraph} that contains a live subgraph of another {@link yfiles.graph.IGraph}. + *

+ * {@link yfiles.graph.FilteredGraphWrapper} is a decorator for another {@link yfiles.graph.IGraph} instance and can be used to retain only + * a subset of nodes and edges of the original graph. The properties {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} and {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} control which nodes and edges are retained in + * the filtered graph. Edges adjacent to filtered nodes are also filtered automatically (as their source or target would + * not be in the graph anyway). + *

+ *

+ * Note that {@link yfiles.graph.FilteredGraphWrapper} has to listen to events raised by the wrapped graph to keep itself updated, + * so {@link yfiles.graph.FilteredGraphWrapper#dispose} should be called if this instance is not used any more. Otherwise the + * wrapped graph may be kept alive for longer than necessary. + *

+ *

+ * {@link yfiles.graph.IPortOwner#ports} at {@link yfiles.graph.IEdge}s (i.e. edge-to-edge connections) are not fully supported. + *

+ *

Related demos:

+ *
    + *
  • Demo: OrgChart, Demo.yFiles.Graph.OrgChart
  • + *
  • Demo: Collapsible Tree, Demo.yFiles.Graph.Collapse
  • + *
+ * @class yfiles.graph.FilteredGraphWrapper + * @extends {yfiles.graph.GraphWrapperBase} + * @final + */ + export interface FilteredGraphWrapper extends yfiles.graph.GraphWrapperBase{} + export class FilteredGraphWrapper { + /** + * Creates a new graph instance that wraps the original graph and uses the predicates 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. + * @constructor + */ + constructor(graph:yfiles.graph.IGraph,nodePredicate:(obj:yfiles.graph.INode)=>boolean,edgePredicate:(obj:yfiles.graph.IEdge)=>boolean); + /** + * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} changed for the given edge in the graph. + * @param {yfiles.graph.IEdge} edge + */ + edgePredicateChanged(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; + /** + * Should be called by clients if the {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} changed for the given node. + * @param {yfiles.graph.INode} node The node. + */ + nodePredicateChanged(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; + /** + * Gets the predicate function for the nodes. + * @type {function(yfiles.graph.INode): boolean} + */ + nodePredicate:(obj:yfiles.graph.INode)=>boolean; + /** + * Gets the predicate function for the edges. + * @type {function(yfiles.graph.IEdge): boolean} + */ + edgePredicate:(obj:yfiles.graph.IEdge)=>boolean; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + nodes:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + edges:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.graph.FreeEdgeLabelModel + * @implements {yfiles.graph.ILabelModelParameterFinder} + * @implements {yfiles.graph.ILabelModel} + */ + export interface FreeEdgeLabelModel extends Object,yfiles.graph.ILabelModelParameterFinder,yfiles.graph.ILabelModel{} + export class FreeEdgeLabelModel { + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * 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. + * @returns {yfiles.graph.ILabelModelParameter} A parameter that describes the position. + * @see yfiles.graph.FreeEdgeLabelModel#edgeRelativeAngle + */ + createEdgeAnchored(ratio:number,distance:number,angle:number):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} layout The anticipated layout for the label. + * @returns {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets a property that indicates whether the angle used by the {@link yfiles.graph.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. + *

+ * @default false + * @type {boolean} + */ + edgeRelativeAngle:boolean; + /** + * A shared unmodifiable public instance that can be used to obtain parameters. + * @const + * @static + * @type {yfiles.graph.FreeEdgeLabelModel} + */ + static INSTANCE:yfiles.graph.FreeEdgeLabelModel; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.FreeLabelModel#getGeometry}. + *

+ * @class yfiles.graph.FreeLabelModel + * @implements {yfiles.graph.ILabelModelParameterFinder} + * @implements {yfiles.graph.ILabelModel} + */ + export interface FreeLabelModel extends Object,yfiles.graph.ILabelModelParameterFinder,yfiles.graph.ILabelModel{} + export class FreeLabelModel { + /** + * Creates a new label model parameter that places the label at the given absolute position using the provided angle. + * @param {yfiles.geometry.Point} anchorLocation The location for the parameter. + * @param {number} angle The angle of rotation. + * @returns {yfiles.graph.ILabelModelParameter} A new parameter that is associated with this instance. + */ + createAbsolute(anchorLocation:yfiles.geometry.Point,angle:number):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. + * @returns {yfiles.graph.ILabelModelParameter} A new parameter that is associated with this instance. + */ + createAnchored(location:yfiles.geometry.IPoint,angle:number):yfiles.graph.ILabelModelParameter; + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a new label model parameter that dynamically reads the label layout from the provided instance. + * @param {yfiles.geometry.IOrientedRectangle} layout The oriented rectangle to dynamically retrieve the values from. + * @returns {yfiles.graph.ILabelModelParameter} A new parameter that is associated with this instance. + */ + createDynamic(layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A shared public instance that can be used to obtain parameters. + * @const + * @static + * @type {yfiles.graph.FreeLabelModel} + */ + static INSTANCE:yfiles.graph.FreeLabelModel; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.graph.FreeNodeLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterFinder} + */ + export interface FreeNodeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterFinder{} + export class FreeNodeLabelModel { + /** + * Creates a parameter instance that anchors the label to the node at the canonical position with respect to the given + * reference point. + *

+ * This method {@link yfiles.graph.FreeNodeLabelModel#createParameter creates a 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. If no reference point is provided, + * the reference point is determined automatically 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.Rect} nodeLayout The node layout. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The label layout. + * @param {yfiles.geometry.Point} [referenceLocation=null] The reference location. + * @returns {yfiles.graph.ILabelModelParameter} The canonical parameter for the specified node and label layout. + */ + createCanonicalParameter(nodeLayout:yfiles.geometry.Rect,labelLayout:yfiles.geometry.IOrientedRectangle,referenceLocation?:yfiles.geometry.Point):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that is anchored at the node center and has no rotation. + * @returns {yfiles.graph.ILabelModelParameter} A parameter that is anchored at the node center and has no rotation. + */ + createDefaultParameter():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.Point} layoutRatio The ratio that describes the point on the node's layout relative to its size. + * @param {yfiles.geometry.Point} layoutOffset The offset to apply to the point on the node after the ratio has been determined. + * @param {yfiles.geometry.Point} labelRatio The ratio that describes the point on the label's layout relative to its size. + * @param {yfiles.geometry.Point} 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. + * @returns {yfiles.graph.ILabelModelParameter} A parameter that exactly fits the described location. + */ + createParameter(layoutRatio:yfiles.geometry.Point,layoutOffset:yfiles.geometry.Point,labelRatio:yfiles.geometry.Point,labelOffset:yfiles.geometry.Point,angle:number):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} layout The anticipated layout for the label. + * @returns {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * Returns an empty context. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to use for the label in the context. + * @returns {yfiles.graph.ILookup} An empty context. + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * 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. + * @returns {Object} An instance that is assignable to the given type or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A shared public instance that can be used to obtain parameters. + * @const + * @static + * @type {yfiles.graph.FreeNodeLabelModel} + */ + static INSTANCE:yfiles.graph.FreeNodeLabelModel; + static $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 ratios 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 and additional offsets to + * obtain the offset to the top-left corner of the node layout. + *

+ * @class yfiles.graph.FreeNodePortLocationModel + * @implements {yfiles.graph.IPortLocationModel} + * @final + */ + export interface FreeNodePortLocationModel extends Object,yfiles.graph.IPortLocationModel{} + export class FreeNodePortLocationModel { + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @param {yfiles.geometry.Point} location + * @returns {yfiles.graph.IPortLocationModelParameter} + */ + createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a parameter that uses the given ratios and offsets. + *

+ * The ratios will be scaled by the node layout's size and added to the node's top left corner and the offset to determine + * the port location. + *

+ * @param {yfiles.geometry.Point} ratios The ratios of the node layout's size. + * @param {yfiles.geometry.Point} [offset=null] The offset that is added after the ratios are applied. + * @returns {yfiles.graph.IPortLocationModelParameter} A new parameter that matches the specification. + */ + createParameterForRatios(ratios:yfiles.geometry.Point,offset?:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.geometry.Point} + */ + getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A read only immutable instance of the {@link yfiles.graph.FreeNodePortLocationModel}. + * @const + * @static + * @type {yfiles.graph.FreeNodePortLocationModel} + */ + static INSTANCE:yfiles.graph.FreeNodePortLocationModel; + /** + * A read only immutable singleton instance of a parameter that locates the port at the center of the node layout. + *

+ * This is the same as creating a parameter using (0.5,0.5) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_CENTER_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the center of the left border of the + * node layout. + *

+ * This is the same as creating a parameter using (0,0.5) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the center of the right border of the + * node layout. + *

+ * This is the same as creating a parameter using (1,0.5) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the center of the top border of the + * node layout. + *

+ * This is the same as creating a parameter using (0.5,0) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_TOP_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the center of the bottom border of the + * node layout. + *

+ * This is the same as creating a parameter using (0.5,1) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_BOTTOM_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the top left corner of the node + * layout. + *

+ * This is the same as creating a parameter using (0,0) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_TOP_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the top right corner of the node + * layout. + *

+ * This is the same as creating a parameter using (1,0) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_TOP_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the bottom right corner of the node + * layout. + *

+ * This is the same as creating a parameter using (1,1) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_BOTTOM_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a parameter that locates the port at the bottom left corner of the node + * layout. + *

+ * This is the same as creating a parameter using (0,1) as ratios and (0,0) as offsets. + *

+ * @const + * @static + * @type {yfiles.graph.IPortLocationModelParameter} + */ + static NODE_BOTTOM_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + static $class:yfiles.lang.Class; + } + /** + * 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: + *

+ * @class yfiles.graph.GenericLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + * @implements {yfiles.graph.ILabelCandidateDescriptorProvider} + * @implements {yfiles.graphml.IMarkupExtensionConverter} + */ + export interface GenericLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelCandidateDescriptorProvider,yfiles.graphml.IMarkupExtensionConverter{} + export class GenericLabelModel { + /** + * Create a new generic label model using the provided parameter as the {@link yfiles.graph.GenericLabelModel#createDefaultParameter default parameter.} + *

+ * The parameter is stored by reference. + *

+ * @param {yfiles.graph.ILabelModelParameter} defaultLayoutParameter The parameter to use as the default. + * @param {yfiles.graph.ILabelCandidateDescriptor} [descriptor=null] The descriptor to associate with the parameter. + * @throws {Stubs.Exceptions.ArgumentError} defaultParameter is null. + * @see yfiles.graph.GenericLabelModel#getDescriptor + * @constructor + */ + constructor(defaultLayoutParameter:yfiles.graph.ILabelModelParameter,descriptor?:yfiles.graph.ILabelCandidateDescriptor); + /** + * 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.graph.GenericLabelModel#getDescriptor} method. + *

+ * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to add to this instance. + * @param {yfiles.graph.ILabelCandidateDescriptor} [descriptor=null] The descriptor to associate with the parameter. + * @returns {yfiles.graph.ILabelModelParameter} A new parameter that wraps the provided parameter and uses this instance as its model. + */ + addParameter(layoutParameter:yfiles.graph.ILabelModelParameter,descriptor?:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ILabelModelParameter; + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * Yields the {@link yfiles.graph.ILabelCandidateDescriptor} that has been associated with the instance during + * {@link yfiles.graph.GenericLabelModel#addParameter}. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to get the descriptor for. + * @returns {yfiles.graph.ILabelCandidateDescriptor} The descriptor instance that had been added to this instance during {@link yfiles.graph.GenericLabelModel#addParameter}. + */ + getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + static $class:yfiles.lang.Class; + } + /** + * 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 in the following way: + *

+ *

+ * Note that in order to work, this model needs to have at least one {@link yfiles.graph.GenericPortLocationModel#addParameter parameter added}. + *

+ * @see yfiles.graph.GenericPortLocationModel#addParameter + * @class yfiles.graph.GenericPortLocationModel + * @implements {yfiles.graph.IPortLocationModel} + * @implements {yfiles.collections.IEnumerable.} + * @implements {yfiles.graphml.IMarkupExtensionConverter} + * @final + */ + export interface GenericPortLocationModel extends Object,yfiles.graph.IPortLocationModel,yfiles.collections.IEnumerable,yfiles.graphml.IMarkupExtensionConverter{} + export class GenericPortLocationModel { + /** + * Initializes a new instance of the {@link yfiles.graph.GenericPortLocationModel} class. + * @constructor + */ + constructor(); + /** + * This method simply delegates to {@link yfiles.graph.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} locationParameter The parameter to add to this instance. + * @see yfiles.graph.GenericPortLocationModel#addParameter + */ + add(locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Adds the given parameter to the {@link yfiles.graph.GenericPortLocationModel#locationParameters} 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} locationParameter The parameter to add to this instance. + * @returns {yfiles.graph.IPortLocationModelParameter} The parameter to use with this model that wraps the given parameter. + * @see yfiles.graph.GenericPortLocationModel#add + */ + addParameter(locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.IPortLocationModelParameter; + /** + * 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.graph.GenericPortLocationModel#locationParameters} to return the one that matches the given location the best. + *

+ * @param {yfiles.graph.IPortOwner} owner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.Point} location The location in the world coordinate system that should be matched as best as possible. + * @returns {yfiles.graph.IPortLocationModelParameter} A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given owner. + */ + createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.geometry.Point} + */ + getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * 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.graph.GenericPortLocationModel#addParameter} + *

+ * @type {yfiles.collections.IEnumerable.} + */ + locationParameters:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * This interface can be used to customize the clipboard behavior for individual {@link yfiles.graph.IModelItem}s. + *

+ * Implementations of this interface can {@link yfiles.graph.ILookupDecorator#addLookup decorate} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IModelItem}s to + * change their behavior during {@link yfiles.graph.GraphClipboard clipboard} actions. + *

+ *

+ * The easiest way to decorate certain model items with a custom {@link yfiles.graph.IClipboardHelper} implementation is via the + * various decorators available on {@link yfiles.graph.GraphDecorator}: + *

+ *

Related demos:

+ *
    + *
  • Demo: Clipboard, Demo.yFiles.Graph.Clipboard
  • + *
+ * @interface + */ + export interface IClipboardHelper extends Object{ + /** + * 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. + *

+ * If the source graph is a managed folding view, the item is always a master item. + *

+ * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {yfiles.graph.IModelItem} item The item to copy to the clipboard. + * @returns {Object} A custom user object that will later be provided to {@link yfiles.graph.IClipboardHelper#paste}. + * @abstract + */ + copy(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):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. + *

+ * If the source graph is a managed folding view, the item is always a master item. + *

+ * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {yfiles.graph.IModelItem} item The item to cut to the clipboard. + * @returns {Object} A custom user object that will later be provided to {@link yfiles.graph.IClipboardHelper#paste}. + * @abstract + */ + cut(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):Object; + /** + * This method is called after the item has been pasted from the clipboard. + *

+ * The item is always a master item since the clipboard graph is not a managed folding view. + *

+ * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {yfiles.graph.IModelItem} 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. + * @abstract + */ + paste(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem,userData:Object):void; + /** + * Determines whether the given item can or should be copied to the clipboard. + *

+ * If the source graph is a managed folding view, the item is always a view item. Furthermore, if collapsed nodes are to be + * copied, this method will be queried with the collapsed group node as item for each "hidden" node that is currently not + * visible. + *

+ * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {yfiles.graph.IModelItem} item The item in question. + * @returns {boolean} Whether this item should be copied. + * @abstract + */ + shouldCopy(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):boolean; + /** + * Determines whether the given item can or should be cut to the clipboard. + *

+ * If the source graph is a managed folding view, the item is always a view item. Furthermore, if collapsed nodes are to be + * cut, this method will be queried with the collapsed group node as item for each "hidden" node that is currently not + * visible. + *

+ * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {yfiles.graph.IModelItem} item The item in question. + * @returns {boolean} Whether this item should be cut. + * @abstract + */ + shouldCut(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem):boolean; + /** + * Determines whether the given item can or should be pasted from the clipboard to the target graph. + *

+ * The item is always a master item since the clipboard graph is not a managed folding view. + *

+ * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {yfiles.graph.IModelItem} item The item in the clipboard graph. + * @param {Object} userData The state memento that had been created during {@link yfiles.graph.IClipboardHelper#cut} or {@link yfiles.graph.IClipboardHelper#copy}. + * @returns {boolean} Whether this item should be pasted. + * @abstract + */ + shouldPaste(context:yfiles.graph.IGraphClipboardContext,item:yfiles.graph.IModelItem,userData:Object):boolean; + } + 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}. + * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface IGraphClipboardContext extends Object,yfiles.graph.ILookup{ + /** + * Gets the clipboard that created this context and is used during the current operation. + * @abstract + * @type {yfiles.graph.GraphClipboard} + */ + clipboard:yfiles.graph.GraphClipboard; + /** + * Gets the source graph for the current operation. + * @abstract + * @type {yfiles.graph.IGraph} + */ + sourceGraph:yfiles.graph.IGraph; + /** + * Gets the target graph for the current operation. + * @abstract + * @type {yfiles.graph.IGraph} + */ + targetGraph:yfiles.graph.IGraph; + } + var IGraphClipboardContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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.graph.IModelItem} object reference as the ID. + *

+ * @interface + */ + export interface IClipboardIdProvider extends Object{ + /** + * Gets the ID for the given originalItem. + * @param {yfiles.graph.IGraphClipboardContext} context The clipboard context + * @param {yfiles.graph.IModelItem} originalItem The original item which is copied. The item is part of the original graph from which the item is copied. + * @returns {Object} An ID for the given item. The object should be suitable for use in a {@link yfiles.collections.Map.}. + * @abstract + */ + getId(context:yfiles.graph.IGraphClipboardContext,originalItem:yfiles.graph.IModelItem):Object; + /** + * Gets the item which is represented by the given id. + * @param {yfiles.graph.IGraphClipboardContext} context The clipboard context. + * @param {Object} id The ID to get the item for. + * @returns {yfiles.graph.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. + * @abstract + */ + getItem(context:yfiles.graph.IGraphClipboardContext,id:Object):yfiles.graph.IModelItem; + } + var IClipboardIdProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum ParentNodeDetectionModes{ + /** + * Nodes should always be pasted into the root group. + */ + ROOT, + /** + * If exactly one group node is selected the nodes should be pasted into that group. + *

+ * As long as {@link yfiles.graph.ParentNodeDetectionModes#ALLOW_SELF} is not set, too, a node will not be pasted into its original + * node. Note that it can be pasted into a copy of its original, though. + *

+ *

+ * If this setting is combined with {@link yfiles.graph.ParentNodeDetectionModes#ROOT} or {@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT} + * it will override that setting if a group node is selected. + *

+ */ + SELECTION, + /** + * A node should be pasted into its original parent. + *

+ * If the parent has been removed from the graph in between the copy and paste operation the node will be placed into the + * parent's parent. + *

+ *

+ * If the previous parent has been moved too far away the node will be placed into the root unless {@link yfiles.graph.ParentNodeDetectionModes#FORCE} + * is set, too. + *

+ *

+ * If this setting is combined with {@link yfiles.graph.ParentNodeDetectionModes#SELECTION} or {@link yfiles.graph.ParentNodeDetectionModes#AT_LOCATION} + * it will be overridden by the other setting. + *

+ */ + PREVIOUS_PARENT, + /** + * A node should be pasted into the group node at the location where the node is pasted to or the root if there is no group + * node. + *

+ * As long as {@link yfiles.graph.ParentNodeDetectionModes#ALLOW_SELF} is not set, too, the node will not be pasted into its + * original node. Note that it can be pasted into a copy of its original, though. + *

+ */ + AT_LOCATION, + /** + * When used in combination with {@link yfiles.graph.ParentNodeDetectionModes#SELECTION} or {@link yfiles.graph.ParentNodeDetectionModes#AT_LOCATION} + * this setting will allow pasting nodes into their original. + */ + ALLOW_SELF, + /** + * If combined with {@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT} forces the node to be pasted into its original + * parent, even if the parent has moved far away and pasting the node would increase the parents size considerably. + */ + FORCE, + /** + * A bitmask that can be used to query the actual mode ({@link yfiles.graph.ParentNodeDetectionModes#ROOT}, + * {@link yfiles.graph.ParentNodeDetectionModes#SELECTION}, {@link yfiles.graph.ParentNodeDetectionModes#AT_LOCATION}, or + * {@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT}). + */ + MODE_MASK, + /** + * A bitmask that can be used to query modifications of the actual mode such as {@link yfiles.graph.ParentNodeDetectionModes#ALLOW_SELF} + * or {@link yfiles.graph.ParentNodeDetectionModes#FORCE}. + */ + MODIFIER_MASK + } + /** + * 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. + *

+ *

Related demos:

+ *
    + *
  • Demo: Simple Editor, Demo.yFiles.Graph.SimpleEditor
  • + *
+ * @see yfiles.graph.IClipboardHelper + * @see yfiles.graph.GraphClipboard#cut + * @see yfiles.graph.GraphClipboard#copy + * @see yfiles.graph.GraphClipboard#clipboardGraph + * @class yfiles.graph.GraphClipboard + */ + export interface GraphClipboard extends Object{} + export class GraphClipboard { + /** + * Creates a new initially empty clipboard. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Point} options.pasteDelta A vector that will be used to move nodes and bends by after they have been pasted to the target graph. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#pasteDelta} property on the created object. + *

+ * @param {yfiles.graph.GraphCopier} options.toClipboardCopier The {@link yfiles.graph.GraphCopier} instance that will be used to copy the graph to the clipboard. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#toClipboardCopier} property on the created object. + *

+ * @param {yfiles.graph.GraphCopier} options.fromClipboardCopier The {@link yfiles.graph.GraphCopier} instance that will be used to copy the graph from the clipboard to the target graph. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#fromClipboardCopier} property on the created object. + *

+ * @param {yfiles.graph.GraphCopier} options.duplicateCopier The {@link yfiles.graph.GraphCopier} instance that will be used to duplicate elements inside the graph. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#duplicateCopier} property on the created object. + *

+ * @param {yfiles.graph.IClipboardIdProvider} options.idProvider The {@link yfiles.graph.IClipboardIdProvider} used by this instance to provide IDs for copied items. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#idProvider} property on the created object. + *

+ * @param {yfiles.graph.IGraph} options.clipboardGraph The graph that contains the clipboard's contents. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#clipboardGraph} property on the created object. + *

+ * @param {yfiles.graph.ParentNodeDetectionModes} options.parentNodeDetection Whether or not nodes should be automatically put into a group node and if so how this group will be determined. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#parentNodeDetection} property on the created object. + *

+ * @param {yfiles.graph.GraphItemTypes} options.dependentCopyItems 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. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#dependentCopyItems} property on the created object. + *

+ * @param {yfiles.graph.GraphItemTypes} options.independentCopyItems The type of items that can be copied and pasted independently of their owning element. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#independentCopyItems} property on the created object. + *

+ * @param {yfiles.graph.GraphItemTypes} options.copyItems The type of items that can be copied and pasted at all using the clipboard. + *

+ * This option sets the {@link yfiles.graph.GraphClipboard#copyItems} property on the created object. + *

+ * @constructor + */ + constructor(options?:{pasteDelta?:yfiles.geometry.Point,toClipboardCopier?:yfiles.graph.GraphCopier,fromClipboardCopier?:yfiles.graph.GraphCopier,duplicateCopier?:yfiles.graph.GraphCopier,idProvider?:yfiles.graph.IClipboardIdProvider,clipboardGraph?:yfiles.graph.IGraph,parentNodeDetection?:yfiles.graph.ParentNodeDetectionModes,dependentCopyItems?:yfiles.graph.GraphItemTypes,independentCopyItems?:yfiles.graph.GraphItemTypes,copyItems?:yfiles.graph.GraphItemTypes}); + /** + * Clears the clipboard's contents. + */ + clear():void; + /** + * Calls {@link yfiles.graph.GraphCopier#copy} 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#copy} + * @param {function(yfiles.graph.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 grouped targetGraph. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} elementCopiedCallback 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 {@link yfiles.graph.FoldingManager#views folding view graph} both elements are passed + * as {@link yfiles.graph.FoldingManager#masterGraph master} elements or {@link yfiles.graph.FoldingManager#getFolderNodeState folding state elements} if a master element does not exist. + * @protected + */ + copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):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#copy} method. + *

+ * @param {yfiles.graph.IGraph} sourceGraph The graph to copy the contents from. + * @param {function(yfiles.graph.IModelItem): boolean} filter The filter to apply to the source graph's elements. + */ + copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean):void; + /** + * Creates the graph used for the clipboard. + * @returns {yfiles.graph.IGraph} A new readily configured {@link yfiles.graph.DefaultGraph} instance. + * @protected + */ + createClipboardGraph():yfiles.graph.IGraph; + /** + * Convenience method that creates a predicate that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldCopy} + * method that can be found in the {@link yfiles.graph.ILookup#lookup} of the provided {@link yfiles.graph.IModelItem}. + * @returns {function(yfiles.graph.IModelItem): boolean} A predicate that uses {@link yfiles.graph.IClipboardHelper#shouldCopy}. + * @see yfiles.graph.GraphClipboard#copy + */ + createClipBoardHelperCopyFilter():(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Convenience method that creates a predicate that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldCut} + * method that can be found in the {@link yfiles.graph.ILookup#lookup} of the provided {@link yfiles.graph.IModelItem}. + * @returns {function(yfiles.graph.IModelItem): boolean} A predicate that uses {@link yfiles.graph.IClipboardHelper#shouldCut}. + * @see yfiles.graph.GraphClipboard#cut + */ + createClipBoardHelperCutFilter():(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Convenience method that creates a predicate that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldPaste} + * method that can be found in the {@link yfiles.graph.ILookup#lookup} of the provided {@link yfiles.graph.IModelItem}. + * @returns {function(yfiles.graph.IModelItem): boolean} A predicate that uses {@link yfiles.graph.IClipboardHelper#shouldPaste}. + * @see yfiles.graph.GraphClipboard#cut + */ + createClipBoardHelperPasteFilter():(obj:yfiles.graph.IModelItem)=>boolean; + /** + * 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. + * @returns {yfiles.graph.IGraphClipboardContext} A context that has the properties configured according to the parameters. + * @protected + */ + createContext(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):yfiles.graph.IGraphClipboardContext; + /** + * 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. + *

+ * @returns {yfiles.graph.IClipboardIdProvider} + * @protected + */ + createDefaultClipboardIdProvider():yfiles.graph.IClipboardIdProvider; + /** + * Creates a predicate for use in the {@link yfiles.graph.GraphClipboard#copy} 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.view.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @returns {function(yfiles.graph.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.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Creates a 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.view.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @returns {function(yfiles.graph.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.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Creates a 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.view.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @returns {function(yfiles.graph.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.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Factory method that creates the {@link yfiles.graph.GraphClipboard#duplicateCopier}. + * @returns {yfiles.graph.GraphCopier} A new {@link yfiles.graph.GraphCopier} instance. + * @protected + */ + createDuplicateCopier():yfiles.graph.GraphCopier; + /** + * Factory method that creates the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}. + * @returns {yfiles.graph.GraphCopier} A new {@link yfiles.graph.GraphCopier} instance. + * @protected + */ + createFromClipboardCopier():yfiles.graph.GraphCopier; + /** + * Creates a predicate for use in the {@link yfiles.graph.GraphClipboard#cut} and {@link yfiles.graph.GraphClipboard#copy} 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.view.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @returns {function(yfiles.graph.IModelItem): boolean} A predicate that filters subgraph induced by the selection of nodes. + */ + createSelectionFilter(selection:yfiles.view.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.graph.IModelItem)=>boolean; + /** + * Factory method that creates the {@link yfiles.graph.GraphClipboard#toClipboardCopier}. + * @returns {yfiles.graph.GraphCopier} A new {@link yfiles.graph.GraphCopier} instance. + * @protected + */ + createToClipboardCopier():yfiles.graph.GraphCopier; + /** + * Creates an induced predicate from coreFilter for use in the {@link yfiles.graph.GraphClipboard#cut} and {@link yfiles.graph.GraphClipboard#copy} + * 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.graph.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 + * @returns {function(yfiles.graph.IModelItem): boolean} + * @static + */ + static createWrappedFilter(coreFilter:(obj:yfiles.graph.IModelItem)=>boolean,graph:yfiles.graph.IGraph,restrictive:boolean):(obj:yfiles.graph.IModelItem)=>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#copy} 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.graph.IModelItem): boolean} filter The filter to use. + * @see yfiles.graph.GraphClipboard#createSelectionFilter + */ + cut(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean):void; + /** + * Duplicates the elements indicated by the filter. + *

+ * The {@link yfiles.graph.GraphClipboard#clipboardGraph} is not altered by this operation. + *

+ * @param {yfiles.input.IInputModeContext} context The current {@link yfiles.input.IInputModeContext}. + * @param {yfiles.graph.IGraph} sourceGraph The graph whose elements should be duplicated. + * @param {function(yfiles.graph.IModelItem): boolean} filter A predicate which returns true for elements which should be duplicated. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} elementDuplicated An element copied callback 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. + */ + duplicate(context:yfiles.input.IInputModeContext,sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,elementDuplicated:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; + /** + * Retrieves the {@link yfiles.graph.IClipboardHelper} instance associated with the given item. + *

+ * This implementation uses the item's {@link yfiles.graph.ILookup#lookup} method to retrieve the helper instance. + *

+ * @param {yfiles.graph.IModelItem} item The item to find the clipboard helper for. + * @returns {yfiles.graph.IClipboardHelper} An instance or null. + * @protected + */ + getClipboardHelper(item:yfiles.graph.IModelItem):yfiles.graph.IClipboardHelper; + /** + * Gets a folding state of an edge for a given {@link yfiles.graph.FoldingEdgeStateId}. + *

+ * This method might be overridden to map folding 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 folding state for. + * @param {yfiles.graph.FoldingEdgeStateId} id The original {@link yfiles.graph.FoldingEdgeStateId} to get the folding state for. Passing null will return the folding state + * which was visible when the edge was copied into the clipboard. + * @returns {yfiles.graph.IEdge} The folding state which is mapped to the given id. May be null. + * @protected + */ + getFoldingEdgeState(edge:yfiles.graph.IEdge,id:yfiles.graph.FoldingEdgeStateId):yfiles.graph.IEdge; + /** + * 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#copyLabelLayoutParameter} 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#copyLabelLayoutParameter} 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.ILabelOwner} newOwner The new owner for the label. + * @returns {yfiles.graph.ILabelModelParameter} An {@link yfiles.graph.ILabelModelParameter} for the copied label. + * @protected + */ + getLabelLayoutParameter(copier:yfiles.graph.GraphCopier,graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel,newOwner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; + /** + * 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.graph.IModelItem} clipboardItem The item in the clipboard graph. + * @returns {Object} The object returned by the {@link yfiles.graph.IClipboardHelper} methods or null. + */ + getMemento(clipboardItem:yfiles.graph.IModelItem):Object; + /** + * 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#copyPortLocationParameter} 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#copyPortLocationParameter} 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. + * @returns {yfiles.graph.IPortLocationModelParameter} An {@link yfiles.graph.IPortLocationModelParameter} for the copied port. + * @protected + */ + getPortLocationParameter(copier:yfiles.graph.GraphCopier,graph:yfiles.graph.IGraph,originalPort:yfiles.graph.IPort,newOwner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * 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. + * @returns {yfiles.graph.IEdge} An {@link yfiles.graph.IEdge} for the bend to be added to or null if the bend should not be copied. + * @protected + */ + getTargetEdge(originalBend:yfiles.graph.IBend):yfiles.graph.IEdge; + /** + * Provides an {@link yfiles.graph.ILabelOwner} 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. + * @returns {yfiles.graph.ILabelOwner} An {@link yfiles.graph.ILabelOwner} for the label to be added to or null if the label should not be copied. + * @protected + */ + getTargetLabeledItem(originalLabel:yfiles.graph.ILabel):yfiles.graph.ILabelOwner; + /** + * 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 root or if the graph is not grouped. + *

+ * @param {yfiles.graph.INode} originalNode The node to be copied. + * @returns {yfiles.graph.INode} The new parent group of the node or null if the node should be placed at the root of the hierarchy or if the graph is + * not grouped. + * @see yfiles.graph.GraphClipboard#parentNodeDetection + * @protected + */ + getTargetNode(originalNode:yfiles.graph.INode):yfiles.graph.INode; + /** + * 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. + * @returns {yfiles.graph.IPort} An {@link yfiles.graph.IPort} for the edge to be added to or null if the edge should not be copied. + * @protected + */ + getTargetPort(originalEdge:yfiles.graph.IEdge,atSource:boolean):yfiles.graph.IPort; + /** + * 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. + * @returns {yfiles.graph.IPortOwner} An {@link yfiles.graph.IPortOwner} for the port to be added to or null if the port should not be copied. + * @protected + */ + getTargetPortOwner(originalPort:yfiles.graph.IPort):yfiles.graph.IPortOwner; + /** + * Whether the given item is a "dummy" item which should not be pasted. + *

+ * A dummy item is used to keep {@link yfiles.graph.IModelItem}s which cannot exist without an owner in the {@link yfiles.graph.GraphClipboard#clipboardGraph} (e.g. + * {@link yfiles.graph.ILabel}s). + *

+ * @param {yfiles.graph.IModelItem} item The item to test. + * @returns {boolean} true if the item is a "dummy" item. + */ + isDummy(item:yfiles.graph.IModelItem):boolean; + /** + * Whether the given item exists in a folding state of its owner. + * @param {yfiles.graph.IModelItem} owner The owner of the given item. + * @param {yfiles.graph.IModelItem} item An {@link yfiles.graph.ILabel}, {@link yfiles.graph.IPort}, or {@link yfiles.graph.IBend}. + * @returns {boolean} true if the given item exists in a folding state. + * @protected + * @static + */ + static isFoldingStateElement(owner:yfiles.graph.IModelItem,item:yfiles.graph.IModelItem):boolean; + /** + * 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#copy} + * operation. + *

+ * This implementation will {@link yfiles.graph.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.graph.IModelItem} original The original element from the source graph instance. If the source graph is a managed folding view, this is always a + * master item. + * @param {yfiles.graph.IModelItem} copy The copy from the clipboard graph. + * @protected + */ + onElementCopied(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem):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.graph.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.graph.IModelItem} original The original element from the source graph instance. If the source graph is a managed folding view, this is always a + * master item. + * @param {yfiles.graph.IModelItem} copy The copy from the clipboard graph. + * @protected + */ + onElementCut(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem):void; + /** + * A callback function that will be invoked for each item that has been pasted into the target graph in response to a + * Paste(IGraph) 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.graph.IModelItem} original The original element from the clipboard graph instance. If the target graph is a managed folding view, this is always a + * master item. + * @param {yfiles.graph.IModelItem} copy The copy from the target graph. + * @protected + */ + onElementPasted(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem):void; + /** + * Calls {@link yfiles.graph.GraphCopier#copy} 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#copy} + * @param {function(yfiles.graph.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 grouped targetGraph. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} elementCopiedCallback 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.FoldingManager#views folding view graph} the original element is + * passed as {@link yfiles.graph.FoldingManager#masterGraph master} elements or {@link yfiles.graph.FoldingManager#getFolderNodeState folding state elements} if a master element does not exist. The copied element is always + * part of the targetGraph. + * @param {function(yfiles.graph.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. If null all model items can be used as targets. + * @protected + */ + paste(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void,targetFilter:(obj:yfiles.graph.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#copy} method. + *

+ * @param {yfiles.graph.IGraph} targetGraph The graph to paste into. + * @param {yfiles.view.IGraphSelection} selection The selection model to set the selection on. + */ + paste(targetGraph:yfiles.graph.IGraph,selection:yfiles.view.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#copy} method. + *
+ * 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.input.IInputModeContext} context 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 {yfiles.graph.IGraph} targetGraph The graph to paste the contents in. + * @param {function(yfiles.graph.IModelItem): boolean} filter The filter to apply to the clipboard graph. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} 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.FoldingManager#views folding view graph} + * the original element is passed as {@link yfiles.graph.FoldingManager#masterGraph master} elements or {@link yfiles.graph.FoldingManager#getFolderNodeState folding state elements} if a master element does not exist. The + * copied element is always part of the targetGraph. + * @param {function(yfiles.graph.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). If null all model items can be used as targets. + */ + paste(context:yfiles.input.IInputModeContext,targetGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,elementPasted:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void,targetFilter:(obj:yfiles.graph.IModelItem)=>boolean):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#copy} method. + *

+ * @param {yfiles.graph.IGraph} targetGraph The graph to paste the contents in. + * @param {function(yfiles.graph.IModelItem): boolean} [filter=null] The filter to apply to the clipboard graph. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} [elementPasted=null] 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.FoldingManager#views folding view graph} + * the original element is passed as {@link yfiles.graph.FoldingManager#masterGraph master} elements or {@link yfiles.graph.FoldingManager#getFolderNodeState folding state elements} if a master element does not exist. The + * copied element is always part of the targetGraph. + */ + paste(targetGraph:yfiles.graph.IGraph,filter?:(obj:yfiles.graph.IModelItem)=>boolean,elementPasted?:(original:yfiles.graph.IModelItem,copy:yfiles.graph.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#copy} method. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IGraph} options.targetGraph The graph to paste the contents in. + * @param {function(yfiles.graph.IModelItem): boolean} [options.filter=null] The filter to apply to the clipboard graph. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} [options.elementPasted=null] 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.FoldingManager#views folding view graph} + * the original element is passed as {@link yfiles.graph.FoldingManager#masterGraph master} elements or {@link yfiles.graph.FoldingManager#getFolderNodeState folding state elements} if a master element does not exist. The + * copied element is always part of the targetGraph. + */ + paste(options:{targetGraph:yfiles.graph.IGraph,filter?:(obj:yfiles.graph.IModelItem)=>boolean,elementPasted?:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void}):void; + /** + * Removes elements from the graph based on a predicate. + * @param {yfiles.graph.IGraph} sourceGraph The graph to remove elements from. + * @param {function(yfiles.graph.IModelItem): boolean} predicate The predicate that decides which elements to remove. + * @see yfiles.graph.GraphClipboard#cut + * @protected + */ + removeElements(sourceGraph:yfiles.graph.IGraph,predicate:(obj:yfiles.graph.IModelItem)=>boolean):void; + /** + * Gets or sets a vector that will be used to move nodes and bends by after they have been pasted to the target graph. + * @type {yfiles.geometry.Point} + */ + pasteDelta:yfiles.geometry.Point; + /** + * Determines whether the clipboard graph is empty. + * @type {boolean} + */ + empty:boolean; + /** + * 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}. + *

+ * @type {yfiles.graph.GraphCopier} + */ + 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}. + *

+ * @type {yfiles.graph.GraphCopier} + */ + 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}. + *

+ * @type {yfiles.graph.GraphCopier} + */ + duplicateCopier:yfiles.graph.GraphCopier; + /** + * Gets or sets 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. + *

+ * @type {yfiles.graph.IClipboardIdProvider} + */ + idProvider:yfiles.graph.IClipboardIdProvider; + /** + * Gets or sets the graph that contains the clipboard's contents. + * @throws {Stubs.Exceptions.ArgumentError} If value is null. + * @type {yfiles.graph.IGraph} + */ + clipboardGraph:yfiles.graph.IGraph; + /** + * Gets or sets whether or not 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.ParentNodeDetectionModes#SELECTION}|{@link yfiles.graph.ParentNodeDetectionModes#PREVIOUS_PARENT}. + *

+ * @type {yfiles.graph.ParentNodeDetectionModes} + */ + parentNodeDetection:yfiles.graph.ParentNodeDetectionModes; + /** + * Gets or sets 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.ILabelOwner 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. + *

+ * @default 63 & ~1 + * @type {yfiles.graph.GraphItemTypes} + */ + dependentCopyItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets 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.ILabelOwner 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. + *

+ * @default 63 + * @type {yfiles.graph.GraphItemTypes} + */ + independentCopyItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets 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}. + *

+ * @default 63 + * @type {yfiles.graph.GraphItemTypes} + */ + copyItems:yfiles.graph.GraphItemTypes; + /** + * 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. + *

+ * @type {boolean} + */ + ignoreEdgesWithOneNode:boolean; + /** + * Adds the given listener for the ElementsCut event that occurs when the {@link yfiles.graph.GraphClipboard#cut} operation + * finished successfully. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.graph.GraphClipboard#removeElementsCutListener + */ + addElementsCutListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the ElementsCut event that occurs when the {@link yfiles.graph.GraphClipboard#cut} operation + * finished successfully. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.graph.GraphClipboard#addElementsCutListener + */ + removeElementsCutListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the ElementsCopied event that occurs when the {@link yfiles.graph.GraphClipboard#copy} operation + * finished successfully. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.graph.GraphClipboard#removeElementsCopiedListener + */ + addElementsCopiedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the ElementsCopied event that occurs when the {@link yfiles.graph.GraphClipboard#copy} operation + * finished successfully. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.graph.GraphClipboard#addElementsCopiedListener + */ + removeElementsCopiedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the ElementsPasted event that occurs when the {@link yfiles.graph.GraphClipboard#paste} operation + * finished successfully. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.graph.GraphClipboard#removeElementsPastedListener + */ + addElementsPastedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the ElementsPasted event that occurs when the {@link yfiles.graph.GraphClipboard#paste} operation + * finished successfully. + * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.graph.GraphClipboard#addElementsPastedListener + */ + removeElementsPastedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + export enum CloneTypes{ + /** + * Indicates the {@link yfiles.styles.INodeStyle} constant. + */ + NODE_STYLE, + /** + * Indicates the {@link yfiles.styles.IEdgeStyle} constant. + */ + EDGE_STYLE, + /** + * Indicates the {@link yfiles.styles.IPortStyle} constant. + */ + PORT_STYLE, + /** + * Indicates the {@link yfiles.styles.ILabelStyle} constant. + */ + LABEL_STYLE, + /** + * Indicates the {@link yfiles.graph.ILabelModelParameter} constant. + */ + LABEL_MODEL_PARAMETER, + /** + * Indicates the {@link yfiles.graph.IPortLocationModelParameter} constant. + */ + PORT_LOCATION_MODEL_PARAMETER, + /** + * Indicates the {@link yfiles.graph.ITagOwner#tag} constant. + */ + TAGS, + /** + * A combination of all flags in this enumeration. + */ + ALL + } + /** + * 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. + *

+ * @class yfiles.graph.GraphCopier + */ + export interface GraphCopier extends Object{} + export class GraphCopier { + constructor(); + /** + * 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 {yfiles.geometry.Point} offset The offset to apply to the copied bend. + * @param {number} index The index to add the bend at. + * @returns {yfiles.graph.IBend} The newly created bend. + * @protected + */ + addBend(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetEdge:yfiles.graph.IEdge,sourceBend:yfiles.graph.IBend,offset:yfiles.geometry.Point,index:number):yfiles.graph.IBend; + /** + * 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#copyLabelLayoutParameter}, {@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.ILabelOwner} targetOwner The item owner in the target graph to add the label to. + * @param {yfiles.graph.ILabel} sourceLabel The source label in the source graph. + * @returns {yfiles.graph.ILabel} The newly created label. + * @protected + */ + addLabel(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetOwner:yfiles.graph.ILabelOwner,sourceLabel:yfiles.graph.ILabel):yfiles.graph.ILabel; + /** + * 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#copyPortLocationParameter}, {@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} targetOwner The port owner in the target graph to add the port to. + * @param {yfiles.graph.IPort} sourcePort The source port in the source graph. + * @returns {yfiles.graph.IPort} The newly created port. + */ + addPort(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetOwner:yfiles.graph.IPortOwner,sourcePort:yfiles.graph.IPort):yfiles.graph.IPort; + /** + * 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. + *

+ * Type parameter T: The type of the item to cache. + * @param {T} original The original item. + * @param {T} copy The copy of the item. + * @see yfiles.graph.GraphCopier#getOrCreateCopy + * @protected + * @template T + */ + cacheCopy(original:T,copy:T):void; + /** + * 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. + *

+ * @protected + */ + clearCopyCache():void; + /** + * Copies a subgraph induced by a predicate from the sourceGraph to the targetGraph. + *

+ * For each element that has been copied, the elementCopiedCallback will be invoked. + *

+ * @param {yfiles.graph.IGraph} sourceGraph The graph to copy the elements from. + * @param {function(yfiles.graph.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} targetRootNode The group node that should act as the root node for the pasted elements. May be null if there is no such node. + * @param {yfiles.geometry.Point} offset The offset to apply to the copied items. Only nodes and bends will be offset explicitly, while other items will move + * implicitly. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} elementCopiedCallback A delegate to invoke for each element being copied. + * @throws {Stubs.Exceptions.ArgumentError} if targetRootNode is not in targetGraph + */ + copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,offset:yfiles.geometry.Point,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; + /** + * Copies a subgraph described by a predicate from the sourceGraph to the targetGraph. + *

+ * For each element that has been copied, the elementCopiedCallback will be invoked. This method actually delegates to {@link yfiles.graph.GraphCopier#copy} + * and provides the 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.graph.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.geometry.Point} offset The offset to apply to the copied items. Only nodes and bends will be offset explicitly, while other items will move + * implicitly. + * @param {function(yfiles.graph.IModelItem, yfiles.graph.IModelItem): void} elementCopiedCallback A delegate to invoke for each element being copied. + */ + copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.graph.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,offset:yfiles.geometry.Point,elementCopiedCallback:(original:yfiles.graph.IModelItem,copy:yfiles.graph.IModelItem)=>void):void; + /** + * Copies sourceGraph to targetGraph. + *

+ * This method actually delegates to {@link yfiles.graph.GraphCopier#copy} and provides the root as the "targetGraph" parameter if + * there is a hierarchy associated with targetGraph. + *

+ * @param {yfiles.graph.IGraph} sourceGraph The graph to copy. + * @param {yfiles.graph.IGraph} targetGraph The graph to copy to. + */ + copy(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):void; + /** + * 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. + * @returns {yfiles.graph.IEdge} The newly created edge. + * @protected + */ + copyEdge(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,sourceEdge:yfiles.graph.IEdge,targetSourcePort:yfiles.graph.IPort,targetTargetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Copies an {@link yfiles.styles.IEdgeStyle} instance. + *

+ * This implementation uses the {@link yfiles.lang.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. + * @returns {yfiles.styles.IEdgeStyle} The style to apply for the copy. + * @see yfiles.graph.GraphCopier#copy + */ + copyEdgeStyle(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):yfiles.styles.IEdgeStyle; + /** + * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of an {@link yfiles.graph.IEdge}. + *

+ * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + *

+ * @param {yfiles.graph.IEdge} edge The old edge. + * @param {Object} tag The tag to copy. + * @returns {Object} The copy of the tag. + * @protected + */ + copyEdgeTag(edge:yfiles.graph.IEdge,tag:Object):Object; + /** + * 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.IGraph} 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. + * @param {yfiles.geometry.Point} offset The offset to apply to the copied node. + * @returns {yfiles.graph.INode} The newly created node. + * @protected + */ + copyGroupNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,sourceGroupNode:yfiles.graph.INode,targetParent:yfiles.graph.INode,offset:yfiles.geometry.Point):yfiles.graph.INode; + /** + * Copies a {@link yfiles.graph.ILabelModelParameter} for a given label. + *

+ * This implementation uses the {@link yfiles.lang.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. + * @returns {yfiles.graph.ILabelModelParameter} The copy of the parameter to apply for the copy. + * @see yfiles.graph.GraphCopier#copy + */ + copyLabelLayoutParameter(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; + /** + * Copies an {@link yfiles.styles.ILabelStyle} instance. + *

+ * This implementation uses the {@link yfiles.lang.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. + * @returns {yfiles.styles.ILabelStyle} The style to apply for the copy. + * @see yfiles.graph.GraphCopier#copy + */ + copyLabelStyle(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.styles.ILabelStyle; + /** + * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of a {@link yfiles.graph.ILabel}. + *

+ * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + *

+ * @param {yfiles.graph.ILabel} label The old label. + * @param {Object} tag The tag to copy. + * @returns {Object} The copy of the tag. + */ + copyLabelTag(label:yfiles.graph.ILabel,tag:Object):Object; + /** + * Callback method that creates a copy of the node 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} targetParent The parent of the group node in the target graph. + * @param {yfiles.graph.INode} node The source node to create a copy of in the targetGraph. + * @param {yfiles.geometry.Point} offset The offset to apply to the copied node. + * @returns {yfiles.graph.INode} The newly created node. + * @protected + */ + copyNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,node:yfiles.graph.INode,targetParent:yfiles.graph.INode,offset:yfiles.geometry.Point):yfiles.graph.INode; + /** + * Callback method that creates a copy of the node 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} node The source node to create a copy of in the targetGraph. + * @param {yfiles.geometry.Point} offset The offset to apply to the copied node. + * @returns {yfiles.graph.INode} The newly created node. + * @protected + */ + copyNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,node:yfiles.graph.INode,offset:yfiles.geometry.Point):yfiles.graph.INode; + /** + * Copies an {@link yfiles.styles.INodeStyle} instance. + *

+ * This implementation uses the {@link yfiles.lang.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. + * @returns {yfiles.styles.INodeStyle} The style to apply for the copy. + * @see yfiles.graph.GraphCopier#copy + */ + copyNodeStyle(graph:yfiles.graph.IGraph,node:yfiles.graph.INode):yfiles.styles.INodeStyle; + /** + * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of a {@link yfiles.graph.INode}. + *

+ * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + *

+ * @param {yfiles.graph.INode} node The old node. + * @param {Object} tag The tag to copy. + * @returns {Object} The copy of the tag. + * @protected + */ + copyNodeTag(node:yfiles.graph.INode,tag:Object):Object; + /** + * Copies a {@link yfiles.graph.IPortLocationModelParameter} for a given port. + *

+ * This implementation uses the {@link yfiles.lang.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. + * @returns {yfiles.graph.IPortLocationModelParameter} The copy of the parameter to apply for the copy. + * @see yfiles.graph.GraphCopier#copy + */ + copyPortLocationParameter(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):yfiles.graph.IPortLocationModelParameter; + /** + * Copies an {@link yfiles.styles.IPortStyle} instance. + *

+ * This implementation uses the {@link yfiles.lang.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. + * @returns {yfiles.styles.IPortStyle} The style to apply for the copy. + * @see yfiles.graph.GraphCopier#copy + */ + copyPortStyle(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):yfiles.styles.IPortStyle; + /** + * Callback that copies the {@link yfiles.graph.ITagOwner#tag} of a {@link yfiles.graph.IPort}. + *

+ * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + *

+ * @param {yfiles.graph.IPort} port The old port. + * @param {Object} tag The tag to copy. + * @returns {Object} The copy of the tag. + * @protected + */ + copyPortTag(port:yfiles.graph.IPort,tag:Object):Object; + /** + * Callback that will copy a {@link yfiles.graph.ITagOwner#tag} for the target graph. + *

+ * This implementation will try to {@link yfiles.lang.ICloneable#clone} the tag if the {@link yfiles.graph.GraphCopier#clone} property has the {@link yfiles.graph.CloneTypes#TAGS} + * flag set. If this is not the case or the tag is not {@link yfiles.lang.ICloneable}, the instance will be returned. + *

+ * @param {yfiles.graph.IModelItem} owner The old owner of the tag. + * @param {Object} tag The tag to copy. + * @returns {Object} A copy of the tag. + */ + copyTag(owner:yfiles.graph.IModelItem,tag:Object):Object; + /** + * 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}. In order to indicate + * that no copy is available, this implementation yields {@link yfiles.graph.GraphCopier#NO_COPY}. In contrast, null is a valid + * return value that is the copied value of the original. + *

+ * Type parameter T: The type of the item to copy. + * @param {yfiles.lang.Class} itemType The type of the item to copy. + * @param {T} original The original item. + * @returns {T} The copy of original or {@link yfiles.graph.GraphCopier#NO_COPY} if no copy has been found. + * @see yfiles.graph.GraphCopier#cacheCopy + * @see yfiles.graph.GraphCopier#getOrCreateCopy + * @protected + * @template T + */ + getCopy(itemType:yfiles.lang.Class,original:T):T; + /** + * 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}. + *

+ * Type parameter T: The type of the item to copy. + * @param {yfiles.lang.Class} tType The type of the item to copy. + * @param {T} original The original item. + * @param {function(T): T} copyDelegate The copy delegate to create the copy. + * @returns {T} A copy of the original, either cached, or newly created and then cached. + * @template T + */ + getOrCreateCopy(tType:yfiles.lang.Class,original:T,copyDelegate:(arg:T)=>T):T; + /** + * 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. + * @protected + */ + onEdgeCopied(original:yfiles.graph.IEdge,copy:yfiles.graph.IEdge):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. + * @protected + */ + onGraphCopied(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):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 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. + * @protected + */ + onNodeCopied(original:yfiles.graph.INode,copy:yfiles.graph.INode):void; + /** + * Emits the {@link yfiles.graph.GraphCopier#addObjectCopiedListener ObjectCopied} event. + * @param {yfiles.graph.ItemCopiedEventArgs.} evt The argument to use. + * @protected + */ + onObjectCopied(evt:yfiles.graph.ItemCopiedEventArgs):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; + /** + * Gets or sets the types of items that should be {@link yfiles.lang.ICloneable#clone cloned} for the copy operation. + * @type {yfiles.graph.CloneTypes} + */ + clone:yfiles.graph.CloneTypes; + /** + * 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. + *

+ * @see yfiles.graph.GraphCopier#getOrCreateCopy + * @type {yfiles.graph.CloneTypes} + */ + referentialIdentityTypes:yfiles.graph.CloneTypes; + /** + * The sentinel return value for use in {@link yfiles.graph.GraphCopier#getCopy}. + * @returns This value is used as a place-holder to indicate that no copy has been stored previously. + * @protected + * @const + * @static + * @type {Object} + */ + static NO_COPY:Object; + /** + * Gets or sets a property that determines whether grouping information should be copied to target graphs. + *

+ * With this property set to false the {@link yfiles.graph.GraphCopier} can be used to flatten a grouped graph, i.e. remove the + * grouping information. + *

+ *

+ * The default is true. + *

+ * @type {boolean} + */ + copyGrouping:boolean; + /** + * Gets or sets a property that determines whether {@link yfiles.graph.FoldingManager additional folding 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#getFolderNodeState folding state} + * of the nodes and edges will be copied. The default is true. + *

+ * @type {boolean} + */ + copyFoldingStates:boolean; + /** + * Adds the given listener for the NodeCopied event that occurs after a node has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removeNodeCopiedListener + */ + addNodeCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the NodeCopied event that occurs after a node has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addNodeCopiedListener + */ + removeNodeCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Adds the given listener for the BendCopied event that occurs after a bend has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ *

+ * For {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edge} bends, their view state representation is passed. These elements are neither part of the {@link yfiles.graph.FoldingManager#masterGraph} nor the + * {@link yfiles.graph.FoldingManager#views view graph}. + *

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removeBendCopiedListener + */ + addBendCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the BendCopied event that occurs after a bend has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ *

+ * For {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edge} bends, their view state representation is passed. These elements are neither part of the {@link yfiles.graph.FoldingManager#masterGraph} nor the + * {@link yfiles.graph.FoldingManager#views view graph}. + *

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addBendCopiedListener + */ + removeBendCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Adds the given listener for the ObjectCopied event that occurs 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#copyLabelLayoutParameter labels}, and {@link yfiles.graph.GraphCopier#copyPortLocationParameter 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. + *

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removeObjectCopiedListener + */ + addObjectCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the ObjectCopied event that occurs 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#copyLabelLayoutParameter labels}, and {@link yfiles.graph.GraphCopier#copyPortLocationParameter 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. + *

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addObjectCopiedListener + */ + removeObjectCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Adds the given listener for the EdgeCopied event that occurs after an edge has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removeEdgeCopiedListener + */ + addEdgeCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeCopied event that occurs after an edge has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addEdgeCopiedListener + */ + removeEdgeCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Adds the given listener for the PortCopied event that occurs after a port has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removePortCopiedListener + */ + addPortCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the PortCopied event that occurs after a port has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addPortCopiedListener + */ + removePortCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Adds the given listener for the LabelCopied event that occurs after a label has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removeLabelCopiedListener + */ + addLabelCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the LabelCopied event that occurs after a label has been copied. + *

+ * This event is dispatched after the element copied callback 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original original} item is a master item, i.e. it belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + *

+ *

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

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addLabelCopiedListener + */ + removeLabelCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Adds the given listener for the GraphCopied event that occurs after the entire graph has been copied. + *

+ * This event is dispatched at the end of the {@link yfiles.graph.GraphCopier#copy} 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original source graph} item is the {@link yfiles.graph.FoldingManager#masterGraph master graph} of the folding view. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.GraphCopier#removeGraphCopiedListener + */ + addGraphCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + /** + * Removes the given listener for the GraphCopied event that occurs after the entire graph has been copied. + *

+ * This event is dispatched at the end of the {@link yfiles.graph.GraphCopier#copy} 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 folding view + * graph the {@link yfiles.graph.ItemCopiedEventArgs.#original source graph} item is the {@link yfiles.graph.FoldingManager#masterGraph master graph} of the folding view. + *

+ *

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

+ * @param {function(Object, yfiles.graph.ItemCopiedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.GraphCopier#addGraphCopiedListener + */ + removeGraphCopiedListener(listener:(sender:Object,evt:yfiles.graph.ItemCopiedEventArgs)=>void):void; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * Type parameter T: The logical base type of the copied item. + * @class yfiles.graph.ItemCopiedEventArgs. + * @extends {yfiles.lang.EventArgs} + * @template T + */ + export interface ItemCopiedEventArgs extends yfiles.lang.EventArgs{} + export class ItemCopiedEventArgs { + /** + * 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}. + * @constructor + */ + constructor(original:T,copy:T); + /** + * The original of the {@link yfiles.graph.ItemCopiedEventArgs.#copy copied item}. + * @type {T} + */ + original:T; + /** + * The copied item. + * @type {T} + */ + copy:T; + static $class:yfiles.lang.Class; + } + /** + * Helper class that can be used to aid in decorating {@link yfiles.graph.IModelItem}s from an {@link yfiles.graph.IGraph} instance. + *

+ * This class servers as a factory for lookup decorators for the various items that make up an {@link yfiles.graph.IGraph}. This is + * a convenience class that obtains the {@link yfiles.graph.ILookupDecorator} from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} + * and passes that to the various specialized decorator convenience classes like e.g. {@link yfiles.graph.NodeDecorator}. + *

+ * @see yfiles.graph.GraphDecorator#nodeDecorator + * @see yfiles.graph.NodeDecorator + * @see yfiles.graph.GraphDecorator#edgeDecorator + * @see yfiles.graph.EdgeDecorator + * @see yfiles.graph.GraphDecorator#labelDecorator + * @see yfiles.graph.LabelDecorator + * @see yfiles.graph.GraphDecorator#portDecorator + * @see yfiles.graph.PortDecorator + * @see yfiles.graph.GraphDecorator#bendDecorator + * @see yfiles.graph.BendDecorator + * @class yfiles.graph.GraphDecorator + * @final + */ + export interface GraphDecorator extends Object{} + export class GraphDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.GraphDecorator} class. + * @param {yfiles.graph.IGraph} graph The graph. + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * 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.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.NodeDecorator} + *

+ * @type {yfiles.graph.NodeDecorator} + */ + 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.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.EdgeDecorator} + *

+ * @type {yfiles.graph.EdgeDecorator} + */ + 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.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.LabelDecorator} + *

+ * @type {yfiles.graph.LabelDecorator} + */ + 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.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.PortDecorator} + *

+ * @type {yfiles.graph.PortDecorator} + */ + 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.graph.ILookupDecorator} instance from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.BendDecorator} + *

+ * @type {yfiles.graph.BendDecorator} + */ + bendDecorator:yfiles.graph.BendDecorator; + static $class:yfiles.lang.Class; + } + /** + * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.ILabel} instances that + * are contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. + *

+ * This decorator can be used to conveniently {@link yfiles.graph.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 yfiles.graph.GraphDecorator + * @see yfiles.graph.LookupDecorator. + * @class yfiles.graph.LabelDecorator + * @final + */ + export interface LabelDecorator extends Object{} + export class LabelDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDecorator} class. + * @param {yfiles.graph.ILookupDecorator} decorator The decorator to use, which can be null. + * @constructor + */ + constructor(decorator:yfiles.graph.ILookupDecorator); + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.ILabel}s that can be used to decorate TInterface types of the labels. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {yfiles.lang.Class} type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.ILabel}s that can be used to decorate TInterface types of the labels. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {Object} options The parameters to pass. + * @param {yfiles.lang.Class} options.type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(options:{type: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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + clipboardHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.input.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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + marqueeTestableDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to + * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + mementoSupportDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is + * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + selectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item + * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the + * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + highlightDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is + * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.view.GraphComponent}. 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + handleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} + * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of + * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is + * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @see yfiles.view.GraphObstacleProvider + * @see yfiles.view.BridgeManager + * @type {yfiles.graph.LookupDecorator.} + */ + obstacleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * 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.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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 {@link yfiles.input.GraphEditorInputMode} 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.graph.ILookupDecorator} that is + * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.view.GraphComponent}. This interface is mainly used by the {@link yfiles.input.LabelPositionHandler} and {@link yfiles.input.MoveLabelInputMode} + * in the {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + labelSnapContextHelperDecorator:yfiles.graph.LookupDecorator; + static $class:yfiles.lang.Class; + } + /** + * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IEdge} instances that are + * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. + *

+ * This decorator can be used to conveniently {@link yfiles.graph.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 yfiles.graph.GraphDecorator + * @see yfiles.graph.LookupDecorator. + * @class yfiles.graph.EdgeDecorator + * @final + */ + export interface EdgeDecorator extends Object{} + export class EdgeDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeDecorator} class. + * @param {yfiles.graph.ILookupDecorator} decorator The decorator to use, which can be null. + * @constructor + */ + constructor(decorator:yfiles.graph.ILookupDecorator); + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IEdge}s that can be used to decorate TInterface types of the edges. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {yfiles.lang.Class} type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IEdge}s that can be used to decorate TInterface types of the edges. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {Object} options The parameters to pass. + * @param {yfiles.lang.Class} options.type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} type for the + * {@link yfiles.graph.IEdge}s of the graph this instance has been created for. + *

+ * Custom {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} 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#setEdgePorts change the ports} of an {@link yfiles.graph.IEdge} in a {@link yfiles.view.GraphComponent}. This interface is + * mainly used by the {@link yfiles.input.PortRelocationHandle}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + edgeReconnectionPortCandidateProviderDecorator: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#allowEdgeToEdgeConnections} is + * enabled. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by + * the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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#setEdgePorts} + * 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @see yfiles.input.PortRelocationHandle + * @see yfiles.input.IHandle + * @see yfiles.input.IHandleProvider + * @see yfiles.input.OrthogonalEdgeEditingContext + * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + snapLineProviderDecorator: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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + clipboardHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.input.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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + marqueeTestableDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to + * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + mementoSupportDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is + * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + selectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item + * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the + * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + highlightDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is + * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.view.GraphComponent}. 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + handleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} + * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of + * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is + * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @see yfiles.view.GraphObstacleProvider + * @see yfiles.view.BridgeManager + * @type {yfiles.graph.LookupDecorator.} + */ + obstacleProviderDecorator:yfiles.graph.LookupDecorator; + static $class:yfiles.lang.Class; + } + /** + * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IBend} instances that are + * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. + *

+ * This decorator can be used to conveniently {@link yfiles.graph.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 yfiles.graph.GraphDecorator + * @see yfiles.graph.LookupDecorator. + * @class yfiles.graph.BendDecorator + * @final + */ + export interface BendDecorator extends Object{} + export class BendDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.BendDecorator} class. + * @param {yfiles.graph.ILookupDecorator} decorator The decorator to use, which can be null. + * @constructor + */ + constructor(decorator:yfiles.graph.ILookupDecorator); + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IBend}s that can be used to decorate TInterface types of the bends. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {yfiles.lang.Class} type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IBend}s that can be used to decorate TInterface types of the bends. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {Object} options The parameters to pass. + * @param {yfiles.lang.Class} options.type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; + /** + * 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.view.GraphComponent}. 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + bendSnapResultProviderDecorator: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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + clipboardHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.input.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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + marqueeTestableDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to + * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + mementoSupportDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is + * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + selectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item + * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the + * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + highlightDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is + * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.view.GraphComponent}. 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + handleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} + * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of + * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is + * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @see yfiles.view.GraphObstacleProvider + * @see yfiles.view.BridgeManager + * @type {yfiles.graph.LookupDecorator.} + */ + obstacleProviderDecorator:yfiles.graph.LookupDecorator; + static $class:yfiles.lang.Class; + } + /** + * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.IPort} instances that are + * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. + *

+ * This decorator can be used to conveniently {@link yfiles.graph.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. 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 yfiles.graph.GraphDecorator + * @see yfiles.graph.LookupDecorator. + * @class yfiles.graph.PortDecorator + * @final + */ + export interface PortDecorator extends Object{} + export class PortDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.PortDecorator} class. + * @param {yfiles.graph.ILookupDecorator} decorator The decorator to use, which can be null. + * @constructor + */ + constructor(decorator:yfiles.graph.ILookupDecorator); + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IPort}s that can be used to decorate TInterface types of the ports. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {yfiles.lang.Class} type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.IPort}s that can be used to decorate TInterface types of the ports. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {Object} options The parameters to pass. + * @param {yfiles.lang.Class} options.type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; + /** + * 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.view.GraphComponent}. 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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + handleDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.styles.IEdgePathCropper} type for the + * {@link yfiles.graph.IPort}s of the graph this instance has been created for. + *

+ * Custom {@link yfiles.styles.IEdgePathCropper} implementations can be used to change the way the path of {@link yfiles.styles.PathBasedEdgeStyleRenderer.} implementations + * calculate the {@link yfiles.geometry.GeneralPath} of the visual representation of an {@link yfiles.graph.IEdge} in a + * {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.styles.PathBasedEdgeStyleRenderer.} 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + edgePathCropperDecorator: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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + portSnapResultProviderDecorator: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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + clipboardHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.input.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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + marqueeTestableDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to + * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + mementoSupportDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is + * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + selectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item + * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the + * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + highlightDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is + * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.view.GraphComponent}. 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + handleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} + * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of + * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is + * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @see yfiles.view.GraphObstacleProvider + * @see yfiles.view.BridgeManager + * @type {yfiles.graph.LookupDecorator.} + */ + obstacleProviderDecorator:yfiles.graph.LookupDecorator; + static $class:yfiles.lang.Class; + } + /** + * A utility class that helps in {@link yfiles.graph.ILookupDecorator#addLookup decorating} the {@link yfiles.graph.ILookup#lookup} method of {@link yfiles.graph.INode} instances that are + * contained in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.graph.ILookupDecorator}. + *

+ * This decorator can be used to conveniently {@link yfiles.graph.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 yfiles.graph.GraphDecorator + * @see yfiles.graph.LookupDecorator. + * @class yfiles.graph.NodeDecorator + * @final + */ + export interface NodeDecorator extends Object{} + export class NodeDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.NodeDecorator} class. + * @param {yfiles.graph.ILookupDecorator} decorator The decorator to use, which can be null. + * @constructor + */ + constructor(decorator:yfiles.graph.ILookupDecorator); + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.INode}s that can be used to decorate TInterface types of the nodes. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {yfiles.lang.Class} type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean):yfiles.graph.LookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator.} for {@link yfiles.graph.INode}s that can be used to decorate TInterface types of the nodes. + * Type parameter TInterface: The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {Object} options The parameters to pass. + * @param {yfiles.lang.Class} options.type The type of the interface that should be decorated of the instances' {@link yfiles.graph.ILookup#lookup}. + * @param {boolean} [options.decorateNulls=true] if set to true null values will be decorated, otherwise not. + * @param {boolean} [options.nullIsFallback=false] if set to true null values will be treated as fallback values, otherwise they will be used as the final result. + * @returns {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator.} for the specified interface. + * @template TInterface + */ + getDecoratorFor(options:{type:yfiles.lang.Class,decorateNulls?:boolean,nullIsFallback?:boolean}):yfiles.graph.LookupDecorator; + /** + * 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + editLabelHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.styles.IShapeGeometry} type for the type + * {@link yfiles.graph.INode}s this instance has been created for. + *

+ * Custom {@link yfiles.styles.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.styles.DefaultEdgePathCropper}, and a custom {@link yfiles.input.IPortCandidateProvider} + * that can be obtained from {@link yfiles.input.IPortCandidateProvider#fromShapeGeometry}. Note that decorating the {@link yfiles.styles.IShapeGeometry} + * for an {@link yfiles.graph.INode} will not change the result of a call to {@link yfiles.styles.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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + shapeGeometryDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.INodeSizeConstraintProvider} type for the type + * {@link yfiles.graph.INode}s this instance has been created for. + *

+ * Custom {@link yfiles.input.INodeSizeConstraintProvider} 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + sizeConstraintProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IGroupBoundsCalculator} type for the + * {@link yfiles.graph.INode}s this instance has been created for. + *

+ * Custom {@link yfiles.graph.IGroupBoundsCalculator} implementations can be used to change the way the bounds of group nodes are + * being calculated if the geometry of child nodes is changed by the user. This is a convenient alternative to the direct + * usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + groupBoundsCalculatorDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.INodeInsetsProvider} (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.input.INodeInsetsProvider} implementations can be used to change the way the bounds of group nodes are + * being calculated if the geometry of child nodes is changed by the user. This interface will be used if there is no + * custom {@link yfiles.graph.IGroupBoundsCalculator} associated with the nodes (see {@link yfiles.graph.NodeDecorator#groupBoundsCalculatorDecorator}). This is a convenient alternative to the + * direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. Note that many {@link yfiles.styles.INodeStyle} implementations provide an Insets property whose + * value will be reported by a {@link yfiles.input.INodeInsetsProvider} implementation that is provided by the corresponding + * {@link yfiles.styles.INodeStyleRenderer}. Using this property instead of decorating the lookup of the {@link yfiles.graph.INode} is thus + * often simpler. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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 the + * default implementation of {@link yfiles.input.IEdgeReconnectionPortCandidateProvider} 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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} that is provided + * by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + nodeReshapeSnapResultProviderDecorator: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.graph.ILookupDecorator} that is provided by the {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + clipboardHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.input.IMarqueeTestable} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.input.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.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + marqueeTestableDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.graph.IMementoSupport} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.graph.IMementoSupport} implementations can be used to make the {@link yfiles.graph.UndoEngine} aware of changes to + * data that is associated with the model items. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + mementoSupportDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.ISelectionIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.ISelectionIndicatorInstaller} implementations can be used change the way the selection of an item is + * represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.SelectionIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + selectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IHighlightIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IHighlightIndicatorInstaller} implementations can be used change the way the highlighting of an item + * is represented in a {@link yfiles.view.CanvasComponent}. This interface is mainly used by the {@link yfiles.view.HighlightIndicatorManager.} in the + * {@link yfiles.view.GraphComponent}. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + highlightDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IFocusIndicatorInstaller} type for the type of items this instance has been + * created for. + *

+ * Custom {@link yfiles.view.IFocusIndicatorInstaller} implementations can be used change the way the focus of an item is + * represented in a {@link yfiles.view.GraphComponent}. This interface is mainly used by the {@link yfiles.view.FocusIndicatorManager.} in the {@link yfiles.view.GraphComponent}. + * This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is provided by the + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + 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.view.GraphComponent}. 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.graph.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @type {yfiles.graph.LookupDecorator.} + */ + handleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator.} that decorates the {@link yfiles.view.IObstacleProvider} type for the type of items this instance has been created for. + *

+ * Custom {@link yfiles.view.IObstacleProvider} implementations provide information about obstacles that will be considered by {@link yfiles.view.GraphObstacleProvider} + * which itself serves as a provider for geometric obstacles to {@link yfiles.view.BridgeManager} that manages the rendering of + * bridges in edge paths. This is a convenient alternative to the direct usage of the {@link yfiles.graph.ILookupDecorator} that is + * provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup#lookup}. + *

+ * @see yfiles.view.GraphObstacleProvider + * @see yfiles.view.BridgeManager + * @type {yfiles.graph.LookupDecorator.} + */ + obstacleProviderDecorator:yfiles.graph.LookupDecorator; + static $class:yfiles.lang.Class; + } + /** + * A convenience class that simplifies using an {@link yfiles.graph.ILookupDecorator}. + *

+ * This class provides convenience methods that help in performing common tasks related to decorating the {@link yfiles.graph.ILookup#lookup} + * method for a certain TDecoratedType. + *

+ * Type parameter TDecoratedType: The type of the instances whose {@link yfiles.graph.ILookup#lookup} behavior should be modified. + * Type parameter TInterface: The interface or type that clients will use during the {@link yfiles.graph.ILookup#lookup} call. Note that this is normally an + * interface and not the implementation of the interface since client code will use the interface for the query. + * @see yfiles.graph.ILookup + * @see yfiles.graph.GraphDecorator + * @class yfiles.graph.LookupDecorator. + * @template TDecoratedType,TInterface + * @final + */ + export interface LookupDecorator extends Object{} + export class LookupDecorator { + /** + * Initializes a new instance of the {@link yfiles.graph.LookupDecorator.} class. + * @param {yfiles.lang.Class} decoratedType The type of the instances whose {@link yfiles.graph.ILookup#lookup} behavior should be modified. + * @param {yfiles.lang.Class} interfaceType The interface or type that clients will use during the {@link yfiles.graph.ILookup#lookup} call. Note that this is normally an + * interface and not the implementation of the interface since client code will use the interface for the query. + * @param {yfiles.graph.ILookupDecorator} decorator The decorator instance that will be used to {@link yfiles.graph.ILookupDecorator#addLookup extend the Lookup mechanism}. + * @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. + * @constructor + */ + constructor(decoratedType:yfiles.lang.Class,interfaceType:yfiles.lang.Class,decorator:yfiles.graph.ILookupDecorator,decorateNulls:boolean,nullIsFallback:boolean); + /** + * Simple helper method that tries to add the provided chain link to the {@link yfiles.graph.LookupDecorator.#decorator}. + * @param {yfiles.graph.IContextLookupChainLink} lookup The link to add. + * @returns {yfiles.graph.IContextLookupChainLink} The lookup that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if the decoration was unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + addChainLink(lookup:yfiles.graph.IContextLookupChainLink):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all TDecoratedType items matching a predicate to return null if TInterface is queried during the + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to temporarily or permanently disable a certain behavior for all items. To do this only for items + * matching a predicate, use {@link yfiles.graph.LookupDecorator.#hideImplementation} instead. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @param {function(TDecoratedType): boolean} [predicate=null] The predicate that determines for which items the implementation shall be hidden. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + hideImplementation(predicate?:(obj:TDecoratedType)=>boolean):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for items matching a predicate with a factory that creates a TInterface instance if TInterface is queried during the + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of all items matching a certain predicate where the returned instance either + * depends on the item or uses it in some way. + *

+ *

+ * To adjust the lookup of all items in this manner, use {@link yfiles.graph.LookupDecorator.#setFactory} instead. To adjust the lookup of a single item, use + * {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#nullIsFallback} property a null return value from the factory will be either returned directly, + * or interpreted as a hint to return a fallback value which is obtained by querying the remainder of the lookup chain. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @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. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + * @see yfiles.graph.LookupDecorator.#nullIsFallback + */ + setFactory(predicate:(obj:TDecoratedType)=>boolean,factory:(arg:TDecoratedType)=>TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all TDecoratedType items, so that factory is used to create a TInterface instance if TInterface is queried during the + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of all items where the returned instance either depends on the item or uses it in + * some way. + *

+ *

+ * To only adjust the lookup of items matching a predicate in this manner, use {@link yfiles.graph.LookupDecorator.#setFactory} instead. To adjust the lookup of + * a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#nullIsFallback} property a null return value from the factory will be either returned directly, + * or interpreted as a hint to return a fallback value which is obtained by querying the remainder of the lookup chain. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @param {function(TDecoratedType): TInterface} factory The factory that is queried to create the result. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + * @see yfiles.graph.LookupDecorator.#nullIsFallback + */ + setFactory(factory:(arg:TDecoratedType)=>TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all items matching a predicate with a fixed TInterface implementation if TInterface is queried on an item's + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of all items matching a certain predicate in the same way. + *

+ *

+ * To adjust the lookup of only a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation} instead. To adjust the lookup of all items, use + * {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @param {function(TDecoratedType): boolean} predicate A predicate that determines which items are affected. + * @param {TInterface} implementation The implementation to return if the predicate matches and TInterface is queried. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + setImplementation(predicate:(obj:TDecoratedType)=>boolean,implementation:TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for a single item with a fixed TInterface implementation if TInterface is queried on the item's + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of a single item only. + *

+ *

+ * To adjust the lookup of all items matching a predicate, use {@link yfiles.graph.LookupDecorator.#setImplementation} instead. To adjust the lookup of all + * items, use {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @param {TDecoratedType} item The item for which the implementation shall be returned. + * @param {TInterface} implementation The implementation to return if item is queried for TInterface. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + setImplementation(item:TDecoratedType,implementation:TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain}, so that implementation is always returned if TInterface is queried on an item's + * {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of all items in the same way. + *

+ *

+ * To adjust the lookup of only a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation} instead. To adjust the lookup of all items matching a + * certain predicate, use {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @param {TInterface} implementation The implementation to return unconditionally. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + setImplementation(implementation:TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all items matching a predicate with a factory callback that wraps the underlying + * implementation if TInterface is queried during the {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of all items matching a certain predicate where the factory implementation may + * delegate to the wrapped implementation in certain cases. + *

+ *

+ * To adjust the lookup for all items in this manner, use {@link yfiles.graph.LookupDecorator.#setImplementationWrapper} instead. To adjust the lookup of a + * single item, use {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#decorateNulls} property, the factory will not not be called to decorate null results. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @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. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + setImplementationWrapper(predicate:(obj:TDecoratedType)=>boolean,factory:(arg1:TDecoratedType,arg2:TInterface)=>TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Amends the {@link yfiles.graph.IContextLookupChainLink lookup chain} for all items with a factory callback that wraps the underlying implementation if TInterface is queried + * during the {@link yfiles.graph.ILookup#lookup}. + *

+ * This can be used to modify the lookup of all items matching where the factory implementation may delegate to the wrapped + * implementation in certain cases. + *

+ *

+ * To adjust the lookup in this manner only for items matching a predicate, use {@link yfiles.graph.LookupDecorator.#setImplementationWrapper} instead. To + * adjust the lookup of a single item, use {@link yfiles.graph.LookupDecorator.#setImplementation}. + *

+ *

+ * Note that depending on the value of the {@link yfiles.graph.LookupDecorator.#decorateNulls} property, the factory will not not be called to decorate null results. + *

+ *

+ * The effects of this method call can be undone by passing the return value to + * {@link yfiles.graph.ILookupDecorator#removeLookup}. + *

+ * @param {function(TDecoratedType, TInterface): TInterface} factory The factory that will be passed the underlying implementation and that is queried to create the result. + * @returns {yfiles.graph.IContextLookupChainLink} An {@link yfiles.graph.IContextLookupChainLink} that has been {@link yfiles.graph.ILookupDecorator#addLookup added} to the {@link yfiles.graph.LookupDecorator.#decorator} as a result of this call, or null if decoration was + * unsuccessful. + * @see yfiles.graph.ILookupDecorator#addLookup + */ + setImplementationWrapper(factory:(arg1:TDecoratedType,arg2:TInterface)=>TInterface):yfiles.graph.IContextLookupChainLink; + /** + * Gets the {@link yfiles.graph.ILookupDecorator} instance that is used. + *

+ * This can be null. In this case all methods of this class do nothing. + *

+ * @type {yfiles.graph.ILookupDecorator} + */ + decorator:yfiles.graph.ILookupDecorator; + /** + * Gets or sets a value indicating whether wrapping implementations will wrap null values from the rest of the lookup chain + * or those values will simply be returned instead. + *

+ * If this is true, then the {@link yfiles.graph.LookupDecorator.#setImplementationWrapper SetImplementationWrapper} methods will not wrap null values from the rest of the lookup chain + * and the result of the call to {@link yfiles.graph.ILookup#lookup} will simply be null. If this is false, the wrapper will get null + * as the implementation to wrap and should handle this accordingly. + *

+ * @type {boolean} + */ + decorateNulls:boolean; + /** + * Gets or sets a value indicating whether a null result value of the methods {@link yfiles.graph.LookupDecorator.#setImplementation} and {@link yfiles.graph.LookupDecorator.#setFactory} should be + * interpreted as taking the fallback value, or actually return null. + *

+ * If this is true, then null values returned from the implementation or factory set with {@link yfiles.graph.LookupDecorator.#setImplementation} or {@link yfiles.graph.LookupDecorator.#setFactory} + * are not returned, but rather interpreted as a hint to query the rest of the lookup chain. If this is false, then null + * values are returned as is. + *

+ * @type {boolean} + */ + nullIsFallback:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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.GraphWrapperBase#dispose} should be called if this + * instance is not used any more. + *

+ * @class yfiles.graph.GraphWrapperBase + * @implements {yfiles.graph.IGraph} + */ + export interface GraphWrapperBase extends Object,yfiles.graph.IGraph{} + export class GraphWrapperBase { + /** + * Creates a new instance that wraps a given {@link yfiles.graph.IGraph}. + *

+ * Note that this instance will {@link yfiles.graph.GraphWrapperBase#addEventHandlers register listeners} with the graph, so {@link yfiles.graph.GraphWrapperBase#dispose} should be + * called if this instance is not used any more. + *

+ * @param {yfiles.graph.IGraph} graph The graph to wrap. + * @protected + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.geometry.Point} location + * @param {number} [index=-1] + * @returns {yfiles.graph.IBend} + */ + addBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point,index?:number):yfiles.graph.IBend; + /** + * 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 + * @protected + */ + addEventHandlers(graph:yfiles.graph.IGraph):void; + /** + * + * @param {yfiles.graph.ILabelOwner} owner + * @param {string} text + * @param {yfiles.graph.ILabelModelParameter} [layoutParameter=null] + * @param {yfiles.styles.ILabelStyle} [style=null] + * @param {yfiles.geometry.Size} [preferredSize=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.ILabel} + */ + addLabel(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object):yfiles.graph.ILabel; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.ILabelOwner} options.owner + * @param {string} options.text + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] + * @param {yfiles.styles.ILabelStyle} [options.style=null] + * @param {yfiles.geometry.Size} [options.preferredSize=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.ILabel} + */ + addLabel(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @param {yfiles.graph.IPortLocationModelParameter} [locationParameter=null] + * @param {yfiles.styles.IPortStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.IPort} + */ + addPort(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object):yfiles.graph.IPort; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPortOwner} options.owner + * @param {yfiles.graph.IPortLocationModelParameter} [options.locationParameter=null] + * @param {yfiles.styles.IPortStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.IPort} + */ + addPort(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; + /** + * + * @param {yfiles.graph.IModelItem} item + * @returns {boolean} + */ + contains(item:yfiles.graph.IModelItem):boolean; + /** + * + * @param {yfiles.graph.INode} source + * @param {yfiles.graph.INode} target + * @param {yfiles.styles.IEdgeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.IEdge} + */ + createEdge(source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object):yfiles.graph.IEdge; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} options.source + * @param {yfiles.graph.INode} options.target + * @param {yfiles.styles.IEdgeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.IEdge} + */ + createEdge(options:{source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; + /** + * + * @param {yfiles.graph.IPort} sourcePort + * @param {yfiles.graph.IPort} targetPort + * @param {yfiles.styles.IEdgeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.IEdge} + */ + createEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object):yfiles.graph.IEdge; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPort} options.sourcePort + * @param {yfiles.graph.IPort} options.targetPort + * @param {yfiles.styles.IEdgeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.IEdge} + */ + createEdge(options:{sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object}):yfiles.graph.IEdge; + /** + * + * @param {yfiles.graph.INode} [parent=null] + * @param {yfiles.geometry.Rect} [layout=null] + * @param {yfiles.styles.INodeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.INode} + */ + createGroupNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] + * @param {yfiles.geometry.Rect} [options.layout=null] + * @param {yfiles.styles.INodeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.INode} + */ + createGroupNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * + * @param {yfiles.geometry.Rect} layout + * @param {yfiles.styles.INodeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.Rect} options.layout + * @param {yfiles.styles.INodeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(options:{layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * + * @param {yfiles.graph.INode} [parent=null] + * @param {yfiles.geometry.Rect} [layout=null] + * @param {yfiles.styles.INodeStyle} [style=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] + * @param {yfiles.geometry.Rect} [options.layout=null] + * @param {yfiles.styles.INodeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.INode} + */ + createNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * Clears the internal state of this instance and released memory and bound listeners. + *

+ * After this instance has been disposed of, it will not work as expected anymore. This implementation {@link yfiles.graph.GraphWrapperBase#removeEventHandlers removes all event handlers} + * from the {@link yfiles.graph.GraphWrapperBase#wrappedGraph} and releases the reference. + *

+ */ + dispose():void; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @param {yfiles.graph.AdjacencyTypes} [type=3] + * @returns {yfiles.collections.IListEnumerable.} + */ + edgesAt(owner:yfiles.graph.IPortOwner,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.AdjacencyTypes} [type=3] + * @returns {yfiles.collections.IListEnumerable.} + */ + edgesAt(port:yfiles.graph.IPort,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.collections.IListEnumerable.} + */ + getChildren(node:yfiles.graph.INode):yfiles.collections.IListEnumerable; + /** + * Gets the lookup instance to use in {@link yfiles.graph.GraphWrapperBase#lookup} + * @returns {yfiles.graph.ILookup} + */ + getLookup():yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.INode} node + * @returns {yfiles.graph.INode} + */ + getParent(node:yfiles.graph.INode):yfiles.graph.INode; + /** + * + */ + invalidateDisplays():void; + /** + * + * @param {yfiles.graph.INode} node + * @returns {boolean} + */ + isGroupNode(node:yfiles.graph.INode):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addBendAddedListener BendAdded} event + * @param {yfiles.collections.ItemEventArgs.} evt The parameters for the event + * @protected + */ + onBendAdded(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addBendLocationChangedListener BendLocationChanged} event + * @param {yfiles.graph.IBend} bend The bend whose location changed + * @param {yfiles.geometry.Point} oldLocation The bend location before the change + * @protected + */ + onBendLocationChanged(bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addBendRemovedListener BendRemoved} event + * @param {yfiles.graph.BendEventArgs} evt The parameters for the event + * @protected + */ + onBendRemoved(evt:yfiles.graph.BendEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addBendTagChangedListener BendTagChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onBendTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeCreatedListener EdgeCreated} event + * @param {yfiles.collections.ItemEventArgs.} evt The parameters for the event + * @protected + */ + onEdgeCreated(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgePortsChangedListener EdgePortsChanged} event + * @param {yfiles.graph.EdgeEventArgs} evt The parameters for the event + * @protected + */ + onEdgePortsChanged(evt:yfiles.graph.EdgeEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeRemovedListener EdgeRemoved} event + * @param {yfiles.graph.EdgeEventArgs} evt The parameters for the event + * @protected + */ + onEdgeRemoved(evt:yfiles.graph.EdgeEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeStyleChangedListener EdgeStyleChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onEdgeStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addEdgeTagChangedListener EdgeTagChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onEdgeTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Called when the {@link yfiles.graph.GraphWrapperBase#wrappedGraph} property value changes and after initialization of the field. + *

+ * Delegates to {@link yfiles.graph.GraphWrapperBase#addEventHandlers} for newGraph and to {@link yfiles.graph.GraphWrapperBase#removeEventHandlers} + * for oldGraph. + *

+ * @param {yfiles.graph.IGraph} oldGraph the old value, which may be null the first time + * @param {yfiles.graph.IGraph} newGraph the new value + * @protected + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addGraphTagChangedListener GraphTagChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onGraphTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addDisplaysInvalidatedListener DisplaysInvalidated} event + * @param {yfiles.lang.EventArgs} evt The parameters for the event + * @protected + */ + onInvalidateDisplays(evt:yfiles.lang.EventArgs):void; + /** + * Dispatches the {@link yfiles.graph.GraphWrapperBase#addIsGroupNodeChangedListener IsGroupNodeChanged} event. + * @param {yfiles.graph.NodeEventArgs} evt The event args to dispatch. + * @protected + */ + onIsGroupNodeChanged(evt:yfiles.graph.NodeEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelAddedListener LabelAdded} event + * @param {yfiles.collections.ItemEventArgs.} evt The parameters for the event + * @protected + */ + onLabelAdded(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelLayoutParameterChangedListener LabelLayoutParameterChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onLabelLayoutParameterChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelPreferredSizeChangedListener LabelPreferredSizeChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onLabelPreferredSizeChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelRemovedListener LabelRemoved} event + * @param {yfiles.graph.LabelEventArgs} evt The parameters for the event + * @protected + */ + onLabelRemoved(evt:yfiles.graph.LabelEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelStyleChangedListener LabelStyleChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onLabelStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelTagChangedListener LabelTagChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onLabelTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addLabelTextChangedListener LabelTextChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onLabelTextChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeCreatedListener NodeCreated} event + * @param {yfiles.collections.ItemEventArgs.} evt The parameters for the event + * @protected + */ + onNodeCreated(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeLayoutChangedListener NodeLayoutChanged} event + * @param {yfiles.graph.INode} node The node whose layout changed + * @param {yfiles.geometry.Rect} oldLayout The node layout before the change + * @protected + */ + onNodeLayoutChanged(node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeRemovedListener NodeRemoved} event + * @param {yfiles.graph.NodeEventArgs} evt The parameters for the event + * @protected + */ + onNodeRemoved(evt:yfiles.graph.NodeEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeStyleChangedListener NodeStyleChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onNodeStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addNodeTagChangedListener NodeTagChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onNodeTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Dispatches the {@link yfiles.graph.GraphWrapperBase#addParentChangedListener ParentChanged} event. + * @param {yfiles.graph.NodeEventArgs} evt The event args to dispatch. + * @protected + */ + onParentChanged(evt:yfiles.graph.NodeEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addPortAddedListener PortAdded} event + * @param {yfiles.collections.ItemEventArgs.} evt The parameters for the event + * @protected + */ + onPortAdded(evt:yfiles.collections.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addPortLocationParameterChangedListener PortLocationParameterChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onPortLocationParameterChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addPortRemovedListener PortRemoved} event + * @param {yfiles.graph.PortEventArgs} evt The parameters for the event + * @protected + */ + onPortRemoved(evt:yfiles.graph.PortEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addPortStyleChangedListener PortStyleChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onPortStyleChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphWrapperBase#addPortTagChangedListener PortTagChanged} event + * @param {yfiles.graph.ItemChangedEventArgs.} evt The parameters for the event + * @protected + */ + onPortTagChanged(evt:yfiles.graph.ItemChangedEventArgs):void; + /** + * + * @param {yfiles.graph.IModelItem} item + */ + remove(item:yfiles.graph.IModelItem):void; + /** + * Removes event handlers for graph that have been added with {@link yfiles.graph.GraphWrapperBase#addEventHandlers}. + * @param {yfiles.graph.IGraph} graph The graph for which event propagators should be removed + * @protected + */ + removeEventHandlers(graph:yfiles.graph.IGraph):void; + /** + * + * @param {yfiles.graph.IBend} bend + * @param {yfiles.geometry.Point} location + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.Point):void; + /** + * + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.graph.IPort} sourcePort + * @param {yfiles.graph.IPort} targetPort + */ + setEdgePorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * + * @param {yfiles.graph.INode} node + * @param {boolean} isGroupNode + */ + setIsGroupNode(node:yfiles.graph.INode,isGroupNode:boolean):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + */ + setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.geometry.Size} preferredSize + */ + setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {string} text + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Sets the lookup instance to use in {@link yfiles.graph.GraphWrapperBase#lookup} + * @param {yfiles.graph.ILookup} lookup + */ + setLookup(lookup:yfiles.graph.ILookup):void; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.geometry.Rect} layout + */ + setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.graph.INode} parent + */ + setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + */ + setPortLocationParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + */ + setStyle(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):void; + /** + * + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + */ + setStyle(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):void; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + */ + setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + */ + setStyle(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):void; + /** + * Gets the graph that has been wrapped by this instance. + * @type {yfiles.graph.IGraph} + */ + wrappedGraph:yfiles.graph.IGraph; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + nodes:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + edges:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + /** + * + * @type {yfiles.graph.IEdgeDefaults} + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * + * @type {yfiles.graph.INodeDefaults} + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addGraphTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeGraphTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + addNodeRemovedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + removeNodeRemovedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addNodeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeNodeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.INode, yfiles.geometry.Rect): void} listener + */ + addNodeLayoutChangedListener(listener:(source:Object,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.INode, yfiles.geometry.Rect): void} listener + */ + removeNodeLayoutChangedListener(listener:(source:Object,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addNodeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeNodeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addEdgeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeEdgeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + addEdgeRemovedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + removeEdgeRemovedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addEdgeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeEdgeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + addEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener + */ + removeEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addEdgeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeEdgeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addBendAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeBendAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.BendEventArgs): void} listener + */ + addBendRemovedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.BendEventArgs): void} listener + */ + removeBendRemovedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.IBend, yfiles.geometry.Point): void} listener + */ + addBendLocationChangedListener(listener:(source:Object,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.IBend, yfiles.geometry.Point): void} listener + */ + removeBendLocationChangedListener(listener:(source:Object,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addBendTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeBendTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener + */ + addLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener + */ + removeLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelPreferredSizeChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelPreferredSizeChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelLayoutParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelLayoutParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addLabelTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removeLabelTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addPortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removePortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.PortEventArgs): void} listener + */ + addPortRemovedListener(listener:(sender:Object,evt:yfiles.graph.PortEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.PortEventArgs): void} listener + */ + removePortRemovedListener(listener:(sender:Object,evt:yfiles.graph.PortEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addPortStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removePortStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addPortLocationParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removePortLocationParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + addPortTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener + */ + removePortTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.lang.EventArgs): void} listener + */ + addDisplaysInvalidatedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.lang.EventArgs): void} listener + */ + removeDisplaysInvalidatedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * + * @type {yfiles.graph.IMapperRegistry} + */ + mapperRegistry:yfiles.graph.IMapperRegistry; + /** + * + * @type {yfiles.graph.INodeDefaults} + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + addParentChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + removeParentChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + addIsGroupNodeChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener + */ + removeIsGroupNodeChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * + * @type {Object} + */ + tag:Object; + static $class:yfiles.lang.Class; + } + /** + * 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.collections.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.graph.ILookup#lookup} method that can be used to query additional aspects of the item. + *

+ *

+ * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. + *

+ *

+ * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. + *

+ * @interface + * @implements {yfiles.graph.IModelItem} + */ + export interface IBend extends Object,yfiles.graph.IModelItem{ + /** + * Returns the edge this bend instance belongs to. + *

+ * This implies that Owner.Bends contains this instance. + *

+ * @abstract + * @type {yfiles.graph.IEdge} + */ + 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 yfiles.geometry.IPoint#toPoint + * @abstract + * @type {yfiles.geometry.IPoint} + */ + location:yfiles.geometry.IPoint; + /** + * Gets the index of the bend at its {@link yfiles.graph.IBend#owner}. + * @returns 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. + * @type {number} + */ + index?:number; + } + var IBend:{ + $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.ILabelOwner} to get access to the labels, and, + * like all items in an IGraph, edges support the {@link yfiles.graph.ILookup#lookup} method inherited from the {@link yfiles.graph.IModelItem} + * interface that can be used to query additional aspects of each instance. + *

+ *

+ * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. + *

+ *

+ * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. + *

+ * @interface + * @implements {yfiles.graph.IPortOwner} + * @implements {yfiles.graph.ILabelOwner} + * @implements {yfiles.graph.IModelItem} + */ + export interface IEdge extends Object,yfiles.graph.IPortOwner,yfiles.graph.ILabelOwner,yfiles.graph.IModelItem{ + /** + * Gets the opposite port of an {@link yfiles.graph.IEdge}. + * @param {yfiles.graph.IPort} port The port that the {@link yfiles.graph.IEdge} is connected to. + * @returns {yfiles.graph.IPort} The opposite port. + * @throws {Stubs.Exceptions.ArgumentError} If port is neither the source or target of the edge. + */ + opposite?(port:yfiles.graph.IPort):yfiles.graph.IPort; + /** + * Gets the opposite port owner of an {@link yfiles.graph.IEdge}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that the {@link yfiles.graph.IEdge} is connected to. + * @returns {yfiles.graph.IPortOwner} The owner of the opposite port. + * @throws {Stubs.Exceptions.ArgumentError} If owner is neither the source or target of the edge. + */ + opposite?(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortOwner; + /** + * 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}. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + bends:yfiles.collections.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. + *

+ * @abstract + * @type {yfiles.graph.IPort} + */ + 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. + *

+ * @abstract + * @type {yfiles.graph.IPort} + */ + targetPort:yfiles.graph.IPort; + /** + * Returns the style that is responsible for the visual representation of this edge in a {@link yfiles.view.CanvasComponent}. + *

+ * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} 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. + *

+ * @abstract + * @type {yfiles.styles.IEdgeStyle} + */ + style:yfiles.styles.IEdgeStyle; + /** + * Gets the source node for the given edge or null. + * @returns The source node or null. + * @type {yfiles.graph.INode} + */ + sourceNode?:yfiles.graph.INode; + /** + * Gets the target node for the given edge or null. + * @returns The target node or null. + * @type {yfiles.graph.INode} + */ + targetNode?:yfiles.graph.INode; + /** + * Returns whether an {@link yfiles.graph.IEdge edge} is a self loop. + * @returns true, if the edge is a self loop + * @type {boolean} + */ + isSelfloop?:boolean; + } + var IEdge:{ + $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 and ports. + *

+ * Note that changing these defaults does not change properties of already created model items. Rather, only items created + * after the change are affected. + *

+ * @see yfiles.graph.IGraph#edgeDefaults + * @interface + */ + export interface IEdgeDefaults extends Object{ + /** + * Factory method that returns a style instance for use with newly created edges. + *

+ * Most implementations will yield either, a {@link yfiles.lang.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. + *

+ * @returns {yfiles.styles.IEdgeStyle} The style to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IEdgeDefaults#style} property, if {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} is enabled. + * @abstract + */ + getStyleInstance():yfiles.styles.IEdgeStyle; + /** + * 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. + *

+ * @abstract + * @type {yfiles.graph.IPortDefaults} + */ + ports:yfiles.graph.IPortDefaults; + /** + * Gets or sets the defaults for labels at edges. + * @abstract + * @type {yfiles.graph.ILabelDefaults} + */ + 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.lang.ICloneable#clone clone} of this + * instance or the very same instance. + *

+ * @see yfiles.graph.IEdgeDefaults#shareStyleInstance + * @abstract + * @type {yfiles.styles.IEdgeStyle} + */ + style:yfiles.styles.IEdgeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IEdgeDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.IEdgeDefaults#getStyleInstance}. + * @see yfiles.graph.IEdgeDefaults#getStyleInstance + * @see yfiles.graph.IEdgeDefaults#style + * @abstract + * @type {boolean} + */ + shareStyleInstance:boolean; + } + var IEdgeDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is used for manipulating a managed view of an {@link yfiles.graph.IGraph} that supports folding operations like {@link yfiles.graph.IFoldingView#expand expanding} + * and {@link yfiles.graph.IFoldingView#collapse collapsing} of nodes. + *

+ * The {@link yfiles.graph.FoldingManager} creates views of a {@link yfiles.graph.FoldingManager#masterGraph} which is 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#getFolderNodeState 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.IFoldingView#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 created by the same Manager and can be obtained and modified via the + * {@link yfiles.graph.FoldingManager}'s GetFoldingEdgeState methods for {@link yfiles.graph.FoldingManager#getFoldingEdgeState folding edges} and {@link yfiles.graph.FoldingManager#getFolderNodeState folder nodes} in the absence of a + * corresponding {@link yfiles.graph.IFoldingView} 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 CreateFoldingView to obtain an {@link yfiles.graph.IGraph} implementation that contains an implementation of + * this class in its {@link yfiles.graph.ILookup#lookup} method: + *

+ *

+ * This interface extends the {@link yfiles.lang.IPropertyObservable} interface. This can be used to easily monitor the {@link yfiles.graph.IFoldingView#invalid validity} of + * this view. Also changes to the {@link yfiles.graph.IFoldingView#localRoot} property will be published via this event. + *

+ *

+ * A brief description of the interface's API and some usage aspects is given in the section {@link @DGUIDE_PREFIX@/folding.html#folding-working_with_folding Working with Folding}. Class + * FoldingManager's central role for folding support in general is discussed in the section {@link @DGUIDE_PREFIX@/folding-technical_background.html Folding Revisited}. + *

+ * @see yfiles.graph.FoldingManager + * @interface + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.lang.IPropertyObservable} + */ + export interface IFoldingView extends Object,yfiles.graph.ILookup,yfiles.lang.IPropertyObservable{ + /** + * This method will collapse the {@link yfiles.graph.IGraph#getChildren children} of a group node into the group node. + *

+ * If a {@link yfiles.graph.IGraph#isGroupNode group} node that belongs to this view's hierarchy is in {@link yfiles.graph.IFoldingView#expand expanded} state, calling this method will remove the {@link yfiles.graph.IGraph#getChildren children} + * from this {@link yfiles.graph.IFoldingView#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.IGraph#isGroupNode non-group} node in the hierarchy. The collapsed group node has its own separate set of attributes, which can be + * obtained using the {@link yfiles.graph.FoldingManager#getFolderNodeState} 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.IFoldingView#addGroupCollapsedListener GroupCollapsed} + * event to perform the necessary modifications, like adjusting the view port or moving the node to the desired location. + *

+ *

+ * In addition to that this method can also be used for {@link yfiles.graph.FoldingManager#masterGraph master} nodes which are currently not represented in this view. In + * this case these nodes will be displayed as collapsed the next time they will be included in this view. + *

+ * @param {yfiles.graph.INode} groupNode A group node that is part of the {@link yfiles.graph.IFoldingView#graph} or the {@link yfiles.graph.FoldingManager#masterGraph master graph}. + * @see yfiles.graph.IFoldingView#isExpanded + * @abstract + */ + collapse(groupNode:yfiles.graph.INode):void; + /** + * Directly creates a collapsed node on this instance with the given parameters. + *

+ * This will implicitly create a new empty group node on the {@link yfiles.graph.FoldingManager#masterGraph} with the defaults for such a group node. The parent must be + * part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View} or null to create a folder at the root of the current hierarchy. It will be converted into + * a group node if necessary. The returned {@link yfiles.graph.INode} is also part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View}. + *

+ * @param {yfiles.graph.INode} [parent=null] The parent node in the {@link yfiles.graph.IFoldingView#graph}, or null + * @param {yfiles.geometry.Rect} [layout=null] The layout for the collapsed node. + * @param {yfiles.styles.INodeStyle} [style=null] The style for the collapsed node + * @param {Object} [tag=null] The tag of the node. + * @returns {yfiles.graph.INode} A collapsed (folder) node that lives in {@link yfiles.graph.IFoldingView#graph} + * @abstract + */ + createFolderNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * Directly creates a collapsed node on this instance with the given parameters. + *

+ * This will implicitly create a new empty group node on the {@link yfiles.graph.FoldingManager#masterGraph} with the defaults for such a group node. The parent must be + * part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View} or null to create a folder at the root of the current hierarchy. It will be converted into + * a group node if necessary. The returned {@link yfiles.graph.INode} is also part of the {@link yfiles.graph.IFoldingView#graph Folded Graph View}. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] The parent node in the {@link yfiles.graph.IFoldingView#graph}, or null + * @param {yfiles.geometry.Rect} [options.layout=null] The layout for the collapsed node. + * @param {yfiles.styles.INodeStyle} [options.style=null] The style for the collapsed node + * @param {Object} [options.tag=null] The tag of the node. + * @returns {yfiles.graph.INode} A collapsed (folder) node that lives in {@link yfiles.graph.IFoldingView#graph} + * @abstract + */ + createFolderNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object}):yfiles.graph.INode; + /** + * 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. + *

+ * @abstract + */ + dispose():void; + /** + * This method will expand a previously {@link yfiles.graph.IFoldingView#collapse collapsed} group node to make its contents appear in this view. + *

+ * If a node that belongs to this view is in {@link yfiles.graph.IFoldingView#collapse collapsed} state, calling this method will make the {@link yfiles.graph.IGraph#getChildren children} appear in this + * {@link yfiles.graph.IFoldingView#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 {@link yfiles.graph.IGraph#isGroupNode group node}, whereas a collapsed group node is no group node in this 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#getFolderNodeState} method. The expanded state is always + * the same as the state of the {@link yfiles.graph.IFoldingView#getMasterItem 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.IFoldingView#addGroupExpandedListener GroupExpanded} event to perform the + * necessary modifications, like adjusting the view port or moving the node and its descendants to the desired location. + *

+ *

+ * In addition to that this method can also be used for {@link yfiles.graph.FoldingManager#masterGraph master} nodes which are currently not represented in this view. In + * this case these nodes will be displayed as expanded the next time they will be included in this view. + *

+ * @param {yfiles.graph.INode} groupNode A group node that is part of the {@link yfiles.graph.IFoldingView#graph} or the {@link yfiles.graph.FoldingManager#masterGraph master graph}. + * @see yfiles.graph.IFoldingView#isExpanded + * @see yfiles.graph.IFoldingView#collapse + * @abstract + */ + expand(groupNode:yfiles.graph.INode):void; + /** + * Helper method that corresponds to the {@link yfiles.graph.IFoldingView#getMasterItem} method, but is used for folding edges, + * only. + *

+ * Since folding edges can represent more than one master edge, this method can be used to query all of the master edges + * that the provided folding edge represents. If the folding edge corresponds to a single master edge, the result will + * enumerate that edge, only. + *

+ * @param {yfiles.graph.IEdge} foldingEdge The folding edge for which the master edges should be returned. + * @returns {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 folding edge in this {@link yfiles.graph.IFoldingView#graph view}. + * @see yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge + * @see yfiles.graph.IFoldingView#getViewItem + * @abstract + */ + getMasterEdges(foldingEdge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Helper method that can be used to retrieve the original "master" items in the {@link yfiles.graph.FoldingManager#masterGraph} that is managed by the Manager associated + * with this view. + *

+ * Since the {@link yfiles.graph.IFoldingView#graph} view that is associated with this instance maintains a copy of the entities in the Manager's {@link yfiles.graph.FoldingManager#masterGraph}, there is a + * mapping between elements that belong to this view's {@link yfiles.graph.IFoldingView#graph} and the elements in the master graph. This method can be called for + * the elements contained in this {@link yfiles.graph.IGraph} 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.IFoldingView#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.FoldingEdgeStateId folding 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 folding edges and folder nodes. For folding edges, this method will yield the main representing edge in + * the master, if the folding edge represents more than one master edge. For nodes, the master node will be returned, no + * matter whether the node is currently {@link yfiles.graph.IFoldingView#collapse collapsed} or not. + *

+ * Type parameter T: The type of the argument, which is typically {@link yfiles.graph.INode}, {@link yfiles.graph.IEdge}, {@link yfiles.graph.ILabel}, + * {@link yfiles.graph.IBend}, or {@link yfiles.graph.IPort}. + * @param {T} item The item that is part of this {@link yfiles.graph.IFoldingView#graph} for which the original "master" item in the {@link yfiles.graph.FoldingManager#masterGraph} will be returned. + * @returns {T} An item in the {@link yfiles.graph.FoldingManager#masterGraph} that corresponds to the item or null, if there is no such item. + * @see yfiles.graph.IFoldingView#getViewItem + * @template T + * @abstract + */ + getMasterItem(item:T):T; + /** + * Helper method that can be used to retrieve the items in this {@link yfiles.graph.IFoldingView#graph}-view for all items that are part of the {@link yfiles.graph.FoldingManager#masterGraph} that is + * associated with the Manager of this instance. + *

+ * Since the {@link yfiles.graph.IFoldingView#graph} view that is associated with this instance maintains a copy of the entities in the 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.IFoldingView#graph} of this view. This method can be called + * for the elements contained in this {@link yfiles.graph.FoldingManager#masterGraph master graph's} items and will return the corresponding item in this view's {@link yfiles.graph.IFoldingView#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.IFoldingView#graph} instance, + * e.g. those elements which are part of a {@link yfiles.graph.IFoldingView#collapse collapsed} subtree in the {@link yfiles.graph.FoldingManager#masterGraph} hierarchy or those items that do not belong to the + * subtree that is induced by the {@link yfiles.graph.IFoldingView#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 folding edge in this view, this method will yield the same folding edge instance for each + * of them. + *

+ * Type parameter T: The type of the argument, which is typically {@link yfiles.graph.INode}, {@link yfiles.graph.IEdge}, {@link yfiles.graph.ILabel}, + * {@link yfiles.graph.IBend}, or {@link yfiles.graph.IPort}. + * @param {T} item An item that is part of the {@link yfiles.graph.FoldingManager#masterGraph} that is associated with the Manager of this instance. + * @returns {T} An item in the {@link yfiles.graph.IFoldingView#graph local graph view} that corresponds to the item or + * null, if the item is not currently being represented in this view. + * @see yfiles.graph.IFoldingView#getMasterItem + * @see yfiles.graph.IFoldingView#getMasterEdges + * @template T + * @abstract + */ + getViewItem(item:T):T; + /** + * Determines whether the provided node is currently expanded or will be displayed in + * {@link yfiles.graph.IFoldingView#expand}ed state the next time it will be included in this view. + *

+ * Expanded group nodes will have all of their {@link yfiles.graph.IGraph#getChildren children} visible in this {@link yfiles.graph.IFoldingView#graph view}. + *

+ *

+ * The groupNode can be either a node of the {@link yfiles.graph.IFoldingView#graph view} or the {@link yfiles.graph.FoldingManager#masterGraph master graph}. If the node is from the master graph and is + * currently not represented in this view, this method will return the + * {@link yfiles.graph.IFoldingView#expand}ed state it will have the next time it will be included in this view. + *

+ * @param {yfiles.graph.INode} groupNode The group node for which the {@link yfiles.graph.IFoldingView#expand expanded} state will be returned. + * @returns {boolean} true, if the group node can be {@link yfiles.graph.IFoldingView#collapse collapsed}. + * @abstract + */ + isExpanded(groupNode:yfiles.graph.INode):boolean; + /** + * Determines whether the specified item is a folding state 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#getFolderNodeState view local state} and is not a direct copy of the {@link yfiles.graph.IFoldingView#getMasterItem master item}, if any. + * Note that {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes are in folding state, even though they do have a {@link yfiles.graph.IFoldingView#getMasterItem master} item in the master graph and + * folding edges always have at least one + * {@link yfiles.graph.IFoldingView#getMasterEdges master edge}, while all other folding items don't have a corresponding master item in the master graph. + *

+ * @param {yfiles.graph.IModelItem} item One of the items that are {@link yfiles.graph.IGraph#contains contained} in the {@link yfiles.graph.IFoldingView#graph}. + * @returns {boolean} Whether the item is in folding state and is not an exact copy of an item in the {@link yfiles.graph.FoldingManager#masterGraph}. + * @abstract + */ + isInFoldingState(item:yfiles.graph.IModelItem):boolean; + /** + * Adds the given listener for the GroupCollapsed event that occurs whenever a group has been + * {@link yfiles.graph.IFoldingView#collapse}d. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IFoldingView#removeGroupCollapsedListener + * @abstract + */ + addGroupCollapsedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupCollapsed event that occurs whenever a group has been + * {@link yfiles.graph.IFoldingView#collapse}d. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IFoldingView#addGroupCollapsedListener + * @abstract + */ + removeGroupCollapsedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the GroupExpanded event that occurs whenever a group has been + * {@link yfiles.graph.IFoldingView#expand}ed. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IFoldingView#removeGroupExpandedListener + * @abstract + */ + addGroupExpandedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the GroupExpanded event that occurs whenever a group has been + * {@link yfiles.graph.IFoldingView#expand}ed. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IFoldingView#addGroupExpandedListener + * @abstract + */ + removeGroupExpandedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * 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.graph.ILookup} that has been obtained from the + * {@link yfiles.graph.FoldingManager}'s CreateFoldingView 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.IFoldingView#getMasterItem masters}, they are copies that may share the same attributes. + *

+ * @abstract + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Determines whether this instance should automatically switch the {@link yfiles.graph.IFoldingView#localRoot} to an ancestor of the current root, if this view + * becomes {@link yfiles.graph.IFoldingView#invalid}. + *

+ * By default this property is set to true which assures that this view will never become + * {@link yfiles.graph.IFoldingView#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. + *

+ * @abstract + * @type {boolean} + */ + autoSwitchToAncestor:boolean; + /** + * Determines if this view is currently valid and can be edited. + *

+ * A view is invalid if the {@link yfiles.graph.IFoldingView#localRoot} is not currently part of the {@link yfiles.graph.FoldingManager#masterGraph} hierarchy. 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 yfiles.graph.IFoldingView#autoSwitchToAncestor + * @abstract + * @type {boolean} + */ + invalid:boolean; + /** + * Determines whether changes to the {@link yfiles.graph.IFoldingView#localRoot} property and calls to {@link yfiles.graph.IFoldingView#collapse} and {@link yfiles.graph.IFoldingView#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.graph.IUndoUnit}s for this type of operations. + *

+ * @see yfiles.graph.IFoldingView#autoSwitchToAncestor + * @abstract + * @type {boolean} + */ + enqueueNavigationalUndoUnits:boolean; + /** + * Gets or sets an entity of the {@link yfiles.graph.FoldingManager#masterGraph} hierarchy to serve as the virtual root for the view's local hierarchy. + *

+ * This property can be set to any {@link yfiles.graph.IGraph#isGroupNode group} node in the + * {@link yfiles.graph.FoldingManager#masterGraph}'s hierarchy whose contents will then be represented in this view. Note that the root of the view's local hierarchy is + * not set to the same instance. + *

+ * @abstract + * @type {yfiles.graph.INode} + */ + localRoot:yfiles.graph.INode; + /** + * Provides access to the manager that created this view and that contains a reference to the {@link yfiles.graph.FoldingManager#masterGraph}. + * @type {yfiles.graph.FoldingManager} + */ + manager?:yfiles.graph.FoldingManager; + } + var IFoldingView:{ + $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 yfiles.graph.INode + */ + NODE, + /** + * Constant for edges. + * @see yfiles.graph.IEdge + */ + EDGE, + /** + * Constant for node labels. + * @see yfiles.graph.ILabel + */ + NODE_LABEL, + /** + * Constant for edge labels. + * @see yfiles.graph.ILabel + */ + EDGE_LABEL, + /** + * Constant for ports. + * @see 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 yfiles.graph.ILabel + */ + LABEL, + /** + * Constant for all kinds of {@link yfiles.graph.ILabelOwner}. + *

+ * This is a bitwise combination of {@link yfiles.graph.GraphItemTypes#NODE} and {@link yfiles.graph.GraphItemTypes#EDGE}. + *

+ * @see yfiles.graph.ILabelOwner + */ + LABEL_OWNER, + /** + * Constant for edge bends. + * @see 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 + } + /** + * Central interface that models a graph which can be displayed in a {@link yfiles.view.CanvasComponent canvas} or {@link yfiles.view.GraphComponent}. + *

+ * 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. + *

+ *

+ * This interface also provides support for hierarchically organized, i.e. grouped graphs. This means that nodes together + * with their connecting edges can be {@link yfiles.graph.IGraph#setParent put into} other nodes. The containing node is referred to as a "group node." To create + * and edit group nodes interactively use the {@link yfiles.input.GraphEditorInputMode} as input mode and enable the + * {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations grouping operations}. + *

+ *

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

+ *

+ * Each element in the graph can be associated with a 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.graph.ITagOwner#tag} property that all {@link yfiles.graph.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 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. + *

+ *

+ * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. + *

+ *

+ * More information on visual styles can be found in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. + *

+ * @see yfiles.graph.DefaultGraph + * @see yfiles.graph.INode + * @see yfiles.graph.IEdge + * @see yfiles.graph.IPort + * @see yfiles.graph.ILabel + * @see yfiles.graph.IBend + * @see yfiles.graph.IMapperRegistry + * @interface + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.graph.ITagOwner} + */ + export interface IGraph extends Object,yfiles.graph.ILookup,yfiles.graph.ITagOwner{ + /** + * 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 {yfiles.geometry.Point} location the coordinates to use for the newly created bend + * @param {number} [index=-1] The index for the newly added bend; a negative value (which is the default) indicates that the bend should be appended + * to the end of the list of bends. + * @returns {yfiles.graph.IBend} a newly created live bend + * @see yfiles.graph.IGraph#remove + * @see yfiles.graph.IGraph#setBendLocation + * @abstract + */ + addBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.Point,index?:number):yfiles.graph.IBend; + /** + * Adds bends with the given locations to the end of the bend list of the given edge. + * @param {yfiles.graph.IEdge} edge The edge to add the bends to. + * @param {yfiles.collections.IEnumerable.} locations The locations of the bends. + */ + addBends?(edge:yfiles.graph.IEdge,locations:yfiles.collections.IEnumerable):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.ILabelOwner} owner the item to add the label to. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ILabelModelParameter} [layoutParameter=null] The label model parameter instance to use. + * @param {yfiles.styles.ILabelStyle} [style=null] The style to use for the label + * @param {yfiles.geometry.Size} [preferredSize=null] The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} [tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.ILabel} the newly created label + * @see yfiles.graph.IGraph#addLabelAddedListener + * @see yfiles.graph.IGraph#setLabelText + * @see yfiles.graph.IGraph#setLabelLayoutParameter + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.styles.VoidLabelStyle#INSTANCE + * @abstract + */ + addLabel(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text and label model parameter, style and tag. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.ILabelOwner} options.owner the item to add the label to. + * @param {string} options.text the initial text of the label + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] The label model parameter instance to use. + * @param {yfiles.styles.ILabelStyle} [options.style=null] The style to use for the label + * @param {yfiles.geometry.Size} [options.preferredSize=null] The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} [options.tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.ILabel} the newly created label + * @see yfiles.graph.IGraph#addLabelAddedListener + * @see yfiles.graph.IGraph#setLabelText + * @see yfiles.graph.IGraph#setLabelLayoutParameter + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.styles.VoidLabelStyle#INSTANCE + * @abstract + */ + addLabel(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; + /** + * Add a port to the given port owner using the location model parameter, style and tag. + *

+ * The locationParameter determines the location of the port. + *

+ *

+ * Depending on the implementation this method may throw an {@link Stubs.Exceptions.NotSupportedError} if the type of the owner + * instance does not support adding of ports. + *

+ * @param {yfiles.graph.IPortOwner} owner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} [locationParameter=null] the parameter to use for the port to determine its location. + * @param {yfiles.styles.IPortStyle} [style=null] the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. {@link yfiles.styles.VoidPortStyle#INSTANCE}. + * @param {Object} [tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.IPort} the newly created port + * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. + * @see yfiles.graph.IGraph#addPortAddedListener + * @see yfiles.styles.VoidPortStyle#INSTANCE + * @abstract + */ + addPort(owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object):yfiles.graph.IPort; + /** + * Add a port to the given port owner using the location model parameter, style and tag. + *

+ * The locationParameter determines the location of the port. + *

+ *

+ * Depending on the implementation this method may throw an {@link Stubs.Exceptions.NotSupportedError} if the type of the owner + * instance does not support adding of ports. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPortOwner} options.owner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} [options.locationParameter=null] the parameter to use for the port to determine its location. + * @param {yfiles.styles.IPortStyle} [options.style=null] the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. {@link yfiles.styles.VoidPortStyle#INSTANCE}. + * @param {Object} [options.tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.IPort} the newly created port + * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. + * @see yfiles.graph.IGraph#addPortAddedListener + * @see yfiles.styles.VoidPortStyle#INSTANCE + * @abstract + */ + addPort(options:{owner:yfiles.graph.IPortOwner,locationParameter?:yfiles.graph.IPortLocationModelParameter,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; + /** + * 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} owner the owner to add the port instance to. + * @param {yfiles.geometry.Point} location the location to use for the port to determine its location. This is passed to the {@link yfiles.graph.IGraph#createDefaultPortLocationParameter} + * method to determine the initial {@link yfiles.graph.IPortLocationModelParameter} to use. + * @param {yfiles.styles.IPortStyle} [style=null] the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. {@link yfiles.styles.VoidPortStyle#INSTANCE}. + * @param {Object} [tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.IPort} the newly created port + * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. + */ + addPortAt?(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point,style?:yfiles.styles.IPortStyle,tag?:Object):yfiles.graph.IPort; + /** + * Add a port to the given port owner using the absolute coordinates as the new initial position of the port anchor. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IPortOwner} options.owner the owner to add the port instance to. + * @param {yfiles.geometry.Point} options.location the location to use for the port to determine its location. This is passed to the {@link yfiles.graph.IGraph#createDefaultPortLocationParameter} + * method to determine the initial {@link yfiles.graph.IPortLocationModelParameter} to use. + * @param {yfiles.styles.IPortStyle} [options.style=null] the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. {@link yfiles.styles.VoidPortStyle#INSTANCE}. + * @param {Object} [options.tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.IPort} the newly created port + * @throws {Stubs.Exceptions.NotSupportedError} If this instance cannot add a port to owner. + */ + addPortAt?(options:{owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point,style?:yfiles.styles.IPortStyle,tag?:Object}):yfiles.graph.IPort; + /** + * Adds a new port to the graph at the node using a location that is relative to the center of the node. + *

+ * The port style for the newly-created port is taken from the graph's defaults. The location parameter is determined by + * delegating to {@link yfiles.graph.IGraph#addPortAt}. + *

+ * @param {yfiles.graph.INode} node The owner of the port. + * @param {yfiles.geometry.Point} relativeLocation The offset of the port relative to the center of the {@link yfiles.graph.INode#layout}. + * @returns {yfiles.graph.IPort} The newly added port instance. + */ + addRelativePort?(node:yfiles.graph.INode,relativeLocation:yfiles.geometry.Point):yfiles.graph.IPort; + /** + * Convenience method that uses the {@link yfiles.graph.UndoEngine} from the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.ILookup} to + * {@link yfiles.graph.UndoEngine#addUnit add a unit}. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @param {function(): void} undo The undo action. + * @param {function(): void} redo The redo action. + */ + addUndoUnit?(undoName:string,redoName:string,undo:()=>void,redo:()=>void):void; + /** + * 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.IGraph#getChildren children}, its bounds will be left unchanged. This will also respect any {@link yfiles.input.INodeSizeConstraintProvider}s + * for {@link yfiles.graph.INode}s, that are available in the lookup of the groupNode. + *

+ * @param {yfiles.graph.INode} groupNode The group node to adjust the size of. + * @see yfiles.graph.IGroupBoundsCalculator + * @see yfiles.input.INodeSizeConstraintProvider + * @see yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea + * @see yfiles.graph.GroupingSupport#enlargeGroupNode + * @see yfiles.graph.GroupingSupport#enlargeAllGroupNodes + */ + adjustGroupNodeLayout?(groupNode:yfiles.graph.INode):void; + /** + * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to fit the suggested size of its {@link yfiles.styles.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.ILabel} label The label to adjust the size for. + * @see yfiles.graph.ILabelDefaults#autoAdjustPreferredSize + */ + adjustLabelPreferredSize?(label:yfiles.graph.ILabel):void; + /** + * Convenience method that runs a layout on a graph using {@link yfiles.layout.LayoutGraphAdapter#applyLayout}. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout. + * @param {yfiles.layout.LayoutData} [layoutData=null] The layout data. + * @see yfiles.view.GraphComponent#morphLayout + */ + applyLayout?(layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; + /** + * Starts an {@link yfiles.graph.ICompoundEdit} that uses the {@link yfiles.graph.IMementoSupport memento design pattern} to record changes to the items in the given items + * collection. + *

+ * This method uses the {@link yfiles.graph.IMementoSupport} returned by the provider to record the state of an item at the + * beginning of the edit and when {@link yfiles.graph.ICompoundEdit#commit} is called to create an {@link yfiles.graph.IUndoUnit} that can + * revert the item to the recorded state and back. If no provider is given, this method uses the {@link yfiles.graph.IMementoSupport} + * returned by the {@link yfiles.graph.ILookup#lookup} implementation of the items to record the state of an item at the beginning + * of the edit and when {@link yfiles.graph.ICompoundEdit#commit} is called to create an {@link yfiles.graph.IUndoUnit} that can revert the + * item to the recorded state and back. + *

+ *

+ * Calling this method will immediately enqueue an {@link yfiles.graph.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.graph.ICompoundEdit#commit} + * method has been called. + *

+ *

+ * The following is an example implementation of an item that is being managed using {@link yfiles.graph.IMementoSupport}: + *

+ *

+ * A collection of items from this type can then be watched using the following code snippet: + *

+ *

+ * Alternatively, when using a specific provider, consider the following examples. The following is an example + * implementation of an item that is being managed using {@link yfiles.graph.IMementoSupport}: + *

+ *

+ * A collection of items from this type can then be watched using the following code snippet, using the provider to return + * an appropriate {@link yfiles.graph.IMementoSupport} implementation: + *

+ *

+ * Implementing the {@link yfiles.graph.IMementoSupport} interface is quite unrestrained, the type of the state returned by {@link yfiles.graph.IMementoSupport#getState} + * method can by anything as long as the {@link yfiles.graph.IMementoSupport#applyState} and {@link yfiles.graph.IMementoSupport#stateEquals} + * methods can deal with it: + *

+ *

+ * In summary, use this concept when you want to track the state of items during certain operations for undo/redo. This is + * efficient if it's easier to handle an item's state than the changes to the item themselves. If you want to focus on the + * changes or on certain events, you should use custom {@link yfiles.graph.IUndoUnit} + *

+ * Type parameter T: The type of the items that will be modified subsequently. + * @param {string} undoName The {@link yfiles.graph.IUndoUnit#undoName} of the {@link yfiles.graph.IUndoUnit} that will be placed into the undo queue after {@link yfiles.graph.ICompoundEdit#commit} has + * been called. + * @param {string} redoName The {@link yfiles.graph.IUndoUnit#redoName} of the {@link yfiles.graph.IUndoUnit} that will be placed into the undo queue after {@link yfiles.graph.ICompoundEdit#commit} has + * been called. + * @param {yfiles.collections.IEnumerable.} items The items that will be changed after this call and before the call to {@link yfiles.graph.ICompoundEdit#commit}. + * @param {function(T): yfiles.graph.IMementoSupport} [provider=null] The provider for the {@link yfiles.graph.IMementoSupport} of the items. if the provider returns null for a given item, changes + * to this item are not being recorded. + * @returns {yfiles.graph.ICompoundEdit} An implementation of the {@link yfiles.graph.ICompoundEdit} interface whose {@link yfiles.graph.ICompoundEdit#commit} or {@link yfiles.graph.ICompoundEdit#cancel} + * methods need to be called after the items have been modified. + * @see yfiles.graph.IMementoSupport + * @template T + */ + beginEdit?(undoName:string,redoName:string,items:yfiles.collections.IEnumerable,provider?:(item:T)=>yfiles.graph.IMementoSupport):yfiles.graph.ICompoundEdit; + /** + * Starts an {@link yfiles.graph.ICompoundEdit} that records graph changes and {@link yfiles.graph.IGraph#addUndoUnit custom undo units} in a single compound unit. + *

+ * This method can be used to bracket several undo units. All edits added to the queue after this call and before a call to + * {@link yfiles.graph.ICompoundEdit#cancel} or {@link yfiles.graph.ICompoundEdit#commit} will be placed into the queue as a single block. + *

+ *

+ * Client code needs to make sure that either the {@link yfiles.graph.ICompoundEdit#cancel} or {@link yfiles.graph.ICompoundEdit#commit} + * method is called on the returned instance. + *

+ * @param {string} undoName The undo name for the compound edit. + * @param {string} redoName The redo name for the compound edit. + * @returns {yfiles.graph.ICompoundEdit} The handle to stop the recording by calling {@link yfiles.graph.ICompoundEdit#cancel} or {@link yfiles.graph.ICompoundEdit#commit} on + * it. + */ + beginEdit?(undoName:string,redoName:string):yfiles.graph.ICompoundEdit; + /** + * Calculates the preferred size of a label with the given properties. + * @param {yfiles.graph.ILabelOwner} owner The item that will own the label. + * @param {string} text The text. + * @param {yfiles.graph.ILabelModelParameter} [layoutParameter=null] The label model parameter. + * @param {yfiles.styles.ILabelStyle} [style=null] The label style. + * @param {Object} [tag=null] The tag for the label. + * @returns {yfiles.geometry.Size} The size as calculated by the {@link yfiles.styles.ILabelStyleRenderer}. + */ + calculateLabelPreferredSize?(owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,tag?:Object):yfiles.geometry.Size; + /** + * Calculates the preferred size of a label with the given properties. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.ILabelOwner} options.owner The item that will own the label. + * @param {string} options.text The text. + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] The label model parameter. + * @param {yfiles.styles.ILabelStyle} [options.style=null] The label style. + * @param {Object} [options.tag=null] The tag for the label. + * @returns {yfiles.geometry.Size} The size as calculated by the {@link yfiles.styles.ILabelStyleRenderer}. + */ + calculateLabelPreferredSize?(options:{owner:yfiles.graph.ILabelOwner,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,tag?:Object}):yfiles.geometry.Size; + /** + * Clears the graph instance, removing all entities in proper order. + * @see yfiles.graph.IGraph#remove + * @see yfiles.graph.IGraph#remove + */ + clear?():void; + /** + * 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.IEdge} edge the edge whose bends will be removed + * @see yfiles.graph.IGraph#remove + * @see yfiles.graph.IGraph#addBendRemovedListener + */ + clearBends?(edge:yfiles.graph.IEdge):void; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.graph.IModelItem} item The item. + * @returns {boolean} true if this graph contains the specified item; otherwise, false. + * @abstract + */ + contains(item:yfiles.graph.IModelItem):boolean; + /** + * Creates the label layout parameter for a given {@link yfiles.graph.ILabelOwner}. + *

+ * This implementation uses the {@link yfiles.graph.IGraph#getLabelDefaults label defaults} for the graph to {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance obtain the parameter instance}. + *

+ * @param {yfiles.graph.ILabelOwner} owner The item that is the {@link yfiles.graph.ILabel#owner} of the label in question. + * @returns {yfiles.graph.ILabelModelParameter} The default label layout parameter to use for newly created labels at the item. + * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance + * @see yfiles.graph.IGraph#getLabelDefaults + */ + createDefaultLabelLayoutParameter?(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; + /** + * Creates a location model parameter for a newly created {@link yfiles.graph.IPort} at the owner that matches the location. + *

+ * If location is null, this method uses the {@link yfiles.graph.IGraph#getPortDefaults port defaults} for the owner to obtain the {@link yfiles.graph.IPortDefaults#getLocationParameterInstance location parameter}. + *

+ * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.geometry.Point} [location=null] The location in the world coordinate system where the port should be added. + * @returns {yfiles.graph.IPortLocationModelParameter} Either a location model parameter that matches the location, or the default parameter to use for the {@link yfiles.graph.IPortOwner} + * as returned by {@link yfiles.graph.IPortDefaults#getLocationParameterInstance}. + * @see yfiles.graph.IPortLocationModel#createParameter + * @see yfiles.graph.IGraph#getPortDefaults + */ + createDefaultPortLocationParameter?(owner:yfiles.graph.IPortOwner,location?:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * 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.styles.IEdgeStyle} [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new edge. + * @returns {yfiles.graph.IEdge} the newly created edge instance + * @see yfiles.graph.IGraph#addEdgeCreatedListener + * @see yfiles.styles.VoidEdgeStyle#INSTANCE + * @abstract + */ + createEdge(source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.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 {Object} options The parameters to pass. + * @param {yfiles.graph.INode} options.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} options.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.styles.IEdgeStyle} [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [options.tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new edge. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @param options.bends An array of bends to add to the newly created edge. Each item will be passed to the {@link yfiles.graph.IGraph#addBend} method. + * @returns {yfiles.graph.IEdge} the newly created edge instance + * @see yfiles.graph.IGraph#addEdgeCreatedListener + * @see yfiles.styles.VoidEdgeStyle#INSTANCE + * @abstract + */ + createEdge(options:{source:yfiles.graph.INode,target:yfiles.graph.INode,style?:yfiles.styles.IEdgeStyle,tag?:Object,labels?:Array,ports?:Array,bends?:Array}):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.styles.IEdgeStyle} [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new edge. + * @returns {yfiles.graph.IEdge} the newly created edge instance + * @see yfiles.graph.IGraph#addEdgeCreatedListener + * @see yfiles.styles.VoidEdgeStyle#INSTANCE + * @abstract + */ + createEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object):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 {Object} options The parameters to pass. + * @param {yfiles.graph.IPort} options.sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} options.targetPort The target port the created edge will connect to. + * @param {yfiles.styles.IEdgeStyle} [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [options.tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new edge. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @param options.bends An array of bends to add to the newly created edge. Each item will be passed to the {@link yfiles.graph.IGraph#addBend} method. + * @returns {yfiles.graph.IEdge} the newly created edge instance + * @see yfiles.graph.IGraph#addEdgeCreatedListener + * @see yfiles.styles.VoidEdgeStyle#INSTANCE + * @abstract + */ + createEdge(options:{sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style?:yfiles.styles.IEdgeStyle,tag?:Object,labels?:Array,ports?:Array,bends?:Array}):yfiles.graph.IEdge; + /** + * Creates a new group node using the provided style and layout as a child of parent. + *

+ * The group node will be a direct descendant of parent. + *

+ *

+ * To create group nodes interactively use the {@link yfiles.input.GraphEditorInputMode} as input mode and enable the + * {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations grouping operations}. + *

+ * @param {yfiles.graph.INode} [parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. + * @param {yfiles.geometry.Rect} [layout=null] The initial layout to use for the new node. + * @param {yfiles.styles.INodeStyle} [style=null] The style to use for the new node. + * @param {Object} [tag=null] The {@link yfiles.graph.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @returns {yfiles.graph.INode} The newly created group node. + * @abstract + */ + createGroupNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * Creates a new group node using the provided style and layout as a child of parent. + *

+ * The group node will be a direct descendant of parent. + *

+ *

+ * To create group nodes interactively use the {@link yfiles.input.GraphEditorInputMode} as input mode and enable the + * {@link yfiles.input.GraphEditorInputMode#allowGroupingOperations grouping operations}. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. + * @param {yfiles.geometry.Rect} [options.layout=null] The initial layout to use for the new node. + * @param {yfiles.styles.INodeStyle} [options.style=null] The style to use for the new node. + * @param {Object} [options.tag=null] The {@link yfiles.graph.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @param options.children An array of nodes to create as child nodes of this group node. Each item will be passed to the {@link yfiles.graph.IGraph#createNode} + * method. + * @returns {yfiles.graph.INode} The newly created group node. + * @abstract + */ + createGroupNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array,children?:Array}):yfiles.graph.INode; + /** + * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.graph.ITagOwner#tag}. + *

+ * The node will be a part of this graph after the method returns. This will trigger the corresponding events. + *

+ * @param {yfiles.geometry.Rect} layout The layout to use initially. The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.styles.INodeStyle} [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new node. + * @returns {yfiles.graph.INode} A newly created node instance + * @see yfiles.graph.IGraph#addNodeCreatedListener + * @see yfiles.styles.VoidNodeStyle#INSTANCE + * @abstract + */ + createNode(layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.graph.ITagOwner#tag}. + *

+ * The node will be a part of this graph after the method returns. This will trigger the corresponding events. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.Rect} options.layout The layout to use initially. The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.styles.INodeStyle} [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [options.tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new node. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @returns {yfiles.graph.INode} A newly created node instance + * @see yfiles.graph.IGraph#addNodeCreatedListener + * @see yfiles.styles.VoidNodeStyle#INSTANCE + * @abstract + */ + createNode(options:{layout:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array}):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent using the given layout and style. + * @param {yfiles.graph.INode} [parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. + * @param {yfiles.geometry.Rect} [layout=null] The layout to use initially. The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field. + * @param {yfiles.styles.INodeStyle} [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [tag=null] The {@link yfiles.graph.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @returns {yfiles.graph.INode} The newly created node. + * @see yfiles.graph.IGraph#setParent + * @see yfiles.graph.IGraph#createNode + * @see yfiles.graph.IGraph#createGroupNode + * @abstract + */ + createNode(parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent using the given layout and style. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.parent=null] The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node. + * @param {yfiles.geometry.Rect} [options.layout=null] The layout to use initially. The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field. + * @param {yfiles.styles.INodeStyle} [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [options.tag=null] The {@link yfiles.graph.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @returns {yfiles.graph.INode} The newly created node. + * @see yfiles.graph.IGraph#setParent + * @see yfiles.graph.IGraph#createNode + * @see yfiles.graph.IGraph#createGroupNode + * @abstract + */ + createNode(options:{parent?:yfiles.graph.INode,layout?:yfiles.geometry.Rect,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array}):yfiles.graph.INode; + /** + * Creates and returns a node using the specified initial center location and style, 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.geometry.Point} location the initial coordinates of the center of the node's {@link yfiles.graph.INode#layout Layout} property + * @param {yfiles.styles.INodeStyle} [style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new node. + * @returns {yfiles.graph.INode} A newly created node instance + * @see yfiles.graph.IGraph#addNodeCreatedListener + */ + createNodeAt?(location:yfiles.geometry.Point,style?:yfiles.styles.INodeStyle,tag?:Object):yfiles.graph.INode; + /** + * Creates and returns a node using the specified initial center location and style, 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 {Object} options The parameters to pass. + * @param {yfiles.geometry.Point} options.location the initial coordinates of the center of the node's {@link yfiles.graph.INode#layout Layout} property + * @param {yfiles.styles.INodeStyle} [options.style=null] The style instance that will be assigned to the newly created instance. This is done by reference. + * @param {Object} [options.tag=null] The initial value of the {@link yfiles.graph.ITagOwner#tag} that will be assigned to the new node. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @returns {yfiles.graph.INode} A newly created node instance + * @see yfiles.graph.IGraph#addNodeCreatedListener + */ + createNodeAt?(options:{location:yfiles.geometry.Point,style?:yfiles.styles.INodeStyle,tag?:Object,labels?:Array,ports?:Array}):yfiles.graph.INode; + /** + * 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.IPort} port The port owner to count the degree of. + * @returns {number} The number of edges that are incident to the port. + */ + degree?(port:yfiles.graph.IPort):number; + /** + * 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.IPortOwner} owner The port owner to count the degree of. + * @returns {number} The number of edges that are incident to the port owner. + */ + degree?(owner:yfiles.graph.IPortOwner):number; + /** + * Returns an {@link yfiles.collections.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} + *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the adjacent + * edges via a foreach loop. + *

+ * @param {yfiles.graph.AdjacencyTypes} [type=yfiles.graph.AdjacencyTypes.ALL] The type of adjacency to consider. + * @param {yfiles.graph.IPortOwner} owner the port owner to check + * @returns {yfiles.collections.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @throws {Stubs.Exceptions.ArgumentError} If owner is not in this graph + * @see yfiles.graph.IGraph#inEdgesAt + * @see yfiles.graph.IGraph#outEdgesAt + * @see yfiles.graph.AdjacencyTypes + * @abstract + */ + edgesAt(owner:yfiles.graph.IPortOwner,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; + /** + * 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}. + *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the adjacent + * edges via a foreach loop. + *

+ * @param {yfiles.graph.IPort} port the port to check + * @param {yfiles.graph.AdjacencyTypes} [type=yfiles.graph.AdjacencyTypes.ALL] The type of adjacency to consider. + * @returns {yfiles.collections.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @throws {Stubs.Exceptions.ArgumentError} If port is not in this graph + * @see yfiles.graph.IGraph#inEdgesAt + * @see yfiles.graph.IGraph#outEdgesAt + * @see yfiles.graph.AdjacencyTypes + * @abstract + */ + edgesAt(port:yfiles.graph.IPort,type?:yfiles.graph.AdjacencyTypes):yfiles.collections.IListEnumerable; + /** + * Returns an enumerable over the children of the provided node. + * @param {yfiles.graph.INode} node The node for which to return the children or null if the top-level nodes should be returned. + * @returns {yfiles.collections.IListEnumerable.} All nodes that have node as their {@link yfiles.graph.IGraph#getParent parent}. + * @throws {Stubs.Exceptions.ArgumentError} If node is not in this graph + * @abstract + */ + getChildren(node:yfiles.graph.INode):yfiles.collections.IListEnumerable; + /** + * Finds an edge that connects sourcePort and targetPort in the given graph. + * @param {yfiles.graph.IPort} sourcePort The {@link yfiles.graph.IEdge#sourcePort} of the edge to find. + * @param {yfiles.graph.IPort} targetPort The {@link yfiles.graph.IEdge#targetPort} of the edge to find. + * @returns {yfiles.graph.IEdge} An edge that satisfies the constraints or null, if none was found. + */ + getEdge?(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Finds an edge that connects from and to in the given graph. + * @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. + * @returns {yfiles.graph.IEdge} An edge that satisfies the constraints or null, if none was found. + */ + getEdge?(from:yfiles.graph.IPortOwner,to:yfiles.graph.IPortOwner):yfiles.graph.IEdge; + /** + * Gets the {@link yfiles.graph.ILabelDefaults label defaults} for a given {@link yfiles.graph.ILabelOwner} in the context of the graph. + * @param {yfiles.graph.ILabelOwner} owner The item that the label defaults are returned for. If this is a group node, the {@link yfiles.graph.IGraph#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. + * @returns {yfiles.graph.ILabelDefaults} Appropriate {@link yfiles.graph.ILabelDefaults} for the provided owner. + */ + getLabelDefaults?(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelDefaults; + /** + * Returns the parent node of the node or null if node is a top-level node. + * @param {yfiles.graph.INode} node The node to retrieve the parent node for. + * @returns {yfiles.graph.INode} The parent node in this hierarchy or null if node is a top-level node. + * @throws {Stubs.Exceptions.ArgumentError} If node is not in this graph or is null. + * @abstract + */ + getParent(node:yfiles.graph.INode):yfiles.graph.INode; + /** + * Gets the {@link yfiles.graph.IPortDefaults port defaults} for a given {@link yfiles.graph.IPortOwner} in the context of the graph. + * @param {yfiles.graph.IPortOwner} owner The item that the label defaults are returned for. If this is a group node, the {@link yfiles.graph.IGraph#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. + * @returns {yfiles.graph.IPortDefaults} Appropriate {@link yfiles.graph.IPortDefaults} for the provided owner. + */ + getPortDefaults?(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortDefaults; + /** + * 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.IGraph#setParent} + * for each node in the children enumerable whose parent is not part of the set. + *

+ * @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 yfiles.graph.IGraph#groupNodes + * @see yfiles.graph.IGraph#setParent + * @see yfiles.graph.IGraph#createGroupNode + */ + groupNodes?(parent:yfiles.graph.INode,children:yfiles.collections.IEnumerable):void; + /** + * 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. + * @returns {yfiles.graph.INode} The newly created group node. + * @see yfiles.graph.GroupingSupport#getNearestCommonAncestor + * @see yfiles.graph.IGraph#groupNodes + */ + groupNodes?(children:yfiles.collections.IEnumerable):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 {Object} options The parameters to pass. + * @param {yfiles.collections.IEnumerable.} options.children The children to group into the new group node. + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addLabel} + * method. + * @param options.ports An array of ports to add to the newly created node. Each item will be passed to the {@link yfiles.graph.IGraph#addPort} method. + * @returns {yfiles.graph.INode} The newly created group node. + * @see yfiles.graph.GroupingSupport#getNearestCommonAncestor + * @see yfiles.graph.IGraph#groupNodes + */ + groupNodes?(options:{children:yfiles.collections.IEnumerable,labels?:Array,ports?:Array}):yfiles.graph.INode; + /** + * Calculates the number of incoming edges at the given {@link yfiles.graph.IPort} for this graph. + * @param {yfiles.graph.IPort} port The port to count the incoming edges of. + * @returns {number} The number of edges that have the port as their target port. + */ + inDegree?(port:yfiles.graph.IPort):number; + /** + * Calculates the number of incoming edges at the given {@link yfiles.graph.IPortOwner} for this graph. + * @param {yfiles.graph.IPortOwner} owner The port owner to count the incoming edges of. + * @returns {number} The number of edges that have the port owner as their target port's owner. + */ + inDegree?(owner:yfiles.graph.IPortOwner):number; + /** + * Convenience method that yields the incoming edges at the given port. + *

+ * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#INCOMING}. + *

+ *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the incoming + * edges via a foreach loop. + *

+ * @param {yfiles.graph.IPort} port The port of the edges. + * @returns {yfiles.collections.IListEnumerable.} An enumerable for the edges. + */ + inEdgesAt?(port:yfiles.graph.IPort):yfiles.collections.IListEnumerable; + /** + * Convenience method that yields the incoming edges at the given owner. + *

+ * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#INCOMING}. + *

+ *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the incoming + * edges via a foreach loop. + *

+ * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @returns {yfiles.collections.IListEnumerable.} An enumerable for the edges. + */ + inEdgesAt?(owner:yfiles.graph.IPortOwner):yfiles.collections.IListEnumerable; + /** + * 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. + *

+ * @abstract + */ + invalidateDisplays():void; + /** + * Returns whether the given node is considered a group node. + *

+ * Group nodes may have children but do not necessarily need to have {@link yfiles.graph.IGraph#getChildren children}. + *

+ * @param {yfiles.graph.INode} node The node to check. + * @returns {boolean} Whether the node is considered a group node. + * @throws {Stubs.Exceptions.ArgumentError} If node is not in this graph. + * @see yfiles.graph.IGraph#getChildren + * @see yfiles.graph.IGraph#setIsGroupNode + * @abstract + */ + isGroupNode(node:yfiles.graph.INode):boolean; + /** + * Enumerates the neighbors of a given {@link yfiles.graph.INode}. + *

+ * Neighbors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} and inspecting the {@link yfiles.graph.IGraph#edgesAt edges at these ports}, collecting the + * {@link yfiles.graph.IEdge#opposite}s. + *

+ * @param {yfiles.graph.INode} node The node. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all neighbor nodes. + */ + neighbors?(node:yfiles.graph.INode):yfiles.collections.IEnumerable; + /** + * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPort} for this graph. + * @param {yfiles.graph.IPort} port The port to count the outgoing edges of. + * @returns {number} The number of edges that have the port as their source port. + */ + outDegree?(port:yfiles.graph.IPort):number; + /** + * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPortOwner} for this graph. + * @param {yfiles.graph.IPortOwner} owner The port owner to count the outgoing edges of. + * @returns {number} The number of edges that have the port owner as their source port's owner. + */ + outDegree?(owner:yfiles.graph.IPortOwner):number; + /** + * Convenience method that yields the outgoing edges at the given port. + *

+ * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#OUTGOING}. + *

+ *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the outgoing + * edges via a foreach loop. + *

+ * @param {yfiles.graph.IPort} port The owner of the edges. + * @returns {yfiles.collections.IListEnumerable.} An enumerable for the edges. + */ + outEdgesAt?(port:yfiles.graph.IPort):yfiles.collections.IListEnumerable; + /** + * Convenience method that yields the outgoing edges at the given owner. + *

+ * This method delegates to {@link yfiles.graph.IGraph#edgesAt} using {@link yfiles.graph.AdjacencyTypes#OUTGOING}. + *

+ *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the outgoing + * edges via a foreach loop. + *

+ * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @returns {yfiles.collections.IListEnumerable.} An enumerable for the edges. + */ + outEdgesAt?(owner:yfiles.graph.IPortOwner):yfiles.collections.IListEnumerable; + /** + * Enumerates the predecessors of a given {@link yfiles.graph.INode}. + *

+ * Predecessors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} and inspecting the {@link yfiles.graph.IGraph#inEdgesAt incoming edges at these ports}, collecting the {@link yfiles.graph.IEdge#sourcePort} {@link yfiles.graph.IPort#owner}s. + *

+ * @param {yfiles.graph.INode} node The node. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all predecessors. + */ + predecessors?(node:yfiles.graph.INode):yfiles.collections.IEnumerable; + /** + * Removes the given {@link yfiles.graph.IModelItem item} from this graph. + *

+ * The item must be a part of this graph. + *

+ *

+ * If the item is a {@link yfiles.graph.INode node} the {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} event will be triggered. The + * implementation 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. + *

+ *

+ * If the item is an {@link yfiles.graph.IEdge edge} the {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved} event will be triggered. 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. + *

+ *

+ * If the item is a {@link yfiles.graph.IBend bend} the {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} event will be triggered. + *

+ *

+ * If the item is a {@link yfiles.graph.IPort port} the {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} event will be triggered. This + * will also remove all edges that are currently connected to the port. + *

+ *

+ * If the item is a {@link yfiles.graph.ILabel label} the {@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved} event will be triggered. + *

+ * @param {yfiles.graph.IModelItem} item the live item to be removed from this graph instance + * @throws {Stubs.Exceptions.ArgumentError} item is not part of the graph. + * @abstract + */ + remove(item:yfiles.graph.IModelItem):void; + /** + * Reverses an edge by {@link yfiles.graph.IGraph#setEdgePorts 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. + */ + reverse?(edge:yfiles.graph.IEdge):void; + /** + * Modifies the location of the given bend. + * @param {yfiles.graph.IBend} bend the bend whose location is to be modified + * @param {yfiles.geometry.Point} location the new location of the bend + * @see yfiles.graph.IGraph#addBend + * @abstract + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.Point):void; + /** + * Sets the ports of the given edge to the new values. + *

+ * This will trigger an {@link yfiles.graph.IGraph#addEdgePortsChangedListener EdgePortsChanged} 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. + * @abstract + */ + setEdgePorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Determines whether the given node should be considered a group node. + *

+ * Group nodes may have {@link yfiles.graph.IGraph#getChildren children} but do not necessarily need to have one. Attempting to set a node to the + * non-group-node-status while it has children at the same time will result in an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @param {yfiles.graph.INode} node The node to set the group node status for. + * @param {boolean} isGroupNode Whether to make the node a group node. + * @throws {Stubs.Exceptions.InvalidOperationError} If node is the root or currently has children and isGroupNode is false. + * @throws {Stubs.Exceptions.ArgumentError} If node is not in this graph. + * @see yfiles.graph.IGraph#getChildren + * @see yfiles.graph.IGraph#isGroupNode + * @abstract + */ + setIsGroupNode(node:yfiles.graph.INode,isGroupNode:boolean):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The new parameter. + * @throws {Stubs.Exceptions.ArgumentError} If the layoutParameter cannot be used for this label. + * @throws {Stubs.Exceptions.ArgumentError} If the label does not belong to this graph. + * @abstract + */ + setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.Size} preferredSize The new preferred size. + * @see yfiles.graph.ILabel#preferredSize + * @abstract + */ + setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; + /** + * 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 yfiles.graph.ILabel#text + * @abstract + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Sets the center of a node to the given world coordinates. + *

+ * This implementation delegates to {@link yfiles.graph.IGraph#setNodeLayout} + *

+ * @param {yfiles.graph.INode} node The node to recenter. + * @param {yfiles.geometry.Point} center The new center coordinates of the node in the world coordinate system. + */ + setNodeCenter?(node:yfiles.graph.INode,center:yfiles.geometry.Point):void; + /** + * Sets the layout of the given node to the new value. + * @param {yfiles.graph.INode} node a live node that belongs to this graph + * @param {yfiles.geometry.Rect} layout The new layout of the node to assign to its {@link yfiles.graph.INode#layout}. + * @see yfiles.graph.INode#layout + * @abstract + */ + setNodeLayout(node:yfiles.graph.INode,layout:yfiles.geometry.Rect):void; + /** + * Sets the parent node for a given node. + *

+ * Use null as parent 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 or null to make node a top-level node. + * @throws {Stubs.Exceptions.ArgumentError} If node is null. + * @throws {Stubs.Exceptions.ArgumentError} If node is not in this graph + * @see yfiles.graph.IGraph#getParent + * @abstract + */ + setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):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#setPortLocationParameter} method should be used + * instead. This implementation will use the port's {@link yfiles.graph.IPort#locationParameter}'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. + *

+ * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.geometry.Point} location the new absolute coordinates of the port + * @see yfiles.graph.IGraph#addPort + */ + setPortLocation?(port:yfiles.graph.IPort,location:yfiles.geometry.Point):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 + * @abstract + */ + setPortLocationParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * 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 Stubs.Exceptions.ArgumentError}. + * This method will delegate to {@link yfiles.graph.IGraph#setPortLocation}. + *

+ * @param {yfiles.graph.IPort} port the port + * @param {yfiles.geometry.Point} relativeLocation the new coordinate offsets relative to the center of the node's {@link yfiles.graph.INode#layout}'s center. + * @throws {Stubs.Exceptions.ArgumentError} If the port is not owned by a node + * @see yfiles.graph.INode#layout + */ + setRelativePortLocation?(port:yfiles.graph.IPort,relativeLocation:yfiles.geometry.Point):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.styles.IPortStyle} style The style instance that will be assigned to the port. + * @see yfiles.graph.IPort#style + * @see yfiles.graph.IGraph#addPortStyleChangedListener + * @see yfiles.styles.VoidPortStyle#INSTANCE + * @abstract + */ + setStyle(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):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.styles.IEdgeStyle} style The style instance that will be assigned to the edge. + * @see yfiles.graph.IEdge#style + * @see yfiles.graph.IGraph#addEdgeStyleChangedListener + * @see yfiles.styles.VoidEdgeStyle#INSTANCE + * @abstract + */ + setStyle(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):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.styles.ILabelStyle} style The style instance that will be assigned to the label. + * @see yfiles.graph.ILabel#style + * @see yfiles.graph.IGraph#addLabelStyleChangedListener + * @see yfiles.styles.VoidLabelStyle#INSTANCE + * @abstract + */ + setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):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.styles.INodeStyle} style The style instance that will be assigned to the node. + * @see yfiles.graph.INode#style + * @see yfiles.graph.IGraph#addNodeStyleChangedListener + * @see yfiles.styles.VoidNodeStyle#INSTANCE + * @abstract + */ + setStyle(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):void; + /** + * Enumerates the successors of a given {@link yfiles.graph.INode}. + *

+ * Successors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} and inspecting the {@link yfiles.graph.IGraph#outEdgesAt outgoing edges at these ports}, collecting the {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IPort#owner}s. + *

+ * @param {yfiles.graph.INode} node The node. + * @returns {yfiles.collections.IEnumerable.} An enumerable over all successors. + */ + successors?(node:yfiles.graph.INode):yfiles.collections.IEnumerable; + /** + * A 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. + *

+ *

+ * Note that even though nodes can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the nodes in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the nodes via a foreach + * loop. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + nodes:yfiles.collections.IListEnumerable; + /** + * A 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. + *

+ *

+ * Note that even though edges can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the edges via a foreach + * loop. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + edges:yfiles.collections.IListEnumerable; + /** + * A view of the node and edge labels contained in this graph. + *

+ * This is a live view of the labels that always represents the current state of the graph. The same reference will be + * returned for each invocation. + *

+ *

+ * Note that even though labels can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the labels in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the labels via a + * foreach loop. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + /** + * A 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. + *

+ *

+ * Note that even though ports can be accessed via index, the underlying graph structure in the default {@link yfiles.graph.IGraph} + * implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the ports in + * your own list, if possible. This is not necessary for the first or last element or when iterating over the ports via a foreach + * loop. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + /** + * 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. + *

+ * @abstract + * @type {yfiles.graph.INodeDefaults} + */ + 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. + *

+ * @abstract + * @type {yfiles.graph.IEdgeDefaults} + */ + 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 yfiles.graph.IMapperRegistry + * @see yfiles.graph.IModelItem + * @see yfiles.graph.ITagOwner#tag + * @abstract + * @type {yfiles.graph.IMapperRegistry} + */ + mapperRegistry:yfiles.graph.IMapperRegistry; + /** + * Adds the given listener for the GraphTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of the graph 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#removeGraphTagChangedListener + * @abstract + */ + addGraphTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the GraphTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of the graph 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#addGraphTagChangedListener + * @abstract + */ + removeGraphTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the NodeCreated event that occurs when a node has been created. + *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#createNode + * @see yfiles.graph.IGraph#createGroupNode + * @see yfiles.input.GraphEditorInputMode#addNodeCreatedListener + * @see yfiles.graph.IGraph#removeNodeCreatedListener + * @abstract + */ + addNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the NodeCreated event that occurs when a node has been created. + *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#createNode + * @see yfiles.graph.IGraph#createGroupNode + * @see yfiles.input.GraphEditorInputMode#addNodeCreatedListener + * @see yfiles.graph.IGraph#addNodeCreatedListener + * @abstract + */ + removeNodeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the DisplaysInvalidated event that occurs when the graph has changed visually and the + * display should be updated to reflect the changes. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#removeDisplaysInvalidatedListener + * @abstract + */ + addDisplaysInvalidatedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Removes the given listener for the DisplaysInvalidated event that occurs when the graph has changed visually and the + * display should be updated to reflect the changes. + *

+ * This event is invoked with {@link yfiles.lang.EventArgs#EMPTY} per default. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#addDisplaysInvalidatedListener + * @abstract + */ + removeDisplaysInvalidatedListener(listener:(sender:Object,evt:yfiles.lang.EventArgs)=>void):void; + /** + * Adds the given listener for the NodeRemoved event that occurs when a node has been removed. + *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#removeNodeRemovedListener + * @abstract + */ + addNodeRemovedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Removes the given listener for the NodeRemoved event that occurs when a node has been removed. + *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#addNodeRemovedListener + * @abstract + */ + removeNodeRemovedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Adds the given listener for the NodeStyleChanged event that occurs when a node 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#removeNodeStyleChangedListener + * @abstract + */ + addNodeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the NodeStyleChanged event that occurs when a node 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#addNodeStyleChangedListener + * @abstract + */ + removeNodeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the NodeLayoutChanged event that occurs when a node layout 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. + *

+ * @param {function(Object, yfiles.graph.INode, yfiles.geometry.Rect): void} listener The listener to add. + * @see yfiles.graph.IGraph#setNodeLayout + * @see yfiles.graph.IGraph#removeNodeLayoutChangedListener + * @abstract + */ + addNodeLayoutChangedListener(listener:(source:Object,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; + /** + * Removes the given listener for the NodeLayoutChanged event that occurs when a node layout 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. + *

+ * @param {function(Object, yfiles.graph.INode, yfiles.geometry.Rect): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setNodeLayout + * @see yfiles.graph.IGraph#addNodeLayoutChangedListener + * @abstract + */ + removeNodeLayoutChangedListener(listener:(source:Object,node:yfiles.graph.INode,oldLayout:yfiles.geometry.Rect)=>void):void; + /** + * Adds the given listener for the NodeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a node 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#removeNodeTagChangedListener + * @abstract + */ + addNodeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the NodeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a node 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#addNodeTagChangedListener + * @abstract + */ + removeNodeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the EdgeCreated event that occurs when an edge has been created. + *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener EdgeCreated} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#createEdge + * @see yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener + * @see yfiles.graph.IGraph#removeEdgeCreatedListener + * @abstract + */ + addEdgeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeCreated event that occurs when an edge has been created. + *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener EdgeCreated} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#createEdge + * @see yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener + * @see yfiles.graph.IGraph#addEdgeCreatedListener + * @abstract + */ + removeEdgeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the EdgeRemoved event that occurs when an edge has been removed. + *

+ * This event will be triggered, too, prior to a node removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#removeEdgeRemovedListener + * @abstract + */ + addEdgeRemovedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeRemoved event that occurs when an edge has been removed. + *

+ * This event will be triggered, too, prior to a node removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#addEdgeRemovedListener + * @abstract + */ + removeEdgeRemovedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Adds the given listener for the EdgeStyleChanged event that occurs when an edge 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#removeEdgeStyleChangedListener + * @abstract + */ + addEdgeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeStyleChanged event that occurs when an edge 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#addEdgeStyleChangedListener + * @abstract + */ + removeEdgeStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the EdgePortsChanged event that occurs when an edge had its {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IGraph#setEdgePorts 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. + *

+ * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#setEdgePorts + * @see yfiles.graph.IGraph#removeEdgePortsChangedListener + * @abstract + */ + addEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Removes the given listener for the EdgePortsChanged event that occurs when an edge had its {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IGraph#setEdgePorts 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. + *

+ * @param {function(Object, yfiles.graph.EdgeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setEdgePorts + * @see yfiles.graph.IGraph#addEdgePortsChangedListener + * @abstract + */ + removeEdgePortsChangedListener(listener:(sender:Object,evt:yfiles.graph.EdgeEventArgs)=>void):void; + /** + * Adds the given listener for the EdgeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of an edge 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#removeEdgeTagChangedListener + * @abstract + */ + addEdgeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the EdgeTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of an edge 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#addEdgeTagChangedListener + * @abstract + */ + removeEdgeTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the BendAdded event that occurs when 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 {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#addBend + * @see yfiles.input.CreateBendInputMode#addBendCreatedListener + * @see yfiles.graph.IGraph#removeBendAddedListener + * @abstract + */ + addBendAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the BendAdded event that occurs when 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 {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#addBend + * @see yfiles.input.CreateBendInputMode#addBendCreatedListener + * @see yfiles.graph.IGraph#addBendAddedListener + * @abstract + */ + removeBendAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the BendRemoved event that occurs when 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. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.BendEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#removeBendRemovedListener + * @abstract + */ + addBendRemovedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * Removes the given listener for the BendRemoved event that occurs when 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. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.BendEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#addBendRemovedListener + * @abstract + */ + removeBendRemovedListener(listener:(sender:Object,evt:yfiles.graph.BendEventArgs)=>void):void; + /** + * Adds the given listener for the BendLocationChanged event that occurs when the location of 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. + *

+ * @param {function(Object, yfiles.graph.IBend, yfiles.geometry.Point): void} listener The listener to add. + * @see yfiles.graph.IGraph#setBendLocation + * @see yfiles.graph.IGraph#removeBendLocationChangedListener + * @abstract + */ + addBendLocationChangedListener(listener:(source:Object,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; + /** + * Removes the given listener for the BendLocationChanged event that occurs when the location of 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. + *

+ * @param {function(Object, yfiles.graph.IBend, yfiles.geometry.Point): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setBendLocation + * @see yfiles.graph.IGraph#addBendLocationChangedListener + * @abstract + */ + removeBendLocationChangedListener(listener:(source:Object,bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.Point)=>void):void; + /** + * Adds the given listener for the BendTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a bend 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#removeBendTagChangedListener + * @abstract + */ + addBendTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the BendTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a bend 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#addBendTagChangedListener + * @abstract + */ + removeBendTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the LabelAdded event that occurs when 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 {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#addLabel + * @see yfiles.input.GraphEditorInputMode#addLabelAddedListener + * @see yfiles.graph.IGraph#removeLabelAddedListener + * @abstract + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the LabelAdded event that occurs when 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 {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} + * 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#addLabel + * @see yfiles.input.GraphEditorInputMode#addLabelAddedListener + * @see yfiles.graph.IGraph#addLabelAddedListener + * @abstract + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the LabelRemoved event that occurs when 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. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.input.GraphEditorInputMode#addLabelTextChangedListener + * @see yfiles.graph.IGraph#removeLabelRemovedListener + * @abstract + */ + addLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelRemoved event that occurs when 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. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.input.GraphEditorInputMode#addLabelTextChangedListener + * @see yfiles.graph.IGraph#addLabelRemovedListener + * @abstract + */ + removeLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the LabelStyleChanged event that occurs when a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#removeLabelStyleChangedListener + * @abstract + */ + addLabelStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the LabelStyleChanged event that occurs when a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#addLabelStyleChangedListener + * @abstract + */ + removeLabelStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the LabelPreferredSizeChanged event that occurs when the preferred size of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setLabelPreferredSize + * @see yfiles.graph.IGraph#removeLabelPreferredSizeChangedListener + * @abstract + */ + addLabelPreferredSizeChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the LabelPreferredSizeChanged event that occurs when the preferred size of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setLabelPreferredSize + * @see yfiles.graph.IGraph#addLabelPreferredSizeChangedListener + * @abstract + */ + removeLabelPreferredSizeChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTextChanged event that occurs when the text of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setLabelText + * @see yfiles.graph.IGraph#removeLabelTextChangedListener + * @abstract + */ + addLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTextChanged event that occurs when the text of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setLabelText + * @see yfiles.graph.IGraph#addLabelTextChangedListener + * @abstract + */ + removeLabelTextChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the LabelLayoutParameterChanged event that occurs when the model parameter of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setLabelLayoutParameter + * @see yfiles.graph.IGraph#removeLabelLayoutParameterChangedListener + * @abstract + */ + addLabelLayoutParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the LabelLayoutParameterChanged event that occurs when the model parameter of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setLabelLayoutParameter + * @see yfiles.graph.IGraph#addLabelLayoutParameterChangedListener + * @abstract + */ + removeLabelLayoutParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the LabelTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#removeLabelTagChangedListener + * @abstract + */ + addLabelTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the LabelTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a label 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#addLabelTagChangedListener + * @abstract + */ + removeLabelTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the PortAdded event that occurs when 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#addPort + * @see yfiles.graph.IGraph#createEdge + * @see yfiles.graph.IGraph#removePortAddedListener + * @abstract + */ + addPortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the PortAdded event that occurs when 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. + *

+ * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#addPort + * @see yfiles.graph.IGraph#createEdge + * @see yfiles.graph.IGraph#addPortAddedListener + * @abstract + */ + removePortAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the PortRemoved event that occurs when 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. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.PortEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#removePortRemovedListener + * @abstract + */ + addPortRemovedListener(listener:(sender:Object,evt:yfiles.graph.PortEventArgs)=>void):void; + /** + * Removes the given listener for the PortRemoved event that occurs when 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. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. Please use the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * 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. + *

+ * @param {function(Object, yfiles.graph.PortEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#remove + * @see yfiles.input.GraphEditorInputMode#addDeletedItemListener + * @see yfiles.graph.IGraph#addPortRemovedListener + * @abstract + */ + removePortRemovedListener(listener:(sender:Object,evt:yfiles.graph.PortEventArgs)=>void):void; + /** + * Adds the given listener for the PortStyleChanged event that occurs when a port 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#removePortStyleChangedListener + * @abstract + */ + addPortStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PortStyleChanged event that occurs when a port 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setStyle + * @see yfiles.graph.IGraph#addPortStyleChangedListener + * @abstract + */ + removePortStyleChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the PortLocationParameterChanged event that occurs when the location model parameter of a + * port 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.IGraph#setPortLocationParameter + * @see yfiles.graph.IGraph#removePortLocationParameterChangedListener + * @abstract + */ + addPortLocationParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PortLocationParameterChanged event that occurs when the location model parameter of a + * port 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.IGraph#setPortLocationParameter + * @see yfiles.graph.IGraph#addPortLocationParameterChangedListener + * @abstract + */ + removePortLocationParameterChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Adds the given listener for the PortTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a port 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#removePortTagChangedListener + * @abstract + */ + addPortTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PortTagChanged event that occurs when the {@link yfiles.graph.ITagOwner#tag tag} of a port 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. + *

+ * @param {function(Object, yfiles.graph.ItemChangedEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITagOwner#tag + * @see yfiles.graph.IGraph#addPortTagChangedListener + * @abstract + */ + removePortTagChangedListener(listener:(sender:Object,evt:yfiles.graph.ItemChangedEventArgs)=>void):void; + /** + * Gets or sets the defaults for group nodes. + * @abstract + * @type {yfiles.graph.INodeDefaults} + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * Adds the given listener for the ParentChanged + * event. + *
+ * Event that will be triggered if an node has been reparented in the model. + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#removeParentChangedListener + * @abstract + */ + addParentChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Removes the given listener for the ParentChanged + * event. + *
+ * Event that will be triggered if an node has been reparented in the model. + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#addParentChangedListener + * @abstract + */ + removeParentChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Adds the given listener for the IsGroupNodeChanged + * event. + *
+ * Event that will be triggered if the group node status of a node has changed. + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to add. + * @see yfiles.graph.IGraph#removeIsGroupNodeChangedListener + * @abstract + */ + addIsGroupNodeChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Removes the given listener for the IsGroupNodeChanged + * event. + *
+ * Event that will be triggered if the group node status of a node has changed. + * @param {function(Object, yfiles.graph.NodeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.IGraph#addIsGroupNodeChangedListener + * @abstract + */ + removeIsGroupNodeChangedListener(listener:(sender:Object,evt:yfiles.graph.NodeEventArgs)=>void):void; + /** + * Gets a {@link yfiles.graph.GraphDecorator} instance for use with the given graph. + * @returns A new {@link yfiles.graph.GraphDecorator} + * @type {yfiles.graph.GraphDecorator} + */ + decorator?:yfiles.graph.GraphDecorator; + /** + * Creates a {@link yfiles.graph.GroupingSupport} instance for the graph. + *

+ * {@link yfiles.graph.GroupingSupport} provides less frequently used methods for grouped graphs, such as methods for analyzing and + * walking the grouping hierarchy. + *

+ * @returns + * @type {yfiles.graph.GroupingSupport} + */ + groupingSupport?:yfiles.graph.GroupingSupport; + /** + * Gets the {@link yfiles.graph.IFoldingView folding view} instance associated with this {@link yfiles.graph.IGraph} or null if none is associated with it. + *

+ * This convenience method uses the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.graph.IGraph} to obtain the + * {@link yfiles.graph.IFoldingView}. + *

+ * @returns The implementation of the {@link yfiles.graph.IFoldingView} or null if the graph has not been created by a + * {@link yfiles.graph.FoldingManager}. + * @see yfiles.graph.FoldingManager + * @type {yfiles.graph.IFoldingView} + */ + foldingView?:yfiles.graph.IFoldingView; + /** + * Gets the {@link yfiles.graph.UndoEngine} instance associated with this {@link yfiles.graph.IGraph} or null if none is associated with + * it. + *

+ * This convenience method uses the {@link yfiles.graph.ILookup#lookup} of the {@link yfiles.graph.IGraph} to obtain the + * {@link yfiles.graph.UndoEngine}. + *

+ * @returns The implementation of the {@link yfiles.graph.UndoEngine} or null if {@link yfiles.graph.DefaultGraph#undoEngineEnabled undo is not supported}. + * @type {yfiles.graph.UndoEngine} + */ + undoEngine?:yfiles.graph.UndoEngine; + /** + * Gets or sets whether or not the {@link yfiles.graph.UndoEngine} used for this instance should be enabled. + * @see yfiles.graph.IGraph#undoEngine + * @type {boolean} + */ + undoEngineEnabled?:boolean; + /** + * Gets a live view of all bends contained in this {@link yfiles.graph.IGraph}. + * @type {yfiles.collections.IEnumerable.} + */ + bends?:yfiles.collections.IEnumerable; + /** + * Gets a live view of all edge labels contained in this {@link yfiles.graph.IGraph}. + * @type {yfiles.collections.IEnumerable.} + */ + edgeLabels?:yfiles.collections.IEnumerable; + /** + * Gets a live view of all node labels contained in this {@link yfiles.graph.IGraph}. + * @type {yfiles.collections.IEnumerable.} + */ + nodeLabels?:yfiles.collections.IEnumerable; + } + var IGraph:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.INode} type and carries additional information + * about the parent node and the group node status. + *

+ * Since for some events ({@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved}, + * {@link yfiles.graph.IGraph#addIsGroupNodeChangedListener IsGroupNodeChanged}, + * {@link yfiles.graph.IGraph#addParentChangedListener ParentChanged}) it is unclear which {@link yfiles.graph.NodeEventArgs#parent} or {@link yfiles.graph.NodeEventArgs#isGroupNode} the node had before the event + * this event can be used to carry exactly that information. + *

+ * @class yfiles.graph.NodeEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface NodeEventArgs extends yfiles.collections.ItemEventArgs{} + export class NodeEventArgs { + /** + * Creates a new instance. + * @param {yfiles.graph.INode} item The node that has changed. + * @param {yfiles.graph.INode} oldParent The parent the node had before this event. + * @param {boolean} oldIsGroupNode Whether the node was a group node before this event. + * @constructor + */ + constructor(item:yfiles.graph.INode,oldParent:yfiles.graph.INode,oldIsGroupNode:boolean); + /** + * The parent of the {@link yfiles.collections.ItemEventArgs.#item node} before this event. + * @type {yfiles.graph.INode} + */ + parent:yfiles.graph.INode; + /** + * Whether the {@link yfiles.collections.ItemEventArgs.#item node} was a group node before this event. + * @type {boolean} + */ + isGroupNode:boolean; + static $class:yfiles.lang.Class; + } + /** + * A specialized subclass of the {@link yfiles.collections.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#addEdgePortsChangedListener EdgePortsChanged} 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. + *

+ * @class yfiles.graph.EdgeEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface EdgeEventArgs extends yfiles.collections.ItemEventArgs{} + export class EdgeEventArgs { + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeEventArgs} class. + * @param {yfiles.graph.IEdge} edge The edge to assign to the {@link yfiles.collections.ItemEventArgs.#item} property. + * @param {yfiles.graph.IPort} [sourcePort=null] The source port the edge was connected to before the event happened. + * @param {yfiles.graph.IPort} [targetPort=null] The target port the edge was connected to before the event happened. + * @param {yfiles.graph.IPortOwner} [sourcePortOwner=null] The owner of the source port the edge was connected to before the event happened. + * @param {yfiles.graph.IPortOwner} [targetPortOwner=null] The owner of the target port the edge was connected to before the event happened. + * @constructor + */ + constructor(edge:yfiles.graph.IEdge,sourcePort?:yfiles.graph.IPort,targetPort?:yfiles.graph.IPort,sourcePortOwner?:yfiles.graph.IPortOwner,targetPortOwner?:yfiles.graph.IPortOwner); + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeEventArgs} class. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IEdge} options.edge The edge to assign to the {@link yfiles.collections.ItemEventArgs.#item} property. + * @param {yfiles.graph.IPort} [options.sourcePort=null] The source port the edge was connected to before the event happened. + * @param {yfiles.graph.IPort} [options.targetPort=null] The target port the edge was connected to before the event happened. + * @param {yfiles.graph.IPortOwner} [options.sourcePortOwner=null] The owner of the source port the edge was connected to before the event happened. + * @param {yfiles.graph.IPortOwner} [options.targetPortOwner=null] The owner of the target port the edge was connected to before the event happened. + * @constructor + */ + constructor(options:{edge:yfiles.graph.IEdge,sourcePort?:yfiles.graph.IPort,targetPort?:yfiles.graph.IPort,sourcePortOwner?:yfiles.graph.IPortOwner,targetPortOwner?:yfiles.graph.IPortOwner}); + /** + * Gets the source port the edge was connected to before the event happened. + * @type {yfiles.graph.IPort} + */ + sourcePort:yfiles.graph.IPort; + /** + * Gets the target port the edge was connected to before the event happened. + * @type {yfiles.graph.IPort} + */ + targetPort:yfiles.graph.IPort; + /** + * Gets the owner of the source port the edge was connected to before the event happened. + * @type {yfiles.graph.IPortOwner} + */ + sourcePortOwner:yfiles.graph.IPortOwner; + /** + * Gets the owner of the target port the edge was connected to before the event happened. + * @type {yfiles.graph.IPortOwner} + */ + targetPortOwner:yfiles.graph.IPortOwner; + static $class:yfiles.lang.Class; + } + /** + * A specialized subclass of the {@link yfiles.collections.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. + *

+ * @class yfiles.graph.PortEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface PortEventArgs extends yfiles.collections.ItemEventArgs{} + export class PortEventArgs { + /** + * Initializes a new instance of the {@link yfiles.graph.PortEventArgs} class. + * @param {yfiles.graph.IPort} port The port to assign to the {@link yfiles.collections.ItemEventArgs.#item} property. + * @param {yfiles.graph.IPortOwner} owner The owner of the port the port was attached to. + * @constructor + */ + constructor(port:yfiles.graph.IPort,owner:yfiles.graph.IPortOwner); + /** + * Gets the owner the port the was connected to before the event happened. + * @type {yfiles.graph.IPortOwner} + */ + owner:yfiles.graph.IPortOwner; + static $class:yfiles.lang.Class; + } + /** + * A specialized subclass of the {@link yfiles.collections.ItemEventArgs.} class that is bound to the {@link yfiles.graph.ILabel} type and carries additional {@link yfiles.graph.ILabelOwner 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. + *

+ * @class yfiles.graph.LabelEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface LabelEventArgs extends yfiles.collections.ItemEventArgs{} + export class LabelEventArgs { + /** + * Initializes a new instance of the {@link yfiles.graph.LabelEventArgs} class. + * @param {yfiles.graph.ILabel} label The label to assign to the {@link yfiles.collections.ItemEventArgs.#item} property. + * @param {yfiles.graph.ILabelOwner} owner The previous owner of the label. + * @constructor + */ + constructor(label:yfiles.graph.ILabel,owner:yfiles.graph.ILabelOwner); + /** + * Gets the owner of the label that owned the label before the event happened. + * @type {yfiles.graph.ILabelOwner} + */ + owner:yfiles.graph.ILabelOwner; + static $class:yfiles.lang.Class; + } + /** + * A specialized subclass of the {@link yfiles.collections.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. + *

+ * @class yfiles.graph.BendEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface BendEventArgs extends yfiles.collections.ItemEventArgs{} + export class BendEventArgs { + /** + * Initializes a new instance of the {@link yfiles.graph.BendEventArgs} class. + * @param {yfiles.graph.IBend} bend The bend to assign to the {@link yfiles.collections.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. + * @constructor + */ + constructor(bend:yfiles.graph.IBend,owner:yfiles.graph.IEdge,index:number); + /** + * Gets the owner of the bend that owned the bend before the event happened. + * @type {yfiles.graph.IEdge} + */ + owner:yfiles.graph.IEdge; + /** + * Gets the former index of the bend in the {@link yfiles.graph.IEdge#bends} list. + * @type {number} + */ + index:number; + static $class:yfiles.lang.Class; + } + /** + * Event argument class used by {@link yfiles.graph.IGraph} if a model item's property has been changed. + * Type parameter TItem: The type of the item contained in the event. + * Type parameter TValue: The type of the item's property that has been changed. + * @class yfiles.graph.ItemChangedEventArgs. + * @extends {yfiles.collections.ItemEventArgs.} + * @template TItem,TValue + */ + export interface ItemChangedEventArgs extends yfiles.collections.ItemEventArgs{} + export class ItemChangedEventArgs { + /** + * Initializes a new instance of the {@link yfiles.graph.ItemChangedEventArgs.} class. + * @param {TItem} item The item whose property has been changed. + * @param {TValue} oldValue The value of the property before the change. + * @constructor + */ + constructor(item:TItem,oldValue:TValue); + /** + * Gets the value of the property before the change. + * @type {TValue} + */ + oldValue:TValue; + static $class:yfiles.lang.Class; + } + /** + * 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.collections.IListEnumerable. IListEnumerable<ILabel>}s, that can be obtained from {@link yfiles.graph.ILabelOwner} implementations' {@link yfiles.graph.ILabelOwner#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.graph.ILookup#lookup} method that can be used to query additional aspects of the item. + *

+ *

+ * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. + *

+ *

+ * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. + *

+ * @interface + * @implements {yfiles.graph.IModelItem} + */ + export interface ILabel extends Object,yfiles.graph.IModelItem{ + /** + * Returns the style that is responsible for the visual representation of this node in a {@link yfiles.view.CanvasComponent}. + *

+ * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} 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. + *

+ * @abstract + * @type {yfiles.styles.ILabelStyle} + */ + style:yfiles.styles.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#setLabelPreferredSize} method. + *

+ * @abstract + * @type {yfiles.geometry.Size} + */ + preferredSize:yfiles.geometry.Size; + /** + * Gets the owner of this label. + *

+ * Typically this will yield an instance of {@link yfiles.graph.INode} or {@link yfiles.graph.IEdge}. + *

+ * @abstract + * @type {yfiles.graph.ILabelOwner} + */ + owner:yfiles.graph.ILabelOwner; + /** + * 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 layout} of this instance. + *

+ * @abstract + * @type {string} + */ + 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#setLabelLayoutParameter} + * 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. + *

+ * @abstract + * @type {yfiles.graph.ILabelModelParameter} + */ + layoutParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets the index of the label at its {@link yfiles.graph.ILabel#owner}. + * @returns The zero based index of the label in the {@link yfiles.graph.ILabelOwner#labels} list; -1 if the label is not part of a label owner. + * @type {number} + */ + index?:number; + /** + * Gets a snapshot of the current layout of the 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#layoutParameter} for this label or modify its associated instance. + *

+ * @returns The current label layout. + * @type {yfiles.geometry.IOrientedRectangle} + */ + layout?:yfiles.geometry.IOrientedRectangle; + } + 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. + *

+ * Note that changing these defaults does not change properties of already created model items. Rather, only items created + * after the change are affected. + *

+ * @see yfiles.graph.INodeDefaults#labels + * @see yfiles.graph.IEdgeDefaults#labels + * @see yfiles.graph.IGraph#nodeDefaults + * @see yfiles.graph.IGraph#edgeDefaults + * @see yfiles.graph.IGraph#groupNodeDefaults + * @interface + */ + export interface ILabelDefaults extends Object{ + /** + * Factory method that returns a label model parameter instance for use with newly created labels. + *

+ * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.ILabelDefaults#layoutParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLayoutParameterInstance} is enabled, but they might use more complicated + * logic, too. + *

+ * @param {yfiles.graph.ILabelOwner} owner The owner of the label that will be created. + * @returns {yfiles.graph.ILabelModelParameter} The parameter to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.ILabelDefaults#layoutParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLayoutParameterInstance} is enabled. + * @abstract + */ + getLayoutParameterInstance(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; + /** + * Factory method that returns a style instance for use with newly created labels. + *

+ * Most implementations will yield either, a {@link yfiles.lang.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.ILabelOwner} owner The owner of the label that will be created. + * @returns {yfiles.styles.ILabelStyle} The style to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.ILabelDefaults#style} property, if {@link yfiles.graph.ILabelDefaults#shareStyleInstance} is enabled. + * @abstract + */ + getStyleInstance(owner:yfiles.graph.ILabelOwner):yfiles.styles.ILabelStyle; + /** + * 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.lang.ICloneable#clone clone} of this + * instance or the very same instance. + *

+ * @see yfiles.graph.ILabelDefaults#shareStyleInstance + * @abstract + * @type {yfiles.styles.ILabelStyle} + */ + style:yfiles.styles.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#setStyle}, 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 yfiles.styles.ILabelStyleRenderer#getPreferredSize + * @abstract + * @type {boolean} + */ + autoAdjustPreferredSize:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#layoutParameter} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance}. + * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance + * @see yfiles.graph.ILabelDefaults#layoutParameter + * @abstract + * @type {boolean} + */ + shareLayoutParameterInstance:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.ILabelDefaults#getStyleInstance}. + * @see yfiles.graph.ILabelDefaults#getStyleInstance + * @see yfiles.graph.ILabelDefaults#style + * @abstract + * @type {boolean} + */ + shareStyleInstance:boolean; + /** + * Gets or sets the label model parameter to use for labels. + *

+ * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareLayoutParameterInstance}, the {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} of + * this instance or the very same instance. + *

+ * @see yfiles.graph.ILabelDefaults#shareLayoutParameterInstance + * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance + * @abstract + * @type {yfiles.graph.ILabelModelParameter} + */ + layoutParameter:yfiles.graph.ILabelModelParameter; + } + var ILabelDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines the geometry of {@link yfiles.graph.ILabel} instances with respect to specific {@link yfiles.graph.ILabelModelParameter}s. + *

+ * In addition to defining the geometry of a label with respect to a specific + * {@link yfiles.graph.ILabelModelParameter}, a label model is typically the factory of the label model parameters that are + * compatible with it, too. + *

+ *

+ * Typically, the label model defines a, possibly infinite, compilation of valid geometries for labels, and a specific + * label model parameter specifies an exact geometry for a label. + *

+ *

+ * By design, the same instance of a label model can be shared by multiple label model parameters. Similarly, the same + * instance of a label model parameter can be shared by multiple labels. + *

+ *

+ * This interface supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the + * implementation. + *

+ * @see yfiles.graph.ILabelModelParameter + * @see yfiles.graph.ILabel + * @see yfiles.graph.IGraph + * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface ILabelModel extends Object,yfiles.graph.ILookup{ + /** + * Creates a default parameter that can be used for this model. + * @returns {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @abstract + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.graph.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} layoutParameter The parameter to use for the label in the context. + * @returns {yfiles.graph.ILookup} An implementation of the {@link yfiles.graph.ILookup} interface that can be used to query additional aspects of the + * label/parameter combination. + * @see yfiles.graph.ILookup#EMPTY + * @abstract + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * Calculates the {@link yfiles.geometry.IOrientedRectangle geometry} of the given label using the given model parameter. + * @param {yfiles.graph.ILabel} label The label to calculate the geometry for. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and + * its property {@link yfiles.graph.ILabelModelParameter#model} returns this instance. + * @returns {yfiles.geometry.IOrientedRectangle} An {@link yfiles.geometry.IOrientedRectangle} that describes the geometry of the label. This is typically designed as a + * flyweight, therefore clients should not cache the instance but store the values if they need a snapshot for later use. + * @abstract + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + } + var ILabelModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that provides more information about a potential label geometry (a candidate) to an automatic labeling + * algorithm. + *

+ * Typically, instances of this interface are created by an implementation of {@link yfiles.graph.ILabelCandidateDescriptorProvider} + * for a pair of an {@link yfiles.graph.ILabel} and a {@link yfiles.graph.ILabelModelParameter} that describes a potential placement of + * that label (a 'candidate'). + *

+ * @see yfiles.graph.ILabelCandidateDescriptorProvider + * @interface + */ + 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 that are a visual part of the node's internals. It could be used for edge + * labels, too, if the edge occupies significant amounts of visual space. + *

+ * @abstract + * @type {boolean} + */ + externalCandidate:boolean; + /** + * Gets a penalty value that is used by labeling algorithms to judge the severity if this candidate overlaps with an edge + * path. + *

+ * This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a + * value of 1 means that an overlap is considered severe. + *

+ * @abstract + * @type {number} + */ + edgeOverlapPenalty:number; + /** + * Gets a penalty value that is used by labeling algorithms to judge the severity if this label candidate overlaps with a + * node's bounds. + *

+ * This value must be between 0 and 1 (inclusive). A value of 0 means that an overlap is considered not important, while a + * value of 1 means that an overlap is considered severe. + *

+ * @abstract + * @type {number} + */ + nodeOverlapPenalty:number; + /** + * Gets a profit value that is used by labeling algorithms to judge how good this label candidate is. + *

+ * This value must be between 0 and 1 (inclusive). Higher profit means better candidates. Hence, there is a higher + * probability that the candidate is chosen by a labeling algorithm. + *

+ * @abstract + * @type {number} + */ + profit:number; + } + var ILabelCandidateDescriptor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to retrieve {@link yfiles.graph.ILabelCandidateDescriptor} instances for a given pair of a {@link yfiles.graph.ILabel} + * and a {@link yfiles.graph.ILabelModelParameter candidate parameter}. + *

+ * This interface can be used by automatic labeling algorithms to help decide which labels candidate positions should be + * used. + *

+ * @see yfiles.graph.ILabelCandidateDescriptor + * @interface + */ + export interface ILabelCandidateDescriptorProvider extends Object{ + /** + * Gets the descriptor for a given pair of a label and a {@link yfiles.graph.ILabelModelParameter}. + * @param {yfiles.graph.ILabel} label The label to possibly assign the layoutParameter. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to provide a descriptor for if applied to the given label. + * @returns {yfiles.graph.ILabelCandidateDescriptor} A descriptor or null. + * @abstract + */ + getDescriptor(label:yfiles.graph.ILabel,layoutParameter: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}. + * @class yfiles.graph.ConstantLabelCandidateDescriptorProvider + * @implements {yfiles.graph.ILabelCandidateDescriptorProvider} + * @final + */ + export interface ConstantLabelCandidateDescriptorProvider extends Object,yfiles.graph.ILabelCandidateDescriptorProvider{} + export class ConstantLabelCandidateDescriptorProvider { + /** + * 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}. + * @constructor + */ + constructor(descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Always yields the parameter that has been passed to the constructor. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILabelCandidateDescriptor} + */ + getDescriptor(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + /** + * A sharable implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} interface that always yields + * {@link yfiles.graph.LabelCandidateDescriptor#EXTERNAL_DESCRIPTOR}. + * @const + * @static + * @type {yfiles.graph.ILabelCandidateDescriptorProvider} + */ + static 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}. + * @const + * @static + * @type {yfiles.graph.ILabelCandidateDescriptorProvider} + */ + static INTERNAL_DESCRIPTOR_PROVIDER:yfiles.graph.ILabelCandidateDescriptorProvider; + static $class:yfiles.lang.Class; + } + /** + * A simple mutable default implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} interface. + *

+ * All properties are read/write in this implementation. + *

+ * @class yfiles.graph.LabelCandidateDescriptor + * @implements {yfiles.graph.ILabelCandidateDescriptor} + */ + export interface LabelCandidateDescriptor extends Object,yfiles.graph.ILabelCandidateDescriptor{} + export class LabelCandidateDescriptor { + /** + * A sharable immutable implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} interface that has penalties of 1.0d + * and a profit of 1.0d and yields true for the {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate} property. + * @const + * @static + * @type {yfiles.graph.ILabelCandidateDescriptor} + */ + static EXTERNAL_DESCRIPTOR:yfiles.graph.ILabelCandidateDescriptor; + /** + * A sharable immutable implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} interface that has penalties of 1.0d + * and a profit of 1.0d and yields false for the {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate} property. + * @const + * @static + * @type {yfiles.graph.ILabelCandidateDescriptor} + */ + static INTERNAL_DESCRIPTOR:yfiles.graph.ILabelCandidateDescriptor; + /** + * + * @type {boolean} + */ + externalCandidate:boolean; + /** + * + * @default 1.0 + * @type {number} + */ + edgeOverlapPenalty:number; + /** + * + * @default 1.0 + * @type {number} + */ + nodeOverlapPenalty:number; + /** + * + * @default 1.0 + * @type {number} + */ + profit:number; + static $class:yfiles.lang.Class; + } + /** + * Defines a state that can be used to {@link yfiles.graph.ILabelModel#getGeometry determine the geometry of a label} with a {@link yfiles.graph.ILabelModel}. + *

+ * Typically, implementations of this interface are created by factory methods of the corresponding {@link yfiles.graph.ILabelModelParameter#model}. + *

+ *

+ * This interface extends the {@link yfiles.lang.ICloneable} interface. This allows clients to obtain a persistent copy of the + * current state of this parameter. Immutable parameter implementations may return themselves. + *

+ * @see yfiles.graph.ILabelModel + * @see yfiles.graph.ILabel + * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface ILabelModelParameter extends Object,yfiles.lang.ICloneable{ + /** + * Determines whether this parameter can be used for a given label instance. + *

+ * A parameter must not necessarily support all types of labels. This method returns whether it supports the given label. + * For example, a parameter might only support labels that are owned by an {@link yfiles.graph.INode}. + *

+ * @param {yfiles.graph.ILabel} label The label to test. + * @returns {boolean} true if this instance can be used for the given label, false otherwise. + * @abstract + */ + supports(label:yfiles.graph.ILabel):boolean; + /** + * Gets the model that can be used to determine the geometry of a label given this parameter and a label instance. + * @abstract + * @type {yfiles.graph.ILabelModel} + */ + model:yfiles.graph.ILabelModel; + } + 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.graph.ILookup#lookup} + * method. Note that implementations are not required to return an instance if queried for this interface. + *

+ * @see yfiles.graph.DefaultLabelModelParameterFinder + * @interface + */ + 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} layout The anticipated layout for the label. + * @returns {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + * @abstract + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var ILabelModelParameterFinder:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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#selectBestParameter}. + *

+ * @class yfiles.graph.DefaultLabelModelParameterFinder + * @implements {yfiles.graph.ILabelModelParameterFinder} + */ + export interface DefaultLabelModelParameterFinder extends Object,yfiles.graph.ILabelModelParameterFinder{} + export class DefaultLabelModelParameterFinder { + /** + * 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} layoutParameter The parameter candidate. + * @param {yfiles.geometry.IOrientedRectangle} layout The targeted layout rectangle. + * @returns {number} A metric that indicates the distance between the candidate's layout and the target layout. + * @protected + */ + calculateMetric(label:yfiles.graph.ILabel,layoutParameter: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} rectangle1 The first geometry. + * @param {yfiles.geometry.IOrientedRectangle} rectangle2 The geometry to compare the first one with. + * @returns {number} A value indicating the distance between the two instances. + * @protected + */ + distance(rectangle1:yfiles.geometry.IOrientedRectangle,rectangle2:yfiles.geometry.IOrientedRectangle):number; + /** + * 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} layout The anticipated layout for the label. + * @returns {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):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. + * @returns {yfiles.collections.IEnumerable.} An enumerator over the candidates. The enumerator may be empty. + * @protected + */ + getCandidateParameters(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 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} layout The anticipated layout for the label. + * @param {yfiles.collections.IEnumerable.} layoutParameters A set of parameters to choose from. + * @returns {yfiles.graph.ILabelModelParameter} A parameter that can be used for the label to approximate the provided layout. + */ + selectBestParameter(label:yfiles.graph.ILabel,layout:yfiles.geometry.IOrientedRectangle,layoutParameters:yfiles.collections.IEnumerable):yfiles.graph.ILabelModelParameter; + /** + * A singleton instance of this class. + * @const + * @static + * @type {yfiles.graph.DefaultLabelModelParameterFinder} + */ + static INSTANCE:yfiles.graph.DefaultLabelModelParameterFinder; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.ILookup#lookup} + * method. Note that not all models necessarily need to or can provide implementations of this interface. + *

+ * @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. + * @returns {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @abstract + */ + 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 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.graph.ILookup#lookup} method that can be used to query + * additional aspects of the item. + *

+ * @see yfiles.graph.INode + * @see yfiles.graph.IEdge + * @interface + * @implements {yfiles.graph.IModelItem} + */ + export interface ILabelOwner extends Object,yfiles.graph.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. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + } + var ILabelOwner:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A registry that can be used to store {@link yfiles.collections.IMapper.} implementations by tag. + *

+ * Implementations of this interface can be found in the {@link yfiles.graph.ILookup#lookup} of the default {@link yfiles.graph.IGraph} + * implementations in the framework. + *

+ *

+ * Using IMapperRegistry is described in the section {@link @DGUIDE_PREFIX@/customizing_graph-binding_data.html Associating Data with Graph Elements}. + *

+ * @see yfiles.graph.MapperRegistry + * @interface + */ + export interface IMapperRegistry extends Object{ + /** + * Registers a mapper for the given tag. + *

+ * If there already was a mapper for tag, it will be replaced. + *

+ * Type parameter K: The key type for the mapper. + * Type parameter V: The value type for the mapper. + * @param {yfiles.lang.Class} valueType The value type for the mapper. + * @param {yfiles.lang.Class} keyType The key type for the mapper. + * @param {Object} tag The tag to use. + * @param {yfiles.collections.IMapper.} mapper The mapper to register. + * @template K,V + * @abstract + */ + addMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object,mapper:yfiles.collections.IMapper):void; + /** + * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.ILabel} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the + * provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.ILabelLayoutDpKey.} tag The tag. + * @param {V} constant The value to yield during {@link yfiles.collections.IMapper.} reads. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template V + */ + createConstantMapper?(tag:yfiles.algorithms.ILabelLayoutDpKey,constant:V):yfiles.collections.IMapper; + /** + * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.IEdge} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the + * provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.EdgeDpKey.} tag The tag. + * @param {V} constant The value to yield during {@link yfiles.collections.IMapper.} reads. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template V + */ + createConstantMapper?(tag:yfiles.algorithms.EdgeDpKey,constant:V):yfiles.collections.IMapper; + /** + * Creates a simple read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.INode} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using the + * provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.NodeDpKey.} tag The tag. + * @param {V} constant The value to yield during {@link yfiles.collections.IMapper.} reads. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template V + */ + createConstantMapper?(tag:yfiles.algorithms.NodeDpKey,constant:V):yfiles.collections.IMapper; + /** + * Creates a simple read-only {@link yfiles.collections.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. + *

+ * Type parameter K: The type of the keys of the mapper. + * Type parameter V: The type of the values of the mapper. + * @param {Object} tag The tag. + * @param {V} constant The value to yield during {@link yfiles.collections.IMapper.} reads. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromConstant + * @template K,V + */ + createConstantMapper?(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object,constant:V):yfiles.collections.IMapper; + /** + * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.ILabel} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using + * the provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.ILabelLayoutDpKey.} tag The tag. + * @param {function(yfiles.graph.ILabel): V} getter The getter delegate to which {@link yfiles.collections.IMapper.} reads will be delegated. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template V + */ + createDelegateMapper?(tag:yfiles.algorithms.ILabelLayoutDpKey,getter:(key:yfiles.graph.ILabel)=>V):yfiles.collections.IMapper; + /** + * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.IEdge} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using + * the provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.EdgeDpKey.} tag The tag. + * @param {function(yfiles.graph.IEdge): V} getter The getter delegate to which {@link yfiles.collections.IMapper.} reads will be delegated. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template V + */ + createDelegateMapper?(tag:yfiles.algorithms.EdgeDpKey,getter:(key:yfiles.graph.IEdge)=>V):yfiles.collections.IMapper; + /** + * Creates a delegate-based read-only {@link yfiles.collections.IMapper.} implementation with key type {@link yfiles.graph.INode} and {@link yfiles.graph.IMapperRegistry#addMapper adds} it to the registry using + * the provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.NodeDpKey.} tag The tag. + * @param {function(yfiles.graph.INode): V} getter The getter delegate to which {@link yfiles.collections.IMapper.} reads will be delegated. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template V + */ + createDelegateMapper?(tag:yfiles.algorithms.NodeDpKey,getter:(key:yfiles.graph.INode)=>V):yfiles.collections.IMapper; + /** + * Creates a delegate-based read-only {@link yfiles.collections.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. + *

+ * Type parameter K: The type of the keys of the mapper. + * Type parameter V: The type of the values of the mapper. + * @param {Object} tag The tag. + * @param {function(K): V} getter The getter delegate to which {@link yfiles.collections.IMapper.} reads will be delegated. + * @returns {yfiles.collections.IMapper.} The newly created mapper instance. + * @see yfiles.collections.IMapper.#fromDelegate + * @template K,V + */ + createDelegateMapper?(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object,getter:(key:K)=>V):yfiles.collections.IMapper; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} with key type {@link yfiles.graph.IEdge} to the registry using the provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.EdgeDpKey.} tag The tag. + * @returns {yfiles.collections.Mapper.} The newly created mapper instance. + * @see yfiles.collections.Mapper. + * @template V + */ + createMapper?(tag:yfiles.algorithms.EdgeDpKey):yfiles.collections.Mapper; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} with key type {@link yfiles.graph.ILabel} to the registry using the provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.ILabelLayoutDpKey.} tag The tag. + * @returns {yfiles.collections.Mapper.} The newly created mapper instance. + * @see yfiles.collections.Mapper. + * @template V + */ + createMapper?(tag:yfiles.algorithms.ILabelLayoutDpKey):yfiles.collections.Mapper; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} with key type {@link yfiles.graph.INode} to the registry using the provided tag. + *

+ * The value type of the mapper is inferred by the provided tag. If there already was a mapper for + * tag, it will be replaced. + *

+ * Type parameter V: The type of the values of the mapper. + * @param {yfiles.algorithms.NodeDpKey.} tag The tag. + * @returns {yfiles.collections.Mapper.} The newly created mapper instance. + * @see yfiles.collections.Mapper. + * @template V + */ + createMapper?(tag:yfiles.algorithms.NodeDpKey):yfiles.collections.Mapper; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} a new {@link yfiles.collections.Mapper.} to the registry using the provided tag. + *

+ * If there already was a mapper for tag, it will be replaced. + *

+ * Type parameter K: The type of the keys of the mapper. + * Type parameter V: The type of the values of the mapper. + * @param {Object} tag The tag. + * @returns {yfiles.collections.Mapper.} The newly created mapper instance. + * @see yfiles.collections.Mapper. + * @template K,V + */ + createMapper?(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object):yfiles.collections.Mapper; + /** + * Returns a mapper that has previously been registered with this instance for the given tag. + * Type parameter K: The key type for the mapper. + * Type parameter V: The value type for the mapper. + * @param {Object} tag The tag to use to look up the mapper. + * @returns {yfiles.collections.IMapper.} The previously registered instance or null. + * @template K,V + * @abstract + */ + getMapper(tag:Object):yfiles.collections.IMapper; + /** + * Gets the mapper {@link yfiles.graph.MapperMetadata meta data} for the mapper that is registered using the tag. + * @param {Object} tag The tag. + * @returns {yfiles.graph.MapperMetadata} The meta data or null if there is no such mapper registered for the given tag. + * @abstract + */ + getMapperMetadata(tag:Object):yfiles.graph.MapperMetadata; + /** + * Removes a previously registered mapper for the given tag. + * @param {Object} tag The tag that has been used for registering the mapper. + * @abstract + */ + removeMapper(tag:Object):void; + /** + * 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.MapperMetadata} metadata The meta data to store with the mapper. + * @throws {Stubs.Exceptions.ArgumentError} If the {@link yfiles.graph.MapperMetadata#keyType} or {@link yfiles.graph.MapperMetadata#valueType} mismatch the mapper instance in the registry. + * @abstract + */ + setMapperMetadata(tag:Object,metadata:yfiles.graph.MapperMetadata):void; + /** + * Gets an enumerable over all tags that have been used to register mapper implementations with this interface. + * @abstract + * @type {yfiles.collections.IEnumerable.} + */ + registeredTags:yfiles.collections.IEnumerable; + } + var IMapperRegistry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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#edgesAt} method for querying the edges that connect to nodes. Also it is possible to + * query the {@link yfiles.graph.IGraph#edgesAt 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.ILabelOwner} to get access to the labels, and, like all items in an IGraph, + * nodes support the {@link yfiles.graph.ILookup#lookup} method inherited from the {@link yfiles.graph.IModelItem} interface can be used to + * query additional aspects of each instance. + *

+ *

+ * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. + *

+ *

+ * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. + *

+ * @see yfiles.graph.IGraph + * @see yfiles.graph.IEdge + * @interface + * @implements {yfiles.graph.IPortOwner} + * @implements {yfiles.graph.ILabelOwner} + */ + export interface INode extends Object,yfiles.graph.IPortOwner,yfiles.graph.ILabelOwner{ + /** + * 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#setNodeLayout various methods} in + * {@link yfiles.graph.IGraph}. + *

+ * @abstract + * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * Returns the style that is responsible for the visual representation of this node in a {@link yfiles.view.CanvasComponent}. + *

+ * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} 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. + *

+ * @abstract + * @type {yfiles.styles.INodeStyle} + */ + style:yfiles.styles.INodeStyle; + } + var INode:{ + $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. + *

+ * Note that changing these defaults does not change properties of already created model items. Rather, only items created + * after the change are affected. + *

+ * @see yfiles.graph.IGraph#nodeDefaults + * @see yfiles.graph.IGraph#groupNodeDefaults + * @interface + */ + export interface INodeDefaults extends Object{ + /** + * Factory method that returns a style instance for use with newly created nodes. + *

+ * Most implementations will yield either, a {@link yfiles.lang.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. + *

+ * @returns {yfiles.styles.INodeStyle} The style to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.INodeDefaults#style} property, if {@link yfiles.graph.INodeDefaults#shareStyleInstance} is enabled. + * @abstract + */ + getStyleInstance():yfiles.styles.INodeStyle; + /** + * 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.lang.ICloneable#clone clone} of this + * instance or the very same instance. + *

+ * @see yfiles.graph.INodeDefaults#shareStyleInstance + * @abstract + * @type {yfiles.styles.INodeStyle} + */ + style:yfiles.styles.INodeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.INodeDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.INodeDefaults#getStyleInstance}. + * @see yfiles.graph.INodeDefaults#getStyleInstance + * @see yfiles.graph.INodeDefaults#style + * @abstract + * @type {boolean} + */ + shareStyleInstance:boolean; + /** + * Gets or sets the defaults for ports at nodes. + * @abstract + * @type {yfiles.graph.IPortDefaults} + */ + ports:yfiles.graph.IPortDefaults; + /** + * Gets or sets the defaults for labels at nodes. + * @abstract + * @type {yfiles.graph.ILabelDefaults} + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the default node size. + *

+ * The values of this size will be used by the CreateNode and CreateNode methods. + *

+ * @abstract + * @type {yfiles.geometry.Size} + */ + size:yfiles.geometry.Size; + } + var INodeDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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#edgesAt} + * method provided by {@link yfiles.graph.IGraph}. 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.graph.ILookup#lookup} method that can be used to + * query additional aspects of the item. + *

+ *

+ * The graph model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/graph.html The Graph Model}. + *

+ *

+ * Using the look-up mechanism is explained in the section {@link @DGUIDE_PREFIX@/customizing_concepts_lookup.html Service Locator Pattern: Lookup}. + *

+ * @interface + * @implements {yfiles.graph.IModelItem} + */ + export interface IPort extends Object,yfiles.graph.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#edgesAt} + * method. + *

+ * @abstract + * @type {yfiles.graph.IPortOwner} + */ + owner:yfiles.graph.IPortOwner; + /** + * Returns the style that is responsible for the visual representation of this port in a {@link yfiles.view.CanvasComponent}. + *

+ * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setStyle} 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. + *

+ * @abstract + * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * Gets the {@link yfiles.graph.IPortLocationModelParameter} that is used to determine the location of this port. + *

+ * The port location can be calculated using the {@link yfiles.graph.IPortLocationModelParameter#model}'s {@link yfiles.graph.IPortLocationModel#getLocation} method or the convenience + * methods {@link yfiles.graph.IPort#location} and {@link yfiles.graph.IPort#dynamicLocation}. + *

+ *

+ * Note that parameters may be shared across port instances. + *

+ * @see yfiles.graph.IGraph#setPortLocationParameter + * @see yfiles.graph.IPort#location + * @see yfiles.graph.IPort#dynamicLocation + * @abstract + * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Gets a snapshot of the current location of the port. + *

+ * Unlike {@link yfiles.graph.IPort#dynamicLocation} this does not return a dynamic point that always refers to the current location. + *

+ * @returns The current port location. + * @type {yfiles.geometry.Point} + */ + location?:yfiles.geometry.Point; + /** + * Gets 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#setPortLocationParameter} + * in {@link yfiles.graph.IGraph}. + *

+ * @see yfiles.graph.IPort#locationParameter + * @type {yfiles.geometry.IPoint} + */ + dynamicLocation?:yfiles.geometry.IPoint; + } + var IPort:{ + $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#edgesAt} 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#edgesAt} method provided by {@link yfiles.graph.IGraph}. Like all items in an IGraph, + * this item supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the item. + *

+ * @see yfiles.graph.INode + * @see yfiles.graph.IEdge + * @interface + * @implements {yfiles.graph.IModelItem} + */ + export interface IPortOwner extends Object,yfiles.graph.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. + *

+ * @abstract + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + } + var IPortOwner:{ + $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. + *

+ * Note that changing these defaults does not change properties of already created model items. Rather, only items created + * after the change are affected. + *

+ * @see yfiles.graph.IPort + * @see yfiles.graph.INodeDefaults#ports + * @see yfiles.graph.IEdgeDefaults#ports + * @see yfiles.graph.IGraph#nodeDefaults + * @see yfiles.graph.IGraph#edgeDefaults + * @interface + */ + export interface IPortDefaults extends Object{ + /** + * Factory method that returns a location model parameter instance for use with newly created ports. + *

+ * Most implementations will yield either, a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IPortDefaults#locationParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationParameterInstance} is enabled, but they might use more complicated + * logic, too. + *

+ * @param {yfiles.graph.IPortOwner} owner The owner of the port that will be created. + * @returns {yfiles.graph.IPortLocationModelParameter} The parameter to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IPortDefaults#locationParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationParameterInstance} is enabled. + * @abstract + */ + getLocationParameterInstance(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * Factory method that returns a style instance for use with newly created ports. + *

+ * Most implementations will yield either, a {@link yfiles.lang.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. + * @returns {yfiles.styles.IPortStyle} The style to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IPortDefaults#style} property, if {@link yfiles.graph.IPortDefaults#shareStyleInstance} is enabled. + * @abstract + */ + getStyleInstance(owner:yfiles.graph.IPortOwner):yfiles.styles.IPortStyle; + /** + * 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.lang.ICloneable#clone clone} of this + * instance or the very same instance. + *

+ * @see yfiles.graph.IPortDefaults#shareStyleInstance + * @abstract + * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * Determines whether unused ports should automatically be removed from their owners as soon as no further edge is + * connected to them. + * @see yfiles.graph.IGraph#remove + * @abstract + * @type {boolean} + */ + autoCleanup:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.IPortDefaults#getStyleInstance}. + * @see yfiles.graph.IPortDefaults#getStyleInstance + * @see yfiles.graph.IPortDefaults#style + * @abstract + * @type {boolean} + */ + shareStyleInstance:boolean; + /** + * Gets or sets the location model parameter to use for ports. + *

+ * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareLocationParameterInstance}, the {@link yfiles.graph.IPortDefaults#getLocationParameterInstance} method should return a {@link yfiles.lang.ICloneable#clone clone} + * of this instance or the very same instance. + *

+ * @see yfiles.graph.IPortDefaults#shareLocationParameterInstance + * @see yfiles.graph.IPortDefaults#getLocationParameterInstance + * @abstract + * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#locationParameter} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.IPortDefaults#getLocationParameterInstance}. + * @see yfiles.graph.IPortDefaults#getLocationParameterInstance + * @see yfiles.graph.IPortDefaults#locationParameter + * @abstract + * @type {boolean} + */ + shareLocationParameterInstance:boolean; + } + var IPortDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines the geometry of {@link yfiles.graph.IPort} instances with respect to specific + * {@link yfiles.graph.IPortLocationModelParameter}s. + *

+ * In addition to defining the location of a port with respect to a specific + * {@link yfiles.graph.IPortLocationModelParameter}, a port location model is typically the factory of the model parameters that + * are compatible with it, too. + *

+ *

+ * Typically, the port location model defines a compilation of valid locations for ports, and a specific model parameter + * specifies an exact geometry for a port. + *

+ *

+ * By design, the same instance of a port location model can be shared by multiple port location model parameters. + * Similarly, the same instance of a port location model parameter can be shared by multiple ports. + *

+ *

+ * This interface supports the {@link yfiles.graph.ILookup#lookup} method that can be used to query additional aspects of the + * implementation. + *

+ * @see yfiles.graph.IPortLocationModelParameter + * @see yfiles.graph.IPort + * @see yfiles.graph.IGraph + * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface IPortLocationModel extends Object,yfiles.graph.ILookup{ + /** + * 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} owner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.Point} location The location in the world coordinate system that should be matched as best as possible. + * @returns {yfiles.graph.IPortLocationModelParameter} A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given owner. + * @abstract + */ + createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * Provides a {@link yfiles.graph.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} locationParameter The parameter to use for the port in the context. + * @returns {yfiles.graph.ILookup} An implementation of the {@link yfiles.graph.ILookup} interface that can be used to query additional aspects of the + * port/parameter combination. + * @abstract + */ + getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.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} locationParameter 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.. + * @returns {yfiles.geometry.Point} The calculated location of the port. + * @abstract + */ + getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; + } + var IPortLocationModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines a state that can be used to {@link yfiles.graph.IPortLocationModel#getLocation determine the location of a port} with a {@link yfiles.graph.IPortLocationModel}. + *

+ * Typically, implementations of this interface are created by factory methods of the corresponding {@link yfiles.graph.IPortLocationModelParameter#model}. + *

+ *

+ * This interface extends the {@link yfiles.lang.ICloneable} interface. This allows clients to obtain a persistent copy of the + * current state of this parameter. Immutable parameter implementations may return themselves. + *

+ * @see yfiles.graph.IPortLocationModel + * @see yfiles.graph.IPort + * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface IPortLocationModelParameter extends Object,yfiles.lang.ICloneable{ + /** + * Determines whether this parameter can be used for ports at the given owner. + *

+ * A parameter must not necessarily support all types of ports. This method returns whether it supports ports at the given + * owner. + *

+ * @param {yfiles.graph.IPortOwner} owner The port owner to test. + * @returns {boolean} true if this instance can be used for ports of the given port owner, false otherwise. + * @abstract + */ + supports(owner:yfiles.graph.IPortOwner):boolean; + /** + * Gets the model that created this parameter. + * @abstract + * @type {yfiles.graph.IPortLocationModel} + */ + model:yfiles.graph.IPortLocationModel; + } + var IPortLocationModelParameter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum InteriorStretchLabelModelPosition{ + /** + * Encodes a position at the top side of the node interior + */ + NORTH, + /** + * Encodes a position at the right side of the node interior + */ + EAST, + /** + * Encodes a position at the bottom side of the node interior + */ + SOUTH, + /** + * Encodes a position at the left side of the node interior + */ + WEST, + /** + * Encodes a position at the center of the node interior + */ + CENTER + } + /** + * 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. + *

+ * @class yfiles.graph.InteriorStretchLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface InteriorStretchLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class InteriorStretchLabelModel { + /** + * Creates a new instance of this model with empty insets. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Insets} options.insets The insets to use within the node's {@link yfiles.graph.INode#layout}. + *

+ * This option sets the {@link yfiles.graph.InteriorStretchLabelModel#insets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{insets?:yfiles.geometry.Insets}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates the parameter for the given position. + * @param {yfiles.graph.InteriorStretchLabelModelPosition} position The position. + * @returns {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.graph.InteriorStretchLabelModelPosition):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * 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} layoutParameter The parameter to use. + * @returns {yfiles.geometry.Size} The minimum size requirements for this label. + */ + getMinimumNodeSize(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Size; + /** + * 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} layoutParameter The parameter to use. + * @returns {yfiles.geometry.Insets} The insets rectangle. + */ + getNodeInsets(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Insets; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instance's {@link yfiles.graph.InteriorStretchLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static CENTER:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the insets to use within the node's {@link yfiles.graph.INode#layout}. + * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + static $class:yfiles.lang.Class; + } + export enum InteriorLabelModelPosition{ + /** + * Encodes a position at the top side of the node interior + */ + NORTH, + /** + * Encodes a position at the right side of the node interior + */ + EAST, + /** + * Encodes a position at the bottom side of the node interior + */ + SOUTH, + /** + * Encodes a position at the left side of the node interior + */ + WEST, + /** + * Encodes a position at the upper right corner of the node interior + */ + NORTH_EAST, + /** + * Encodes a position at the lower right corner of the node interior + */ + SOUTH_EAST, + /** + * Encodes a position at the upper left corner of the node interior + */ + NORTH_WEST, + /** + * Encodes a position at the lower left corner of the node interior + */ + SOUTH_WEST, + /** + * Encodes a position at the center of the node interior + */ + CENTER + } + /** + * 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. + *

+ * @class yfiles.graph.InteriorLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface InteriorLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class InteriorLabelModel { + /** + * Creates a new instance of this model with empty insets. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Insets} options.insets The insets to use within the node's {@link yfiles.graph.INode#layout}. + *

+ * This option sets the {@link yfiles.graph.InteriorLabelModel#insets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{insets?:yfiles.geometry.Insets}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates the parameter for the given position. + * @param {yfiles.graph.InteriorLabelModelPosition} position The position. + * @returns {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.graph.InteriorLabelModelPosition):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * 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} layoutParameter The parameter to use. + * @returns {yfiles.geometry.Size} The minimum size requirements for this label. + */ + getMinimumNodeSize(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Size; + /** + * 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} layoutParameter The parameter to use. + * @returns {yfiles.geometry.Insets} The insets rectangle. + */ + getNodeInsets(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.Insets; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.InteriorLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static CENTER:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the insets to use within the node's {@link yfiles.graph.INode#layout}. + * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + static $class:yfiles.lang.Class; + } + /** + * The meta data that is associated with {@link yfiles.collections.IMapper.}s in a {@link yfiles.graph.IMapperRegistry}. + * @see yfiles.graph.IMapperRegistry#getMapperMetadata + * @see yfiles.graph.IMapperRegistry#setMapperMetadata + * @class yfiles.graph.MapperMetadata + */ + export interface MapperMetadata extends Object{} + export class 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. + * @constructor + */ + constructor(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class); + /** + * Initializes a new instance of the {@link yfiles.graph.MapperMetadata} from the given instance class. + * @param {yfiles.graph.MapperMetadata} metadata The metadata to copy key and value type from. + * @protected + * @constructor + */ + constructor(metadata:yfiles.graph.MapperMetadata); + /** + * Creates an instance for the specified mapper. + * Type parameter TKey: The type of the keys. + * Type parameter TValue: The type of the values. + * @param {yfiles.lang.Class} valueType The type of the values. + * @param {yfiles.lang.Class} keyType The type of the keys. + * @param {yfiles.collections.IMapper.} mapper The mapper instance to create the metadata for. + * @returns {yfiles.graph.MapperMetadata} An instance that uses the {@link yfiles.graph.MapperMetadata#keyType} and {@link yfiles.graph.MapperMetadata#valueType} of the mapper. + * @template TKey,TValue + * @static + */ + static create(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.graph.MapperMetadata; + /** + * + * @type {yfiles.lang.Class} + */ + keyType:yfiles.lang.Class; + /** + * + * @type {yfiles.lang.Class} + */ + valueType:yfiles.lang.Class; + static $class:yfiles.lang.Class; + } + /** + * A simple {@link yfiles.collections.Map.}-based implementation of the {@link yfiles.graph.IMapperRegistry} interface. + * @class yfiles.graph.MapperRegistry + * @implements {yfiles.graph.IMapperRegistry} + * @final + */ + export interface MapperRegistry extends Object,yfiles.graph.IMapperRegistry{} + export class MapperRegistry { + constructor(); + /** + * + * Type parameter K. + * Type parameter V. + * @param {yfiles.lang.Class} valueType + * @param {yfiles.lang.Class} keyType + * @param {Object} tag + * @param {yfiles.collections.IMapper.} mapper + * @template K,V + */ + addMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object,mapper:yfiles.collections.IMapper):void; + /** + * + * Type parameter K. + * Type parameter V. + * @param {Object} tag + * @returns {yfiles.collections.IMapper.} + * @template K,V + */ + getMapper(tag:Object):yfiles.collections.IMapper; + /** + * + * @param {Object} tag + * @returns {yfiles.graph.MapperMetadata} + */ + getMapperMetadata(tag:Object):yfiles.graph.MapperMetadata; + /** + * + * @param {Object} tag + */ + removeMapper(tag:Object):void; + /** + * + * @param {Object} tag + * @param {yfiles.graph.MapperMetadata} metadata + */ + setMapperMetadata(tag:Object,metadata:yfiles.graph.MapperMetadata):void; + /** + * + * @type {yfiles.collections.IEnumerable.} + */ + registeredTags:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + export enum NinePositionsEdgeLabelModelPosition{ + /** + * Encodes a label position at the source above the edge + */ + SOURCE_ABOVE, + /** + * Encodes a label position at the center above the edge + */ + CENTER_ABOVE, + /** + * Encodes a label position at the target above the edge + */ + TARGET_ABOVE, + /** + * Encodes a label position at the source of the edge that lies on the edge + */ + SOURCE_CENTERED, + /** + * Encodes a label position at the center of the edge that lies on the edge + */ + CENTER_CENTERED, + /** + * Encodes a label position at the source of the edge that lies on the edge + */ + TARGET_CENTERED, + /** + * Encodes a label position at the source below the edge + */ + SOURCE_BELOW, + /** + * Encodes a label position at the center below the edge + */ + CENTER_BELOW, + /** + * Encodes a label position at the target below the edge + */ + TARGET_BELOW + } + /** + * 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. + *

+ * @class yfiles.graph.NinePositionsEdgeLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface NinePositionsEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class NinePositionsEdgeLabelModel { + /** + * Initializes a new instance of the {@link yfiles.graph.NinePositionsEdgeLabelModel} class. + * @param {number} distance The distance. + * @param {number} angle The angle. + * @constructor + */ + constructor(distance:number,angle:number); + /** + * Initializes a new instance of the {@link yfiles.graph.NinePositionsEdgeLabelModel} class with a {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} of 10 and an {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} of 0. + * @param {Object} [options=null] The parameters to pass. + * @param {number} options.angle The angle for the rotation of the labels. + *

+ * This option sets the {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} property on the created object. + *

+ * @param {number} options.distance The distance of the labels above or below the edge. + *

+ * This option sets the {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} property on the created object. + *

+ * @constructor + */ + constructor(options?:{angle?:number,distance?:number}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Create a model parameter for the specified position + * @param {yfiles.graph.NinePositionsEdgeLabelModelPosition} position The position for this parameter + * @returns {yfiles.graph.ILabelModelParameter} a model parameter for the specified position + */ + createParameter(position:yfiles.graph.NinePositionsEdgeLabelModelPosition):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOURCE_ABOVE:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static CENTER_ABOVE:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static TARGET_ABOVE:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOURCE_CENTERED:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static CENTER_CENTERED:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static TARGET_CENTERED:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOURCE_BELOW:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static CENTER_BELOW:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.NinePositionsEdgeLabelModel#angle} or {@link yfiles.graph.NinePositionsEdgeLabelModel#distance} properties will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static TARGET_BELOW:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the angle for the rotation of the labels. + *

+ * A value of 0 makes the label appear horizontally aligned. + *

+ * @default 0.0 + * @type {number} + */ + angle:number; + /** + * Gets or sets the distance of the labels above or below the edge. + * @default 10.0 + * @type {number} + */ + distance:number; + static $class:yfiles.lang.Class; + } + /** + * 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.graph.SandwichLabelModel#yOffset}. + *

+ * @class yfiles.graph.SandwichLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface SandwichLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class SandwichLabelModel { + /** + * Initializes a new instance of the {@link yfiles.graph.SandwichLabelModel} class with zero offset. + * @param {Object} [options=null] The parameters to pass. + * @param {number} options.yOffset The distance between the node's {@link yfiles.graph.INode#layout} and the label's {@link yfiles.graph.ILabel#layout layout}. + *

+ * This option sets the {@link yfiles.graph.SandwichLabelModel#yOffset} property on the created object. + *

+ * @constructor + */ + constructor(options?:{yOffset?:number}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter for the north side of the node. + * @returns {yfiles.graph.ILabelModelParameter} + */ + createNorthParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter for the south side of the node. + * @returns {yfiles.graph.ILabelModelParameter} + */ + createSouthParameter():yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.SandwichLabelModel#yOffset} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.SandwichLabelModel#yOffset} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the distance between the node's {@link yfiles.graph.INode#layout} and the label's {@link yfiles.graph.ILabel#layout layout}. + * @default 0.0 + * @type {number} + */ + yOffset:number; + static $class:yfiles.lang.Class; + } + /** + * A port location model that places the port on a certain edge segment at a specified ratio. + * @class yfiles.graph.SegmentRatioPortLocationModel + * @implements {yfiles.graph.IPortLocationModel} + * @final + */ + export interface SegmentRatioPortLocationModel extends Object,yfiles.graph.IPortLocationModel{} + export class SegmentRatioPortLocationModel { + /** + * 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. + * @returns {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. + * @returns {yfiles.graph.IPortLocationModelParameter} A parameter for the given ratio and segment. + */ + createFromTarget(ratio:number,segmentIndex:number):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @param {yfiles.geometry.Point} location + * @returns {yfiles.graph.IPortLocationModelParameter} + */ + createParameter(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.Point):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.IPort} port + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter + * @returns {yfiles.geometry.Point} + */ + getLocation(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.Point; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A static immutable global instance of this class. + * @const + * @static + * @type {yfiles.graph.SegmentRatioPortLocationModel} + */ + static INSTANCE:yfiles.graph.SegmentRatioPortLocationModel; + static $class:yfiles.lang.Class; + } + /** + * An edge label model that allows the placement at any position. + *

+ * Similar to + * {@link yfiles.graph.EdgeSegmentLabelModel}, 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.graph.EdgeSegmentLabelModel}, 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.graph.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 {@link yfiles.input.MoveLabelInputMode} provides a {@link yfiles.input.LabelSnapContext} + * that is enabled and has a suitable configuration. + *

+ * @class yfiles.graph.SmartEdgeLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterFinder} + */ + export interface SmartEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterFinder{} + export class SmartEdgeLabelModel { + /** + * Initializes a new instance of this class. + * @param {Object} [options=null] The parameters to pass. + * @param {number} options.angle The rotation angle of all labels with this model. + *

+ * This option sets the {@link yfiles.graph.SmartEdgeLabelModel#angle} property on the created object. + *

+ * @param {boolean} options.autoRotation Whether or not edge labels are automatically rotated according to the angle of the corresponding reference edge segment. + *

+ * This option sets the {@link yfiles.graph.SmartEdgeLabelModel#autoRotation} property on the created object. + *

+ * @constructor + */ + constructor(options?:{angle?:number,autoRotation?:boolean}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * 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. + * @returns {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. + * @returns {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; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @param {yfiles.geometry.IOrientedRectangle} layout + * @returns {yfiles.graph.ILabelModelParameter} + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,layout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * Gets the distance from the edge path described by the specified parameter. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The parameter to get the edge path distance for. + * @returns {number} The distance from the edge path + */ + getDistance(layoutParameter:yfiles.graph.ILabelModelParameter):number; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.geometry.IOrientedRectangle} + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference + * edge segment. + *

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

+ * @default true + * @type {boolean} + */ + autoRotation:boolean; + /** + * Gets or sets the rotation angle of all labels with this model. + * @default 0.0 + * @type {number} + */ + angle:number; + static $class:yfiles.lang.Class; + } + export enum StripeTypes{ + /** + * Constant for rows. + * @see yfiles.graph.StripeTypes#ROW + */ + ROW, + /** + * Constant for columns. + * @see 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 + } + /** + * A canonic implementation of the {@link yfiles.graph.IPortDefaults} interface. + * @class yfiles.graph.PortDefaults + * @implements {yfiles.graph.IPortDefaults} + */ + export interface PortDefaults extends Object,yfiles.graph.IPortDefaults{} + export class PortDefaults { + /** + * Initializes a new instance of the {@link yfiles.graph.PortDefaults} class using a trivial location model parameter. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} [options.autoCleanup=null] Sets the autoCleanup property. + * @param {yfiles.graph.IPortLocationModelParameter} [options.locationParameter=null] Sets the locationParameter property. + * @param {boolean} [options.shareLocationParameterInstance=null] Sets the shareLocationParameterInstance property. + * @param {yfiles.styles.IPortStyle} [options.style=null] Sets the style property. + * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. + * @constructor + */ + constructor(options?:{autoCleanup?:boolean,locationParameter?:yfiles.graph.IPortLocationModelParameter,shareLocationParameterInstance?:boolean,style?:yfiles.styles.IPortStyle,shareStyleInstance?:boolean}); + /** + * Factory method that returns a style instance for use with newly created ports. + *

+ * Most implementations will yield either, a {@link yfiles.lang.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. + *

+ * @returns {yfiles.styles.IPortStyle} The style to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.PortDefaults#style} property, if {@link yfiles.graph.PortDefaults#shareStyleInstance} is enabled. + */ + GetDefaultStyleInstance():yfiles.styles.IPortStyle; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @returns {yfiles.graph.IPortLocationModelParameter} + */ + getLocationParameterInstance(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * + * @param {yfiles.graph.IPortOwner} owner + * @returns {yfiles.styles.IPortStyle} + */ + getStyleInstance(owner:yfiles.graph.IPortOwner):yfiles.styles.IPortStyle; + /** + * + * @default true + * @type {boolean} + */ + autoCleanup:boolean; + /** + * + * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * + * @default true + * @type {boolean} + */ + shareLocationParameterInstance:boolean; + /** + * + * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * + * @default true + * @type {boolean} + */ + shareStyleInstance:boolean; + static $class:yfiles.lang.Class; + } + /** + * A canonic implementation of the {@link yfiles.graph.INodeDefaults} interface. + * @class yfiles.graph.NodeDefaults + * @implements {yfiles.graph.INodeDefaults} + */ + export interface NodeDefaults extends Object,yfiles.graph.INodeDefaults{} + export class NodeDefaults { + /** + * Initializes a new instance of the {@link yfiles.graph.NodeDefaults} class using default properties. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Size} [options.size=null] Sets the size property. + * @param {yfiles.graph.ILabelDefaults} [options.labels=null] Sets the labels property. + * @param {yfiles.graph.IPortDefaults} [options.ports=null] Sets the ports property. + * @param {yfiles.styles.INodeStyle} [options.style=null] Sets the style property. + * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. + * @constructor + */ + constructor(options?:{size?:yfiles.geometry.Size,labels?:yfiles.graph.ILabelDefaults,ports?:yfiles.graph.IPortDefaults,style?:yfiles.styles.INodeStyle,shareStyleInstance?:boolean}); + /** + * + * @returns {yfiles.styles.INodeStyle} + */ + getStyleInstance():yfiles.styles.INodeStyle; + /** + * + * @type {yfiles.geometry.Size} + */ + size:yfiles.geometry.Size; + /** + * + * @type {yfiles.graph.ILabelDefaults} + */ + labels:yfiles.graph.ILabelDefaults; + /** + * + * @type {yfiles.graph.IPortDefaults} + */ + ports:yfiles.graph.IPortDefaults; + /** + * + * @type {yfiles.styles.INodeStyle} + */ + style:yfiles.styles.INodeStyle; + /** + * + * @default true + * @type {boolean} + */ + shareStyleInstance:boolean; + static $class:yfiles.lang.Class; + } + /** + * A canonic implementation of the {@link yfiles.graph.IEdgeDefaults} interface + * @class yfiles.graph.EdgeDefaults + * @implements {yfiles.graph.IEdgeDefaults} + */ + export interface EdgeDefaults extends Object,yfiles.graph.IEdgeDefaults{} + export class EdgeDefaults { + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeDefaults} class with default edge style and label and port defaults. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.graph.ILabelDefaults} [options.labels=null] Sets the labels property. + * @param {yfiles.graph.IPortDefaults} [options.ports=null] Sets the ports property. + * @param {yfiles.styles.IEdgeStyle} [options.style=null] Sets the style property. + * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. + * @constructor + */ + constructor(options?:{labels?:yfiles.graph.ILabelDefaults,ports?:yfiles.graph.IPortDefaults,style?:yfiles.styles.IEdgeStyle,shareStyleInstance?:boolean}); + /** + * + * @returns {yfiles.styles.IEdgeStyle} + */ + getStyleInstance():yfiles.styles.IEdgeStyle; + /** + * + * @type {yfiles.graph.ILabelDefaults} + */ + labels:yfiles.graph.ILabelDefaults; + /** + * + * @type {yfiles.graph.IPortDefaults} + */ + ports:yfiles.graph.IPortDefaults; + /** + * + * @type {yfiles.styles.IEdgeStyle} + */ + style:yfiles.styles.IEdgeStyle; + /** + * + * @default true + * @type {boolean} + */ + shareStyleInstance:boolean; + static $class:yfiles.lang.Class; + } + /** + * A canonic implementation of the {@link yfiles.graph.ILabelDefaults} interface + * @class yfiles.graph.LabelDefaults + * @implements {yfiles.graph.ILabelDefaults} + */ + export interface LabelDefaults extends Object,yfiles.graph.ILabelDefaults{} + export class LabelDefaults { + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDefaults} class using a trivial parameter. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} [options.autoAdjustPreferredSize=null] Sets the autoAdjustPreferredSize property. + * @param {boolean} [options.shareLayoutParameterInstance=null] Sets the shareLayoutParameterInstance property. + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] Sets the layoutParameter property. + * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. + * @param {yfiles.styles.ILabelStyle} [options.style=null] Sets the style property. + * @constructor + */ + constructor(options?:{autoAdjustPreferredSize?:boolean,shareLayoutParameterInstance?:boolean,layoutParameter?:yfiles.graph.ILabelModelParameter,shareStyleInstance?:boolean,style?:yfiles.styles.ILabelStyle}); + /** + * + * @param {yfiles.graph.ILabelOwner} owner + * @returns {yfiles.graph.ILabelModelParameter} + */ + getLayoutParameterInstance(owner:yfiles.graph.ILabelOwner):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabelOwner} owner + * @returns {yfiles.styles.ILabelStyle} + */ + getStyleInstance(owner:yfiles.graph.ILabelOwner):yfiles.styles.ILabelStyle; + /** + * + * @type {boolean} + */ + autoAdjustPreferredSize:boolean; + /** + * + * @type {boolean} + */ + shareLayoutParameterInstance:boolean; + /** + * + * @type {yfiles.graph.ILabelModelParameter} + */ + layoutParameter:yfiles.graph.ILabelModelParameter; + /** + * + * @type {yfiles.styles.ILabelStyle} + */ + style:yfiles.styles.ILabelStyle; + /** + * + * @type {boolean} + */ + shareStyleInstance:boolean; + static $class:yfiles.lang.Class; + } + /** + * Interface for implementations that can calculate the bounds of a group node in a grouped graph. + *

+ * Implementations of this interface will be queried from {@link yfiles.graph.INode}'s {@link yfiles.graph.ILookup#lookup} method. + *

+ * @interface + */ + 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 graph. + * @param {yfiles.graph.IGraph} graph The graph which holds the groupNode. + * @param {yfiles.graph.INode} groupNode The node to calculate the bounds for. + * @returns {yfiles.geometry.Rect} The minimum bounds to use for the given group node. + * @abstract + */ + calculateBounds(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode):yfiles.geometry.Rect; + } + var IGroupBoundsCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Contains less frequently used methods for analyzing and managing grouped graphs. + *

+ * An instance of this class which is configured for a given {@link yfiles.graph.IGraph} instance can be obtained via {@link yfiles.graph.IGraph#groupingSupport}. + *

+ * @class yfiles.graph.GroupingSupport + */ + export interface GroupingSupport extends Object{} + export class GroupingSupport { + /** + * Creates a new instance which operates on the given graph. + * @param {yfiles.graph.IGraph} graph The graph to operate on. + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * Calculates the minimum area to enclose by the given group node with respect to its {@link yfiles.graph.IGroupBoundsCalculator}. + * @param {yfiles.graph.INode} groupNode The group node to calculate the minimum enclosed area of. + * @returns {yfiles.geometry.Rect} The area to enclose for the given group node. This is {@link yfiles.geometry.Rect#EMPTY} if the node is not a group node, or if + * it hasn't any children. + */ + calculateMinimumEnclosedArea(groupNode:yfiles.graph.INode):yfiles.geometry.Rect; + /** + * Enlarges all group nodes in the graph in an interactive scenario, so that the {@link yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea minimum enclosed area} is respected. + *

+ * This method should be used in an interactive editing scenario. It records an {@link yfiles.graph.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. + * @see yfiles.graph.GroupingSupport#enlargeGroupNode + */ + enlargeAllGroupNodes(context:yfiles.input.IInputModeContext):void; + /** + * Enlarges all group nodes in the graph so that the {@link yfiles.graph.GroupingSupport#calculateMinimumEnclosedArea minimum enclosed area} is respected. + * @see yfiles.graph.GroupingSupport#enlargeGroupNode + */ + enlargeAllGroupNodes():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.graph.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.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 yfiles.input.IReshapeHandler + */ + enlargeGroupNode(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,ancestors:boolean):void; + /** + * Enlarges the given group node to ensure that the {@link yfiles.graph.GroupingSupport#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.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 yfiles.graph.GroupingSupport#enlargeGroupNode + */ + enlargeGroupNode(groupNode:yfiles.graph.INode,ancestors:boolean):void; + /** + * Returns all descendants of the provided node that are part of the grouped graph. + *

+ * The enumeration will be top down, i.e. all of a node's ancestors will be enumerated before the respective node. + *

+ * @param {yfiles.graph.INode} node The root node to get the descendants from. + * @returns {yfiles.collections.IEnumerable.} An enumeration of the children of the node at the time of this invocation in reverse DFS prefix order. + */ + getDescendants(node:yfiles.graph.INode):yfiles.collections.IEnumerable; + /** + * Returns all descendants of the provided node that are part of the grouped graph. + *

+ * The enumeration will be bottom up, i.e. all of a node's children will be enumerated before the respective node. + *

+ * @param {yfiles.graph.INode} node The root node to get the descendants from. + * @returns {yfiles.collections.IEnumerable.} An enumeration of the children of the node at the time of this invocation in DFS postfix order. + */ + getDescendantsBottomUp(node:yfiles.graph.INode):yfiles.collections.IEnumerable; + /** + * Determines the nearest common ancestor of the provided nodes in the graph. + * @param {...yfiles.graph.INode} nodes The nodes to find the nearest common ancestor of. + * @returns {yfiles.graph.INode} + */ + getNearestCommonAncestor(...nodes:yfiles.graph.INode[]):yfiles.graph.INode; + /** + * Determines the nearest common ancestor of the provided nodes in the graph. + * @param {yfiles.collections.IEnumerable.} nodes The nodes to find the nearest common ancestor of. + * @returns {yfiles.graph.INode} + */ + getNearestCommonAncestor(nodes:yfiles.collections.IEnumerable):yfiles.graph.INode; + /** + * Gets the path to root traversing all {@link yfiles.graph.IGraph#getParent parents} of the given item. + * @param {yfiles.graph.INode} node The node to start. + * @returns {yfiles.collections.IList.} A list that includes the node but not the root, unless they are identical and all parents in between them. + */ + getPathToRoot(node:yfiles.graph.INode):yfiles.collections.IList; + /** + * Whether there are group nodes in the graph. + *

+ * This methods considers all {@link yfiles.graph.IGraph#isGroupNode group} nodes with {@link yfiles.graph.IGraph#getChildren children} as group nodes. + *

+ * @returns {boolean} true if there are {@link yfiles.graph.IGraph#isGroupNode group} nodes with {@link yfiles.graph.IGraph#getChildren children}. + */ + hasGroupNodes():boolean; + /** + * Determines whether ancestor is an ancestor of node in the grouped graph. + * @param {yfiles.graph.INode} node The node to check. + * @param {yfiles.graph.INode} ancestor The ancestor to check. + * @returns {boolean} Whether ancestor is an ancestor of node. + */ + isDescendant(node:yfiles.graph.INode,ancestor:yfiles.graph.INode):boolean; + static $class:yfiles.lang.Class; + } + /** + * An abstract basic implementation of the {@link yfiles.graph.IFoldingEdgeConverter} interface that may be derived from to create + * a customized {@link yfiles.graph.FoldingManager#foldingEdgeConverter}. + *

+ * This class provides default mechanisms and callbacks that can be used to set another style for folding edges, for the + * ports of folding edges, synchronizing the first label of a folding edge with the master edge, etc. Subclasses need to + * implement the {@link yfiles.graph.FoldingEdgeConverterBase#addFoldingEdge} method, only. + *

+ * @see yfiles.graph.DefaultFoldingEdgeConverter + * @see yfiles.graph.FoldingManager + * @class yfiles.graph.FoldingEdgeConverterBase + * @implements {yfiles.graph.IFoldingEdgeConverter} + */ + export interface FoldingEdgeConverterBase extends Object,yfiles.graph.IFoldingEdgeConverter{} + export class FoldingEdgeConverterBase { + /** + * + * @param {yfiles.graph.IFoldingEdgeFactory} factory + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} masterEdge + * @param {yfiles.graph.INode} source + * @param {boolean} sourceIsCollapsed + * @param {yfiles.graph.INode} target + * @param {boolean} targetIsCollapsed + * @returns {yfiles.graph.IEdge} + * @abstract + */ + addFoldingEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,source:yfiles.graph.INode,sourceIsCollapsed:boolean,target:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; + /** + * Callback factory method that creates the {@link yfiles.styles.IEdgeStyle} for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeStyle}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge in the view whose {@link yfiles.graph.IEdge#style} should be initialized. + * @param {yfiles.collections.IList.} masterEdges The edges that are being represented by the folding edge. + * @returns {yfiles.styles.IEdgeStyle} The {@link yfiles.graph.FoldingEdgeConverterBase#foldingEdgeStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneEdgeStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createEdgeStyle(foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.styles.IEdgeStyle; + /** + * Callback factory method that creates the {@link yfiles.graph.ILabelModelParameter} for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeLabels}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.ILabel} localLabel The local label in the view whose {@link yfiles.graph.ILabel#layoutParameter} should be initialized. May be null if the label layout parameter is requested for the + * label creation. + * @param {yfiles.graph.ILabel} masterLabel The label that is being represented by the folding label. + * @returns {yfiles.graph.ILabelModelParameter} The {@link yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneLabelLayoutParameter} property. This method may return null to indicate that + * the default label layout parameter should not be changed. + * @protected + */ + createLabelLayoutParameter(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; + /** + * Callback factory method that creates the {@link yfiles.styles.ILabelStyle} for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeLabels}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.ILabel} localLabel The local label in the view whose {@link yfiles.graph.ILabel#style} should be initialized. May be null if the label style is requested for the label + * creation. + * @param {yfiles.graph.ILabel} masterLabel The label that is being represented by the folding label. + * @returns {yfiles.styles.ILabelStyle} The {@link yfiles.graph.FoldingEdgeConverterBase#labelStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneLabelStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createLabelStyle(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.styles.ILabelStyle; + /** + * Callback factory method that creates the {@link yfiles.graph.IPortLocationModelParameter} of the source port for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IEdge} localEdge The local edge in the view whose source port's {@link yfiles.graph.IPort#locationParameter} should be initialized. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @returns {yfiles.graph.IPortLocationModelParameter} The {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneSourcePortLocationParameter} property. This method may return null to indicate that + * the default port location parameter should not be changed. + * @protected + */ + createSourcePortLocationParameter(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.graph.IPortLocationModelParameter; + /** + * Callback factory method that creates the {@link yfiles.styles.IPortStyle} of the source port for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IEdge} localEdge The local edge in the view whose source port's {@link yfiles.graph.IPort#style} should be initialized. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @returns {yfiles.styles.IPortStyle} The {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneSourcePortStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createSourcePortStyle(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.styles.IPortStyle; + /** + * Callback factory method that creates the {@link yfiles.graph.IPortLocationModelParameter} of the target port for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IEdge} localEdge The local edge in the view whose target port's {@link yfiles.graph.IPort#locationParameter} should be initialized. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @returns {yfiles.graph.IPortLocationModelParameter} The {@link yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneTargetPortLocationParameter} property. This method may return null to indicate that + * the default port location parameter should not be changed. + * @protected + */ + createTargetPortLocationParameter(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.graph.IPortLocationModelParameter; + /** + * Callback factory method that creates the {@link yfiles.styles.IPortStyle} of the target port for use in + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IEdge} localEdge The local edge in the view whose target port's {@link yfiles.graph.IPort#style} should be initialized. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @returns {yfiles.styles.IPortStyle} The {@link yfiles.graph.FoldingEdgeConverterBase#targetPortStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.FoldingEdgeConverterBase#cloneTargetPortStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createTargetPortStyle(foldingView:yfiles.graph.IFoldingView,localEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.styles.IPortStyle; + /** + * Callback method that initializes the bends of the folding edge. + *

+ * This will call the {@link yfiles.graph.FoldingEdgeState#clearBends} callback if {@link yfiles.graph.FoldingEdgeConverterBase#resetBends} is enabled. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The viewstate to change. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance that has triggered the {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeState} call. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge in the view that may be changed using the state. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @protected + */ + initializeFoldingEdgeBends(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback method that initializes the initial labels of the folding edge. + *

+ * This will first {@link yfiles.graph.FoldingLabelOwnerState#clearLabels clear all the labels} and then try to copy the first label of the single master edge if {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} is enabled. It + * will call {@link yfiles.graph.FoldingEdgeConverterBase#createLabelStyle} and {@link yfiles.graph.FoldingEdgeConverterBase#createLabelLayoutParameter} + * and use the returned style and layout parameter if they are non-null when {@link yfiles.graph.FoldingEdgeState#addLabel adding the label} on the folding edge. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The viewstate to change. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance that has triggered the {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeState} call. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge in the view that may be changed using the state. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @see yfiles.graph.FoldingEdgeConverterBase#labelStyle + * @see yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter + * @protected + */ + initializeFoldingEdgeLabels(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback method that initializes the ports of the folding edge. + *

+ * If the source port of the foldingEdge {@link yfiles.graph.IFoldingView#isInFoldingState is in folding state}, this implementation calls {@link yfiles.graph.FoldingEdgeConverterBase#createSourcePortStyle} + * and {@link yfiles.graph.FoldingEdgeConverterBase#createSourcePortLocationParameter} and {@link yfiles.graph.FoldingPortState#style assigns the style} and {@link yfiles.graph.FoldingPortState#locationParameter location parameter} + * to the folding source port if non-null values have been returned. The same holds true for the target port where the {@link yfiles.graph.FoldingEdgeConverterBase#createTargetPortStyle} + * and {@link yfiles.graph.FoldingEdgeConverterBase#createTargetPortLocationParameter} callbacks are used. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The viewState to change. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance that has triggered the {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeState} call. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge in the view that may be changed using the state. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @see yfiles.graph.FoldingEdgeConverterBase#sourcePortStyle + * @see yfiles.graph.FoldingEdgeConverterBase#targetPortStyle + * @see yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter + * @see yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter + * @see yfiles.graph.FoldingEdgeConverterBase#createSourcePortStyle + * @see yfiles.graph.FoldingEdgeConverterBase#createTargetPortStyle + * @see yfiles.graph.FoldingEdgeConverterBase#createSourcePortLocationParameter + * @see yfiles.graph.FoldingEdgeConverterBase#createTargetPortLocationParameter + * @protected + */ + initializeFoldingEdgePorts(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Implements the {@link yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState} method and initializes the folding edge + * appearance. + *

+ * This method calls {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeStyle}, + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgePorts}, + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeBends}, + * {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeLabels}. + *

+ * @param {yfiles.graph.FoldingEdgeState} state + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} foldingEdge + * @param {yfiles.collections.IList.} masterEdges + */ + initializeFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback method that initializes the {@link yfiles.graph.FoldingEdgeState#style style property} of the folding edge. + *

+ * This implementation calls {@link yfiles.graph.FoldingEdgeConverterBase#createEdgeStyle} and {@link yfiles.graph.FoldingEdgeState#style assigns} the style to the folding + * edge if a non-null value has been returned. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The viewstate to change. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance that has triggered the {@link yfiles.graph.FoldingEdgeConverterBase#initializeFoldingEdgeState} call. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge in the view that may be changed using the state. + * @param {yfiles.collections.IList.} masterEdges The master edges that the folding edge represents. + * @protected + */ + initializeFoldingEdgeStyle(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Called by {@link yfiles.graph.FoldingEdgeConverterBase#updateFoldingEdgeState} to synchronize the first label if {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} is enabled. + *

+ * This will adjust the label's text, preferred size and tag properties or remove the label if there is no master label or + * there is more than one master edge. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The viewstate of the edge to change. + * @param {yfiles.graph.IFoldingView} foldingView The folding view. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge. + * @param {yfiles.collections.IList.} masterEdges The master edges. + * @protected + */ + synchronizeLabels(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Implements the {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} method and changes the folding edge + * appearance. + *

+ * This method calls {@link yfiles.graph.FoldingEdgeConverterBase#synchronizeLabels}, only. + *

+ * @param {yfiles.graph.FoldingEdgeState} state + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} foldingEdge + * @param {yfiles.collections.IList.} masterEdges + */ + updateFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#foldingEdgeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneEdgeStyle:boolean; + /** + * Gets or sets the {@link yfiles.styles.IPortStyle} to use for the folding source port. + *

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

+ * @type {yfiles.styles.IPortStyle} + */ + sourcePortStyle:yfiles.styles.IPortStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneSourcePortStyle:boolean; + /** + * Gets or sets the {@link yfiles.styles.IPortStyle} to use for the folding target port. + *

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

+ * @type {yfiles.styles.IPortStyle} + */ + targetPortStyle:yfiles.styles.IPortStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#targetPortStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneTargetPortStyle:boolean; + /** + * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} to use for the source port of the folding edge. + *

+ * Since the appearance of the folding edge may totally differ from the appearance of the master edge, the location of the + * source port may also be different. This property can be used to assign a different specific location parameter to the + * source port if the edge {@link yfiles.graph.IFoldingView#isInFoldingState is in folding state}. A value of null will leave the location parameter property unmodified. The + * default is null + *

+ * @see yfiles.graph.FoldingEdgeConverterBase#createSourcePortLocationParameter + * @type {yfiles.graph.IPortLocationModelParameter} + */ + sourcePortLocationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneSourcePortLocationParameter:boolean; + /** + * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} to use for the target port of the folding edge. + *

+ * Since the appearance of the folding edge may totally differ from the appearance of the master edge, the location of the + * target port may also be different. This property can be used to assign a different specific location parameter to the + * target port if the edge {@link yfiles.graph.IFoldingView#isInFoldingState is in folding state}. A value of null will leave the location parameter property unmodified. The + * default is null + *

+ * @see yfiles.graph.FoldingEdgeConverterBase#createTargetPortLocationParameter + * @type {yfiles.graph.IPortLocationModelParameter} + */ + targetPortLocationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneTargetPortLocationParameter:boolean; + /** + * Gets or sets the {@link yfiles.styles.ILabelStyle} to use for the first label of the folding edge. + *

+ * This will only affect the folding edge if the {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} property is set to true. + *

+ *

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

+ * @type {yfiles.styles.ILabelStyle} + */ + labelStyle:yfiles.styles.ILabelStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneLabelStyle:boolean; + /** + * Gets or sets the {@link yfiles.graph.ILabelModelParameter} to use for the first label of the folding edge. + *

+ * This will only affect the folding edge if the {@link yfiles.graph.FoldingEdgeConverterBase#copyFirstLabel} property is set to true. + *

+ *

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

+ * @type {yfiles.graph.ILabelModelParameter} + */ + labelLayoutParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneLabelLayoutParameter:boolean; + /** + * Gets or sets the {@link yfiles.styles.IEdgeStyle} to use for the folding edge. + *

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

+ *

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

+ * @type {yfiles.styles.IEdgeStyle} + */ + foldingEdgeStyle:yfiles.styles.IEdgeStyle; + /** + * Gets or sets a value indicating whether to reset and clear the bends of a folding edge initially. + * @type {boolean} + */ + resetBends:boolean; + /** + * Gets or sets a value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master edge} should be recreated for the folding 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. + *

+ * @see yfiles.graph.FoldingEdgeConverterBase#labelStyle + * @see yfiles.graph.FoldingEdgeConverterBase#labelLayoutParameter + * @type {boolean} + */ + copyFirstLabel:boolean; + static $class:yfiles.lang.Class; + } + /** + * The default implementation of the {@link yfiles.graph.IFoldingEdgeConverter} that is used by the {@link yfiles.graph.FoldingManager} + * initially and can be customized to suit the application's needs. + * @see yfiles.graph.FoldingEdgeConverterBase + * @see yfiles.graph.DefaultFoldingEdgeConverter#reuseMasterPorts + * @class yfiles.graph.DefaultFoldingEdgeConverter + * @extends {yfiles.graph.FoldingEdgeConverterBase} + */ + export interface DefaultFoldingEdgeConverter extends yfiles.graph.FoldingEdgeConverterBase{} + export class DefaultFoldingEdgeConverter { + constructor(); + /** + * 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.IFoldingView#isInFoldingState folder} nodes + * for the folding edges. + *

+ * The {@link yfiles.graph.IFoldingView view} can be configured to use separate port instances for folding edges. This makes it possible to assign different + * styles and locations to source and target ports of folding edges, which may be desirable if the style and geometry of + * folding edges differs a lot from the style of the master edges. Folding edges may of course still connect to non-folder + * nodes at one of their ports. Setting this property to true will make the folding edge connect to the {@link yfiles.graph.IFoldingView#getViewItem view} 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 folding edges should still connect to those specific view ports. The default value is false + *

+ * @see yfiles.graph.DefaultFoldingEdgeConverter#reuseFolderNodePorts + * @type {boolean} + */ + reuseMasterPorts:boolean; + /** + * Gets or sets a property that determines whether this implementation should reuse the ports of {@link yfiles.graph.IFoldingView#isInFoldingState folder} nodes for the + * folding edges. + *

+ * The {@link yfiles.graph.IFoldingView view} can be configured to use separate port instances for folding edges. This makes it possible to assign different + * styles and locations to source and target ports of folding edges, which may be desirable if the style and geometry of + * folding edges differs a lot from the style of the master edges. Folder nodes ({@link yfiles.graph.IFoldingView#collapse collapsed} group nodes), will have all of + * their master's ports {@link yfiles.graph.IFoldingView#getViewItem represented} in the view. This property can be used to make folding edges that connect to the master + * ports connect to these folding port instances instead of creating extra folding ports for the edges. Note that ports can + * only be automatically reused by folding edges if they still connect to the same nodes. Otherwise the view will have to + * create new folding 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 folding edges should still + * connect to those specific port instances, if possible. The default value is false. + *

+ * @see yfiles.graph.DefaultFoldingEdgeConverter#reuseMasterPorts + * @type {boolean} + */ + reuseFolderNodePorts:boolean; + static $class:yfiles.lang.Class; + } + /** + * Simple default implementation of the {@link yfiles.graph.IFolderNodeConverter} interface that is used by the + * {@link yfiles.graph.FoldingManager}'s {@link yfiles.graph.FoldingManager#folderNodeConverter} 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 yfiles.graph.FoldingManager + * @see yfiles.graph.IFolderNodeConverter + * @see yfiles.graph.DefaultFoldingEdgeConverter + * @class yfiles.graph.DefaultFolderNodeConverter + * @implements {yfiles.graph.IFolderNodeConverter} + */ + export interface DefaultFolderNodeConverter extends Object,yfiles.graph.IFolderNodeConverter{} + export class DefaultFolderNodeConverter { + /** + * Initializes a new instance of this class using the values provided by the folderNodeDefaults parameter. + * @param {yfiles.graph.INodeDefaults} folderNodeDefaults + * @constructor + */ + constructor(folderNodeDefaults:yfiles.graph.INodeDefaults); + /** + * Initializes a new instance of this class using the values provided by the folderNodeDefaults parameter. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INodeDefaults} options.folderNodeDefaults + * @param {boolean} options.cloneLabelLayoutParameter A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelLayoutParameter} property on the created object. + *

+ * @param {boolean} options.cloneLabelStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelStyle} property on the created object. + *

+ * @param {boolean} options.cloneNodeStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property on the created object. + *

+ * @param {boolean} options.clonePortStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#clonePortStyle} property on the created object. + *

+ * @param {boolean} options.copyFirstLabel A value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} should be recreated for the collapsed group node instance. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.folderNodeSize The initial size of the {@link yfiles.graph.INode#layout} of the collapsed group node that will be assigned during the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState creation} of the appearance of the collapsed group node. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeSize} property on the created object. + *

+ * @param {yfiles.styles.INodeStyle} options.folderNodeStyle The {@link yfiles.styles.INodeStyle} to use for the {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} property on the created object. + *

+ * @param {yfiles.graph.ILabelModelParameter} options.labelLayoutParameter The {@link yfiles.graph.ILabelModelParameter} to use for the first label of the collapsed group node. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} property on the created object. + *

+ * @param {yfiles.styles.ILabelStyle} options.labelStyle The {@link yfiles.styles.ILabelStyle} to use for the first label of the collapsed group nodes. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} property on the created object. + *

+ * @param {yfiles.graph.IPortLocationModelParameter} options.portLocationParameter The {@link yfiles.graph.IPortLocationModelParameter} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} property on the created object. + *

+ * @param {yfiles.styles.IPortStyle} options.portStyle The {@link yfiles.styles.IPortStyle} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} property on the created object. + *

+ * @constructor + */ + constructor(options:{folderNodeDefaults:yfiles.graph.INodeDefaults,cloneLabelLayoutParameter?:boolean,cloneLabelStyle?:boolean,cloneNodeStyle?:boolean,clonePortStyle?:boolean,copyFirstLabel?:boolean,folderNodeSize?:yfiles.geometry.Size,folderNodeStyle?:yfiles.styles.INodeStyle,labelLayoutParameter?:yfiles.graph.ILabelModelParameter,labelStyle?:yfiles.styles.ILabelStyle,portLocationParameter?:yfiles.graph.IPortLocationModelParameter,portStyle?:yfiles.styles.IPortStyle}); + /** + * Initializes a new instance of this class with default values. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} options.cloneLabelLayoutParameter A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelLayoutParameter} property on the created object. + *

+ * @param {boolean} options.cloneLabelStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelStyle} property on the created object. + *

+ * @param {boolean} options.cloneNodeStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property on the created object. + *

+ * @param {boolean} options.clonePortStyle A value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#clonePortStyle} property on the created object. + *

+ * @param {boolean} options.copyFirstLabel A value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} should be recreated for the collapsed group node instance. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.folderNodeSize The initial size of the {@link yfiles.graph.INode#layout} of the collapsed group node that will be assigned during the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState creation} of the appearance of the collapsed group node. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeSize} property on the created object. + *

+ * @param {yfiles.styles.INodeStyle} options.folderNodeStyle The {@link yfiles.styles.INodeStyle} to use for the {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} property on the created object. + *

+ * @param {yfiles.graph.ILabelModelParameter} options.labelLayoutParameter The {@link yfiles.graph.ILabelModelParameter} to use for the first label of the collapsed group node. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} property on the created object. + *

+ * @param {yfiles.styles.ILabelStyle} options.labelStyle The {@link yfiles.styles.ILabelStyle} to use for the first label of the collapsed group nodes. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} property on the created object. + *

+ * @param {yfiles.graph.IPortLocationModelParameter} options.portLocationParameter The {@link yfiles.graph.IPortLocationModelParameter} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} property on the created object. + *

+ * @param {yfiles.styles.IPortStyle} options.portStyle The {@link yfiles.styles.IPortStyle} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of the {@link yfiles.graph.IFoldingView#getMasterItem master group node} in the collapsed state. + *

+ * This option sets the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} property on the created object. + *

+ * @constructor + */ + constructor(options?:{cloneLabelLayoutParameter?:boolean,cloneLabelStyle?:boolean,cloneNodeStyle?:boolean,clonePortStyle?:boolean,copyFirstLabel?:boolean,folderNodeSize?:yfiles.geometry.Size,folderNodeStyle?:yfiles.styles.INodeStyle,labelLayoutParameter?:yfiles.graph.ILabelModelParameter,labelStyle?:yfiles.styles.ILabelStyle,portLocationParameter?:yfiles.graph.IPortLocationModelParameter,portStyle?:yfiles.styles.IPortStyle}); + /** + * Callback factory method that creates the {@link yfiles.graph.ILabelModelParameter} for use in + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.ILabel} localLabel The local label in the view whose {@link yfiles.graph.ILabel#layoutParameter} should be initialized. May be null if the label layout parameter is requested for the + * label creation. + * @param {yfiles.graph.ILabel} masterLabel The label that is being represented by the folding label. + * @returns {yfiles.graph.ILabelModelParameter} The {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelLayoutParameter} property. This method may return null to indicate that + * the default label layout parameter should not be changed. + * @protected + */ + createLabelLayoutParameter(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; + /** + * Callback factory method that creates the {@link yfiles.styles.ILabelStyle} for use in + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.ILabel} localLabel The local label in the view whose {@link yfiles.graph.ILabel#style} should be initialized. May be null if the label style is requested for the label + * creation. + * @param {yfiles.graph.ILabel} masterLabel The label that is being represented by the folding label. + * @returns {yfiles.styles.ILabelStyle} The {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.DefaultFolderNodeConverter#cloneLabelStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createLabelStyle(foldingView:yfiles.graph.IFoldingView,localLabel:yfiles.graph.ILabel,masterLabel:yfiles.graph.ILabel):yfiles.styles.ILabelStyle; + /** + * Callback factory method that creates the {@link yfiles.styles.INodeStyle} for use in + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeStyle}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.INode} viewNode The local folder 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 folder node. + * @returns {yfiles.styles.INodeStyle} The {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createNodeStyle(foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):yfiles.styles.INodeStyle; + /** + * Callback factory method that creates the {@link yfiles.graph.IPortLocationModelParameter} for use in + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodePorts}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IPort} localPort The local port in the view whose {@link yfiles.graph.IPort#locationParameter} should be initialized. + * @param {yfiles.graph.IPort} masterPort The port that is being represented by the folding port. + * @returns {yfiles.graph.IPortLocationModelParameter} The {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.DefaultFolderNodeConverter#clonePortLocationParameter} property. This method may return null to indicate that + * the default port location parameter should not be changed. + * @protected + */ + createPortLocationParameter(foldingView:yfiles.graph.IFoldingView,localPort:yfiles.graph.IPort,masterPort:yfiles.graph.IPort):yfiles.graph.IPortLocationModelParameter; + /** + * Callback factory method that creates the {@link yfiles.styles.IPortStyle} for use in + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodePorts}. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.IPort} localPort The local port in the view whose {@link yfiles.graph.IPort#style} should be initialized. + * @param {yfiles.graph.IPort} masterPort The port that is being represented by the folding port. + * @returns {yfiles.styles.IPortStyle} The {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} or a {@link yfiles.lang.ICloneable#clone} of it depending on the {@link yfiles.graph.DefaultFolderNodeConverter#clonePortStyle} property. This method may return null to indicate that + * the default style should not be changed. + * @protected + */ + createPortStyle(foldingView:yfiles.graph.IFoldingView,localPort:yfiles.graph.IPort,masterPort:yfiles.graph.IPort):yfiles.styles.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.DefaultFolderNodeConverter#copyFirstLabel} is enabled. It will call {@link yfiles.graph.DefaultFolderNodeConverter#createLabelStyle} + * and {@link yfiles.graph.DefaultFolderNodeConverter#createLabelLayoutParameter} and use the returned style and layout parameter + * if they are non-null when {@link yfiles.graph.FolderNodeState#addLabel adding the label} on the folder node. + *

+ * @param {yfiles.graph.FolderNodeState} state The node view state whose labels should be synchronized. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance that has triggered the {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeState} + * call. + * @param {yfiles.graph.INode} viewNode The collapsed group node in the view that may be changed using the {@link yfiles.graph.FolderNodeState}. + * @param {yfiles.graph.INode} masterNode The master node that the folder node represents. + * @see yfiles.graph.DefaultFolderNodeConverter#labelStyle + * @see yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter + * @see yfiles.graph.FoldingManager#getFolderNodeState + * @protected + */ + initializeFolderNodeLabels(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode: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.FolderNodeState#layout set the bounds} of the nodes in such a way that the size will be that of the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeSize} property (if + * non-null) but not smaller than the {@link yfiles.input.INodeSizeConstraintProvider#getMinimumSize minimum} size that is reported by a potential {@link yfiles.input.INodeSizeConstraintProvider} + * for {@link yfiles.graph.INode}s that has been found in the {@link yfiles.graph.ILookup} of the viewNode. + *

+ * @param {yfiles.graph.FolderNodeState} state The node view state whose layout should be synchronized. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.INode} viewNode The local collapsed group node to change. + * @param {yfiles.graph.INode} masterNode The master node that is represented by the local group node. + * @protected + */ + initializeFolderNodeLayout(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Called by {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeState} to initialize the appearance of the {@link yfiles.graph.IFoldingView#getViewItem representatives} + * of the master ports at the collapsed group node. + *

+ * This method will call {@link yfiles.graph.DefaultFolderNodeConverter#createPortStyle} and {@link yfiles.graph.DefaultFolderNodeConverter#createPortLocationParameter} + * for each port at the group node and assign the returned style and location parameter if they are non-null. + *

+ * @param {yfiles.graph.FolderNodeState} state The node view state whose ports should be synchronized. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance. + * @param {yfiles.graph.INode} viewNode The local group node. + * @param {yfiles.graph.INode} masterNode The master group node. + * @protected + */ + initializeFolderNodePorts(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Implements the {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState} method and initializes the appearance of the + * collapsed group node. + *

+ * This method calls {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeStyle}, + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels}, + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLayout}, and + * {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodePorts}. + *

+ * @param {yfiles.graph.FolderNodeState} state + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.INode} viewNode + * @param {yfiles.graph.INode} masterNode + */ + initializeFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback method that initializes the {@link yfiles.graph.FolderNodeState#style style property} of the collapsed group node. + *

+ * This implementation calls {@link yfiles.graph.DefaultFolderNodeConverter#createNodeStyle} and {@link yfiles.graph.FolderNodeState#style assigns} the style to the group + * node if a non-null value has been returned. + *

+ * @param {yfiles.graph.FolderNodeState} state The node view state whose style should be synchronized. + * @param {yfiles.graph.IFoldingView} foldingView The folding view instance that has triggered the {@link yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeState} + * call. + * @param {yfiles.graph.INode} viewNode The local node in the view that may be changed using the {@link yfiles.graph.FolderNodeState}. + * @param {yfiles.graph.INode} masterNode The master node that the local folder node represents. + * @see yfiles.graph.FoldingManager#getFolderNodeState + * @protected + */ + initializeFolderNodeStyle(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Called by {@link yfiles.graph.DefaultFolderNodeConverter#updateFolderNodeState} to synchronize the first label if {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} is enabled. + *

+ * This will adjust the label text property or remove the label if there is no master label. + *

+ * @param {yfiles.graph.FolderNodeState} state The node view state whose labels should be synchronized. + * @param {yfiles.graph.IFoldingView} foldingView The folding view. + * @param {yfiles.graph.INode} viewNode The local node instance. + * @param {yfiles.graph.INode} masterNode The master node. + * @protected + */ + synchronizeLabels(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Implements the {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState} method and changes the folder node appearance. + *

+ * This method calls {@link yfiles.graph.DefaultFolderNodeConverter#synchronizeLabels}, only. + *

+ * @param {yfiles.graph.FolderNodeState} state + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.INode} viewNode + * @param {yfiles.graph.INode} masterNode + */ + updateFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Gets or sets the {@link yfiles.styles.INodeStyle} to use for the {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes. + *

+ * Depending on the {@link yfiles.graph.DefaultFolderNodeConverter#cloneNodeStyle} property this implementation will assign a {@link yfiles.lang.ICloneable#clone} to the property or this + * instance. The default is null + *

+ *

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

+ * @type {yfiles.styles.INodeStyle} + */ + folderNodeStyle:yfiles.styles.INodeStyle; + /** + * Gets or sets a value indicating whether the first label of the {@link yfiles.graph.IFoldingView#getMasterItem 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; false otherwise. The default is false. + *

+ * @see yfiles.graph.DefaultFolderNodeConverter#labelStyle + * @see yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter + * @type {boolean} + */ + copyFirstLabel:boolean; + /** + * Gets or sets the {@link yfiles.styles.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.DefaultFolderNodeConverter#copyFirstLabel} property is set to true. The default is null + *

+ *

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

+ * @see yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel + * @type {yfiles.styles.ILabelStyle} + */ + labelStyle:yfiles.styles.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 folder node if the {@link yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel} property is set to true. The default is null + *

+ *

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

+ * @see yfiles.graph.DefaultFolderNodeConverter#copyFirstLabel + * @see yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLabels + * @type {yfiles.graph.ILabelModelParameter} + */ + labelLayoutParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the {@link yfiles.styles.IPortStyle} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} the ports of + * the {@link yfiles.graph.IFoldingView#getMasterItem 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 yfiles.graph.DefaultFolderNodeConverter#createPortStyle + * @type {yfiles.styles.IPortStyle} + */ + portStyle:yfiles.styles.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.IFolderNodeConverter#initializeFolderNodeState creation} of the appearance of + * the collapsed group node. + *

+ * Since the {@link yfiles.graph.INode#layout} of an {@link yfiles.graph.IFoldingView#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 yfiles.graph.DefaultFolderNodeConverter#initializeFolderNodeLayout + * @type {yfiles.geometry.Size} + */ + folderNodeSize:yfiles.geometry.Size; + /** + * Gets or sets the {@link yfiles.graph.IPortLocationModelParameter} to use for the ports at the collapsed group node that {@link yfiles.graph.IFoldingView#getViewItem represent} + * the ports of the {@link yfiles.graph.IFoldingView#getMasterItem 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 location + * parameter to the ports if the node is in collapsed state. A value of null will leave the location parameter property + * unmodified. The default is null + *

+ * @see yfiles.graph.DefaultFolderNodeConverter#createPortLocationParameter + * @type {yfiles.graph.IPortLocationModelParameter} + */ + portLocationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#folderNodeStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneNodeStyle:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + clonePortStyle:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#portLocationParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + clonePortLocationParameter:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelStyle} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneLabelStyle:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultFolderNodeConverter#labelLayoutParameter} instance should be assigned as a {@link yfiles.lang.ICloneable#clone}clone or not. + * @type {boolean} + */ + cloneLabelLayoutParameter:boolean; + static $class:yfiles.lang.Class; + } + /** + * A simple implementation of the {@link yfiles.graph.IFoldingEdgeConverter} interface for use in the {@link yfiles.graph.FoldingManager#foldingEdgeConverter} property, that will prevent + * folding edges from appearing in the {@link yfiles.graph.IFoldingView view}. + * @class yfiles.graph.ExcludingFoldingEdgeConverter + * @implements {yfiles.graph.IFoldingEdgeConverter} + */ + export interface ExcludingFoldingEdgeConverter extends Object,yfiles.graph.IFoldingEdgeConverter{} + export class ExcludingFoldingEdgeConverter { + /** + * Always calls {@link yfiles.graph.IFoldingEdgeFactory#excludeFoldingEdge} + * @param {yfiles.graph.IFoldingEdgeFactory} factory + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} masterEdge + * @param {yfiles.graph.INode} source + * @param {boolean} sourceIsCollapsed + * @param {yfiles.graph.INode} target + * @param {boolean} targetIsCollapsed + * @returns {yfiles.graph.IEdge} + */ + addFoldingEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,source:yfiles.graph.INode,sourceIsCollapsed:boolean,target:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; + /** + * Does nothing and should not normally be called by the view since all folding edges are excluded from it. + * @param {yfiles.graph.FoldingEdgeState} state + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} foldingEdge + * @param {yfiles.collections.IList.} masterEdges + */ + initializeFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Does nothing and should not normally be called by the view since all folding edges are excluded from it. + * @param {yfiles.graph.FoldingEdgeState} state + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} foldingEdge + * @param {yfiles.collections.IList.} masterEdges + */ + updateFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + static $class:yfiles.lang.Class; + } + /** + * A simple implementation of the {@link yfiles.graph.IFoldingEdgeConverter} interface that will make the {@link yfiles.graph.IFoldingView view} contain at most one + * folding edge between each pair of nodes by letting a single folding edge represent all master edges. + *

+ * This implementation by default, will have the {@link yfiles.graph.FoldingEdgeConverterBase#sourcePortLocationParameter} and the {@link yfiles.graph.FoldingEdgeConverterBase#targetPortLocationParameter} properties set to {@link yfiles.graph.FreeNodePortLocationModel#NODE_CENTER_ANCHORED} + * and the {@link yfiles.graph.FoldingEdgeConverterBase#resetBends} property set to true. + *

+ * @class yfiles.graph.MergingFoldingEdgeConverter + * @extends {yfiles.graph.FoldingEdgeConverterBase} + */ + export interface MergingFoldingEdgeConverter extends yfiles.graph.FoldingEdgeConverterBase{} + export class MergingFoldingEdgeConverter { + /** + * Initializes a new instance of the {@link yfiles.graph.MergingFoldingEdgeConverter} class. + * @constructor + */ + constructor(); + /** + * Adds the first separate edge to the source and target node pair using the {@link yfiles.graph.IFoldingEdgeFactory#addAsSeparateEdge} + * method. + * @param {yfiles.graph.IFoldingEdgeFactory} factory + * @param {yfiles.graph.IFoldingView} foldingView + * @param {yfiles.graph.IEdge} masterEdge + * @param {yfiles.graph.INode} viewSourceNode + * @param {boolean} sourceIsCollapsed + * @param {yfiles.graph.INode} targetSourceNode + * @param {boolean} targetIsCollapsed + * @returns {yfiles.graph.IEdge} + * @protected + */ + addFirstSeparateEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,viewSourceNode:yfiles.graph.INode,sourceIsCollapsed:boolean,targetSourceNode:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; + /** + * Gets or sets a value indicating whether edge direction should be ignored for the determination of the + * {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edges}. + * @type {boolean} + */ + ignoreEdgeDirection:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class adds folding support to {@link yfiles.graph.IGraph} implementations. + *

+ * This implementation manages the varying states nodes and edges can have in different views and during different {@link yfiles.graph.IFoldingView#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#createFoldingView} + * methods to create an {@link yfiles.graph.IGraph} implementation that provides a view of a subset of the graph, where {@link yfiles.graph.IGraph#isGroupNode group nodes} + * can be {@link yfiles.graph.IFoldingView#collapse collapsed} and {@link yfiles.graph.IFoldingView#expand expanded}. + *

+ *

+ * This class can be used to {@link yfiles.graph.FoldingManager#createFoldingView create folding views} of the {@link yfiles.graph.FoldingManager#masterGraph}, where group nodes can appear as {@link yfiles.graph.IFoldingView#collapse collapsed} group nodes with their + * contents hidden. Edges that connect to elements inside collapsed group nodes can be {@link yfiles.graph.FoldingManager#foldingEdgeConverter configured} to be represented by {@link yfiles.graph.FoldingEdgeStateId folding edges} + * in the views. The process of converting one or more true edges from the {@link yfiles.graph.FoldingManager#masterGraph} to zero or more folding edges can be + * customized, as well as the process of {@link yfiles.graph.FoldingManager#folderNodeConverter converting} an expanded group node to a collapsed group node. + *

+ *

+ * Class FoldingManager's central role for folding support is discussed in the section {@link @DGUIDE_PREFIX@/folding-technical_background.html Folding Revisited}. A brief + * description of the class's API, set-up, etc. is given in the section {@link @DGUIDE_PREFIX@/folding.html#folding-working_with_folding Working with Folding}. + *

+ *

Related demos:

+ *
    + *
  • Demo: Simple Editor Demo, Demo.yFiles.Graph.SimpleEditor
  • + *
+ * @see yfiles.graph.IFoldingView + * @see yfiles.graph.FoldingManager#createFoldingView + * @class yfiles.graph.FoldingManager + */ + export interface FoldingManager extends Object{} + export class 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}. + * @throws {Stubs.Exceptions.ArgumentError} masterGraph is null. + * @constructor + */ + constructor(masterGraph:yfiles.graph.IGraph); + /** + * Creates a manager instance for the given {@link yfiles.graph.FoldingManager#masterGraph} to create views on top of it that support folding operations. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IGraph} options.masterGraph The graph to use as the {@link yfiles.graph.FoldingManager#masterGraph}. + * @param {yfiles.graph.IFoldingEdgeConverter} options.foldingEdgeConverter The {@link yfiles.graph.IFoldingEdgeConverter} implementation that is used to create/convert and modify the {@link yfiles.graph.FoldingEdgeStateId folding edges} inside the view instances. + *

+ * This option sets the {@link yfiles.graph.FoldingManager#foldingEdgeConverter} property on the created object. + *

+ * @param {yfiles.graph.IFolderNodeConverter} options.folderNodeConverter The {@link yfiles.graph.IFolderNodeConverter} implementation that is used to create/convert and modify the folder nodes inside the view instances. + *

+ * This option sets the {@link yfiles.graph.FoldingManager#folderNodeConverter} property on the created object. + *

+ * @throws {Stubs.Exceptions.ArgumentError} masterGraph is null. + * @constructor + */ + constructor(options:{masterGraph:yfiles.graph.IGraph,foldingEdgeConverter?:yfiles.graph.IFoldingEdgeConverter,folderNodeConverter?:yfiles.graph.IFolderNodeConverter}); + /** + * Creates a new manager with a default backing graph implementation. + *

+ * Use {@link yfiles.graph.FoldingManager#createFoldingView} to create a view that supports the {@link yfiles.graph.IFoldingView} interface + * for displaying and working with a collapsible graph structure. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.graph.IFoldingEdgeConverter} options.foldingEdgeConverter The {@link yfiles.graph.IFoldingEdgeConverter} implementation that is used to create/convert and modify the {@link yfiles.graph.FoldingEdgeStateId folding edges} inside the view instances. + *

+ * This option sets the {@link yfiles.graph.FoldingManager#foldingEdgeConverter} property on the created object. + *

+ * @param {yfiles.graph.IFolderNodeConverter} options.folderNodeConverter The {@link yfiles.graph.IFolderNodeConverter} implementation that is used to create/convert and modify the folder nodes inside the view instances. + *

+ * This option sets the {@link yfiles.graph.FoldingManager#folderNodeConverter} property on the created object. + *

+ * @see yfiles.graph.FoldingManager#createFoldingView + * @see yfiles.graph.FoldingManager#masterGraph + * @constructor + */ + constructor(options?:{foldingEdgeConverter?:yfiles.graph.IFoldingEdgeConverter,folderNodeConverter?:yfiles.graph.IFolderNodeConverter}); + /** + * 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.IFoldingView#graph} property of the returned {@link yfiles.graph.IFoldingView} implementation. The graph + * instance will provide an {@link yfiles.graph.IFoldingView} instance in its {@link yfiles.graph.ILookup#lookup} mechanism: + *

+ *

+ * This instance can be used to gain access to this manager instance and the folding operations. + *

+ *

+ * 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 (style, {@link yfiles.graph.ITagOwner#tag tag}, {@link yfiles.graph.ILabelModelParameter parameters}, and {@link yfiles.graph.INode#layout geometry}). For collapsed + * group nodes and view edges, there is a separate set of properties available for each possible state combination. The {@link yfiles.graph.FoldingManager#getFoldingEdgeState} + * method for edges and the {@link yfiles.graph.FoldingManager#getFolderNodeState} method for nodes provide access to that state + * while it is not being displayed in a view. + *

+ * @param {yfiles.graph.INode} [root=null] A group node or the root of the {@link yfiles.graph.FoldingManager#masterGraph} whose contents will be displayed in the view. + * @param {function(yfiles.graph.INode): boolean} [isExpanded=null] A predicate that can be provided to the view that will be used as a callback to determine the initial {@link yfiles.graph.IFoldingView#isExpanded expansion state} of + * group nodes in the view. + * @returns {yfiles.graph.IFoldingView} A new graph instance that represents a synchronized view on the {@link yfiles.graph.FoldingManager#masterGraph}. + * @see yfiles.graph.FoldingManager#prepareFoldingView + */ + createFoldingView(root?:yfiles.graph.INode,isExpanded?:(obj:yfiles.graph.INode)=>boolean):yfiles.graph.IFoldingView; + /** + * 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.IFoldingView#graph} property of the returned {@link yfiles.graph.IFoldingView} implementation. The graph + * instance will provide an {@link yfiles.graph.IFoldingView} instance in its {@link yfiles.graph.ILookup#lookup} mechanism: + *

+ *

+ * This instance can be used to gain access to this manager instance and the folding operations. + *

+ *

+ * 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 (style, {@link yfiles.graph.ITagOwner#tag tag}, {@link yfiles.graph.ILabelModelParameter parameters}, and {@link yfiles.graph.INode#layout geometry}). For collapsed + * group nodes and view edges, there is a separate set of properties available for each possible state combination. The {@link yfiles.graph.FoldingManager#getFoldingEdgeState} + * method for edges and the {@link yfiles.graph.FoldingManager#getFolderNodeState} method for nodes provide access to that state + * while it is not being displayed in a view. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.INode} [options.root=null] A group node or the root of the {@link yfiles.graph.FoldingManager#masterGraph} whose contents will be displayed in the view. + * @param {function(yfiles.graph.INode): boolean} [options.isExpanded=null] A predicate that can be provided to the view that will be used as a callback to determine the initial {@link yfiles.graph.IFoldingView#isExpanded expansion state} of + * group nodes in the view. + * @returns {yfiles.graph.IFoldingView} A new graph instance that represents a synchronized view on the {@link yfiles.graph.FoldingManager#masterGraph}. + * @see yfiles.graph.FoldingManager#prepareFoldingView + */ + createFoldingView(options:{root?:yfiles.graph.INode,isExpanded?:(obj:yfiles.graph.INode)=>boolean}):yfiles.graph.IFoldingView; + /** + * Disposes of this instance. + *

+ * This will disconnect the {@link yfiles.graph.FoldingManager#masterGraph} from the previously created {@link yfiles.graph.FoldingManager#createFoldingView managed views}. Also each view will be {@link yfiles.graph.IFoldingView#dispose disposed}. + *

+ */ + dispose():void; + /** + * Provides access to the folder node state of a node. + *

+ * This method can be used to query the collapsed state of a node, even if the node is currently not present in any managed + * view or the node is in fact expanded in all views. + *

+ * @param {yfiles.graph.INode} masterNode The node in the {@link yfiles.graph.FoldingManager#masterGraph} for which the state should be returned. + * @returns {yfiles.graph.FolderNodeState} A state holder implementation of a node, which is not part of any graph. + * @throws {Stubs.Exceptions.ArgumentError} The master node does not belong to the managed graph. + */ + getFolderNodeState(masterNode:yfiles.graph.INode):yfiles.graph.FolderNodeState; + /** + * 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.FoldingEdgeStateId}. + *

+ * 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.IFoldingView#collapse collapsed} states of the nodes and their parents in the view. + *

+ * @param {yfiles.graph.FoldingEdgeStateId} id The ID of the folding edge for which the folding state should be returned. + * @returns {yfiles.graph.FoldingEdgeState} A {@link yfiles.graph.FoldingEdgeState} that can be used to query and change the properties of the edge. + * @see yfiles.graph.FoldingManager#getFolderNodeState + * @see yfiles.graph.FoldingEdgeStateId + */ + getFoldingEdgeState(id:yfiles.graph.FoldingEdgeStateId):yfiles.graph.FoldingEdgeState; + /** + * Determines whether for the given masterNode this manager has stored associated folder node state. + *

+ * The manager does not necessarily have folder node state for folder nodes if that specific state has never been requested + * by a {@link yfiles.graph.IFoldingView view} because it has never been visualized. This method indicates whether there is state information available for + * the given master node. + *

+ * @param {yfiles.graph.INode} masterNode The master node for which the state is requested. + * @returns {boolean} Whether {@link yfiles.graph.FoldingManager#getFolderNodeState} would return existing state information. + * @see yfiles.graph.FoldingManager#getFolderNodeState + */ + hasFolderNodeState(masterNode:yfiles.graph.INode):boolean; + /** + * Determines whether for the given {@link yfiles.graph.FoldingEdgeStateId} this manager has stored associated view local state. + *

+ * The manager does not necessarily have a {@link yfiles.graph.FoldingEdgeState} for folding elements if that specific state has + * never been requested by a {@link yfiles.graph.IFoldingView} because it has never been visualized. This method indicates whether + * there is state information available for the given id. + *

+ * @param {yfiles.graph.FoldingEdgeStateId} id The id for which state is requested. + * @returns {boolean} Whether {@link yfiles.graph.FoldingManager#getFoldingEdgeState} would return existing state information. + * @see yfiles.graph.FoldingManager#getFoldingEdgeState + */ + hasFoldingEdgeState(id:yfiles.graph.FoldingEdgeStateId):boolean; + /** + * Callback that can be overridden by subclasses to prepare the {@link yfiles.graph.IFoldingView} 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.collections.IMapper.} instances with the graph instance or add + * {@link yfiles.graph.IContextLookupChainLink}s via the {@link yfiles.graph.ILookupDecorator} of the {@link yfiles.graph.IFoldingView#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.IFoldingView} foldingView The graph view that has just been created but is still empty. + * @protected + */ + prepareFoldingView(foldingView:yfiles.graph.IFoldingView):void; + /** + * Triggers a call to {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState} for all view nodes that {@link yfiles.graph.IFoldingView#getViewItem 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#getFolderNodeState view-local state} will be updated via a call to the + * {@link yfiles.graph.IFolderNodeConverter}'s {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState} method. + *

+ *

+ * Note that all {@link yfiles.graph.FoldingManager#views} share the same {@link yfiles.graph.FolderNodeState} for the masterNode. + *

+ *

+ * 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.IFolderNodeConverter} implementation. + *

+ * @param {yfiles.graph.INode} masterNode The master node that belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + * @throws {Stubs.Exceptions.ArgumentError} If the provided master node does not belong to the master graph. + * @see yfiles.graph.FoldingManager#updateFoldingEdgeStates + */ + updateFolderNodeStates(masterNode:yfiles.graph.INode):void; + /** + * Triggers a call to {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} for all folder edges that {@link yfiles.graph.IFoldingView#getViewItem represent} the + * given masterEdge. + *

+ * In all {@link yfiles.graph.FoldingManager#views} that are currrently showing the view edge for the provided master edge, the {@link yfiles.graph.FoldingManager#getFoldingEdgeState view-local state} will be updated via + * a call to the {@link yfiles.graph.IFoldingEdgeConverter}'s {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} 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.IFoldingEdgeConverter} implementation. + *

+ * @param {yfiles.graph.IEdge} masterEdge The master edge that belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + * @throws {Stubs.Exceptions.ArgumentError} If the provided master edge does not belong to the master graph. + * @see yfiles.graph.FoldingManager#updateFolderNodeStates + */ + updateFoldingEdgeStates(masterEdge:yfiles.graph.IEdge):void; + /** + * Gets or sets the {@link yfiles.graph.IFoldingEdgeConverter} implementation that is used to create/convert and modify the {@link yfiles.graph.FoldingEdgeStateId folding edges} + * inside the view instances. + *

+ * The converter instance will be used to {@link yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState create the initial} and {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState change} the appearance of the folding edges as soon as they + * appear in a view. + *

+ * @throws {Stubs.Exceptions.ArgumentError} value is null. + * @see yfiles.graph.DefaultFoldingEdgeConverter + * @type {yfiles.graph.IFoldingEdgeConverter} + */ + foldingEdgeConverter:yfiles.graph.IFoldingEdgeConverter; + /** + * Gets or sets the {@link yfiles.graph.IFolderNodeConverter} implementation that is used to create/convert and modify the folder + * nodes inside the view instances. + *

+ * The converter instance will be used to {@link yfiles.graph.IFolderNodeConverter#initializeFolderNodeState create the initial} and {@link yfiles.graph.IFolderNodeConverter#updateFolderNodeState change} the appearance of the folder nodes as soon as they + * appear in a view. + *

+ * @see yfiles.graph.DefaultFolderNodeConverter + * @type {yfiles.graph.IFolderNodeConverter} + */ + folderNodeConverter:yfiles.graph.IFolderNodeConverter; + /** + * Yields the master {@link yfiles.graph.IGraph} instance that holds the complete model in expanded group node state. + *

+ * This graph contains all non-folding edges and expanded group nodes, no folding edges and no collapsed group nodes. + *

+ * @type {yfiles.graph.IGraph} + */ + masterGraph:yfiles.graph.IGraph; + /** + * Yields all currently known {@link yfiles.graph.FoldingManager#createFoldingView view instances} that are managed by this instance. + * @see yfiles.graph.IFoldingView#graph + * @type {yfiles.collections.IEnumerable.} + */ + views:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * A data container representing the state of a bend of a {@link yfiles.graph.FoldingEdgeState}. + *

+ * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. + *

+ * @class yfiles.graph.FoldingBendState + * @final + */ + export interface FoldingBendState extends Object{} + export class FoldingBendState { + /** + * Returns an {@link yfiles.graph.IBend} instance which represents this bend state. + *

+ * The returned bend is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the bend + * state's view bend in the {@link yfiles.graph.IFoldingView#graph folding view graph}. + *

+ * @returns {yfiles.graph.IBend} An {@link yfiles.graph.IBend} instance which represents this bend state. + */ + asBend():yfiles.graph.IBend; + /** + * The location of the bend. + * @type {yfiles.geometry.Point} + */ + location:yfiles.geometry.Point; + /** + * The tag of the bend. + * @type {Object} + */ + tag:Object; + /** + * Gets the bend's index in the {@link yfiles.graph.FoldingEdgeState#bends} of its owner. + * @type {number} + */ + index:number; + static $class:yfiles.lang.Class; + } + /** + * A data container representing the state of an edge whose source and/or target node are collapsed. + *

+ * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. + *

+ * @see yfiles.graph.FoldingEdgeStateId + * @see yfiles.graph.FoldingManager#getFoldingEdgeState + * @class yfiles.graph.FoldingEdgeState + * @extends {yfiles.graph.FoldingLabelOwnerState} + * @final + */ + export interface FoldingEdgeState extends yfiles.graph.FoldingLabelOwnerState{} + export class FoldingEdgeState { + /** + * Adds a new {@link yfiles.graph.FoldingBendState} to this edge state at the given index and location. + * @param {yfiles.geometry.Point} location The location of the new bend state. + * @param {number} [index=-1] The index the bend state shall be inserted in the + * {@link yfiles.graph.FoldingEdgeState#bends}; a negative value (which is the default) indicates that the bend should be appended to the end of the list of bends. + * @returns {yfiles.graph.FoldingBendState} The newly added bend state. + */ + addBend(location:yfiles.geometry.Point,index?:number):yfiles.graph.FoldingBendState; + /** + * Returns an {@link yfiles.graph.IEdge} instance which represents this edge state. + *

+ * The returned edge is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the edge + * state's view edge in the {@link yfiles.graph.IFoldingView#graph folding view graph}. + *

+ * @returns {yfiles.graph.IEdge} An {@link yfiles.graph.IEdge} instance which represents this edge state. + */ + asEdge():yfiles.graph.IEdge; + /** + * Removes all {@link yfiles.graph.FoldingEdgeState#bends}. + */ + clearBends():void; + /** + * + * @param {yfiles.graph.FoldingLabelState} label + */ + remove(label:yfiles.graph.FoldingLabelState):void; + /** + * Removes the bend from this edge state. + * @param {yfiles.graph.FoldingBendState} bend The bend to remove. + * @throws {Stubs.Exceptions.ArgumentError} Thrown if the bend doesn't belong to this edge state. + */ + remove(bend:yfiles.graph.FoldingBendState):void; + /** + * The tag of the edge. + * @type {Object} + */ + tag:Object; + /** + * The {@link yfiles.graph.FoldingBendState}s of this state. + * @type {yfiles.collections.IListEnumerable.} + */ + bends:yfiles.collections.IListEnumerable; + /** + * The {@link yfiles.graph.FoldingPortState} which represents the source port of this edge state. + * @type {yfiles.graph.FoldingPortState} + */ + sourcePort:yfiles.graph.FoldingPortState; + /** + * The {@link yfiles.graph.FoldingPortState} which represents the target port of this edge state. + * @type {yfiles.graph.FoldingPortState} + */ + targetPort:yfiles.graph.FoldingPortState; + /** + * The style of this edge. + * @type {yfiles.styles.IEdgeStyle} + */ + style:yfiles.styles.IEdgeStyle; + static $class:yfiles.lang.Class; + } + /** + * A data container representing the state of a label at a {@link yfiles.graph.FolderNodeState} or {@link yfiles.graph.FoldingEdgeState}. + *

+ * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. + *

+ * @see yfiles.graph.FoldingLabelOwnerState#labels + * @see yfiles.graph.FoldingLabelOwnerState#addLabel + * @class yfiles.graph.FoldingLabelState + * @final + */ + export interface FoldingLabelState extends Object{} + export class FoldingLabelState { + /** + * Returns an {@link yfiles.graph.ILabel} instance which represents this label state. + *

+ * The returned label is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the + * label state's view label in the {@link yfiles.graph.IFoldingView#graph folding view graph}. + *

+ * @returns {yfiles.graph.ILabel} An {@link yfiles.graph.ILabel} instance which represents this label state. + */ + asLabel():yfiles.graph.ILabel; + /** + * The style of this label. + * @type {yfiles.styles.ILabelStyle} + */ + style:yfiles.styles.ILabelStyle; + /** + * The preferred size of the label. + * @type {yfiles.geometry.Size} + */ + preferredSize:yfiles.geometry.Size; + /** + * The label's text. + * @type {string} + */ + text:string; + /** + * The {@link yfiles.graph.ILabelModelParameter} used to describe the label's layout. + * @type {yfiles.graph.ILabelModelParameter} + */ + layoutParameter:yfiles.graph.ILabelModelParameter; + /** + * The tag of the label. + * @type {Object} + */ + tag:Object; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class for data containers representing the state of model items which can own labels. + *

+ * Developers should not extend this class. Only instances of its subclasses {@link yfiles.graph.FolderNodeState} and {@link yfiles.graph.FoldingEdgeState} + * are supported. + *

+ *

+ * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. + *

+ * @see yfiles.graph.FolderNodeState + * @see yfiles.graph.FoldingEdgeState + * @see yfiles.graph.FoldingLabelState + * @class yfiles.graph.FoldingLabelOwnerState + */ + export interface FoldingLabelOwnerState extends Object{} + export class FoldingLabelOwnerState { + constructor(); + /** + * Adds a {@link yfiles.graph.FoldingLabelState} to this state. + * @param {string} text The text of the new label. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The layout parameter of the new label. + * @param {yfiles.styles.ILabelStyle} style The style of the new label. + * @param {yfiles.geometry.Size} preferredSize The preferred size of the label. + * @param {Object} tag The tag of the label. + * @returns {yfiles.graph.FoldingLabelState} The newly added {@link yfiles.graph.FoldingLabelState}. + * @abstract + */ + addLabel(text:string,layoutParameter:yfiles.graph.ILabelModelParameter,style:yfiles.styles.ILabelStyle,preferredSize:yfiles.geometry.Size,tag:Object):yfiles.graph.FoldingLabelState; + /** + * Removes all {@link yfiles.graph.FoldingLabelOwnerState#labels}. + */ + clearLabels():void; + /** + * The {@link yfiles.graph.FoldingLabelState}s owned by this state. + * @type {yfiles.collections.IListEnumerable.} + */ + labels:yfiles.collections.IListEnumerable; + static $class:yfiles.lang.Class; + } + /** + * A data container representing the state of a port at a {@link yfiles.graph.FolderNodeState} or {@link yfiles.graph.FoldingEdgeState}. + *

+ * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. + *

+ * @see yfiles.graph.FoldingEdgeState#sourcePort + * @see yfiles.graph.FoldingEdgeState#targetPort + * @see yfiles.graph.FolderNodeState#ports + * @see yfiles.graph.FolderNodeState#getFoldingPortState + * @class yfiles.graph.FoldingPortState + */ + export interface FoldingPortState extends Object{} + export class FoldingPortState { + /** + * Returns an {@link yfiles.graph.IPort} instance which represents this port state. + *

+ * The returned port is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the port + * state's view port in the {@link yfiles.graph.IFoldingView#graph folding view graph}. + *

+ * @returns {yfiles.graph.IPort} An {@link yfiles.graph.IPort} instance which represents this port state. + * @abstract + */ + asPort():yfiles.graph.IPort; + /** + * The style of this port. + * @type {yfiles.styles.IPortStyle} + */ + style:yfiles.styles.IPortStyle; + /** + * The {@link yfiles.graph.IPortLocationModelParameter} describing the position of this port. + * @type {yfiles.graph.IPortLocationModelParameter} + */ + locationParameter:yfiles.graph.IPortLocationModelParameter; + /** + * The tag of the port. + * @abstract + * @type {Object} + */ + tag:Object; + static $class:yfiles.lang.Class; + } + /** + * A data container representing the collapsed state of a node. + *

+ * When the properties of the state are changed, these changes are reflected immediately in the {@link yfiles.graph.FoldingManager#views}. + *

+ * @see yfiles.graph.FoldingManager#getFolderNodeState + * @class yfiles.graph.FolderNodeState + * @extends {yfiles.graph.FoldingLabelOwnerState} + * @final + */ + export interface FolderNodeState extends yfiles.graph.FoldingLabelOwnerState{} + export class FolderNodeState { + /** + * Returns an {@link yfiles.graph.INode} instance which represents this folder node state. + *

+ * The returned node is not present in any graph but may be passed to {@link yfiles.graph.IFoldingView#getViewItem} to get the node + * state's folder node in the {@link yfiles.graph.IFoldingView#graph folding view graph}. + *

+ * @returns {yfiles.graph.INode} An {@link yfiles.graph.INode} instance which represents this folder node state. + */ + asNode():yfiles.graph.INode; + /** + * Provides access to the folding state of a master port. + *

+ * This method can be used to query the folding state of a port at the folder which is represented by this state. + *

+ * @param {yfiles.graph.IPort} masterPort The master port for which the state should be returned. + * @returns {yfiles.graph.FoldingPortState} A state holder implementation of the masterPort, which reflects the port in the node's collapsed state. + * @see yfiles.graph.FoldingPortState#style + * @see yfiles.graph.FoldingPortState#locationParameter + */ + getFoldingPortState(masterPort:yfiles.graph.IPort):yfiles.graph.FoldingPortState; + /** + * + * @param {yfiles.graph.FoldingLabelState} label + */ + remove(label:yfiles.graph.FoldingLabelState):void; + /** + * The layout of the node. + * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * The style of this node. + * @type {yfiles.styles.INodeStyle} + */ + style:yfiles.styles.INodeStyle; + /** + * The tag of the node. + * @type {Object} + */ + tag:Object; + /** + * The {@link yfiles.graph.FoldingPortState}s owned by this state. + * @type {yfiles.collections.IListEnumerable.} + */ + ports:yfiles.collections.IListEnumerable; + static $class:yfiles.lang.Class; + } + /** + * Interface used by {@link yfiles.graph.FoldingManager} and {@link yfiles.graph.IFoldingView} which is responsible for managing edges + * between folder nodes. + *

+ * Since CreateFoldingView 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.IFoldingView}s to configure these kind of folding edges. + *

+ * @see yfiles.graph.DefaultFoldingEdgeConverter + * @see yfiles.graph.FoldingManager#foldingEdgeConverter + * @see yfiles.graph.FoldingEdgeStateId + * @interface + */ + export interface IFoldingEdgeConverter extends Object{ + /** + * This method gets called by the {@link yfiles.graph.IFoldingView} implementation to determine whether a given edge in the {@link yfiles.graph.FoldingManager#masterGraph} should + * be represented by a folding edge in the given view. + *

+ * The implementation will be passed in a factory object that implements the {@link yfiles.graph.IFoldingEdgeFactory} 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.IFoldingEdgeFactory#addAsSeparateEdge}, {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge}, or {@link yfiles.graph.IFoldingEdgeFactory#excludeFoldingEdge} + * and return the values that these implementation yields to the caller. The implementation can optionally query the {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edges} + * between the source and target node and decide whether to add the edge {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge to the existing folding edge}. + *

+ * @param {yfiles.graph.IFoldingEdgeFactory} factory The {@link yfiles.graph.IFoldingEdgeFactory} implementation that needs to be called in order to communicate the results of this + * query. + * @param {yfiles.graph.IFoldingView} foldingView The instance into which the folding 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 folding edge. Note that you may not return this instance. + * @param {yfiles.graph.INode} source The source node that belongs to the {@link yfiles.graph.IFoldingView} graph that will act as the local view node of the actual + * source node. + * @param {boolean} sourceIsCollapsed Determines whether the source is currently a folder node. + * @param {yfiles.graph.INode} target The target node that belongs to the {@link yfiles.graph.IFoldingView} graph that will act as the local view node of the actual + * target node. + * @param {boolean} targetIsCollapsed Determines whether the target is currently a folder node. + * @returns {yfiles.graph.IEdge} The edge as returned by {@link yfiles.graph.IFoldingEdgeFactory#addAsSeparateEdge}, or + * {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge}, or null if the edge will be {@link yfiles.graph.IFoldingEdgeFactory#excludeFoldingEdge excluded} from the view. + * @abstract + */ + addFoldingEdge(factory:yfiles.graph.IFoldingEdgeFactory,foldingView:yfiles.graph.IFoldingView,masterEdge:yfiles.graph.IEdge,source:yfiles.graph.INode,sourceIsCollapsed:boolean,target:yfiles.graph.INode,targetIsCollapsed:boolean):yfiles.graph.IEdge; + /** + * Callback that is triggered by the {@link yfiles.graph.IFoldingView view} to initially create the appearance of a folding edge. + *

+ * Implementations may not use the {@link yfiles.graph.IFoldingView}'s {@link yfiles.graph.IFoldingView#graph} instance to modify the foldingEdge, because this would + * create and enqueue undo events. Rather the properties provided by the state implementation must be set. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The {@link yfiles.graph.FoldingEdgeState} of the edge to change. + * @param {yfiles.graph.IFoldingView} foldingView The graph to which the folding edge belongs. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge for which the appearance shall be determined. + * @param {yfiles.collections.IList.} masterEdges The list of {@link yfiles.graph.IFoldingView#getMasterEdges master edges}, that the folding edge initially represents. + * @see yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState + * @abstract + */ + initializeFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback that is triggered by the {@link yfiles.graph.IFoldingView view} to adjust the appearance of a folding edge + *

+ * For instance, it can be used to reflect a state change in the {@link yfiles.graph.IFoldingView#getMasterEdges master edges} that make up that folding edge. + *

+ *

+ * Implementations may not use the {@link yfiles.graph.IFoldingView}'s {@link yfiles.graph.IFoldingView#graph} instance to modify the foldingEdge, because this would + * create and enqueue undo events. Rather the properties provided by the state implementation must be set. + *

+ * @param {yfiles.graph.FoldingEdgeState} state The {@link yfiles.graph.FoldingEdgeState} of the edge to change. + * @param {yfiles.graph.IFoldingView} foldingView The graph to which the folding edge belongs. + * @param {yfiles.graph.IEdge} foldingEdge The folding edge for which the appearance might need an update. + * @param {yfiles.collections.IList.} masterEdges The list of {@link yfiles.graph.IFoldingView#getMasterEdges master edges}, that the folding edge currently represents. + * @see yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState + * @abstract + */ + updateFoldingEdgeState(state:yfiles.graph.FoldingEdgeState,foldingView:yfiles.graph.IFoldingView,foldingEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + } + var IFoldingEdgeConverter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.FoldingManager} and {@link yfiles.graph.IFoldingView} which is responsible for managing the + * appearance of folder nodes. + *

+ * Since CreateFoldingView 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.IFoldingView view}s to configure + * the appearance of these {@link yfiles.graph.IFoldingView#isInFoldingState folder nodes}. + *

+ * @see yfiles.graph.DefaultFolderNodeConverter + * @see yfiles.graph.FoldingManager#folderNodeConverter + * @see yfiles.graph.IFoldingView#isInFoldingState + * @interface + */ + export interface IFolderNodeConverter extends Object{ + /** + * Callback that is used by {@link yfiles.graph.IFoldingView view} implementations to initially create the appearance of a {@link yfiles.graph.IFoldingView#isInFoldingState folder} node. + *

+ * This method is called by the view to allow for initially creating the appearance of a local folder 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. + *

+ *

+ * By default the state is an exact copy of the masterNode, including layout, style, labels, and ports. + *

+ *

+ * Note that changing the appearance has to be done on state. + *

+ * @param {yfiles.graph.FolderNodeState} state The folder node state to initialize. + * @param {yfiles.graph.IFoldingView} foldingView The graph instance for which the folder node has been created. + * @param {yfiles.graph.INode} viewNode The folder node instance in the view + * @param {yfiles.graph.INode} masterNode The node that represents the {@link yfiles.graph.IFoldingView#getMasterItem} of the viewstate to change. + * @see yfiles.graph.IFolderNodeConverter#updateFolderNodeState + * @abstract + */ + initializeFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback that is used by {@link yfiles.graph.IFoldingView view} implementations to change the appearance of a {@link yfiles.graph.IFoldingView#isInFoldingState folder} node. + *

+ * This method is called by the view to allow for adjusting the appearance of a local folder node in the view when the {@link yfiles.graph.IFoldingView#getMasterItem 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 on state. + *

+ * @param {yfiles.graph.FolderNodeState} state The folder node state to update. + * @param {yfiles.graph.IFoldingView} foldingView The graph instance for which the folder node can be changed. + * @param {yfiles.graph.INode} viewNode The folder node instance in the view + * @param {yfiles.graph.INode} masterNode The node that represents the {@link yfiles.graph.IFoldingView#getMasterItem} of the viewstate to change. + * @see yfiles.graph.IFolderNodeConverter#initializeFolderNodeState + * @abstract + */ + updateFolderNodeState(state:yfiles.graph.FolderNodeState,foldingView:yfiles.graph.IFoldingView,viewNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + } + var IFolderNodeConverter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface of the factory that is passed to implementations of the {@link yfiles.graph.IFoldingEdgeConverter}'s {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} + * method. + *

+ * Implementors of the {@link yfiles.graph.IFoldingEdgeConverter} need to use this interface to tell the calling {@link yfiles.graph.IFoldingView} + * implementation how to add the folding edge to the given view. They need to call exactly one of the following methods for + * each factory: + *

+ *
    + *
  • + * {@link yfiles.graph.IFoldingEdgeFactory#addAsSeparateEdge} � Call this to add a separate folding edge for the given master edge to the view. Pass the return value of that method to + * the caller. + *
  • + *
  • + * {@link yfiles.graph.IFoldingEdgeFactory#addToExistingFoldingEdge} � Call this to reuse a folding 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.IFoldingEdgeFactory#excludeFoldingEdge} � Call this in order not to add a folding edge for the master edge to the view at all. Pass null to the caller.
  • + *
+ * @see yfiles.graph.IFoldingEdgeConverter#addFoldingEdge + * @see yfiles.graph.IFoldingEdgeConverter + * @see yfiles.graph.FoldingManager#foldingEdgeConverter + * @interface + */ + export interface IFoldingEdgeFactory extends Object{ + /** + * Tells the {@link yfiles.graph.IFoldingView} implementation to add the edge provided to the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} + * method as a separate folding edge to the view at the given ports. + *

+ * This tells the view that there is currently no {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edge} in the view to which the master edge should be + * added to. Instead the view should add a separate folding edge that represents the master edge. Use the result of this + * method call as the return value for the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} call. Note that the returned + * folding edge should not be modified by this code, instead the {@link yfiles.graph.IFoldingEdgeConverter#initializeFoldingEdgeState} + * and {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} callbacks need to be used to change the appearance of the + * folding edge. Existing ports at the provided source and target nodes may be specified to further influence the folding + * 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.IFoldingView#isInFoldingState folding state} 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.IFoldingView#isInFoldingState folding state} port should be added for the + * edge to connect to at the target. + * @returns {yfiles.graph.IEdge} The folding edge that has been created in the view. Don't change the properties of the edge directly. + * @see yfiles.graph.IFoldingEdgeConverter + * @see yfiles.graph.IFoldingView#getViewItem + * @abstract + */ + addAsSeparateEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Tells the {@link yfiles.graph.IFoldingView} implementation to logically add the edge provided to the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} + * method to a folding edge that already exists in the view. + *

+ * This tells the view that there is already an {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edge} in the view to which the master edge should be added + * logically added to. The given foldingEdge will have the master edge added to its collection of {@link yfiles.graph.IFoldingView#getMasterEdges master edges}. Note that + * the returned folding edge should not be modified by this code, instead the {@link yfiles.graph.IFoldingEdgeConverter#updateFoldingEdgeState} + * callback needs to be used to change the appearance of the folding edge. Implementations can use the {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges} + * method to retrieve the current set of existing folding edges that interconnect the same source and target nodes. The + * range of valid parameters is constrained to this collection. + *

+ * @param {yfiles.graph.IEdge} foldingEdge One of the {@link yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges existing folding edges} from the view which has been chosen to represent the master edge in this view. + * @returns {yfiles.graph.IEdge} The folding edge that represents the edge in the view, which is the same as the foldingEdge parameter. Don't change the + * properties of the edge directly. + * @see yfiles.graph.IFoldingEdgeConverter + * @see yfiles.graph.IFoldingEdgeFactory#getExistingFoldingEdges + * @abstract + */ + addToExistingFoldingEdge(foldingEdge:yfiles.graph.IEdge):yfiles.graph.IEdge; + /** + * Tells the {@link yfiles.graph.IFoldingView} implementation not to add a folding edge for the edge provided to the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} + * 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.IFoldingEdgeConverter#addFoldingEdge} 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. + *

+ * @returns {yfiles.graph.IEdge} This method will always return null. This is for symmetry reasons to be easily exchangeable with the other methods. + * @see yfiles.graph.IFoldingEdgeConverter + * @abstract + */ + excludeFoldingEdge():yfiles.graph.IEdge; + /** + * Helper methods that can be used by the implementation of the {@link yfiles.graph.IFoldingEdgeConverter#addFoldingEdge} method to + * determine the folding edges that are currently part of the view and interconnect the same nodes as the folding edge + * would, if it was included in the view. + *

+ * This method will yield all {@link yfiles.graph.IFoldingView#isInFoldingState folding edges} that interconnect the same source and target node as that the folding 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.IFoldingEdgeFactory#addToExistingFoldingEdge} + * method. + *

+ * @param {boolean} ignoreDirection Whether the direction of the edges should be ignored so that reverse edges are included in the enumeration, too. + * @returns {yfiles.collections.IEnumerable.} An collection of currently existing folding edges in the view that interconnects the same source and target node. + * @abstract + */ + getExistingFoldingEdges(ignoreDirection:boolean):yfiles.collections.IEnumerable; + } + var IFoldingEdgeFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum StretchStripeLabelModelPosition{ + /** + * Encodes a position at the top side of the node interior + */ + NORTH, + /** + * Encodes a position at the right side of the node interior + */ + EAST, + /** + * Encodes a position at the bottom side of the node interior + */ + SOUTH, + /** + * Encodes a position at the left side of the node interior + */ + WEST + } + /** + * 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. + *

+ * @class yfiles.graph.StretchStripeLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface StretchStripeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class StretchStripeLabelModel { + /** + * Creates a new instance of this model with empty insets. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Insets} options.insets The insets to use within the stripe's {@link yfiles.graph.IStripe#layout}. + *

+ * This option sets the {@link yfiles.graph.StretchStripeLabelModel#insets} property on the created object. + *

+ * @param {boolean} options.useActualInsets Whether or not to use the {@link yfiles.graph.IStripe#actualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the stripe header area. + *

+ * This option sets the {@link yfiles.graph.StretchStripeLabelModel#useActualInsets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{insets?:yfiles.geometry.Insets,useActualInsets?:boolean}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates the parameter for the given position. + * @param {yfiles.graph.StretchStripeLabelModelPosition} position The position. + * @returns {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.graph.StretchStripeLabelModelPosition):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * 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.ILabel} label the label to calculate the geometry for + * @param {yfiles.graph.ILabelModelParameter} layoutParameter 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. + * @returns {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 + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StretchStripeLabelModel#insets} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static WEST:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the insets to use within the stripe's {@link yfiles.graph.IStripe#layout}. + * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * Gets or sets whether or not to use the {@link yfiles.graph.IStripe#actualInsets 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 + *

+ * @default false + * @type {boolean} + */ + useActualInsets:boolean; + static $class:yfiles.lang.Class; + } + export enum StripeLabelModelPosition{ + /** + * Encodes a position at the top side of the node interior + */ + NORTH, + /** + * Encodes a position at the right side of the node interior + */ + EAST, + /** + * Encodes a position at the bottom side of the node interior + */ + SOUTH, + /** + * Encodes a position at the left side of the node interior + */ + WEST + } + /** + * 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. + *

+ * @class yfiles.graph.StripeLabelModel + * @implements {yfiles.graph.ILabelModel} + * @implements {yfiles.graph.ILabelModelParameterProvider} + */ + export interface StripeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{} + export class StripeLabelModel { + /** + * Creates a new instance of this model with empty insets. + * @param {Object} [options=null] The parameters to pass. + * @param {number} options.ratio The ratio how far the label should be positioned from the border in the header area. + *

+ * This option sets the {@link yfiles.graph.StripeLabelModel#ratio} property on the created object. + *

+ * @param {boolean} options.useActualInsets A value indicating whether to use the {@link yfiles.graph.IStripe#actualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the stripe header area. + *

+ * This option sets the {@link yfiles.graph.StripeLabelModel#useActualInsets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{ratio?:number,useActualInsets?:boolean}); + /** + * + * @returns {yfiles.graph.ILabelModelParameter} + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates the parameter for the given position. + * @param {yfiles.graph.StripeLabelModelPosition} position The position. + * @returns {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.graph.StripeLabelModelPosition):yfiles.graph.ILabelModelParameter; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModelParameter} layoutParameter + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILookup; + /** + * 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.ILabel} label the label to calculate the geometry for + * @param {yfiles.graph.ILabelModelParameter} layoutParameter 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. + * @returns {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 + */ + getGeometry(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.IOrientedRectangle; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.graph.ILabelModel} model + * @returns {yfiles.collections.IEnumerable.} + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between label instances. + *

+ * Trying to change that instances' {@link yfiles.graph.StripeLabelModel#ratio} will raise an {@link Stubs.Exceptions.InvalidOperationError}. + *

+ * @const + * @static + * @type {yfiles.graph.ILabelModelParameter} + */ + static WEST:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets a value indicating whether to use the {@link yfiles.graph.IStripe#actualInsets 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 + *

+ * @default false + * @type {boolean} + */ + useActualInsets:boolean; + /** + * Gets or sets 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 + *

+ * @default 0.5 + * @type {number} + */ + ratio:number; + static $class:yfiles.lang.Class; + } + /** + * Default implementation of the {@link yfiles.graph.ITable} interface. + * @class yfiles.graph.Table + * @implements {yfiles.graph.ITable} + * @implements {yfiles.lang.ICloneable} + */ + export interface Table extends Object,yfiles.graph.ITable,yfiles.lang.ICloneable{} + export class Table { + /** + * Default constructor that creates an empty table + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.geometry.Insets} [options.insets=null] Sets the insets property. + * @param {yfiles.geometry.Point} [options.relativeLocation=null] Sets the relativeLocation property. + * @param {yfiles.graph.IStripeDefaults} options.rowDefaults The defaults for rows. + *

+ * This option sets the {@link yfiles.graph.Table#rowDefaults} property on the created object. + *

+ * @param {yfiles.graph.IStripeDefaults} options.columnDefaults The defaults for Columns. + *

+ * This option sets the {@link yfiles.graph.Table#columnDefaults} property on the created object. + *

+ * @constructor + */ + constructor(options?:{insets?:yfiles.geometry.Insets,relativeLocation?:yfiles.geometry.Point,rowDefaults?:yfiles.graph.IStripeDefaults,columnDefaults?:yfiles.graph.IStripeDefaults}); + /** + * + * @param {yfiles.graph.IStripe} owner + * @param {string} text + * @param {yfiles.graph.ILabelModelParameter} [layoutParameter=null] + * @param {yfiles.styles.ILabelStyle} [style=null] + * @param {yfiles.geometry.Size} [preferredSize=null] + * @param {Object} [tag=null] + * @returns {yfiles.graph.ILabel} + */ + addLabel(owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object):yfiles.graph.ILabel; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IStripe} options.owner + * @param {string} options.text + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] + * @param {yfiles.styles.ILabelStyle} [options.style=null] + * @param {yfiles.geometry.Size} [options.preferredSize=null] + * @param {Object} [options.tag=null] + * @returns {yfiles.graph.ILabel} + */ + addLabel(options:{owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Called during {@link yfiles.graph.Table#clone} to create a copy of column + *

+ * If column implements the {@link yfiles.lang.ICloneable} interface, the column instance is + * {@link yfiles.lang.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. + * @returns {yfiles.graph.IColumn} A clone of column if possible, otherwise the original reference to column + * @protected + */ + copyColumn(column:yfiles.graph.IColumn):yfiles.graph.IColumn; + /** + * 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. + * @returns {yfiles.graph.IStripeDefaults} The original reference to originalDefaults + * @protected + */ + 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.lang.ICloneable} interface, the row instance is + * {@link yfiles.lang.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. + * @returns {yfiles.graph.IRow} A clone of row if possible, otherwise the original reference to row + * @protected + */ + copyRow(row:yfiles.graph.IRow):yfiles.graph.IRow; + /** + * + * @param {yfiles.graph.IColumn} owner + * @param {number} [width=null] + * @param {number} [minWidth=null] + * @param {yfiles.geometry.Insets} [insets=null] + * @param {yfiles.styles.IStripeStyle} [style=null] + * @param {Object} [tag=null] + * @param {number} [index=null] + * @returns {yfiles.graph.IColumn} + */ + createChildColumn(owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number):yfiles.graph.IColumn; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IColumn} options.owner + * @param {number} [options.width=null] + * @param {number} [options.minWidth=null] + * @param {yfiles.geometry.Insets} [options.insets=null] + * @param {yfiles.styles.IStripeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @param {number} [options.index=null] + * @returns {yfiles.graph.IColumn} + */ + createChildColumn(options:{owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IColumn; + /** + * + * @param {yfiles.graph.IRow} owner + * @param {number} [height=null] + * @param {number} [minHeight=null] + * @param {yfiles.geometry.Insets} [insets=null] + * @param {yfiles.styles.IStripeStyle} [style=null] + * @param {Object} [tag=null] + * @param {number} [index=null] + * @returns {yfiles.graph.IRow} + */ + createChildRow(owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number):yfiles.graph.IRow; + /** + * + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IRow} options.owner + * @param {number} [options.height=null] + * @param {number} [options.minHeight=null] + * @param {yfiles.geometry.Insets} [options.insets=null] + * @param {yfiles.styles.IStripeStyle} [options.style=null] + * @param {Object} [options.tag=null] + * @param {number} [options.index=null] + * @returns {yfiles.graph.IRow} + */ + createChildRow(options:{owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IRow; + /** + * Callback method that creates the Column defaults. + * @returns {yfiles.graph.IStripeDefaults} A new instance of the {@link yfiles.graph.StripeDefaults} class which is used for newly created columns. + * @protected + */ + createColumnDefaults():yfiles.graph.IStripeDefaults; + /** + * Callback method that creates the row defaults. + * @returns {yfiles.graph.IStripeDefaults} A new instance of the {@link yfiles.graph.StripeDefaults} class that is used for newly created rows. + * @protected + */ + createRowDefaults():yfiles.graph.IStripeDefaults; + /** + * Installs the undo support for use with all tables that are bound to nodes in graph. + *

+ * This method queries the graph for its undo support dynamically whenever undo support is queried in the table. In + * contrast to {@link yfiles.graph.Table#installStaticUndoSupport} the undo support installed with this method will thus always be + * the one which is the currently available support for the graph. + *

+ * @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 yfiles.graph.Table#uninstallDynamicUndoSupport + * @see yfiles.graph.Table#installStaticUndoSupport + * @static + */ + static installDynamicUndoSupport(graph:yfiles.graph.IGraph):void; + /** + * Installs the undo support for use with all tables that are bound to nodes in graph. + *

+ * This methods installs the undo support which manages the graph at the time this method is called. In contrast to {@link yfiles.graph.Table#installDynamicUndoSupport} + * the installed undo support will not change when the graph's undo support changes. + *

+ *

+ * This method adds undo support 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. + * @see yfiles.graph.Table#uninstallStaticUndoSupport + * @see yfiles.graph.Table#installDynamicUndoSupport + * @static + */ + static installStaticUndoSupport(graph:yfiles.graph.IGraph):void; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Called after a label has been added to a stripe. + *

+ * This method raises the {@link yfiles.graph.Table#addLabelAddedListener LabelAdded} event. + *

+ * @param {yfiles.graph.ILabel} label The label that has just been added. + * @protected + */ + onLabelAdded(label:yfiles.graph.ILabel):void; + /** + * Callback that is invoked after a label has changed. + *

+ * This method raises the {@link yfiles.graph.Table#addLabelChangedListener LabelChanged} event. + *

+ * @param {yfiles.graph.ILabel} label The label that has changed. + * @protected + */ + onLabelChanged(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been removed from its stripe. + *

+ * This method raises the {@link yfiles.graph.Table#addLabelRemovedListener LabelRemoved} event. + *

+ * @param {yfiles.graph.ILabel} label The label that has just been removed. + * @param {yfiles.graph.ILabelOwner} owner The old owner of the label. + * @protected + */ + onLabelRemoved(owner:yfiles.graph.ILabelOwner,label:yfiles.graph.ILabel):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. + * @param {yfiles.graph.ITable} oldTable The original table owner, in case the stripe has been moved between different table instances + * @protected + */ + onStripeChanged(owner:yfiles.graph.IStripe,stripe:yfiles.graph.IStripe,oldTable:yfiles.graph.ITable):void; + /** + * Called after a stripe has been created and added to a table. + *

+ * This method raises the {@link yfiles.graph.Table#addStripeCreatedListener StripeCreated} event. + *

+ * @param {yfiles.graph.IStripe} stripe The stripe that has just been created. + * @protected + */ + onStripeCreated(stripe:yfiles.graph.IStripe):void; + /** + * Called after a stripe has been removed from its owner. + *

+ * This method raises the {@link yfiles.graph.Table#addStripeRemovedListener StripeRemoved} event. + *

+ * @param {yfiles.graph.IStripe} stripe The stripe that has just been removed. + * @param {yfiles.graph.IStripe} owner The old owner of the stripe. + * @protected + */ + onStripeRemoved(owner:yfiles.graph.IStripe,stripe:yfiles.graph.IStripe):void; + /** + * Removes the given label from its owner. + *

+ * This will trigger the corresponding event. + *

+ * @param {yfiles.graph.ILabel} label the label to remove + * @throws {Stubs.Exceptions.ArgumentError} If the label is not associated with this table instance. + */ + remove(label:yfiles.graph.ILabel):void; + /** + * + * @param {yfiles.graph.IStripe} stripe + */ + remove(stripe:yfiles.graph.IStripe):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The new parameter. + * @throws {Stubs.Exceptions.ArgumentError} If the parameter cannot be used for this label or if the label is not associated with this table instance. + */ + setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.Size} preferredSize The new preferred size. + * @throws {Stubs.Exceptions.ArgumentError} If the label is not associated with this table instance. + * @see yfiles.graph.ILabel#preferredSize + */ + setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; + /** + * 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 {Stubs.Exceptions.ArgumentError} If the label is not associated with this table instance. + * @see yfiles.graph.ILabel#text + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * + * @param {yfiles.graph.IStripe} stripe + * @param {number} minimumSize + */ + setMinimumSize(stripe:yfiles.graph.IStripe,minimumSize:number):void; + /** + * + * @param {yfiles.graph.IColumn} owner + * @param {yfiles.graph.IColumn} column + * @param {number} [index=null] + */ + setParent(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn,index?:number):void; + /** + * + * @param {yfiles.graph.IRow} owner + * @param {yfiles.graph.IRow} row + * @param {number} [index=null] + */ + setParent(owner:yfiles.graph.IRow,row:yfiles.graph.IRow,index?:number):void; + /** + * + * @param {yfiles.graph.IStripe} stripe + * @param {number} size + */ + setSize(stripe:yfiles.graph.IStripe,size:number):void; + /** + * + * @param {yfiles.graph.IStripe} stripe + * @param {yfiles.geometry.Insets} insets + */ + setStripeInsets(stripe:yfiles.graph.IStripe,insets:yfiles.geometry.Insets):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.styles.ILabelStyle} style The style instance that will be assigned to the label. + * @see yfiles.graph.ILabel#style + */ + setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; + /** + * + * @param {yfiles.graph.IStripe} stripe + * @param {yfiles.styles.IStripeStyle} style + */ + setStyle(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):void; + /** + * Uninstalls the undo support that has previously been installed with {@link yfiles.graph.Table#installDynamicUndoSupport} + * @param {yfiles.graph.IGraph} graph The graph where the tables are installed for which the undo support should be cleared. + * @static + */ + static uninstallDynamicUndoSupport(graph:yfiles.graph.IGraph):void; + /** + * Uninstalls the undo support that has previously been installed with {@link yfiles.graph.Table#installStaticUndoSupport} + * @param {yfiles.graph.IGraph} graph The graph where the tables are installed for which the undo support should be cleared. + * @static + */ + static uninstallStaticUndoSupport(graph:yfiles.graph.IGraph):void; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.IStripe}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the stripe lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultStripeLookup:yfiles.graph.IContextLookup; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.IColumn}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the column lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultColumnLookup:yfiles.graph.IContextLookup; + /** + * Gets an {@link yfiles.graph.IContextLookup} that provides the default implementations returned by an + * {@link yfiles.graph.IRow}'s lookup. + *

+ * The provided default implementations can for example be used as fallback when the row lookup is wrapped. + *

+ * @static + * @type {yfiles.graph.IContextLookup} + */ + static defaultRowLookup:yfiles.graph.IContextLookup; + /** + * The toplevel {@link yfiles.graph.IRow}s in this table. + * @type {yfiles.collections.IEnumerable.} + */ + rows:yfiles.collections.IEnumerable; + /** + * The toplevel {@link yfiles.graph.IColumn}s in this table. + * @type {yfiles.collections.IEnumerable.} + */ + columns:yfiles.collections.IEnumerable; + /** + * + * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * + * @default '0,0' + * @type {yfiles.geometry.Point} + */ + relativeLocation:yfiles.geometry.Point; + /** + * Gets the relative layout of the table. + *

+ * The upper left corner of the layout always coincides with {@link yfiles.graph.Table#relativeLocation}. + *

+ * @see yfiles.graph.Table#relativeLocation + * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addStripeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeStripeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener + */ + addStripeRemovedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener + */ + removeStripeRemovedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener + */ + addStripeChangedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener + */ + removeStripeChangedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener + */ + addLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener + */ + removeLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + addLabelChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener + */ + removeLabelChangedListener(listener:(sender:Object,evt:yfiles.collections.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. + *

+ *

+ * If no value is set explicitly a default will be created using {@link yfiles.graph.Table#createRowDefaults} upon first read + * access. + *

+ * @type {yfiles.graph.IStripeDefaults} + */ + 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. + *

+ *

+ * If no value is set explicitly a default will be created using {@link yfiles.graph.Table#createColumnDefaults} upon first read + * access. + *

+ * @type {yfiles.graph.IStripeDefaults} + */ + columnDefaults:yfiles.graph.IStripeDefaults; + /** + * + * @type {yfiles.graph.IRow} + */ + rootRow:yfiles.graph.IRow; + /** + * + * @type {yfiles.graph.IColumn} + */ + rootColumn:yfiles.graph.IColumn; + static $class:yfiles.lang.Class; + } + /** + * This interface defines a child element of a table or a table element container + * @interface + * @implements {yfiles.graph.ILabelOwner} + */ + export interface IStripe extends Object,yfiles.graph.ILabelOwner{ + /** + * Returns the layout of stripe in absolute coordinates. + *

+ * Since {@link yfiles.graph.IStripe#layout} is relative to the owning node's left corner, you need to provide an node node to calculate the absolute layout. + *

+ * @param {yfiles.graph.INode} node The node relative to which the stripe layout is calculated. This should be the same node where {@link yfiles.graph.IStripe#table} for stripe is associated + * to. + * @returns {yfiles.geometry.Rect} + */ + getAbsoluteBounds?(node:yfiles.graph.INode):yfiles.geometry.Rect; + /** + * 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#actualInsets}. + *

+ * @abstract + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * 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. + *

+ * @abstract + * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * Gets the style for this stripe. + * @abstract + * @type {yfiles.styles.IStripeStyle} + */ + style:yfiles.styles.IStripeStyle; + /** + * 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. + *

+ * @abstract + * @type {number} + */ + 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. + *

+ * @abstract + * @type {number} + */ + minimumSize:number; + /** + * The {@link yfiles.graph.ITable} instance where this stripe is installed. + * @abstract + * @type {yfiles.graph.ITable} + */ + table:yfiles.graph.ITable; + /** + * Checks whether stripe is the root item of a stripe hierarchy. + * @returns true iff stripe is a root stripe. + * @see yfiles.graph.IStripe#root + * @type {boolean} + */ + isRoot?:boolean; + /** + * Gets the index of stripe in its {@link yfiles.graph.IStripe#parentStripe} collection of {@link yfiles.graph.IStripe#childStripes}. + *

+ * The stripe is the GetIndexth child of its parent. + *

+ * @returns the children of stripe + * @see yfiles.graph.IColumn#childColumns + * @see yfiles.graph.IRow#childRows + * @type {number} + */ + index?: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}. + *

+ * @type {number} + */ + actualMinSize?:number; + /** + * Gets the direct children of stripe in a table hierarchy. + *

+ * For {@link yfiles.graph.IColumn} instances, this returns {@link yfiles.graph.IColumn#childColumns}, for {@link yfiles.graph.IRow} instances, this returns {@link yfiles.graph.IRow#childRows} + *

+ * @returns the children of stripe + * @see yfiles.graph.IColumn#childColumns + * @see yfiles.graph.IRow#childRows + * @type {yfiles.collections.IEnumerable.} + */ + childStripes?:yfiles.collections.IEnumerable; + /** + * Gets the parent of stripe in a table hierarchy. + *

+ * For {@link yfiles.graph.IColumn} instances, this returns {@link yfiles.graph.IColumn#parentColumn}, for {@link yfiles.graph.IRow} instances, this returns {@link yfiles.graph.IRow#parentRow} + *

+ * @returns the parent of stripe + * @see yfiles.graph.IColumn#parentColumn + * @see yfiles.graph.IRow#parentRow + * @type {yfiles.graph.IStripe} + */ + parentStripe?: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#parentRow} for {@link yfiles.graph.ITable#rootRow} + * instances. Otherwise null is returned. + *

+ * @returns the root of stripe + * @see yfiles.graph.ITable#rootColumn + * @see yfiles.graph.ITable#rootRow + * @see yfiles.graph.IStripe#isRoot + * @type {yfiles.graph.IStripe} + */ + root?:yfiles.graph.IStripe; + /** + * Returns a collection of all descendants of stripe that are leaves and therefore don't have any child stripes. + * @returns A collection of all leaf descendants of stripe + * @type {yfiles.collections.IEnumerable.} + */ + leaves?:yfiles.collections.IEnumerable; + /** + * Returns a collection of all descendants of stripe. + *

+ * The descendants are returned in top to bottom order. + *

+ * @returns A collection of all descendants of stripe + * @type {yfiles.collections.IEnumerable.} + */ + descendants?:yfiles.collections.IEnumerable; + /** + * 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}. + *

+ * @returns The actual insets of the stripe. + * @type {yfiles.geometry.Insets} + */ + actualInsets?:yfiles.geometry.Insets; + /** + * 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. + *

+ * @returns The actual size of the stripe. + * @type {number} + */ + actualSize?:number; + } + var IStripe:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Central interface which provides support for tabular data presentation. + *

+ * This interface supports a presentation of data where the nodes of a diagram are organized in a tabular way, i.e., where + * each node is associated to a specific row and column in the grid-like structure of a table. The {@link yfiles.graph.ITable} + * together with its associated interfaces {@link yfiles.graph.IColumn} and {@link yfiles.graph.IRow} represents the model for the tabular + * presentation (or table, for short). It also provides means for altering the model, in particular creation ({@link yfiles.graph.ITable#createChildColumn} + * and {@link yfiles.graph.ITable#createChildRow}) and {@link yfiles.graph.ITable#remove removal} of columns and rows but also changing their size or appearance. + *

+ *

+ * The table structure is backed by a group node. As a consequence, the nodes which should be presented in a tabular + * fashion need to be set up as children of this group node. Using a group node to hold the content nodes has several + * advantages: For example, when the group node is moved, the child nodes move accordingly, thus maintaining the visual + * clue that they are contained in the table group node. + *

+ *

+ * Note that the table structure and its content nodes are only loosely coupled: the node's center coordinates determine + * the row and column that it belongs to. + *

+ *

+ * Associating an {@link yfiles.graph.ITable} instance with its backing group node can most conveniently be done by setting a {@link yfiles.styles.TableNodeStyle} + * instance as style of the associated group node. This style manages the visualization of the individual rows and columns. + * It also associates its {@link yfiles.styles.TableNodeStyle#table} with the group node by decorating its {@link yfiles.graph.ILookup#lookup} to return the table instance. + *

+ *

+ * User interaction is supported by the {@link yfiles.input.TableEditorInputMode} which provides support for intractively resizing + * rows and columns, re-parenting them, or editing their labels. + *

+ *

+ * The table model with all relevant types and their relationships is presented in detail in the section {@link @DGUIDE_PREFIX@/tables.html Tables}. + *

+ * @see yfiles.graph.IStripe + * @see yfiles.graph.IColumn + * @see yfiles.graph.IRow + * @see yfiles.graph.Table + * @see yfiles.input.TableEditorInputMode + * @interface + * @implements {yfiles.graph.ILookup} + */ + export interface ITable extends Object,yfiles.graph.ILookup{ + /** + * Add a label to the given owner using the text as the initial label text and label model parameter and style. + * @param {yfiles.graph.IStripe} owner the owner to add the label to. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ILabelModelParameter} [layoutParameter=null] The label model parameter instance to use. + * @param {yfiles.styles.ILabelStyle} [style=null] The style to use for the label + * @param {yfiles.geometry.Size} [preferredSize=null] The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} [tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.ILabel} the newly created label + * @see yfiles.graph.ITable#setLabelText + * @see yfiles.graph.ITable#setLabelLayoutParameter + * @see yfiles.graph.ITable#setStyle + * @abstract + */ + addLabel(owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object):yfiles.graph.ILabel; + /** + * Add a label to the given owner using the text as the initial label text and label model parameter and style. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IStripe} options.owner the owner to add the label to. + * @param {string} options.text the initial text of the label + * @param {yfiles.graph.ILabelModelParameter} [options.layoutParameter=null] The label model parameter instance to use. + * @param {yfiles.styles.ILabelStyle} [options.style=null] The style to use for the label + * @param {yfiles.geometry.Size} [options.preferredSize=null] The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} [options.tag=null] the initial {@link yfiles.graph.ITagOwner#tag} to assign. + * @returns {yfiles.graph.ILabel} the newly created label + * @see yfiles.graph.ITable#setLabelText + * @see yfiles.graph.ITable#setLabelLayoutParameter + * @see yfiles.graph.ITable#setStyle + * @abstract + */ + addLabel(options:{owner:yfiles.graph.IStripe,text:string,layoutParameter?:yfiles.graph.ILabelModelParameter,style?:yfiles.styles.ILabelStyle,preferredSize?:yfiles.geometry.Size,tag?:Object}):yfiles.graph.ILabel; + /** + * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to fit the suggested size of its {@link yfiles.styles.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.ILabel} label The label to adjust the size for. + * @see yfiles.graph.ILabelDefaults#autoAdjustPreferredSize + */ + adjustLabelPreferredSize?(label:yfiles.graph.ILabel):void; + /** + * Calculates the preferred size of a label with the given properties. + * @param {yfiles.graph.IStripe} stripe The item that will own the label. + * @param {yfiles.styles.ILabelStyle} style The label style. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The label model parameter. + * @param {string} text The text. + * @param {Object} tag The tag for the label. + * @returns {yfiles.geometry.Size} The size as calculated by the {@link yfiles.styles.ILabelStyleRenderer}. + */ + calculateLabelPreferredSize?(stripe:yfiles.graph.IStripe,style:yfiles.styles.ILabelStyle,layoutParameter:yfiles.graph.ILabelModelParameter,text:string,tag:Object):yfiles.geometry.Size; + /** + * Convenience method that clears all stripes from a table. + *

+ * All existing rows and columns are cleared from table + *

+ */ + clear?():void; + /** + * 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=null] The position in the child list. + * @param {number} [width=null] The actual width of the column. + * @param {number} [minWidth=null] The minimal width of the column. + * @param {yfiles.geometry.Insets} [insets=null] The insets of the column. + * @param {yfiles.styles.IStripeStyle} [style=null] The style of the column. + * @param {Object} [tag=null] The tag of the column + * @returns {yfiles.graph.IColumn} A new column instance + * @abstract + */ + createChildColumn(owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number):yfiles.graph.IColumn; + /** + * Create a new column as the indexth child of owner with the given parameters. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IColumn} options.owner The owner of the new column. + * @param {number} [options.index=null] The position in the child list. + * @param {number} [options.width=null] The actual width of the column. + * @param {number} [options.minWidth=null] The minimal width of the column. + * @param {yfiles.geometry.Insets} [options.insets=null] The insets of the column. + * @param {yfiles.styles.IStripeStyle} [options.style=null] The style of the column. + * @param {Object} [options.tag=null] The tag of the column + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.ITable#addLabel} + * method. + * @param options.childColumns An array of rows to create as children of this row. Each item will be passed to the {@link yfiles.graph.ITable#createChildColumn} + * method. + * @returns {yfiles.graph.IColumn} A new column instance + * @abstract + */ + createChildColumn(options:{owner:yfiles.graph.IColumn,width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number,labels?:Array,childColumns?:Array}):yfiles.graph.IColumn; + /** + * 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=null] The position in the child list. + * @param {number} [height=null] The actual height of the row. + * @param {number} [minHeight=null] The minimal height of the row. + * @param {yfiles.geometry.Insets} [insets=null] The insets of the row. + * @param {yfiles.styles.IStripeStyle} [style=null] The style of the row. + * @param {Object} [tag=null] The tag of the row + * @returns {yfiles.graph.IRow} A new row instance + * @abstract + */ + createChildRow(owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number):yfiles.graph.IRow; + /** + * Create a new row as the indexth child of owner with the given parameters. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IRow} options.owner The owner of the new row. + * @param {number} [options.index=null] The position in the child list. + * @param {number} [options.height=null] The actual height of the row. + * @param {number} [options.minHeight=null] The minimal height of the row. + * @param {yfiles.geometry.Insets} [options.insets=null] The insets of the row. + * @param {yfiles.styles.IStripeStyle} [options.style=null] The style of the row. + * @param {Object} [options.tag=null] The tag of the row + * @param options.labels An array of labels to add to the newly created node. Each item will be passed to the {@link yfiles.graph.ITable#addLabel} + * method. + * @param options.childRows An array of rows to create as children of this row. Each item will be passed to the {@link yfiles.graph.ITable#createChildRow} + * method. + * @returns {yfiles.graph.IRow} A new row instance + * @abstract + */ + createChildRow(options:{owner:yfiles.graph.IRow,height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number,labels?:Array,childRows?:Array}):yfiles.graph.IRow; + /** + * Creates and returns a column as last child of table. + *

+ * The column will be a part of this table after the method returns. This will trigger the corresponding events. + *

+ * @param {number} [width=null] The actual width of the column. + * @param {number} [minWidth=null] The minimal width of the column. + * @param {yfiles.geometry.Insets} [insets=null] The insets of the column. + * @param {yfiles.styles.IStripeStyle} [style=null] The style of the column. + * @param {Object} [tag=null] The tag of the column + * @param {number} [index=null] The position in the child list. + * @returns {yfiles.graph.IColumn} A newly created column instance + * @see yfiles.graph.ITable#addStripeCreatedListener + */ + createColumn?(width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table. + *

+ * The column will be a part of this table after the method returns. This will trigger the corresponding events. + *

+ * @param {Object} options The parameters to pass. + * @param {number} [options.width=null] The actual width of the column. + * @param {number} [options.minWidth=null] The minimal width of the column. + * @param {yfiles.geometry.Insets} [options.insets=null] The insets of the column. + * @param {yfiles.styles.IStripeStyle} [options.style=null] The style of the column. + * @param {Object} [options.tag=null] The tag of the column + * @param {number} [options.index=null] The position in the child list. + * @returns {yfiles.graph.IColumn} A newly created column instance + * @see yfiles.graph.ITable#addStripeCreatedListener + */ + createColumn?(options:{width?:number,minWidth?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IColumn; + /** + * Convenience method that creates a columns x rows. + *

+ * All existing rows and columns are cleared from table + *

+ * @param {number} columns The number of columns to test. + * @param {number} rows The number of rows to test. + */ + createGrid?(columns:number,rows:number):void; + /** + * Creates the label model parameter for a given {@link yfiles.graph.ILabelOwner}. + *

+ * This implementation uses the label defaults for the table to {@link yfiles.graph.ILabelDefaults#getLayoutParameterInstance obtain the parameter instance}. + *

+ * @param {yfiles.graph.IStripe} stripe The item that is the {@link yfiles.graph.ILabel#owner} of the label in question. + * @returns {yfiles.graph.ILabelModelParameter} The default label model parameter to use for newly created labels at the item. + * @see yfiles.graph.ILabelDefaults#getLayoutParameterInstance + */ + createLabelLayoutParameter?(stripe:yfiles.graph.IStripe):yfiles.graph.ILabelModelParameter; + /** + * Convenience method that delegates to the {@link yfiles.graph.ILabelDefaults#getStyleInstance} method for the given {@link yfiles.graph.IStripe stripe}. + * @param {yfiles.graph.IStripe} stripe The item the newly created label will belong to. + * @returns {yfiles.styles.ILabelStyle} The style instance to use for newly created stripes. + */ + createLabelStyle?(stripe:yfiles.graph.IStripe):yfiles.styles.ILabelStyle; + /** + * Creates and returns a row as last child of table. + *

+ * The row will be a part of this table after the method returns. This will trigger the corresponding events. + *

+ * @param {number} [height=null] The actual height of the row. + * @param {number} [minHeight=null] The minimal height of the row. + * @param {yfiles.geometry.Insets} [insets=null] The insets of the row. + * @param {yfiles.styles.IStripeStyle} [style=null] The style of the row. + * @param {Object} [tag=null] The tag of the row + * @param {number} [index=null] The position in the child list. + * @returns {yfiles.graph.IRow} A newly created row instance + * @see yfiles.graph.ITable#addStripeCreatedListener + */ + createRow?(height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table. + *

+ * The row will be a part of this table after the method returns. This will trigger the corresponding events. + *

+ * @param {Object} options The parameters to pass. + * @param {number} [options.height=null] The actual height of the row. + * @param {number} [options.minHeight=null] The minimal height of the row. + * @param {yfiles.geometry.Insets} [options.insets=null] The insets of the row. + * @param {yfiles.styles.IStripeStyle} [options.style=null] The style of the row. + * @param {Object} [options.tag=null] The tag of the row + * @param {number} [options.index=null] The position in the child list. + * @returns {yfiles.graph.IRow} A newly created row instance + * @see yfiles.graph.ITable#addStripeCreatedListener + */ + createRow?(options:{height?:number,minHeight?:number,insets?:yfiles.geometry.Insets,style?:yfiles.styles.IStripeStyle,tag?:Object,index?:number}):yfiles.graph.IRow; + /** + * Convenience method to find a column underneath a certain point. + *

+ * The column are tested in bottom up order. + *

+ * @param {yfiles.graph.INode} node The node this table is currently bound to + * @param {yfiles.geometry.Point} location The location to test. + * @param {function(yfiles.graph.IStripe): boolean} filter Additional predicate to further restrict the results. + * @returns {yfiles.graph.IColumn} The topmost column that has been found for the location or null. + */ + findColumn?(node:yfiles.graph.INode,location:yfiles.geometry.Point,filter:(obj:yfiles.graph.IStripe)=>boolean):yfiles.graph.IColumn; + /** + * Convenience method to find a row underneath a certain point. + *

+ * The rows are tested in bottom up order. + *

+ * @param {yfiles.graph.INode} node The node this table is currently bound to + * @param {yfiles.geometry.Point} location The location to test. + * @param {function(yfiles.graph.IStripe): boolean} filter Additional predicate to further restrict the results. + * @returns {yfiles.graph.IRow} The topmost row that has been found for the location or null. + */ + findRow?(node:yfiles.graph.INode,location:yfiles.geometry.Point,filter:(obj:yfiles.graph.IStripe)=>boolean):yfiles.graph.IRow; + /** + * 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.view.ICanvasContext#hitTestRadius} into account. + *

+ * @param {yfiles.graph.INode} node The node this table is currently bound to + * @param {yfiles.geometry.Point} 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} filter Additional predicate to further restrict the hit test results. + * @returns {yfiles.collections.IEnumerable.} The stripes that have been found for the location or null. + */ + findStripes?(node:yfiles.graph.INode,location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,filter:(obj:yfiles.graph.IStripe)=>boolean):yfiles.collections.IEnumerable; + /** + * Return the accumulated insets for the table. + * @returns {yfiles.geometry.Insets} + */ + getAccumulatedInsets?():yfiles.geometry.Insets; + /** + * Calculates the relative bounds of a table cell that is determined by column and row + *

+ * Both column and row must live in the provided table instance. Otherwise, an {@link Stubs.Exceptions.ArgumentError} is thrown. + *

+ * @param {yfiles.graph.IColumn} column The column that determines the cell + * @param {yfiles.graph.IRow} row The row that determines the cell + * @returns {yfiles.geometry.Rect} The relative bounds of a the cell determined by column and row + * @throws {Stubs.Exceptions.ArgumentError} If column and row are part of a different table instance. + */ + getCellBounds?(column:yfiles.graph.IColumn,row:yfiles.graph.IRow):yfiles.geometry.Rect; + /** + * 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 + * @abstract + */ + remove(stripe:yfiles.graph.IStripe):void; + /** + * Removes the given label from its owner. + *

+ * This will trigger the corresponding event. + *

+ * @param {yfiles.graph.ILabel} label the label to remove + * @abstract + */ + remove(label:yfiles.graph.ILabel):void; + /** + * {@link yfiles.graph.ITable#remove Removes} stripe and all of its descendants from table. + *

+ * This method does not resize any stripes, use {@link yfiles.graph.ITable#removeRecursivelyWithResize} instead. + *

+ * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeRecursively?(stripe:yfiles.graph.IStripe):void; + /** + * {@link yfiles.graph.ITable#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.IStripe} stripe The stripe to remove + */ + removeRecursivelyWithResize?(stripe:yfiles.graph.IStripe):void; + /** + * {@link yfiles.graph.ITable#remove Removes} stripe from table and resizes all affected stripes so that the table size does not change if possible. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeWithResize?(stripe:yfiles.graph.IStripe):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} layoutParameter The new parameter. + * @throws {Stubs.Exceptions.ArgumentError} If the parameter cannot be used for this label. + * @abstract + */ + setLabelLayoutParameter(label:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.Size} preferredSize The new preferred size. + * @see yfiles.graph.ILabel#preferredSize + * @abstract + */ + setLabelPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.Size):void; + /** + * 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 yfiles.graph.ILabel#text + * @abstract + */ + setLabelText(label:yfiles.graph.ILabel,text:string):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 + * @abstract + */ + setMinimumSize(stripe:yfiles.graph.IStripe,minimumSize:number):void; + /** + * Sets owner as new parent of column, inserting column at the given index. + *

+ * 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=null] + * @abstract + */ + setParent(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn,index?:number):void; + /** + * Sets owner as new parent of row, inserting row at the given index. + *

+ * 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=null] + * @abstract + */ + setParent(owner:yfiles.graph.IRow,row:yfiles.graph.IRow,index?:number):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} size The new size of the stripe + * @abstract + */ + setSize(stripe:yfiles.graph.IStripe,size:number):void; + /** + * Sets the insets of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {yfiles.geometry.Insets} insets The new insets of the stripe + * @abstract + */ + setStripeInsets(stripe:yfiles.graph.IStripe,insets:yfiles.geometry.Insets):void; + /** + * Sets the style of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {yfiles.styles.IStripeStyle} style The new style of the stripe + * @abstract + */ + setStyle(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):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.styles.ILabelStyle} style The style instance that will be assigned to the label. + * @see yfiles.graph.ILabel#style + * @abstract + */ + setStyle(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):void; + /** + * Gets or sets the insets for this table. + *

+ * These insets are applied in addition to any implicit insets provided by the child stripes. + *

+ * @abstract + * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * 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 yfiles.graph.ITable#layout + * @abstract + * @default '0,0' + * @type {yfiles.geometry.Point} + */ + relativeLocation:yfiles.geometry.Point; + /** + * Gets the relative layout of the table. + *

+ * The upper left corner of the layout always coincides with {@link yfiles.graph.ITable#relativeLocation}. + *

+ * @see yfiles.graph.ITable#relativeLocation + * @abstract + * @type {yfiles.geometry.IRectangle} + */ + 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. + *

+ * @abstract + * @type {yfiles.graph.IStripeDefaults} + */ + 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. + *

+ * @abstract + * @type {yfiles.graph.IStripeDefaults} + */ + 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#parentRow} and the associated {@link yfiles.graph.IStripe#table} + *

+ * @see yfiles.graph.ITable#setParent + * @see yfiles.graph.ITable#createChildRow + * @abstract + * @type {yfiles.graph.IRow} + */ + 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#parentColumn} and the associated {@link yfiles.graph.IStripe#table} + *

+ * @see yfiles.graph.ITable#setParent + * @see yfiles.graph.ITable#createChildColumn + * @abstract + * @type {yfiles.graph.IColumn} + */ + rootColumn:yfiles.graph.IColumn; + /** + * Adds the given listener for the LabelAdded event that occurs when a label has been added to this graph instance. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITable#addLabel + * @see yfiles.graph.ITable#removeLabelAddedListener + * @abstract + */ + addLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the LabelAdded event that occurs when a label has been added to this graph instance. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITable#addLabel + * @see yfiles.graph.ITable#addLabelAddedListener + * @abstract + */ + removeLabelAddedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the LabelRemoved event that occurs when 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. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to add. + * @see yfiles.graph.ITable#remove + * @see yfiles.graph.ITable#removeLabelRemovedListener + * @abstract + */ + addLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Removes the given listener for the LabelRemoved event that occurs when 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. + *

+ * @param {function(Object, yfiles.graph.LabelEventArgs): void} listener The listener to remove. + * @see yfiles.graph.ITable#remove + * @see yfiles.graph.ITable#addLabelRemovedListener + * @abstract + */ + removeLabelRemovedListener(listener:(sender:Object,evt:yfiles.graph.LabelEventArgs)=>void):void; + /** + * Adds the given listener for the LabelChanged event that occurs when a label has been changed, for instance, if its style + * has been replaced. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITable#setStyle + * @see yfiles.graph.ITable#removeLabelChangedListener + * @abstract + */ + addLabelChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the LabelChanged event that occurs when a label has been changed, for instance, if its + * style has been replaced. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITable#setStyle + * @see yfiles.graph.ITable#addLabelChangedListener + * @abstract + */ + removeLabelChangedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the StripeCreated event that occurs when a stripe has been added. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to add. + * @see yfiles.graph.ITable#createChildRow + * @see yfiles.graph.ITable#createChildColumn + * @see yfiles.graph.ITable#removeStripeCreatedListener + * @abstract + */ + addStripeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Removes the given listener for the StripeCreated event that occurs when a stripe has been added. + * @param {function(Object, yfiles.collections.ItemEventArgs.): void} listener The listener to remove. + * @see yfiles.graph.ITable#createChildRow + * @see yfiles.graph.ITable#createChildColumn + * @see yfiles.graph.ITable#addStripeCreatedListener + * @abstract + */ + removeStripeCreatedListener(listener:(sender:Object,evt:yfiles.collections.ItemEventArgs)=>void):void; + /** + * Adds the given listener for the StripeRemoved event that occurs when a stripe has been removed from its parent. + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener The listener to add. + * @see yfiles.graph.ITable#remove + * @see yfiles.graph.ITable#removeStripeRemovedListener + * @abstract + */ + addStripeRemovedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * Removes the given listener for the StripeRemoved event that occurs when a stripe has been removed from its parent. + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.ITable#remove + * @see yfiles.graph.ITable#addStripeRemovedListener + * @abstract + */ + removeStripeRemovedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * Adds the given listener for the StripeChanged event that occurs when a stripe has been changed, for instance, if its + * style has been replaced. + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener The listener to add. + * @see yfiles.graph.ITable#setStyle + * @see yfiles.graph.ITable#setStripeInsets + * @see yfiles.graph.ITable#setSize + * @see yfiles.graph.ITable#setMinimumSize + * @see yfiles.graph.ITable#removeStripeChangedListener + * @abstract + */ + addStripeChangedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + /** + * Removes the given listener for the StripeChanged event that occurs when a stripe has been changed, for instance, if its + * style has been replaced. + * @param {function(Object, yfiles.graph.StripeEventArgs): void} listener The listener to remove. + * @see yfiles.graph.ITable#setStyle + * @see yfiles.graph.ITable#setStripeInsets + * @see yfiles.graph.ITable#setSize + * @see yfiles.graph.ITable#setMinimumSize + * @see yfiles.graph.ITable#addStripeChangedListener + * @abstract + */ + removeStripeChangedListener(listener:(sender:Object,evt:yfiles.graph.StripeEventArgs)=>void):void; + } + var ITable:{ + /** + * Convenience method to find a stripe underneath a certain point. + * @param {yfiles.geometry.Point} 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.input.StripeSubregionTypes} subregionTypes An enumeration value of {@link yfiles.input.StripeSubregionTypes} to further restrict the stripe region. + * @param {yfiles.view.CanvasComponent} canvas The canvas that provides necessary context for hit determination, such as {@link yfiles.view.ICanvasContext#hitTestRadius}. + * @param {function(yfiles.input.StripeSubregion): boolean} filter Additional predicate to further restrict the hit test results. + * @returns {yfiles.input.StripeSubregion} The stripe subregions that have been found for the location or null. + * @static + */ + findStripe?(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,canvas:yfiles.view.CanvasComponent,filter:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.input.StripeSubregion; + /** + * Used as a callback to find the items underneath a certain point. + * @param {yfiles.geometry.Point} 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.input.StripeSubregionTypes} subregionTypes An enumeration value of {@link yfiles.input.StripeSubregionTypes} to further restrict the stripe region. + * @param {yfiles.view.CanvasComponent} canvas The canvas that provides necessary context for hit determination, such as {@link yfiles.view.ICanvasContext#hitTestRadius}. + * @param {function(yfiles.input.StripeSubregion): boolean} filter Additional predicate to further restrict the hit test results. + * @returns {yfiles.collections.IEnumerable.} The stripe subregions that have been found for the location. + * @static + */ + findStripes?(location:yfiles.geometry.Point,stripeTypes:yfiles.graph.StripeTypes,subregionTypes:yfiles.input.StripeSubregionTypes,canvas:yfiles.view.CanvasComponent,filter:(obj:yfiles.input.StripeSubregion)=>boolean):yfiles.collections.IEnumerable; + /** + * Calculates the absolute bounds of a table cell that is determined by column and row + *

+ * Both column and row must live in the same {@link yfiles.graph.ITable} instance that is also present in the tableNodes + * {@link yfiles.graph.ILookup}. Otherwise, an {@link Stubs.Exceptions.ArgumentError} is thrown. + *

+ * @param {yfiles.graph.INode} tableNode The node where a table is bound to via the node's lookup + * @param {yfiles.graph.IColumn} column The column that determines the cell + * @param {yfiles.graph.IRow} row The row that determines the cell + * @returns {yfiles.geometry.Rect} The absolute bounds of a the cell determined by column and row + * @throws {Stubs.Exceptions.ArgumentError} If no table is present in the {@link yfiles.graph.ILookup} of tableNode, or if column and row are part of a different table + * instance. + * @static + */ + getCellBounds?(tableNode:yfiles.graph.INode,column:yfiles.graph.IColumn,row:yfiles.graph.IRow):yfiles.geometry.Rect; + /** + * Places node in the center of the table cell determined by column and row. + *

+ * Both column and row must live in the same {@link yfiles.graph.ITable} instance that is also present in the tableNodes + * {@link yfiles.graph.ILookup}. Otherwise, an {@link Stubs.Exceptions.ArgumentError} is thrown. The cell bounds are determined by + * {@link yfiles.graph.ITable#getCellBounds}. + *

+ *

+ * If reparent is true, the node is made a child node of tableNode if it is no descendant of the table node hierarchy yet. + * Otherwise, the grouping hierarchy is not changed. + *

+ *

+ * If alwaysMove is + * true, the node is moved even if its center is already contained in the cell, otherwise only when the node layout center + * is currently outside of the cell bounds. + *

+ *

+ * This method does not change the size of the target stripes if they would be too small to contain the whole node layout. + * Callers must increase the stripe size before or after calling this method, if necessary. + *

+ * @param {yfiles.graph.IGraph} graph The graph instance where the move should be performed + * @param {yfiles.graph.INode} node The node that should be moved into the given cell. + * @param {yfiles.graph.INode} tableNode The node where a table is bound to via the node's lookup + * @param {yfiles.graph.IColumn} column The column that determines the cell + * @param {yfiles.graph.IRow} row The row that determines the cell + * @param {boolean} [reparent=true] Whether node should also be made part of tableNode's grouping hierarchy if it is not yet contained in it. + * @param {boolean} [alwaysMove=false] Whether node should be moved even if it is already placed in the cell. + * @throws {Stubs.Exceptions.ArgumentError} If no table is present in the {@link yfiles.graph.ILookup} of tableNode, or if column and row are part of a different table + * instance. + * @static + */ + placeNodeInCell?(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,tableNode:yfiles.graph.INode,column:yfiles.graph.IColumn,row:yfiles.graph.IRow,reparent?:boolean,alwaysMove?:boolean):void; + /** + * Places node in the center of the table cell determined by column and row. + *

+ * Both column and row must live in the same {@link yfiles.graph.ITable} instance that is also present in the tableNodes + * {@link yfiles.graph.ILookup}. Otherwise, an {@link Stubs.Exceptions.ArgumentError} is thrown. The cell bounds are determined by + * {@link yfiles.graph.ITable#getCellBounds}. + *

+ *

+ * If reparent is true, the node is made a child node of tableNode if it is no descendant of the table node hierarchy yet. + * Otherwise, the grouping hierarchy is not changed. + *

+ *

+ * If alwaysMove is + * true, the node is moved even if its center is already contained in the cell, otherwise only when the node layout center + * is currently outside of the cell bounds. + *

+ *

+ * This method does not change the size of the target stripes if they would be too small to contain the whole node layout. + * Callers must increase the stripe size before or after calling this method, if necessary. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.graph.IGraph} options.graph The graph instance where the move should be performed + * @param {yfiles.graph.INode} options.node The node that should be moved into the given cell. + * @param {yfiles.graph.INode} options.tableNode The node where a table is bound to via the node's lookup + * @param {yfiles.graph.IColumn} options.column The column that determines the cell + * @param {yfiles.graph.IRow} options.row The row that determines the cell + * @param {boolean} [options.reparent=true] Whether node should also be made part of tableNode's grouping hierarchy if it is not yet contained in it. + * @param {boolean} [options.alwaysMove=false] Whether node should be moved even if it is already placed in the cell. + * @throws {Stubs.Exceptions.ArgumentError} If no table is present in the {@link yfiles.graph.ILookup} of tableNode, or if column and row are part of a different table + * instance. + * @static + */ + placeNodeInCell?(options:{graph:yfiles.graph.IGraph,node:yfiles.graph.INode,tableNode:yfiles.graph.INode,column:yfiles.graph.IColumn,row:yfiles.graph.IRow,reparent?:boolean,alwaysMove?:boolean}):void; + $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 yfiles.graph.ITable#createChildRow + * @interface + * @implements {yfiles.graph.IStripe} + */ + 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. + *

+ * @abstract + * @type {yfiles.graph.IRow} + */ + parentRow: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#parentRow}. + *

+ * @abstract + * @type {yfiles.collections.IEnumerable.} + */ + childRows:yfiles.collections.IEnumerable; + } + var IRow:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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 yfiles.graph.ITable#createChildColumn + * @interface + * @implements {yfiles.graph.IStripe} + */ + 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. + *

+ * @abstract + * @type {yfiles.graph.IColumn} + */ + parentColumn: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#parentColumn}. + *

+ * @abstract + * @type {yfiles.collections.IEnumerable.} + */ + childColumns:yfiles.collections.IEnumerable; + } + var IColumn:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A specialized subclass of the {@link yfiles.collections.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.IStripe#parentStripe parent} the + * stripe was owned by before the event, this event can be used to carry exactly that information. + *

+ * @class yfiles.graph.StripeEventArgs + * @extends {yfiles.collections.ItemEventArgs.} + * @final + */ + export interface StripeEventArgs extends yfiles.collections.ItemEventArgs{} + export class StripeEventArgs { + /** + * Initializes a new instance of the {@link yfiles.graph.StripeEventArgs} class. + * @param {yfiles.graph.IStripe} stripe The stripe to assign to the {@link yfiles.collections.ItemEventArgs.#item} property. + * @param {yfiles.graph.IStripe} parentStripe The previous parent of the stripe. + * @param {yfiles.graph.ITable} table The table the stripe belonged to previously. + * @constructor + */ + constructor(stripe:yfiles.graph.IStripe,parentStripe:yfiles.graph.IStripe,table:yfiles.graph.ITable); + /** + * Gets the parent of the stripe that owned the stripe before the event happened. + * @type {yfiles.graph.IStripe} + */ + parentStripe:yfiles.graph.IStripe; + /** + * Gets the table that owned the stripe before the event happened. + * @type {yfiles.graph.ITable} + */ + table:yfiles.graph.ITable; + static $class:yfiles.lang.Class; + } + /** + * Interface used by {@link yfiles.graph.ITable} and the like to declare and obtain the defaults for stripes and their labels. + * @see yfiles.graph.ITable#rowDefaults + * @see yfiles.graph.ITable#columnDefaults + * @interface + */ + export interface IStripeDefaults extends Object{ + /** + * Factory method that returns a style instance for use with newly created stripes. + *

+ * Most implementations will yield either, a {@link yfiles.lang.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. + *

+ * @returns {yfiles.styles.IStripeStyle} The style to use, which for most implementations is either a {@link yfiles.lang.ICloneable#clone clone} of or the {@link yfiles.graph.IStripeDefaults#style} property, if {@link yfiles.graph.IStripeDefaults#shareStyleInstance} is enabled. + * @abstract + */ + getStyleInstance():yfiles.styles.IStripeStyle; + /** + * Gets or sets the default insets for a stripe. + * @abstract + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * Gets or sets the default stripe size. + * @see yfiles.graph.IStripe#size + * @abstract + * @type {number} + */ + size:number; + /** + * Gets or sets the default minimum stripe size. + * @see yfiles.graph.IStripe#minimumSize + * @abstract + * @type {number} + */ + minimumSize:number; + /** + * Gets or sets the defaults for labels at stripes. + * @abstract + * @type {yfiles.graph.ILabelDefaults} + */ + 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.lang.ICloneable#clone clone} of this + * instance or the very same instance. + *

+ * @see yfiles.graph.IStripeDefaults#shareStyleInstance + * @abstract + * @type {yfiles.styles.IStripeStyle} + */ + style:yfiles.styles.IStripeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IStripeDefaults#style} instance should be shared referentially or {@link yfiles.lang.ICloneable#clone cloned} upon a call to + * {@link yfiles.graph.IStripeDefaults#getStyleInstance}. + * @see yfiles.graph.IStripeDefaults#getStyleInstance + * @see yfiles.graph.IStripeDefaults#style + * @abstract + * @type {boolean} + */ + shareStyleInstance:boolean; + } + var IStripeDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A canonic implementation of the {@link yfiles.graph.IStripeDefaults} interface. + * @class yfiles.graph.StripeDefaults + * @implements {yfiles.graph.IStripeDefaults} + */ + export interface StripeDefaults extends Object,yfiles.graph.IStripeDefaults{} + export class StripeDefaults { + /** + * Default constructor + *

+ * This constructor sets the style to {@link yfiles.styles.VoidNodeStyle#INSTANCE} and the insets to {@link yfiles.geometry.Insets#EMPTY} + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {number} options.size The default stripe size. + *

+ * This option sets the {@link yfiles.graph.StripeDefaults#size} property on the created object. + *

+ * @param {number} options.minimumSize The default minimum stripe size. + *

+ * This option sets the {@link yfiles.graph.StripeDefaults#minimumSize} property on the created object. + *

+ * @param {yfiles.graph.ILabelDefaults} [options.labels=null] Sets the labels property. + * @param {yfiles.styles.IStripeStyle} [options.style=null] Sets the style property. + * @param {boolean} [options.shareStyleInstance=null] Sets the shareStyleInstance property. + * @constructor + */ + constructor(options?:{size?:number,minimumSize?:number,labels?:yfiles.graph.ILabelDefaults,style?:yfiles.styles.IStripeStyle,shareStyleInstance?:boolean}); + /** + * + * @returns {yfiles.styles.IStripeStyle} + */ + getStyleInstance():yfiles.styles.IStripeStyle; + /** + * Gets or sets the default insets for a stripe. + * @default '0' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * Gets or sets the default stripe size. + * @see yfiles.graph.IStripe#size + * @default 100 + * @type {number} + */ + size:number; + /** + * Gets or sets the default minimum stripe size. + * @see yfiles.graph.IStripe#minimumSize + * @default 10 + * @type {number} + */ + minimumSize:number; + /** + * + * @type {yfiles.graph.ILabelDefaults} + */ + labels:yfiles.graph.ILabelDefaults; + /** + * + * @type {yfiles.styles.IStripeStyle} + */ + style:yfiles.styles.IStripeStyle; + /** + * + * @default true + * @type {boolean} + */ + shareStyleInstance:boolean; + static $class:yfiles.lang.Class; + } + }export namespace geometry{ + export enum PathType{ + /** + * The type that is used to move the {@link yfiles.view.Stroke} 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.geometry.PathType#MOVE_TO} position. + *

+ * This type uses no coordinate pair. + *

+ */ + CLOSE + } + /** + * A class that is used by {@link yfiles.geometry.GeneralPath} to iterate over the elements the path is made up of. + * @see yfiles.geometry.GeneralPath#createCursor + * @class yfiles.geometry.GeneralPathCursor + */ + export interface GeneralPathCursor extends Object{} + export class GeneralPathCursor { + /** + * 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.geometry.PathType#CUBIC_TO} needs six coordinates. If the + * path has been flattened a length of two suffices. + *

+ * @param {Array.} coordinates + * @returns {yfiles.geometry.PathType} The current type of the path element. + * @see yfiles.geometry.GeneralPathCursor#getCurrentEndPoint + */ + getCurrent(coordinates:number[]):yfiles.geometry.PathType; + /** + * Places the current end coordinates of the last path element into the array. + * @param {Array.} coordinates An array with length at least 2. + * @returns {yfiles.geometry.PathType} The type of the current element. + */ + getCurrentEndPoint(coordinates:number[]):yfiles.geometry.PathType; + /** + * Advances the cursor to the next position if possible. + * @returns {boolean} Whether the cursor has been moved successfully. false if the cursor has been moved beyond the end of the path. + */ + moveNext():boolean; + /** + * Moves the cursor to the previous position in the path. + * @returns {boolean} Whether the move was successful. + */ + movePrevious():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. + * @returns {boolean} Whether the cursor has been moved successfully. + */ + toLast():boolean; + /** + * Returns the current position of the cursor. + * @type {number} + */ + index:number; + /** + * Returns the type of the path at the position of the cursor. + * @type {yfiles.geometry.PathType} + */ + pathType:yfiles.geometry.PathType; + /** + * Returns the current x coordinate of the last path element. + * @type {number} + */ + currentEndPointX:number; + /** + * Gets the current end point of the last path element. + * @type {yfiles.geometry.Point} + */ + currentEndPoint:yfiles.geometry.Point; + /** + * Returns the current y coordinate of the last path element. + * @type {number} + */ + currentEndPointY:number; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.geometry.GeneralPath + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface GeneralPath extends Object,yfiles.lang.ICloneable{} + export class GeneralPath { + /** + * Creates a new instance with given initial capacity. + * @param {number} [capacity=16] The number of elements for which storage will be allocated initially. + * @constructor + */ + constructor(capacity?:number); + /** + * Appends parts of the contents of the given path to this path. + *

+ * If connect is true, an initial {@link yfiles.geometry.PathType#MOVE_TO} in other will be transformed into a + * {@link yfiles.geometry.PathType#LINE_TO}. + *

+ * @param {yfiles.geometry.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. + */ + append(other:yfiles.geometry.GeneralPath,beginIndex:number,endIndex:number,connect:boolean):void; + /** + * Appends the contents of the given path to this path. + *

+ * If connect is true, an initial {@link yfiles.geometry.PathType#MOVE_TO} in other will be transformed into a + * {@link yfiles.geometry.PathType#LINE_TO}. + *

+ * @param {yfiles.geometry.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.geometry.GeneralPath,connect:boolean):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.geometry.GeneralPath#lineTo} the ellipses lowest point. + */ + appendEllipse(bounds:yfiles.geometry.IRectangle,connect:boolean):void; + /** + * Appends an {@link yfiles.geometry.IOrientedRectangle} to this path instance. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The {@link yfiles.geometry.IOrientedRectangle} to get the coordinates from. + * @param {boolean} connect Whether to use a {@link yfiles.geometry.GeneralPath#lineTo} to the anchor corner. + */ + appendOrientedRectangle(rectangle:yfiles.geometry.IOrientedRectangle,connect:boolean):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.geometry.GeneralPath#lineTo} to the upper left corner. + */ + appendRectangle(rectangle:yfiles.geometry.IRectangle,connect:boolean):void; + /** + * 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.IPoint} point The coordinates of the point to test. + * @param {number} [eps=0.5] The value to use for flattening B�zier curves during the test. 0.5 is the default value. + * @returns {boolean} Whether the point lies within the area described by this path. + */ + areaContains(point:yfiles.geometry.IPoint,eps?:number):boolean; + /** + * Resets this path to be an empty path. + */ + clear():void; + /** + * Creates a clone of this instance, copying the path information to the new instance. + * @returns {Object} An exact clone of this instance. + */ + clone():Object; + /** + * Appends a {@link yfiles.geometry.PathType#CLOSE} operation to the path elements, creating a line to the last {@link yfiles.geometry.PathType#MOVE_TO} + * position. + *

+ * This draws a line from the current end point to the last {@link yfiles.geometry.GeneralPath#moveTo} position, closing the + * current sub path. + *

+ */ + close():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; + /** + * 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. + *

+ * @returns {yfiles.geometry.GeneralPathCursor} A cursor to iterate over this path. + */ + createCursor():yfiles.geometry.GeneralPathCursor; + /** + * Creates a new path based on this one where corners are smoothed with a quadratic B�zier arc starting at smoothingLength + * away from the corner. + * @param {number} smoothingLength Distance from the corner where the arc begins. + * @returns {yfiles.geometry.GeneralPath} A new path, with its corners smoothed. + */ + createSmoothedPath(smoothingLength:number):yfiles.geometry.GeneralPath; + /** + * Creates an SVG path element using the provided parameters. + * @param {yfiles.geometry.Matrix} [transform=null] The matrix to apply to the path data. + * @returns {SVGPathElement} A {@link SVGPathElement path} that displays this instance using the provided attributes. + */ + createSvgPath(transform?:yfiles.geometry.Matrix):SVGPathElement; + /** + * Creates the data for a SVG path element that corresponds to this instance with the provided transform. + * @param {yfiles.geometry.Matrix} [transform=null] The transform to apply to the created data. + * @returns {string} The path data for an SVG path element that corresponds to this instance with the provided transform. + */ + createSvgPathData(transform?:yfiles.geometry.Matrix):string; + /** + * Creates a new {@link yfiles.geometry.GeneralPath} that is a copy of this path with all geometry transformed using the supplied + * matrix. + * @param {yfiles.geometry.Matrix} transform The matrix to multiply the geometry with. + * @returns {yfiles.geometry.GeneralPath} A new path. + */ + createTransformedPath(transform:yfiles.geometry.Matrix):yfiles.geometry.GeneralPath; + /** + * 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.geometry.GeneralPathCursor} cursor The cursor that depicts a position in this path. + */ + cropAfter(cursor:yfiles.geometry.GeneralPathCursor):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.geometry.GeneralPathCursor} cursor The cursor that depicts a position in this path. + */ + cropBefore(cursor:yfiles.geometry.GeneralPathCursor):void; + /** + * Appends a {@link yfiles.geometry.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. + */ + cubicTo(c1x:number,c1y:number,c2x:number,c2y:number,x:number,y:number):void; + /** + * Appends a {@link yfiles.geometry.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} end The coordinates of the curve's end point. + */ + cubicTo(c1:yfiles.geometry.IPoint,c2:yfiles.geometry.IPoint,end:yfiles.geometry.IPoint):void; + /** + * Finds an intersection point between a line and this {@link yfiles.geometry.GeneralPath}. + *

+ * The value returned will be the smallest positive value smaller than 1 such that the point depicted by start + result * (end - start) + * is an intersection point between the line and the path. + *

+ * @param {yfiles.geometry.Point} start The coordinates of the first point of the line. + * @param {yfiles.geometry.Point} end The coordinates of the second point of the line. + * @param {number} [eps=0.5] The value to use for interpolating B�zier curves. + * @returns {number} The factor to calculate the intersection point or double.PositiveInfinity. + */ + findLineIntersection(start:yfiles.geometry.Point,end:yfiles.geometry.Point,eps?:number):number; + /** + * Finds the first intersection of a ray with this {@link yfiles.geometry.GeneralPath} 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.Point} anchor The coordinates of the anchor point of the ray. + * @param {yfiles.geometry.Point} direction The coordinates of the direction vector of the ray. + * @param {number} [eps=0.5] The epsilon value that is used for the accuracy with which the implementation should test B�zier curves within the path + * for intersections. + * @returns {number} The factor to calculate the intersection point or double.PositiveInfinity. + */ + findRayIntersection(anchor:yfiles.geometry.Point,direction:yfiles.geometry.Point,eps?:number):number; + /** + * 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.geometry.PathType#MOVE_TO}, {@link yfiles.geometry.PathType#LINE_TO}, and {@link yfiles.geometry.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. + * @returns {yfiles.geometry.GeneralPath} A new path that does not contain B�zier curves. + */ + flatten(eps:number):yfiles.geometry.GeneralPath; + /** + * Gets the bounds of a flattened version the path. + * @param {number} eps The epsilon to use for the flattening operation. + * @returns {yfiles.geometry.Rect} The bounds of the flattened path. + */ + getBounds(eps:number):yfiles.geometry.Rect; + /** + * 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. + *

+ * @returns {yfiles.geometry.Rect} A rectangle that describes the geometric bounds of this path. + * @see yfiles.geometry.GeneralPath#getBounds + */ + getBounds():yfiles.geometry.Rect; + /** + * Returns the geometric length of this path. + *

+ * Note that B�zier curves are still treated as line segments. + *

+ * @returns {number} The length of this path. + */ + getLength():number; + /** + * 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. + * @returns {yfiles.geometry.Point} The coordinates of the point. + */ + getPoint(ratio:number):yfiles.geometry.Point; + /** + * Gets the number of segments in this path, that is the number of {@link yfiles.geometry.PathType#LINE_TO} and {@link yfiles.geometry.PathType#CLOSE} + * operations. + * @returns {number} The number of segments. + */ + getSegmentCount():number; + /** + * Gets 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. + * @returns {yfiles.geometry.Tangent} The tangent, if any exists. The tangent vector may not be normalized. + */ + getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; + /** + * Gets 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. + * @returns {yfiles.geometry.Tangent} The tangent, if any exists. The tangent vector may not be normalized. + */ + getTangent(ratio:number):yfiles.geometry.Tangent; + /** + * Determines whether this has the same values like path. + * @param {yfiles.geometry.GeneralPath} path The object to compare this to. Must be of the same type. + * @returns {boolean} true if this has the same values like the other object. + */ + hasSameValue(path:yfiles.geometry.GeneralPath):boolean; + /** + * 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.Rect} rectangle The rectangle to test. + * @param {number} eps The epsilon to use for fuzzy testing. + * @returns {boolean} Whether the path described by this instance intersects the rectangle. + */ + intersects(rectangle:yfiles.geometry.Rect,eps:number):boolean; + /** + * Appends a {@link yfiles.geometry.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. + */ + lineTo(x:number,y:number):void; + /** + * Appends a {@link yfiles.geometry.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} point The coordinates of the line's end point. + */ + lineTo(point:yfiles.geometry.IPoint):void; + /** + * Performs a quick test to decide whether this path might intersect the clipping rectangle, provided the path would be + * rendered 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.Rect} clip The clip to check for intersection. + * @param {number} width The width of the stroke. + * @returns {boolean} false if it is guaranteed that this instance would not intersect the given clip. + */ + mayIntersectClip(clip:yfiles.geometry.Rect,width:number):boolean; + /** + * Appends a {@link yfiles.geometry.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. + */ + moveTo(x:number,y:number):void; + /** + * Appends a {@link yfiles.geometry.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. + */ + moveTo(point:yfiles.geometry.IPoint):void; + /** + * Tests whether the line of the path is hit at the given point using an epsilon for fuzzy hit testing. + * @param {yfiles.geometry.IPoint} point The p coordinates of the point to test. + * @param {number} [eps=0.5] The allowed distance from the point to the path that is considered a hit.0.5 is the default value. + * @returns {boolean} Whether the point hits the path. + */ + pathContains(point:yfiles.geometry.IPoint,eps?:number):boolean; + /** + * Adds the contents of the given path to the beginning of this path. + *

+ * If connect is true, the initial {@link yfiles.geometry.PathType#MOVE_TO} in this will be transformed into a + * {@link yfiles.geometry.PathType#LINE_TO}. + *

+ * @param {yfiles.geometry.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.geometry.GeneralPath,connect:boolean):void; + /** + * Appends a {@link yfiles.geometry.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. + */ + quadTo(cx:number,cy:number,x:number,y:number):void; + /** + * Appends a {@link yfiles.geometry.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} point The coordinates of the curve's end point. + */ + quadTo(center:yfiles.geometry.IPoint,point:yfiles.geometry.IPoint):void; + /** + * Transforms this {@link yfiles.geometry.GeneralPath} in place using the given transform. + * @param {yfiles.geometry.Matrix} transform The matrix to multiply the geometry with. + */ + transform(transform:yfiles.geometry.Matrix):void; + /** + * Gets the last x coordinate of the last path element. + * @type {number} + */ + lastX:number; + /** + * Gets the last coordinates of the last path element. + * @type {yfiles.geometry.Point} + */ + lastCoordinate:yfiles.geometry.Point; + /** + * Gets the last y coordinate of the last path element. + * @type {number} + */ + lastY:number; + /** + * Gets a value indicating whether this path contains elements other than an initial {@link yfiles.geometry.PathType#MOVE_TO}.. + * @type {boolean} + */ + isEmpty:boolean; + /** + * Gets a value indicating whether the path contains visible parts. + * @type {boolean} + */ + isVisible:boolean; + /** + * Gets the number of {@link yfiles.geometry.PathType} operations stored in this instance. + * @type {number} + */ + size:number; + static $class:yfiles.lang.Class; + } + /** + * Utility class that performs all kind of geometric operations. + *

+ * Also it serves as a factory for various implementations of geometric primitives. + *

+ * @class yfiles.geometry.GeomUtilities + * @static + */ + export interface GeomUtilities extends Object{} + export class GeomUtilities { + /** + * Checks whether an ellipse contains the given point. + * @param {yfiles.geometry.Rect} bounds The coordinates of the bounds of the ellipse's enclosing rectangle. + * @param {yfiles.geometry.Point} 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. + * @returns {boolean} Whether the point lies within the ellipse + * @static + */ + static ellipseContains(bounds:yfiles.geometry.Rect,point:yfiles.geometry.Point,eps: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.Rect} bounds The coordinates of the bounds of the ellipse's enclosing rectangle. + * @param {yfiles.geometry.Point} inner The coordinates of a point lying inside the ellipse. + * @param {yfiles.geometry.Point} outer The coordinates of a point lying outside the ellipse. + * @returns {yfiles.geometry.Point} The intersection point iff the inner point lies inside the ellipse and an intersection point has been found, otherwise + * null. + * @static + */ + static findEllipseLineIntersection(bounds:yfiles.geometry.Rect,inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * 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: + *

+ * @param {yfiles.geometry.Point} start The coordinates of the first end point of the line segment. + * @param {yfiles.geometry.Point} end The coordinates of the second end point of the line segment. + * @param {yfiles.geometry.Point} anchor The coordinates of the starting point of the ray. + * @param {yfiles.geometry.Point} rayDirection The direction vector of the ray. + * @returns {number} The distance factor or {@link number#POSITIVE_INFINITY} if the ray does not intersect the line. + * @static + */ + static findRayIntersection(start:yfiles.geometry.Point,end:yfiles.geometry.Point,anchor:yfiles.geometry.Point,rayDirection:yfiles.geometry.Point):number; + static $class:yfiles.lang.Class; + } + /** + * An immutable {@link yfiles.geometry.ISize} implementation to describe a size in two-dimensional space. + * @class yfiles.geometry.Size + * @implements {yfiles.geometry.ISize} + * @final + */ + export interface Size extends yfiles.lang.Struct,yfiles.geometry.ISize{} + export class Size { + /** + * Creates a new size using the provided width and height. + * @param {number} width The new width. + * @param {number} height The new height. + * @constructor + */ + constructor(width:number,height:number); + /** + * + * @returns {yfiles.geometry.Size} + */ + clone():yfiles.geometry.Size; + /** + * Performs an implicit conversion from {@link yfiles.geometry.MutableSize} to {@link yfiles.geometry.Size}. + * @param {yfiles.geometry.MutableSize} size The size. + * @returns {yfiles.geometry.Size} The result of the conversion. + * @static + */ + static convertFrom(size:yfiles.geometry.MutableSize):yfiles.geometry.Size; + /** + * Performs an explicit conversion from {@link yfiles.geometry.Size} to {@link yfiles.geometry.MutableSize}. + * @param {yfiles.geometry.Size} size The size. + * @returns {yfiles.geometry.MutableSize} The result of the conversion. + * @static + */ + static convertToMutableSize(size:yfiles.geometry.Size):yfiles.geometry.MutableSize; + /** + * Returns a size whose {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} is the {@link Math#max} of the respecting properties of the two parameters. + * @param {yfiles.geometry.Size} size1 The first size. + * @param {yfiles.geometry.Size} size2 The second size. + * @returns {yfiles.geometry.Size} A size whose {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} is the {@link Math#max} of the respecting properties of the two parameters. + * @static + */ + static max(size1:yfiles.geometry.Size,size2:yfiles.geometry.Size):yfiles.geometry.Size; + /** + * Returns a size whose {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} is the {@link Math#min} of the respecting properties of the two parameters. + * @param {yfiles.geometry.Size} size1 The first size. + * @param {yfiles.geometry.Size} size2 The second size. + * @returns {yfiles.geometry.Size} A size whose {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} is the {@link Math#min} of the respecting properties of the two parameters. + * @static + */ + static min(size1:yfiles.geometry.Size,size2:yfiles.geometry.Size):yfiles.geometry.Size; + /** + * Multiplies the {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} by the given factor and returns the result. + * @param {number} factor The factor to multiply the width and height by. + * @returns {yfiles.geometry.Size} A new size that has the width and height multiplied by the factor. + */ + multiply(factor:number):yfiles.geometry.Size; + /** + * Converts this instance to an {@link yfiles.geometry.MutableSize} instance + * @returns {yfiles.geometry.MutableSize} The {@link yfiles.geometry.MutableSize} instance, whose attributes have been initialized with the values of this instance. + */ + toMutableSize():yfiles.geometry.MutableSize; + /** + * Creates a {@link yfiles.algorithms.YDimension} from a given {@link yfiles.geometry.Size}. + * @returns {yfiles.algorithms.YDimension} The {@link yfiles.algorithms.YDimension}. + */ + toYDimension():yfiles.algorithms.YDimension; + /** + * The "empty" size that has {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} set to -1.0d. + * @const + * @static + * @type {yfiles.geometry.Size} + */ + static EMPTY:yfiles.geometry.Size; + /** + * The "zero" size that has {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} set to 0.0d. + *

+ * This size is not treated as {@link yfiles.geometry.Size#isEmpty}. + *

+ * @const + * @static + * @type {yfiles.geometry.Size} + */ + static ZERO:yfiles.geometry.Size; + /** + * The "infinite" size that has {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} set to {@link number#POSITIVE_INFINITY}. + * @const + * @static + * @type {yfiles.geometry.Size} + */ + static INFINITE:yfiles.geometry.Size; + /** + * Gets the width. + *

+ * Negative values for the width indicate an {@link yfiles.geometry.Size#isEmpty empty} size. + *

+ * @type {number} + */ + width:number; + /** + * Gets the height. + *

+ * Negative values for the height indicate an {@link yfiles.geometry.Size#isEmpty empty} size. + *

+ * @type {number} + */ + height:number; + /** + * Gets the area of this instance which is the product of {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height}. + * @type {number} + */ + area:number; + /** + * Gets a value indicating whether this instance is deemed empty. + * @type {boolean} + */ + isEmpty:boolean; + /** + * Gets a value indicating whether this instance is finite. + *

+ * This means that neither {@link yfiles.geometry.Size#width} nor {@link yfiles.geometry.Size#height} are infinite. + *

+ * @type {boolean} + */ + isFinite:boolean; + static $class:yfiles.lang.Class; + } + /** + * An immutable {@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. + *

+ * @class yfiles.geometry.Point + * @implements {yfiles.geometry.IPoint} + * @final + */ + export interface Point extends yfiles.lang.Struct,yfiles.geometry.IPoint{} + export class Point { + /** + * Initializes a new instance using the given values for the {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} properties. + * @param {number} x The x coordinate. + * @param {number} y The y coordinate. + * @constructor + */ + constructor(x:number,y:number); + /** + * Adds the given vector to this instance. + *

+ * This operator is applied componentwise to {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. + *

+ * @param {yfiles.geometry.Point} otherPoint The second point. + * @returns {yfiles.geometry.Point} The result of the vector addition. + */ + add(otherPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * + * @returns {yfiles.geometry.Point} + */ + clone():yfiles.geometry.Point; + /** + * Performs an explicit conversion from {@link yfiles.geometry.MutablePoint} to {@link yfiles.geometry.Point}. + * @param {yfiles.geometry.MutablePoint} p The point to convert. + * @returns {yfiles.geometry.Point} The result of the conversion. + * @static + */ + static convertFrom(p:yfiles.geometry.MutablePoint):yfiles.geometry.Point; + /** + * Performs an implicit conversion from {@link yfiles.geometry.Point} to {@link yfiles.geometry.MutablePoint}. + * @param {yfiles.geometry.Point} point The point to convert. + * @returns {yfiles.geometry.MutablePoint} + * @static + */ + static convertToMutablePoint(point:yfiles.geometry.Point):yfiles.geometry.MutablePoint; + /** + * Determines the distance between this point and a line segment. + * @param {yfiles.geometry.Point} start The coordinates of the first point of the line. + * @param {yfiles.geometry.Point} end The coordinates of the second point of the line. + * @returns {number} The distance between this point and the closest point on the line segment. + */ + distanceToSegment(start:yfiles.geometry.Point,end:yfiles.geometry.Point):number; + /** + * Determines whether the two given points have the same coordinates with respect to a certain given eps. + * @param {yfiles.geometry.Point} other The other point to check for equality against this point. + * @param {number} eps The epsilon value. + * @returns {boolean} Whether both coordinates are equal with respect for the given epsilon. + */ + equalsEps(other:yfiles.geometry.Point,eps:number):boolean; + /** + * Create a constrained copy of this instance that lies within the given non-empty rectangle. + *

+ * If the given rectangle is {@link yfiles.geometry.Rect#EMPTY}, this implementation will silently return. + *

+ * @param {yfiles.geometry.Rect} rectangle The rectangle to constrain this instance by. + * @returns {yfiles.geometry.Point} A constrained copy of this instance. + */ + getConstrained(rectangle:yfiles.geometry.Rect):yfiles.geometry.Point; + /** + * Calculates the projection of this point onto a line. + * @param {yfiles.geometry.Point} anchor An anchor for the infinite line. + * @param {yfiles.geometry.Point} direction A direction vector for the infinite line. + * @returns {yfiles.geometry.Point} The point on the line that is closest to this point. + */ + getProjectionOnLine(anchor:yfiles.geometry.Point,direction:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * 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.Point} rayStart The start of the segment. + * @param {yfiles.geometry.Point} direction The direction of the ray. + * @returns {yfiles.geometry.Point} The point on the ray that is closest to this point. + */ + getProjectionOnRay(rayStart:yfiles.geometry.Point,direction:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * 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.Point} start The start of the segment. + * @param {yfiles.geometry.Point} end The end of the segment. + * @returns {yfiles.geometry.Point} The point on the segment that is closest to this point. + */ + getProjectionOnSegment(start:yfiles.geometry.Point,end:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Determines if the point lies close to this point given an epsilon. + * @param {yfiles.geometry.Point} other The coordinates of the other point. + * @param {number} hitTestRadius The hit test epsilon. + * @returns {boolean} Whether the distance between the two points is smaller than hitTestRadius + */ + hits(other:yfiles.geometry.Point,hitTestRadius:number):boolean; + /** + * Determines whether this point hits the line segment with respect to a given radius. + * @param {yfiles.geometry.Point} start The starting point of the line segment to test. + * @param {yfiles.geometry.Point} end The ending point of the line segment to test. + * @param {number} radius The hit test radius. + * @returns {boolean} Whether this point hits the given line segment within the radius. + */ + hitsLineSegment(start:yfiles.geometry.Point,end:yfiles.geometry.Point,radius: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} radius 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. + * @returns {boolean} Whether the point hits the polygon. + */ + hitsPolyline(points:yfiles.collections.IEnumerable,radius:number):boolean; + /** + * Applies the given matrix to this instance by calling {@link yfiles.geometry.Matrix#transform} and returns the result. + * @param {yfiles.geometry.Matrix} matrix The matrix to use for the transformation. + * @returns {yfiles.geometry.Point} The result of the transformation. + */ + multiply(matrix:yfiles.geometry.Matrix):yfiles.geometry.Point; + /** + * Multiplies the given factor with this instance using scalar multiplication and returns the result. + *

+ * This factor is applied componentwise to {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. + *

+ * @param {number} factor The factor to scale the components by. + * @returns {yfiles.geometry.Point} The result of the scalar multiplication. + */ + multiply(factor:number):yfiles.geometry.Point; + /** + * Calculates the scalar product of this and the given vector. + * @param {yfiles.geometry.Point} other The other vector. + * @returns {number} The scalar product (X*other.X + Y*other.Y) + */ + scalarProduct(other:yfiles.geometry.Point):number; + /** + * Calculates the scalar product of the two given points. + * @param {yfiles.geometry.Point} point1 The first point. + * @param {yfiles.geometry.Point} point2 The second point. + * @returns {number} The scalar product of the two points. + * @static + */ + static scalarProduct(point1:yfiles.geometry.Point,point2:yfiles.geometry.Point):number; + /** + * Subtracts the given vector from this instance. + *

+ * This operator is applied componentwise to {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. + *

+ * @param {yfiles.geometry.Point} otherPoint The second point. + * @returns {yfiles.geometry.Point} The result of the vector subtraction. + */ + subtract(otherPoint:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Creates an {@link yfiles.geometry.IMutablePoint} that has the same coordinates as this instance. + * @returns {yfiles.geometry.IMutablePoint} A {@link yfiles.geometry.IMutablePoint} with the same coordinates. + */ + toMutablePoint():yfiles.geometry.IMutablePoint; + /** + * Creates a {@link yfiles.algorithms.Point2D} from a given {@link yfiles.geometry.Point}. + * @returns {yfiles.algorithms.Point2D} The {@link yfiles.algorithms.Point2D}. + */ + toPoint2D():yfiles.algorithms.Point2D; + /** + * Creates a {@link yfiles.algorithms.YPoint} from a given {@link yfiles.geometry.Point}. + * @returns {yfiles.algorithms.YPoint} The {@link yfiles.algorithms.YPoint}. + */ + toYPoint():yfiles.algorithms.YPoint; + /** + * Creates a {@link yfiles.algorithms.YVector} from a given {@link yfiles.geometry.Point}. + * @returns {yfiles.algorithms.YVector} The {@link yfiles.algorithms.YVector}. + */ + toYVector():yfiles.algorithms.YVector; + /** + * An instance that has {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} set to 0.0d. + * @const + * @static + * @type {yfiles.geometry.Point} + */ + static ORIGIN:yfiles.geometry.Point; + /** + * Gets the X coordinate of the point. + * @type {number} + */ + x:number; + /** + * Gets the Y coordinate of the point. + * @type {number} + */ + y:number; + /** + * Yields the length of the vector that has {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} as its components. + * @type {number} + */ + vectorLength:number; + /** + * Yields the squared length of the vector that has {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y} as its components. + * @type {number} + */ + squaredVectorLength:number; + /** + * Gets the normalized version of this vector. + * @type {yfiles.geometry.Point} + */ + normalized:yfiles.geometry.Point; + /** + * Indicates whether this instance is a vertically oriented vector. + * @type {boolean} + */ + isVerticalVector:boolean; + /** + * Indicates whether this instance is a horizontally oriented vector. + * @type {boolean} + */ + isHorizontalVector:boolean; + static $class:yfiles.lang.Class; + } + /** + * A class that models the thickness of insets as double precision floating point values. + * @class yfiles.geometry.Insets + * @final + */ + export interface Insets extends yfiles.lang.Struct{} + export class Insets { + /** + * 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. + * @constructor + */ + constructor(left:number,top:number,right:number,bottom:number); + /** + * Initializes a new instance using the provided inset for all four sides. + * @param {number} inset The inset to use for all sides. + * @constructor + */ + constructor(inset:number); + /** + * + * @returns {yfiles.geometry.Insets} + */ + clone():yfiles.geometry.Insets; + /** + * 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.Insets} insets The insets to max with these insets. + * @returns {yfiles.geometry.Insets} + */ + createUnion(insets:yfiles.geometry.Insets):yfiles.geometry.Insets; + /** + * Creates an enlarged instance by adding the insets of the specified insets to this instance and returning the result. + * @param {yfiles.geometry.Insets} insets The insets to add to this instance. + * @returns {yfiles.geometry.Insets} + */ + getEnlarged(insets:yfiles.geometry.Insets):yfiles.geometry.Insets; + /** + * Multiplies each side of the insets by the given factor and returns the result. + * @param {number} factor The factor to scales up by. + * @returns {yfiles.geometry.Insets} New insets scaled up by the factor. + */ + multiply(factor:number):yfiles.geometry.Insets; + /** + * Creates a {@link yfiles.algorithms.Insets} from a given {@link yfiles.geometry.Insets}. + * @returns {yfiles.algorithms.Insets} The {@link yfiles.geometry.Insets}. + */ + toInsets():yfiles.algorithms.Insets; + /** + * The "empty" insets that has all properties set to 0.0d. + * @const + * @static + * @type {yfiles.geometry.Insets} + */ + static EMPTY:yfiles.geometry.Insets; + /** + * Gets the top inset. + * @type {number} + */ + top:number; + /** + * Gets the left inset. + * @type {number} + */ + left:number; + /** + * Gets the bottom inset. + * @type {number} + */ + bottom:number; + /** + * Gets the right inset. + * @type {number} + */ + right:number; + /** + * Gets the vertical insets, which is the sum of {@link yfiles.geometry.Insets#top} and {@link yfiles.geometry.Insets#bottom}. + * @type {number} + */ + verticalInsets:number; + /** + * Gets the horizontal insets, which is the sum of {@link yfiles.geometry.Insets#left} and {@link yfiles.geometry.Insets#right}. + * @type {number} + */ + horizontalInsets:number; + /** + * Gets a value indicating whether this instance is empty, that is all insets are 0.0d. + * @type {boolean} + */ + isEmpty:boolean; + static $class:yfiles.lang.Class; + } + /** + * An immutable 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.Rect#width} and {@link yfiles.geometry.Rect#height} properties are handled and interpreted. + * Width and/or height values may be negative in which case the rectangle is considered {@link yfiles.geometry.Rect#isEmpty empty} and non-existent. Empty + * rectangles are not considered in {@link yfiles.geometry.Rect#add union-like} operations, whereas rectangles with {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#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. + *

+ * @class yfiles.geometry.Rect + * @implements {yfiles.geometry.IRectangle} + * @final + */ + export interface Rect extends yfiles.lang.Struct,yfiles.geometry.IRectangle{} + export class Rect { + /** + * Initializes a new instance. + * @param {number} x The {@link yfiles.geometry.Rect#x} coordinate of the top left corner. + * @param {number} y The {@link yfiles.geometry.Rect#y} coordinate of the top left corner. + * @param {number} width The {@link yfiles.geometry.Rect#width} of the rectangle. + * @param {number} height The {@link yfiles.geometry.Rect#height} of the rectangle. + * @constructor + */ + constructor(x:number,y:number,width:number,height:number); + /** + * Initializes a new instance using the {@link yfiles.geometry.Rect#topLeft} corner and the {@link yfiles.geometry.Rect#size}. + * @param {yfiles.geometry.Point} location The top left corner. + * @param {yfiles.geometry.Size} size The size to use. + * @constructor + */ + constructor(location:yfiles.geometry.Point,size:yfiles.geometry.Size); + /** + * Initializes a new instance using two point to define the bounds + *

+ * This will always result in non-{@link yfiles.geometry.Rect#isEmpty} rectangles as the coordinates of the points are sorted so that the smaller gets assigned + * to {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} respectively and the greater ones define the {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height}. + *

+ * @param {yfiles.geometry.Point} p1 The first point to determine the bounds. + * @param {yfiles.geometry.Point} p2 The second point to determine the bounds. + * @constructor + */ + constructor(p1:yfiles.geometry.Point,p2:yfiles.geometry.Point); + /** + * Initializes a new instance of the {@link yfiles.geometry.Rect} class with the initial values obtained from the given rectangle. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to retrieve the initial values from. + * @constructor + */ + constructor(rectangle:yfiles.geometry.IRectangle); + /** + * Returns the union of this rectangle and the given point. + * @param {yfiles.geometry.Point} point The point to include in the rectangle's bounds. + * @returns {yfiles.geometry.Rect} The enlarged rectangle. + */ + add(point:yfiles.geometry.Point):yfiles.geometry.Rect; + /** + * Returns the union of the given rectangles. + *

+ * {@link yfiles.geometry.Rect#isEmpty empty} rectangles will not be considered. + *

+ * @param {yfiles.geometry.Rect} firstRectangle The first rectangle to use for the union. + * @param {yfiles.geometry.Rect} secondRectangle The second rectangle to use for the union. + * @returns {yfiles.geometry.Rect} A rectangle that encompasses the area of the two given rectangles. + * @static + */ + static add(firstRectangle:yfiles.geometry.Rect,secondRectangle:yfiles.geometry.Rect):yfiles.geometry.Rect; + /** + * + * @returns {yfiles.geometry.Rect} + */ + clone():yfiles.geometry.Rect; + /** + * Determines whether this rectangle contains the specified point with respect to a given epsilon. + * @param {yfiles.geometry.Point} point The point to test. + * @param {number} eps The positive epsilon distance that the point may lie outside the rectangle and still be considered contained. + * @returns {boolean} true if this rectangle contains the specified point; false otherwise. An {@link yfiles.geometry.Rect#isEmpty 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.Rect#minX} and {@link yfiles.geometry.Rect#minY} minus eps nor + * greater than {@link yfiles.geometry.Rect#maxX} and {@link yfiles.geometry.Rect#maxY} plus eps. + */ + containsWithEps(point:yfiles.geometry.Point,eps:number):boolean; + /** + * Performs an explicit conversion from {@link yfiles.geometry.MutableRectangle} to {@link yfiles.geometry.Rect}. + * @param {yfiles.geometry.MutableRectangle} rectangle The rectangle to convert. + * @returns {yfiles.geometry.Rect} The result of the conversion. + * @static + */ + static convertFrom(rectangle:yfiles.geometry.MutableRectangle):yfiles.geometry.Rect; + /** + * Performs an explicit conversion from {@link yfiles.geometry.Rect} to {@link yfiles.geometry.MutableRectangle}. + * @param {yfiles.geometry.Rect} rectangle The rectangle to convert. + * @returns {yfiles.geometry.MutableRectangle} The result of the conversion. + * @static + */ + static convertToMutableRectangle(rectangle:yfiles.geometry.Rect):yfiles.geometry.MutableRectangle; + /** + * Finds the intersection between a rectangle and a line. + * @param {yfiles.geometry.Point} inner The coordinates of a point lying inside the rectangle. + * @param {yfiles.geometry.Point} outer The coordinates of a point lying outside the rectangle. + * @returns {yfiles.geometry.Point} 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.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Creates a new instance given the center of the rectangle and its size. + * @param {yfiles.geometry.Point} center The center to use. + * @param {yfiles.geometry.Size} size The size to assign. + * @returns {yfiles.geometry.Rect} An instance whose center is set to center and size is size + * @static + */ + static fromCenter(center:yfiles.geometry.Point,size:yfiles.geometry.Size):yfiles.geometry.Rect; + /** + * Creates an enlarged instance of this rectangle using the same insets for all sides. + *

+ * If this instance {@link yfiles.geometry.Rect#isEmpty}, the result will be the same. + *

+ * @param {number} size The inset to add to each of the sides to grow the new instance. + * @returns {yfiles.geometry.Rect} + * @see yfiles.geometry.Rect#getEnlarged + */ + getEnlarged(size:number):yfiles.geometry.Rect; + /** + * Creates an enlarged instance that is the same as this one but enlarged by the specified insets. + *

+ * If this instance {@link yfiles.geometry.Rect#isEmpty}, the same will be returned. + *

+ * @param {yfiles.geometry.Insets} insets The insets to use to add to the instance. + * @returns {yfiles.geometry.Rect} + */ + getEnlarged(insets:yfiles.geometry.Insets):yfiles.geometry.Rect; + /** + * Transforms this instance using the specified matrix and returns the result. + * @param {yfiles.geometry.Matrix} transform The transform matrix to apply to this instance. + * @returns {yfiles.geometry.Rect} + */ + getTransformed(transform:yfiles.geometry.Matrix):yfiles.geometry.Rect; + /** + * Returns a translated instance of this which has modified {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} by the given amount. + * @param {yfiles.geometry.Point} delta The delta to add to {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y}. + * @returns {yfiles.geometry.Rect} + */ + getTranslated(delta:yfiles.geometry.Point):yfiles.geometry.Rect; + /** + * Determines whether the bounds of this instance intersect with the bounds of the specified rectangle. + * @param {yfiles.geometry.Rect} rectangle The rectangle to check. + * @returns {boolean} Whether both instance are non-empty and have an intersection with positive {@link yfiles.geometry.Rect#area}. + */ + intersects(rectangle:yfiles.geometry.Rect):boolean; + /** + * Determines whether this rectangle intersects an {@link yfiles.geometry.IOrientedRectangle}, given an epsilon. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The {@link yfiles.geometry.IOrientedRectangle} to test. + * @param {number} [eps=0] 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. + * @returns {boolean} Whether they have a non-empty intersection. + */ + intersects(rectangle:yfiles.geometry.IOrientedRectangle,eps?:number):boolean; + /** + * Determines whether this rectangle intersects a line. + * @param {yfiles.geometry.Point} start The first end point of the line. + * @param {yfiles.geometry.Point} end The second end point of the line. + * @returns {boolean} Whether the line intersects the rectangle. + */ + intersectsLine(start:yfiles.geometry.Point,end:yfiles.geometry.Point):boolean; + /** + * Determines whether a rectangle intersects a polygonal line. + * @param {yfiles.collections.IEnumerable.} points The list of points that is interpreted as a number of line segments. + * @returns {boolean} true if the rectangle intersects at least one segment of the line. + */ + intersectsPolyline(points:yfiles.collections.IEnumerable):boolean; + /** + * Creates an {@link yfiles.geometry.IMutableRectangle} using the values from this instance. + * @returns {yfiles.geometry.IMutableRectangle} An instance that has been initialized from the values of this instance. + */ + toMutableRectangle():yfiles.geometry.IMutableRectangle; + /** + * Creates a {@link yfiles.algorithms.Rectangle2D Rectangle2D} from a given {@link yfiles.geometry.Rect}. + * @returns {yfiles.algorithms.Rectangle2D} The {@link yfiles.algorithms.Rectangle2D Rectangle2D}. + */ + toRectangle2D():yfiles.algorithms.Rectangle2D; + /** + * Creates a {@link yfiles.algorithms.YRectangle} from a given {@link yfiles.geometry.Rect}. + * @returns {yfiles.algorithms.YRectangle} The {@link yfiles.algorithms.YRectangle}. + */ + toYRectangle():yfiles.algorithms.YRectangle; + /** + * An {@link yfiles.geometry.Rect#isEmpty empty} rectangle. + *

+ * {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height} are set to -1.0d, {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} are set to 0.0d. + *

+ * @const + * @static + * @type {yfiles.geometry.Rect} + */ + static EMPTY:yfiles.geometry.Rect; + /** + * An infinite rectangle. + *

+ * {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height} are set to {@link number#POSITIVE_INFINITY}, {@link yfiles.geometry.Rect#x} and {@link yfiles.geometry.Rect#y} are set to {@link number#NEGATIVE_INFINITY}. + *

+ * @const + * @static + * @type {yfiles.geometry.Rect} + */ + static INFINITE:yfiles.geometry.Rect; + /** + * Gets the X coordinate of the upper left corner of the rectangle. + * @type {number} + */ + x:number; + /** + * Gets the Y coordinate of the upper left corner of the rectangle. + * @type {number} + */ + y:number; + /** + * Gets the width of the rectangle. + * @type {number} + */ + width:number; + /** + * Gets the height of the rectangle. + * @type {number} + */ + height:number; + /** + * Gets the center X coordinate of the rectangle. + * @type {number} + */ + centerX:number; + /** + * Gets the center Y coordinate of the rectangle. + * @type {number} + */ + centerY:number; + /** + * Gets the center of the rectangle using {@link yfiles.geometry.Rect#centerX} and {@link yfiles.geometry.Rect#centerY}. + * @type {yfiles.geometry.Point} + */ + center:yfiles.geometry.Point; + /** + * Gets the coordinates of the top left corner of the rectangle. + * @type {yfiles.geometry.Point} + */ + topLeft:yfiles.geometry.Point; + /** + * Gets the coordinates of the top right corner of the rectangle. + * @type {yfiles.geometry.Point} + */ + topRight:yfiles.geometry.Point; + /** + * Gets the coordinates of the bottom left corner of the rectangle. + * @type {yfiles.geometry.Point} + */ + bottomLeft:yfiles.geometry.Point; + /** + * Gets the coordinates of the bottom right corner of the rectangle. + * @type {yfiles.geometry.Point} + */ + bottomRight:yfiles.geometry.Point; + /** + * Gets the size of this instance. + * @type {yfiles.geometry.Size} + */ + size:yfiles.geometry.Size; + /** + * Gets a value indicating whether this instance is considered empty. + *

+ * Yields true if this at least one of {@link yfiles.geometry.Rect#width} or {@link yfiles.geometry.Rect#height} is negative; false otherwise. Note that a width and height of both 0.0d is not + * considered empty for this implementation. + *

+ * @type {boolean} + */ + isEmpty:boolean; + /** + * Gets a value indicating whether this instance is finite. + * @type {boolean} + */ + isFinite:boolean; + /** + * Gets the coordinates of the right border for this instance. + * @type {number} + */ + maxX:number; + /** + * Gets the coordinates of the lower border for this instance. + * @type {number} + */ + maxY:number; + /** + * Gets the X coordinates of the left side of this instance. + * @type {number} + */ + minX:number; + /** + * Gets the Y coordinates of the top side of this instance. + * @type {number} + */ + minY:number; + /** + * Gets the area of this instance which is the product of {@link yfiles.geometry.Rect#width} and {@link yfiles.geometry.Rect#height}. + * @type {number} + */ + area:number; + static $class:yfiles.lang.Class; + } + /** + * An immutable class that represents a tangent in a 2-d Cartesian coordinate space with double values. + *

+ * The tangent consists of its point of tangency ({@link yfiles.geometry.Tangent#point}) and a direction ({@link yfiles.geometry.Tangent#vector}). + *

+ * @class yfiles.geometry.Tangent + * @final + */ + export interface Tangent extends yfiles.lang.Struct{} + export class Tangent { + /** + * Initializes a new instance of the {@link yfiles.geometry.Tangent} class using the given values for the {@link yfiles.geometry.Tangent#point} and {@link yfiles.geometry.Tangent#vector} properties. + * @param {yfiles.geometry.Point} point The point of tangency. + * @param {yfiles.geometry.Point} vector The directional vector. + * @constructor + */ + constructor(point:yfiles.geometry.Point,vector:yfiles.geometry.Point); + /** + * Gets the point of tangency. + * @type {yfiles.geometry.Point} + */ + point:yfiles.geometry.Point; + /** + * Gets the directional vector. + * @type {yfiles.geometry.Point} + */ + vector:yfiles.geometry.Point; + static $class:yfiles.lang.Class; + } + /** + * Interface for mutable oriented rectangles in 2D coordinate space with double precision coordinates. + * @see yfiles.geometry.ISize + * @see yfiles.geometry.IOrientedRectangle + * @see yfiles.geometry.OrientedRectangle + * @interface + * @implements {yfiles.geometry.IOrientedRectangle} + * @implements {yfiles.geometry.IMutableSize} + */ + export interface IMutableOrientedRectangle extends Object,yfiles.geometry.IOrientedRectangle,yfiles.geometry.IMutableSize{ + /** + * Sets the anchor vector of the oriented rectangle to the given value. + * @param {yfiles.geometry.Point} location The coordinates of the new anchor location. + */ + setAnchor?(location:yfiles.geometry.Point):void; + /** + * Sets the center of the oriented rectangle to the given value. + * @param {yfiles.geometry.Point} center The coordinates of the new center. + */ + setCenter?(center:yfiles.geometry.Point):void; + /** + * 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 yfiles.geometry.IOrientedRectangle#upX + * @see yfiles.geometry.IOrientedRectangle#upY + * @abstract + */ + setUpVector(upx:number,upy:number):void; + /** + * 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. + *

+ * @abstract + * @type {number} + */ + 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. + *

+ * @abstract + * @type {number} + */ + anchorY:number; + } + var IMutableOrientedRectangle:{ + $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 adds write access to the read only interface + * {@link yfiles.geometry.IPoint}. + *

+ * @see yfiles.geometry.IPoint + * @see yfiles.geometry.MutablePoint + * @interface + * @implements {yfiles.geometry.IPoint} + */ + export interface IMutablePoint extends Object,yfiles.geometry.IPoint{ + /** + * Sets the coordinates of the point to the given values. + * @param {number} x The new x coordinate + * @param {number} y The new y coordinate + */ + relocate?(x:number,y:number):void; + /** + * Sets the coordinates of the point to the given values. + * @param {yfiles.geometry.IPoint} location The new location. + */ + relocate?(location:yfiles.geometry.IPoint):void; + /** + * 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 yfiles.geometry.IPoint#x + * @abstract + * @type {number} + */ + 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 yfiles.geometry.IPoint#y + * @abstract + * @type {number} + */ + y:number; + } + var IMutablePoint:{ + $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. + *

+ * @see yfiles.geometry.ISize + * @see yfiles.geometry.IPoint + * @see yfiles.geometry.MutableRectangle + * @interface + * @implements {yfiles.geometry.IMutableSize} + * @implements {yfiles.geometry.IMutablePoint} + * @implements {yfiles.geometry.IRectangle} + */ + export interface IMutableRectangle extends Object,yfiles.geometry.IMutableSize,yfiles.geometry.IMutablePoint,yfiles.geometry.IRectangle{ + /** + * 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.IPoint} point The coordinate to include in the bounds. + */ + add?(point:yfiles.geometry.IPoint):void; + /** + * 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.IRectangle} rectangle2 The rectangle to be added. + */ + add?(rectangle2:yfiles.geometry.IRectangle):void; + /** + * Applies a new position and size to a given mutable 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} width The new width of the rectangle. + * @param {number} height The new height of the rectangle. + */ + reshape?(x:number,y:number,width:number,height:number):void; + /** + * Applies a new position and size to a given mutable rectangle. + * @param {yfiles.geometry.IPoint} position The new location. + * @param {yfiles.geometry.ISize} size The new size. + */ + reshape?(position:yfiles.geometry.IPoint,size:yfiles.geometry.ISize):void; + /** + * Applies a new position and size to a given mutable rectangle. + * @param {yfiles.geometry.IRectangle} newRectangle The bounds to set to the rectangle. + */ + reshape?(newRectangle:yfiles.geometry.IRectangle):void; + /** + * Sets the center of the rectangle to the provided value. + * @param {yfiles.geometry.Point} center The new center coordinates. + */ + setCenter?(center:yfiles.geometry.Point):void; + /** + * 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} rectangle1 The first rectangle to create the union of. + * @param {yfiles.geometry.IRectangle} rectangle2 The second rectangle to create the union of. + */ + setToUnion?(rectangle1:yfiles.geometry.IRectangle,rectangle2:yfiles.geometry.IRectangle):void; + } + var IMutableRectangle:{ + $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 extends the read only interface {@link yfiles.geometry.ISize}. + *

+ * @see yfiles.geometry.ISize + * @see yfiles.geometry.MutableSize + * @interface + * @implements {yfiles.geometry.ISize} + */ + export interface IMutableSize extends Object,yfiles.geometry.ISize{ + /** + * Sets the coordinates of the size to the given values. + * @param {number} newWidth The new x coordinate + * @param {number} newHeight The new y coordinate + */ + resize?(newWidth:number,newHeight:number):void; + /** + * Sets the values of the size to the given values. + * @param {yfiles.geometry.Size} newSize The new location. + */ + resize?(newSize:yfiles.geometry.Size):void; + /** + * Sets the coordinates of the size to the given values. + * @param {yfiles.geometry.ISize} newSize The new location. + */ + resize?(newSize:yfiles.geometry.ISize):void; + /** + * 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 yfiles.geometry.ISize#width + * @abstract + * @type {number} + */ + 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 yfiles.geometry.ISize#height + * @abstract + * @type {number} + */ + height:number; + } + var IMutableSize:{ + $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 yfiles.geometry.ISize + * @see yfiles.geometry.IRectangle + * @see yfiles.geometry.OrientedRectangle + * @see yfiles.geometry.MutableRectangle + * @interface + * @implements {yfiles.geometry.ISize} + */ + export interface IOrientedRectangle extends Object,yfiles.geometry.ISize{ + /** + * Determines whether the given oriented rectangle contains the provided point, using an epsilon value. + * @param {yfiles.geometry.Point} 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. + * @returns {boolean} true iff the point lies inside the rectangle. + */ + containsWithEps?(point:yfiles.geometry.Point,eps:number):boolean; + /** + * Creates a transformation matrix 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. + * @returns {yfiles.geometry.Matrix} A matrix that can be used to transform from oriented rectangle coordinates to world coordinates. + */ + createTransform?():yfiles.geometry.Matrix; + /** + * Determines whether the oriented rectangle contains the provided point, using an epsilon value. + * @param {yfiles.geometry.Point} 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. + * @returns {boolean} true iff the point lies inside the rectangle. + */ + hits?(location:yfiles.geometry.Point,eps:number):boolean; + /** + * Creates a {@link yfiles.algorithms.YOrientedRectangle} from a given {@link yfiles.geometry.IOrientedRectangle}. + * @returns {yfiles.algorithms.YOrientedRectangle} The {@link yfiles.algorithms.YOrientedRectangle}. + */ + toOrientedRectangle?():yfiles.algorithms.YOrientedRectangle; + /** + * 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). + *

+ * @abstract + * @type {number} + */ + 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). + *

+ * @abstract + * @type {number} + */ + 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. + *

+ * @abstract + * @type {number} + */ + 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. + *

+ * @abstract + * @type {number} + */ + upY:number; + /** + * Gets the up vector of the oriented rectangle as a {@link yfiles.geometry.Point} struct. + * @returns The value of the up vector of the rectangle at the time of the invocation. + * @type {yfiles.geometry.Point} + */ + upVector?:yfiles.geometry.Point; + /** + * Gets the anchor location of the oriented rectangle as a {@link yfiles.geometry.Point} struct. + * @returns The anchor location of the rectangle at the time of the invocation. + * @type {yfiles.geometry.Point} + */ + anchorLocation?:yfiles.geometry.Point; + /** + * Gets the current center of the oriented rectangle as a {@link yfiles.geometry.Point} struct. + * @returns The current coordinates of the center. + * @type {yfiles.geometry.Point} + */ + orientedRectangleCenter?:yfiles.geometry.Point; + /** + * Determines the bounds of an oriented rectangle. + *

+ * Bounding rectangles are parallel to the coordinate axes. + *

+ * @returns The bounds. + * @type {yfiles.geometry.Rect} + */ + bounds?:yfiles.geometry.Rect; + } + var IOrientedRectangle:{ + /** + * An immutable empty {@link yfiles.geometry.IOrientedRectangle} with width and height of -1. + * @const + * @static + * @type {yfiles.geometry.IOrientedRectangle} + */ + EMPTY?:yfiles.geometry.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 yfiles.geometry.IMutablePoint + * @see yfiles.geometry.MutablePoint + * @interface + */ + export interface IPoint extends Object{ + /** + * Calculates the Euclidean distance between two points. + * @param {yfiles.geometry.IPoint} point2 The second point. + * @returns {number} The distance between the two points. + */ + distanceTo?(point2:yfiles.geometry.IPoint):number; + /** + * Copies the current values of the coordinates of the point to a {@link yfiles.geometry.Point} 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.Point}. + *

+ * @returns {yfiles.geometry.Point} The current values of the coordinates of the point. + * @see yfiles.geometry.Point#toMutablePoint + */ + toPoint?():yfiles.geometry.Point; + /** + * Gets the current x coordinate of this point. + *

+ * Depending on context the values returned may change over time. + *

+ * @abstract + * @type {number} + */ + x:number; + /** + * Gets the current y coordinate of this point. + *

+ * Depending on context the values returned may change over time. + *

+ * @abstract + * @type {number} + */ + y:number; + } + var IPoint:{ + $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 yfiles.geometry.IMutableRectangle + * @see yfiles.geometry.IMutablePoint + * @see yfiles.geometry.ISize + * @see yfiles.geometry.IPoint + * @see yfiles.geometry.MutableRectangle + * @interface + * @implements {yfiles.geometry.ISize} + * @implements {yfiles.geometry.IPoint} + */ + export interface IRectangle extends Object,yfiles.geometry.ISize,yfiles.geometry.IPoint{ + /** + * Determines whether the given rectangle contains the provided point. + * @param {yfiles.geometry.Point} point The point to test. + * @returns {boolean} true iff the point lies inside the rectangle. + */ + contains?(point:yfiles.geometry.Point):boolean; + /** + * Determines whether the given rectangle contains the provided point. + * @param {yfiles.geometry.IPoint} point The point to test. + * @returns {boolean} true iff the point lies inside the rectangle. + */ + contains?(point:yfiles.geometry.IPoint):boolean; + /** + * Copies the current values of the rectangle to {@link yfiles.geometry.Rect} 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.Rect} type. + *

+ * @returns {yfiles.geometry.Rect} A {@link yfiles.geometry.Rect} that holds the values of the rectangle at the time of the invocation. + * @see yfiles.geometry.IMutableRectangle#reshape + * @see yfiles.geometry.Rect#toMutableRectangle + */ + toRect?():yfiles.geometry.Rect; + /** + * Gets the coordinates of the top left corner of the rectangle as a {@link yfiles.geometry.Point}. + * @returns The current coordinates of the corner. + * @type {yfiles.geometry.Point} + */ + topLeft?:yfiles.geometry.Point; + /** + * Gets the coordinates of the bottom left corner of the rectangle as a {@link yfiles.geometry.Point}. + * @returns The current coordinates of the corner. + * @type {yfiles.geometry.Point} + */ + bottomLeft?:yfiles.geometry.Point; + /** + * Gets the coordinates of the center of the rectangle as a {@link yfiles.geometry.Point}. + * @returns The current coordinates of the center. + * @type {yfiles.geometry.Point} + */ + center?:yfiles.geometry.Point; + /** + * 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.geometry.IRectangle#isEmpty}. + *

+ * @returns The maximum x coordinate of the rectangle's corners. + * @type {number} + */ + maxX?: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. + *

+ * @returns true if the specified rectangle is empty; false otherwise. + * @type {boolean} + */ + isEmpty?: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.geometry.IRectangle#isEmpty}. + *

+ * @returns The maximum y coordinate of the rectangle's corners. + * @type {number} + */ + maxY?:number; + /** + * Gets the coordinates of the top right corner of the rectangle as a {@link yfiles.geometry.Point}. + * @returns The current coordinates of the corner. + * @type {yfiles.geometry.Point} + */ + topRight?:yfiles.geometry.Point; + /** + * Gets the coordinates of the bottom right corner of the rectangle as a {@link yfiles.geometry.Point}. + * @returns The current coordinates of the corner. + * @type {yfiles.geometry.Point} + */ + bottomRight?:yfiles.geometry.Point; + } + var IRectangle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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 yfiles.geometry.IMutableSize + * @see yfiles.geometry.MutableSize + * @interface + */ + export interface ISize extends Object{ + /** + * Converts the {@link yfiles.geometry.ISize} to a {@link yfiles.geometry.Size} struct. + * @returns {yfiles.geometry.Size} A {@link yfiles.geometry.Size} struct that has been initialized with the current values of size. + */ + toSize?():yfiles.geometry.Size; + /** + * Gets the current width of this instance. + *

+ * Depending on context the values returned may change over time. + *

+ * @abstract + * @type {number} + */ + width:number; + /** + * Gets the current height of this instance. + *

+ * Depending on context the values returned may change over time. + *

+ * @abstract + * @type {number} + */ + height:number; + } + var ISize:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum MatrixOrder{ + /** + * Constant that defines a prepend operation for matrix multiplications. + *

+ * Prepending a matrix T to another matrix M results in the operation M' = M T. Essentially, this means that T is applied before + * M when applying M' to a vector. + *

+ */ + PREPEND, + /** + * Constant that defines an append operation for matrix multiplications. + *

+ * Appending a matrix T to another matrix M results in the operation M' = T M. Essentially, this means that T is applied after M + * when applying M' to a vector. + *

+ */ + APPEND + } + /** + * An implementation of a matrix that represents an affine transformation and works with {@link yfiles.geometry.Point}. + *

+ * 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. + *

+ * @class yfiles.geometry.Matrix + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface Matrix extends Object,yfiles.lang.ICloneable{} + export class Matrix { + /** + * Create a matrix using the provided matrix entries. + * @param {number} m11 + * @param {number} m12 + * @param {number} m21 + * @param {number} m22 + * @param {number} dx + * @param {number} dy + * @constructor + */ + constructor(m11:number,m12:number,m21:number,m22:number,dx:number,dy:number); + /** + * Create an identity matrix. + * @constructor + */ + constructor(); + /** + * Applies this matrix to the given SVG element. + * @param {SVGElement} element The element to transform. + */ + applyTo(element:SVGElement):void; + /** + * Applies this matrix to the given HTML canvas rendering context. + * @param {CanvasRenderingContext2D} ctx The context to transform. + */ + applyTo(ctx:CanvasRenderingContext2D):void; + /** + * Creates a matrix rotation instance around the origin. + * @param {number} theta The rotation angle in radians. + * @returns {yfiles.geometry.Matrix} A new matrix. + * @static + */ + static createRotateInstance(theta:number):yfiles.geometry.Matrix; + /** + * Determines whether this has the same values like other. + * @param {yfiles.geometry.Matrix} other The object to compare this to. Must be of the same type. + * @returns {boolean} true if this has the same values like the other object. + */ + hasSameValue(other:yfiles.geometry.Matrix):boolean; + /** + * Inverts this instance. + */ + invert():void; + /** + * Multiplies this matrix instance by the given instance using the given order. + * @param {yfiles.geometry.Matrix} matrix The matrix to multiply with this one. + * @param {yfiles.geometry.MatrixOrder} [order=yfiles.geometry.MatrixOrder.PREPEND] The order of the multiplication. {@link yfiles.geometry.MatrixOrder#PREPEND} if not specified. + */ + multiply(matrix:yfiles.geometry.Matrix,order?:yfiles.geometry.MatrixOrder):void; + /** + * Resets this instance to the identity. + */ + reset():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.Point} center The coordinate of the center of the rotation. + * @param {yfiles.geometry.MatrixOrder} [order=yfiles.geometry.MatrixOrder.PREPEND] Whether to append or prepend the rotation matrix. + */ + rotate(theta:number,center:yfiles.geometry.Point,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=yfiles.geometry.MatrixOrder.PREPEND] Whether to append or prepend the rotation matrix. + */ + rotate(theta:number,order?:yfiles.geometry.MatrixOrder):void; + /** + * Appends or prepends a scale operation to this instance. + * @param {number} x + * @param {number} y + * @param {yfiles.geometry.MatrixOrder} [order=0] + */ + scale(x:number,y:number,order?:yfiles.geometry.MatrixOrder):void; + /** + * Sets all elements of this instance. + * @param {number} m0 + * @param {number} m1 + * @param {number} m2 + * @param {number} m3 + * @param {number} dx + * @param {number} dy + */ + set(m0:number,m1:number,m2:number,m3:number,dx:number,dy:number):void; + /** + * Sets the values of the given matrix to this instance. + * @param {yfiles.geometry.Matrix} matrix + */ + set(matrix:yfiles.geometry.Matrix):void; + /** + * Converts the {@link yfiles.geometry.Matrix} object to an SVG transform string. + *

+ * The returned string can be used in a transform attribute. + *

+ * @returns {string} The transform string + */ + toSvgTransform():string; + /** + * Transforms the given coordinate. + * @param {yfiles.geometry.Point} point The coordinate to transform. + * @returns {yfiles.geometry.Point} The transformed coordinates. + */ + transform(point:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Transforms the given point in place. + * @param {yfiles.geometry.IMutablePoint} point The point to transform and return. + * @returns {yfiles.geometry.IMutablePoint} point + */ + transform(point:yfiles.geometry.IMutablePoint):yfiles.geometry.IMutablePoint; + /** + * Appends or Prepends a translation to this instance. + * @param {yfiles.geometry.Point} delta + * @param {yfiles.geometry.MatrixOrder} [order=0] + */ + translate(delta:yfiles.geometry.Point,order?:yfiles.geometry.MatrixOrder):void; + /** + * Returns a new double[] of the elements describing the matrix. + *

+ * The order is m11, m12, m21, m22, dx, dy. + *

+ * @type {Array.} + */ + elements:number[]; + static $class:yfiles.lang.Class; + } + /** + * 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.lang.ICloneable} interface. + *

+ * @see yfiles.geometry.IPoint + * @class yfiles.geometry.MutablePoint + * @implements {yfiles.geometry.IMutablePoint} + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface MutablePoint extends Object,yfiles.geometry.IMutablePoint,yfiles.lang.ICloneable{} + export class MutablePoint { + /** + * Creates an instance using the given coordinate pair. + * @param {number} x The x coordinate + * @param {number} y The y coordinate + * @constructor + */ + constructor(x:number,y:number); + /** + * Creates an instance using the given coordinate pair. + * @param {yfiles.geometry.IPoint} point The coordinate. + * @constructor + */ + constructor(point:yfiles.geometry.IPoint); + /** + * Creates the point with initially 0.0d values for {@link yfiles.geometry.MutablePoint#x} and {@link yfiles.geometry.MutablePoint#y}. + * @constructor + */ + constructor(); + /** + * A variant of {@link yfiles.geometry.MutablePoint#$m} that automatically casts to this type. + * @returns {yfiles.geometry.MutablePoint} A {@link yfiles.geometry.MutablePoint#$m} of this. + */ + clonePoint():yfiles.geometry.MutablePoint; + /** + * Moves this instance by adding the provided offsets to the coordinates of this point. + * @param {yfiles.geometry.Point} delta The offset to add to this point's x coordinate + */ + moveBy(delta:yfiles.geometry.Point):void; + /** + * 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 yfiles.geometry.Point#normalized + */ + normalize():void; + /** + * Gets or sets the x coordinate. + * @type {number} + */ + x:number; + /** + * Gets or sets the y coordinate. + * @type {number} + */ + y:number; + static $class:yfiles.lang.Class; + } + /** + * 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.IOrientedRectangle}, and the {@link yfiles.lang.ICloneable} interfaces. + *

+ * @see yfiles.geometry.IRectangle + * @see yfiles.geometry.IMutableRectangle + * @class yfiles.geometry.MutableRectangle + * @implements {yfiles.geometry.IMutableRectangle} + * @implements {yfiles.geometry.IOrientedRectangle} + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface MutableRectangle extends Object,yfiles.geometry.IMutableRectangle,yfiles.geometry.IOrientedRectangle,yfiles.lang.ICloneable{} + export class MutableRectangle { + /** + * Creates a new instance using the provided values to initialize the position and size. + *

+ * An instance of {@link yfiles.geometry.MutablePoint} will be used to store the position and an instance of {@link yfiles.geometry.MutableRectangle#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} width The width of the rectangle. + * @param {number} height The height of the rectangle. + * @constructor + */ + constructor(x:number,y:number,width:number,height:number); + /** + * Creates a new instance using the provided values to initialize the position and size. + *

+ * An instance of {@link yfiles.geometry.MutablePoint} will be used to store the position and an instance of {@link yfiles.geometry.MutableRectangle#size} will be used to store + * the size. + *

+ * @param {yfiles.geometry.Point} location The coordinates of the upper left corner of the rectangle. + * @param {yfiles.geometry.Size} size The size of the rectangle. + * @constructor + */ + constructor(location:yfiles.geometry.Point,size:yfiles.geometry.Size); + /** + * 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} location The provider for the dynamic position of this instance. + * @param {yfiles.geometry.IMutableSize} size The provider for the dynamic size of this instance. + * @constructor + */ + constructor(location:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize); + /** + * Creates a new instance initialized to the values of the provided argument. + * @param {yfiles.geometry.IRectangle} rectangle + * @constructor + */ + constructor(rectangle:yfiles.geometry.IRectangle); + /** + * Creates a new empty instance located at the origin with width and height set to -1. + * @constructor + */ + constructor(); + /** + * Moves this rectangle by applying the offset to the {@link yfiles.geometry.MutableRectangle#location} + * @param {yfiles.geometry.Point} delta The offset to move the rectangle's position by. + */ + moveBy(delta:yfiles.geometry.Point):void; + /** + * Returns whether this instance has negative width or height. + * @type {boolean} + */ + isEmpty:boolean; + /** + * 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. + *

+ * @type {yfiles.geometry.IPoint} + */ + location: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. + *

+ * @type {yfiles.geometry.ISize} + */ + size:yfiles.geometry.ISize; + /** + * Gets or sets the width of this instance from the {@link yfiles.geometry.MutableRectangle#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. + *

+ * @type {number} + */ + width:number; + /** + * Gets or sets the height of this instance from the {@link yfiles.geometry.MutableRectangle#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. + *

+ * @type {number} + */ + height:number; + /** + * Gets or sets the x coordinate of the upper left corner of this instance from the {@link yfiles.geometry.MutableRectangle#location} 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. + *

+ * @type {number} + */ + x:number; + /** + * Gets or sets the y coordinate of the upper left corner of this instance from the {@link yfiles.geometry.MutableRectangle#location} 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. + *

+ * @type {number} + */ + y:number; + /** + * Gets or sets the x coordinate of the lower right corner of this instance using the {@link yfiles.geometry.MutableRectangle#location} and {@link yfiles.geometry.MutableRectangle#size} instances. + *

+ * Setting this value will update the width accordingly. Note that depending on the implementation used for holding the {@link yfiles.geometry.MutableRectangle#size} + * the results may vary. However the default implementation will do just that: read and write the values without modifying + * them in any way. + *

+ * @type {number} + */ + x2:number; + /** + * Gets or sets the y coordinate of the lower right corner of this instance using the {@link yfiles.geometry.MutableRectangle#location} and {@link yfiles.geometry.MutableRectangle#size} instances. + *

+ * Setting this value will update the height accordingly. Note that depending on the implementation used for holding the {@link yfiles.geometry.MutableRectangle#size} + * the results may vary. However the default implementation will do just that: read and write the values without modifying + * them in any way. + *

+ * @type {number} + */ + y2:number; + /** + * Implements the {@link yfiles.geometry.IOrientedRectangle} and will return the x coordinate of the {@link yfiles.geometry.MutableRectangle#location}. + *

+ * 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). + *

+ * @type {number} + */ + anchorX:number; + /** + * Implements the {@link yfiles.geometry.IOrientedRectangle} and will return the y coordinate of the {@link yfiles.geometry.MutableRectangle#location} 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). + *

+ * @type {number} + */ + 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). + *

+ * @type {number} + */ + 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). + *

+ * @type {number} + */ + upY:number; + static $class:yfiles.lang.Class; + } + /** + * 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 yfiles.geometry.ISize + * @class yfiles.geometry.MutableSize + * @implements {yfiles.geometry.IMutableSize} + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface MutableSize extends Object,yfiles.geometry.IMutableSize,yfiles.lang.ICloneable{} + export class MutableSize { + /** + * Creates an instance using the given width and height. + * @param {number} width The width. + * @param {number} height The height + * @constructor + */ + constructor(width:number,height:number); + /** + * 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. + * @returns A instance of the Size class. + * @constructor + */ + constructor(size:yfiles.geometry.ISize); + /** + * Creates the initially empty size, that is both {@link yfiles.geometry.MutableSize#width} and {@link yfiles.geometry.MutableSize#height} are 0.0d. + * @constructor + */ + constructor(); + /** + * Gets or sets the width. + * @type {number} + */ + width:number; + /** + * Gets or sets the height. + * @type {number} + */ + height:number; + static $class:yfiles.lang.Class; + } + /** + * 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.IMutablePoint} and the {@link yfiles.lang.ICloneable} interfaces. + *

+ * @see yfiles.geometry.IOrientedRectangle + * @see yfiles.geometry.IMutableOrientedRectangle + * @class yfiles.geometry.OrientedRectangle + * @implements {yfiles.geometry.IMutablePoint} + * @implements {yfiles.geometry.IMutableOrientedRectangle} + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface OrientedRectangle extends Object,yfiles.geometry.IMutablePoint,yfiles.geometry.IMutableOrientedRectangle,yfiles.lang.ICloneable{} + export class 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. + * @constructor + */ + constructor(anchor:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize); + /** + * Creates a new instance using the provided values to initialize. + *

+ * This will basically create a copy of the given rectangle + *

+ * @param {yfiles.geometry.IOrientedRectangle} rectangle The rectangle to initialize the anchor and size and up vector from. + * @constructor + */ + constructor(rectangle:yfiles.geometry.IOrientedRectangle); + /** + * 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} rectangle The rectangle to initialize the anchor and size from. + * @constructor + */ + constructor(rectangle:yfiles.geometry.IRectangle); + /** + * 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} 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=0] The x component of the up vector. + * @param {number} [upY=-1] The y component of the up vector. + * @constructor + */ + constructor(anchorX:number,anchorY:number,width:number,height:number,upX?:number,upY?:number); + /** + * 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 {Object} options The parameters to pass. + * @param {number} options.anchorX The x coordinate of the anchor of the oriented rectangle. + * @param {number} options.anchorY The y coordinate of the anchor of the oriented rectangle. + * @param {number} options.width The width of the rectangle. + * @param {number} options.height The height of the rectangle. + * @param {number} [options.upX=0] The x component of the up vector. + * @param {number} [options.upY=-1] The y component of the up vector. + * @constructor + */ + constructor(options:{anchorX:number,anchorY:number,width:number,height:number,upX?:number,upY?:number}); + /** + * Initializes a new instance of the {@link yfiles.geometry.OrientedRectangle} class located at 0.0d,0.0d with empty width and + * height (-1.0d). + * @constructor + */ + constructor(); + /** + * A casting operator that creates a new instance of {@link yfiles.geometry.OrientedRectangle} using the current state of the + * rectangle that is cast. + *

+ * 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). Unlike true casting this will create a new instance that will be initialized to the current state of the object + * being cast, but which will not stay in sync with the state of the object. + *

+ * @param {yfiles.geometry.MutableRectangle} rect the rectangle to get the current state from + * @returns {yfiles.geometry.OrientedRectangle} A new instance of {@link yfiles.geometry.OrientedRectangle} that holds no reference to the provided rectangle. + * @static + */ + static convertFrom(rect:yfiles.geometry.MutableRectangle):yfiles.geometry.OrientedRectangle; + /** + * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} with the given values. + * @param {number} anchorX + * @param {number} anchorY + * @param {number} width + * @param {number} height + * @param {number} upX + * @param {number} upY + * @returns {yfiles.geometry.IOrientedRectangle} + * @static + */ + static createImmutable(anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number):yfiles.geometry.IOrientedRectangle; + /** + * Moves this rectangle by applying the offset to the {@link yfiles.geometry.OrientedRectangle#anchor} + * @param {yfiles.geometry.Point} delta The offset to move the rectangle's anchor by. + * @returns true iff dx != 0 || dy != 0 + */ + moveBy(delta:yfiles.geometry.Point):void; + /** + * Applies the values provided by the given instance to the values of this instance. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The instance to retrieve the values from. + */ + reshape(rectangle:yfiles.geometry.IOrientedRectangle):void; + /** + * 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 yfiles.geometry.OrientedRectangle#angle + */ + setUpVector(upx:number,upy:number):void; + /** + * Returns whether this instance has negative width or height. + * @type {boolean} + */ + isEmpty: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. + *

+ * @type {yfiles.geometry.IPoint} + */ + 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. + *

+ * @type {yfiles.geometry.ISize} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + 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. + *

+ * @type {number} + */ + anchorY:number; + /** + * 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 yfiles.geometry.OrientedRectangle#angle + * @see yfiles.geometry.OrientedRectangle#setUpVector + * @see yfiles.geometry.OrientedRectangle#upY + * @type {number} + */ + 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 yfiles.geometry.OrientedRectangle#angle + * @see yfiles.geometry.OrientedRectangle#setUpVector + * @see yfiles.geometry.OrientedRectangle#upX + * @type {number} + */ + upY:number; + /** + * Gets or sets the orientation of this rectangle. + *

+ * The angle is specified in radians. An angle of 0 means the up vector points up in direction (0,-1). The angle value is + * not stored and will be recalculated from {@link yfiles.geometry.OrientedRectangle#upX} and {@link yfiles.geometry.OrientedRectangle#upY} every time this is invoked, so this is a costly method. Setting the angle + * changes the {@link yfiles.geometry.OrientedRectangle#upX} and {@link yfiles.geometry.OrientedRectangle#upY} values accordingly. + *

+ * @type {number} + */ + angle:number; + static $class:yfiles.lang.Class; + } + }export namespace styles{ + /** + * A default implementation of the {@link yfiles.styles.IArrow} interface that can render {@link yfiles.styles.ArrowType}s. + * @class yfiles.styles.Arrow + * @implements {yfiles.styles.IArrow} + * @implements {yfiles.lang.ICloneable} + * @final + */ + export interface Arrow extends Object,yfiles.styles.IArrow,yfiles.lang.ICloneable{} + export class Arrow { + /** + * Creates a new arrow with the given color to use for {@link yfiles.styles.Arrow#stroke} and brush. + *

+ * The {@link yfiles.styles.Arrow#stroke} is created with thickness 1. + *

+ * @param {yfiles.view.Color} color The color to use for {@link yfiles.styles.Arrow#stroke} and brush. + * @constructor + */ + constructor(color:yfiles.view.Color); + /** + * Creates a new arrow with the given color to use for {@link yfiles.styles.Arrow#stroke} and brush. + *

+ * The {@link yfiles.styles.Arrow#stroke} is created with thickness 1. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.view.Color} options.color The color to use for {@link yfiles.styles.Arrow#stroke} and brush. + * @param {number} options.cropLength The cropping length associated with this instance. + *

+ * This option sets the {@link yfiles.styles.Arrow#cropLength} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.Arrow#stroke} of the outline of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#stroke} property on the created object. + *

+ * @param {number} options.scale The scale factor of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#scale} property on the created object. + *

+ * @param {yfiles.styles.ArrowType} options.type The type of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#type} property on the created object. + *

+ * @constructor + */ + constructor(options:{color:yfiles.view.Color,cropLength?:number,stroke?:yfiles.view.Stroke,scale?:number,type?:yfiles.styles.ArrowType}); + /** + * Creates a new arrow with default values for {@link yfiles.styles.Arrow#stroke} and brush. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.Arrow#fill} of the fill of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#fill} property on the created object. + *

+ * @param {number} options.cropLength The cropping length associated with this instance. + *

+ * This option sets the {@link yfiles.styles.Arrow#cropLength} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.Arrow#stroke} of the outline of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#stroke} property on the created object. + *

+ * @param {number} options.scale The scale factor of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#scale} property on the created object. + *

+ * @param {yfiles.styles.ArrowType} options.type The type of this arrow. + *

+ * This option sets the {@link yfiles.styles.Arrow#type} property on the created object. + *

+ * @constructor + */ + constructor(options?:{fill?:yfiles.view.Fill,cropLength?:number,stroke?:yfiles.view.Stroke,scale?:number,type?:yfiles.styles.ArrowType}); + /** + * Returns an immutable {@link yfiles.styles.IArrow} instance that uses the current properties. + * @returns {yfiles.styles.IArrow} An immutable instance + */ + asFrozen():yfiles.styles.IArrow; + /** + * Gets or sets the type of this arrow. + * @default 1 + * @type {yfiles.styles.ArrowType} + */ + type:yfiles.styles.ArrowType; + /** + * Gets or sets the scale factor of this arrow. + *

+ * The arrow bounds are scaled with this factor. + *

+ * @default 1.0 + * @type {number} + */ + scale:number; + /** + * Gets or sets the {@link yfiles.styles.Arrow#stroke} of the outline of this arrow. + * @default null + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Gets or sets the {@link yfiles.styles.Arrow#fill} of the fill of this arrow. + * @default null + * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + /** + * Gets the cropping length associated with this instance. + *

+ * This value is used by {@link yfiles.styles.IEdgeStyle} implementations to let the edge appear to end shortly before its actual + * target. + *

+ * @default 0.0 + * @type {number} + */ + cropLength:number; + static $class:yfiles.lang.Class; + } + /** + * The default implementation of the {@link yfiles.styles.IEdgePathCropper}. + *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 18 Edge Cropping
  • + *
+ * @class yfiles.styles.DefaultEdgePathCropper + * @implements {yfiles.styles.IEdgePathCropper} + */ + export interface DefaultEdgePathCropper extends Object,yfiles.styles.IEdgePathCropper{} + export class DefaultEdgePathCropper { + /** + * 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.styles.DefaultEdgePathCropper#extraCropLength}, {@link yfiles.styles.IArrow#length arrow length} and {@link yfiles.styles.IArrow#cropLength arrow crop length} + *

+ * @param {yfiles.styles.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. + * @returns {number} The total length the edge path is cropped. + * @see yfiles.styles.DefaultEdgePathCropper#cropEdgePath + * @see yfiles.styles.DefaultEdgePathCropper#cropEdgePathAtArrow + * @protected + */ + calculateTotalCropLength(arrow:yfiles.styles.IArrow,atSource:boolean):number; + /** + * Crops the provided path at one end of an edge. + *

+ * If {@link yfiles.styles.DefaultEdgePathCropper#cropAtPort} is true this implementation delegates to {@link yfiles.styles.DefaultEdgePathCropper#cropEdgePathAtPortGeometry}. Otherwise + * the edge path is cropped at the {@link yfiles.styles.DefaultEdgePathCropper#getNodeGeometry node geometry}. If this would result in an empty path, the cropping is delegated to {@link yfiles.styles.DefaultEdgePathCropper#handleEmptyPath} + * instead. + *

+ * @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.styles.IArrow} arrow The arrow that is used at the end of the edge. + * @param {yfiles.geometry.GeneralPath} path The path to crop. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + */ + cropEdgePath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + /** + * Crops an edge's path at the source or target side with respect to the given arrow. + *

+ * The path is cropped by the length {@link yfiles.styles.DefaultEdgePathCropper#calculateTotalCropLength} returns for arrow and + * atSource. + *

+ * @param {boolean} atSource if set to true the source side is cropped. + * @param {yfiles.styles.IArrow} arrow The arrow to consider for the cropping. + * @param {yfiles.geometry.GeneralPath} path The edge's path to crop. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + */ + cropEdgePathAtArrow(atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + /** + * Crops an edge's path at the source or target side at the {@link yfiles.styles.DefaultEdgePathCropper#getPortGeometry port geometry} with respect to the given arrow. + * @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.styles.IArrow} arrow The arrow that is used at the end of the edge. + * @param {yfiles.geometry.GeneralPath} path The path to crop. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + * @protected + */ + cropEdgePathAtPortGeometry(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + /** + * Finds the intersection between a node and the edge. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.IShapeGeometry} nodeShapeGeometry + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + * @protected + */ + getIntersection(node:yfiles.graph.INode,nodeShapeGeometry:yfiles.styles.IShapeGeometry,edge:yfiles.graph.IEdge,inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Returns the {@link yfiles.styles.IShapeGeometry geometry} that is used to crop the edge at the node outline. + *

+ * The default implementation queries the {@link yfiles.styles.INodeStyleRenderer#getShapeGeometry node style renderer} for an implementation of {@link yfiles.styles.IShapeGeometry}. This + * method can be overridden to return an arbitrary {@link yfiles.styles.IShapeGeometry geometry} for a node. + *

+ * @param {yfiles.graph.INode} node The node the edge should be cropped at. + * @returns {yfiles.styles.IShapeGeometry} The {@link yfiles.styles.IShapeGeometry geometry} of the node. + * @protected + */ + getNodeGeometry(node:yfiles.graph.INode):yfiles.styles.IShapeGeometry; + /** + * Returns the {@link yfiles.styles.IShapeGeometry geometry} that is used to crop the edge at the port outline if {@link yfiles.styles.DefaultEdgePathCropper#cropAtPort} is set to true. + *

+ * The default implementation returns null. This method can be overridden to return an arbitrary {@link yfiles.styles.IShapeGeometry geometry} for a port. + *

+ * @param {yfiles.graph.IPort} port The port the edge should be cropped at. + * @returns {yfiles.styles.IShapeGeometry} The {@link yfiles.styles.IShapeGeometry geometry} of the port. + * @see yfiles.styles.DefaultEdgePathCropper#cropAtPort + * @protected + */ + getPortGeometry(port:yfiles.graph.IPort):yfiles.styles.IShapeGeometry; + /** + * Handles the edge path cropping if {@link yfiles.styles.DefaultEdgePathCropper#cropEdgePath} would result in a {@link yfiles.geometry.GeneralPath#clear cleared} path. + *

+ * This method is called by {@link yfiles.styles.DefaultEdgePathCropper#cropEdgePath} if {@link yfiles.styles.DefaultEdgePathCropper#cropAtPort} is false and cropping the edge path at + * the {@link yfiles.styles.DefaultEdgePathCropper#getNodeGeometry node geometry} would result in an empty path. + *

+ *

+ * The default implementation is to {@link yfiles.geometry.GeneralPath#clear} the edge path. + *

+ * @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.styles.IArrow} arrow The arrow that is used at the end of the edge. + * @param {yfiles.geometry.GeneralPath} path The path to crop. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + * @protected + */ + handleEmptyPath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + /** + * Checks whether a given point is inside a node's shape geometry with respect to the edge that is being calculated. + * @param {yfiles.geometry.Point} location + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.IShapeGeometry} nodeShapeGeometry + * @param {yfiles.graph.IEdge} edge + * @returns {boolean} + * @protected + */ + isInside(location:yfiles.geometry.Point,node:yfiles.graph.INode,nodeShapeGeometry:yfiles.styles.IShapeGeometry,edge:yfiles.graph.IEdge):boolean; + /** + * A singleton instance. + *

+ * Note that this is an immutable instance that cannot be cast to the {@link yfiles.styles.DefaultEdgePathCropper} type. + *

+ * @const + * @static + * @type {yfiles.styles.IEdgePathCropper} + */ + static INSTANCE:yfiles.styles.IEdgePathCropper; + /** + * Gets or sets an extra length the edge is cropped. + *

+ * The default value is 0. + *

+ * @type {number} + */ + 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. + *

+ * @type {boolean} + */ + cropAtPort:boolean; + static $class:yfiles.lang.Class; + } + /** + * 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.styles.IEdgeStyle} implementations. + *

+ *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 20 Custom Arrow
  • + *
  • Tutorial: 02 Custom Styles, step 21 Arrow Thickness
  • + *
+ * @interface + */ + export interface IArrow extends Object{ + /** + * Gets an {@link yfiles.view.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.Point} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.Point} directionVector the direction the arrow is pointing in + * @returns {yfiles.view.IBoundsProvider} an implementation of the {@link yfiles.view.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. + * @abstract + */ + getBoundsProvider(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.Point,directionVector:yfiles.geometry.Point):yfiles.view.IBoundsProvider; + /** + * Gets an {@link yfiles.view.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.Point} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.Point} direction the direction the arrow is pointing in + * @returns {yfiles.view.IVisualCreator} an implementation of the {@link yfiles.view.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. + * @abstract + */ + getVisualCreator(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.Point,direction:yfiles.geometry.Point):yfiles.view.IVisualCreator; + /** + * Returns the length of the arrow (the distance from the arrow's tip to the position where the visual representation of + * the edge's path should begin). + * @abstract + * @type {number} + */ + length:number; + /** + * Gets the cropping length associated with this instance. + *

+ * This value is used by {@link yfiles.styles.IEdgeStyle} implementations to let the edge appear to end shortly before its actual + * target. + *

+ * @abstract + * @type {number} + */ + cropLength:number; + } + var IArrow:{ + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints no arrow at all. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + NONE?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a simple black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + SIMPLE?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a default shaped black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + DEFAULT?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a short black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + SHORT?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a simple diamond-shaped black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + DIAMOND?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a simple cross-shaped black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + CROSS?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a simple circle-shaped black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + CIRCLE?:yfiles.styles.IArrow; + /** + * A singleton {@link yfiles.styles.IArrow} instance that paints a simple triangle-shaped black arrow. + * @const + * @static + * @type {yfiles.styles.IArrow} + */ + TRIANGLE?:yfiles.styles.IArrow; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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.styles.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}. + *

+ * @class yfiles.styles.VoidEdgeStyle + * @implements {yfiles.styles.IEdgeStyle} + * @final + */ + export interface VoidEdgeStyle extends Object,yfiles.styles.IEdgeStyle{} + export class VoidEdgeStyle { + /** + * Returns this. + * @returns {Object} this + */ + clone():Object; + /** + * The {@link yfiles.styles.VoidEdgeStyle} singleton. + * @const + * @static + * @type {yfiles.styles.IEdgeStyle} + */ + static INSTANCE:yfiles.styles.IEdgeStyle; + /** + * Yields the {@link yfiles.styles.VoidEdgeStyleRenderer#INSTANCE VoidEdgeStyleRenderer instance}. + * @see yfiles.styles.IEdgeStyle#renderer + * @type {yfiles.styles.IEdgeStyleRenderer} + */ + renderer:yfiles.styles.IEdgeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A void implementation of an edge style renderer that does nothing. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidEdgeStyleRenderer#INSTANCE} of this + * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IEdgeStyle#renderer} property of an + * {@link yfiles.styles.IEdgeStyle}. + *

+ * @class yfiles.styles.VoidEdgeStyleRenderer + * @implements {yfiles.styles.IEdgeStyleRenderer} + * @final + */ + export interface VoidEdgeStyleRenderer extends Object,yfiles.styles.IEdgeStyleRenderer{} + export class VoidEdgeStyleRenderer { + /** + * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.view.IBoundsProvider} + */ + getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; + /** + * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.graph.ILookup} + */ + getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; + /** + * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.input.IHitTestable} + */ + getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; + /** + * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.input.IMarqueeTestable} + */ + getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; + /** + * This method always returns the {@link yfiles.styles.VoidPathGeometry#INSTANCE VoidPathGeometry instance}. + * @param {yfiles.graph.IEdge} edge The edge to provide an instance for + * @param {yfiles.styles.IEdgeStyle} style The style to use for the rendering + * @returns {yfiles.styles.IPathGeometry} The {@link yfiles.styles.VoidPathGeometry#INSTANCE VoidPathGeometry instance}. + * @see yfiles.styles.IEdgeStyleRenderer#getPathGeometry + */ + getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; + /** + * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.view.IVisibilityTestable} + */ + getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; + /** + * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. + * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; + /** + * The {@link yfiles.styles.VoidEdgeStyleRenderer} singleton. + * @const + * @static + * @type {yfiles.styles.IEdgeStyleRenderer} + */ + static INSTANCE:yfiles.styles.IEdgeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A void implementation of the {@link yfiles.styles.IPathGeometry} interface that does nothing and behaves like an empty path. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidPathGeometry#INSTANCE} of this class + * instead of null were null is not allowed. The {@link yfiles.styles.VoidEdgeStyleRenderer} does so for example. + *

+ * @class yfiles.styles.VoidPathGeometry + * @implements {yfiles.styles.IPathGeometry} + * @final + */ + export interface VoidPathGeometry extends Object,yfiles.styles.IPathGeometry{} + export class VoidPathGeometry { + /** + * The {@link yfiles.styles.VoidPathGeometry} singleton. + * @const + * @static + * @type {yfiles.styles.IPathGeometry} + */ + static INSTANCE:yfiles.styles.IPathGeometry; + static $class:yfiles.lang.Class; + } + /** + * Style 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.view.CanvasComponent}. It is up to + * the implementation to interpret the visual appearance of an edge. The framework uses the associated, possibly shared {@link yfiles.styles.IEdgeStyle#renderer} to + * perform the actual rendering of this style for a given edge. This interface extends the {@link yfiles.lang.ICloneable} + * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style + * implementations may return themselves. + *

+ *

+ * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 16 Custom Edge Style
  • + *
+ * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface IEdgeStyle extends Object,yfiles.lang.ICloneable{ + /** + * 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.view.IVisualCreator} implementation for a given style is: + *

+ * @abstract + * @type {yfiles.styles.IEdgeStyleRenderer} + */ + renderer:yfiles.styles.IEdgeStyleRenderer; + } + var IEdgeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.styles.IEdgeStyle} implementations that can be used to query the actual + * {@link yfiles.view.IVisualCreator}, {@link yfiles.view.IVisibilityTestable}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, and + * {@link yfiles.input.IMarqueeTestable} implementations for an edge and an associated style. + *

+ * Implementations of this interface should be designed to be sharable between multiple style instances and should + * therefore not contain style specific state. + *

+ * @see yfiles.styles.IEdgeStyle + * @see yfiles.graph.IEdge + * @see yfiles.styles.INodeStyleRenderer + * @see yfiles.styles.ILabelStyleRenderer + * @see yfiles.styles.IPortStyleRenderer + * @interface + */ + export interface IEdgeStyleRenderer extends Object{ + /** + * Gets an implementation of the {@link yfiles.view.IBoundsProvider} 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.styles.IEdgeStyle} style The style to use for the calculating the painting bounds + * @returns {yfiles.view.IBoundsProvider} An implementation that may be used to subsequently query the edge'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 + * @abstract + */ + getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; + /** + * Gets a temporary context instance that can be used to query additional information for the edge's style. + *

+ * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. + *

+ * @param {yfiles.graph.IEdge} edge The edge to provide a context instance for. + * @param {yfiles.styles.IEdgeStyle} style The style to use for the context. + * @returns {yfiles.graph.ILookup} An non-null lookup implementation. + * @see yfiles.graph.ILookup#EMPTY + * @see yfiles.graph.ILookup + * @abstract + */ + getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; + /** + * Gets an implementation of the {@link yfiles.input.IHitTestable} 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.styles.IEdgeStyle} style The style to use for the querying hit tests + * @returns {yfiles.input.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 edge cannot be hit tested. + * @abstract + */ + getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} 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.styles.IEdgeStyle} style The style to use for the querying marquee intersection test. + * @returns {yfiles.input.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 + * @abstract + */ + getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; + /** + * Gets an implementation of the {@link yfiles.styles.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.styles.IEdgeStyle} style The style to use for the rendering + * @returns {yfiles.styles.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 + * @abstract + */ + getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; + /** + * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} 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.styles.IEdgeStyle} style The style to use for the testing the visibility + * @returns {yfiles.view.IVisibilityTestable} An implementation that may be used to subsequently query the edge'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 + * @abstract + */ + getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; + /** + * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided edge and its associated + * style. + *

+ * This method may return a flyweight implementation, but never null. + *

+ * @param {yfiles.graph.IEdge} edge The edge to provide an instance for + * @param {yfiles.styles.IEdgeStyle} style The style to use for the creation of the visual + * @returns {yfiles.view.IVisualCreator} An implementation that may be used to subsequently create or update the visual for the edge. 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.view.VoidVisualCreator#INSTANCE void} implementation + * instead. + * @see yfiles.view.VoidVisualCreator#INSTANCE + * @abstract + */ + getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; + } + var IEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + 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 + } + /** + * Interface used by the framework mainly for calculating the visible path of an edge. + *

+ * This interface is queried through the {@link yfiles.graph.ILookup#lookup} of {@link yfiles.graph.IPort} instances to calculate the + * visible portion of an edge path. + *

+ *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 18 Edge Cropping
  • + *
+ * @interface + */ + export interface IEdgePathCropper extends Object{ + /** + * Crops the provided path 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.styles.IArrow} arrow The arrow that is used at the end of the edge. + * @param {yfiles.geometry.GeneralPath} path The path to crop. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + * @abstract + */ + cropEdgePath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + } + var IEdgePathCropper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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.styles.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}. + *

+ * @class yfiles.styles.VoidLabelStyle + * @implements {yfiles.styles.ILabelStyle} + * @final + */ + export interface VoidLabelStyle extends Object,yfiles.styles.ILabelStyle{} + export class VoidLabelStyle { + /** + * Returns this. + * @returns {Object} this + */ + clone():Object; + /** + * The singleton instance of this style. + * @const + * @static + * @type {yfiles.styles.ILabelStyle} + */ + static INSTANCE:yfiles.styles.ILabelStyle; + /** + * Yields the {@link yfiles.styles.VoidLabelStyleRenderer#INSTANCE VoidLabelStyleRenderer instance}. + * @see yfiles.styles.ILabelStyle#renderer + * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A void implementation of a label style renderer that does nothing. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidLabelStyleRenderer#INSTANCE} of this + * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.ILabelStyle#renderer} property of an + * {@link yfiles.styles.ILabelStyle}. + *

+ * @class yfiles.styles.VoidLabelStyleRenderer + * @implements {yfiles.styles.ILabelStyleRenderer} + * @final + */ + export interface VoidLabelStyleRenderer extends Object,yfiles.styles.ILabelStyleRenderer{} + export class VoidLabelStyleRenderer { + /** + * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.view.IBoundsProvider} + */ + getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; + /** + * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.graph.ILookup} + */ + getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; + /** + * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.input.IHitTestable} + */ + getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; + /** + * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.input.IMarqueeTestable} + */ + getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; + /** + * Yields {@link yfiles.geometry.Size#EMPTY}. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.geometry.Size} + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; + /** + * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.view.IVisibilityTestable} + */ + getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; + /** + * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; + /** + * The singleton instance of this renderer. + * @const + * @static + * @type {yfiles.styles.ILabelStyleRenderer} + */ + static INSTANCE:yfiles.styles.ILabelStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Style 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.view.CanvasComponent}. It is up + * to the implementation to interpret the visual appearance of a label. The framework uses the associated, possibly shared + * {@link yfiles.styles.ILabelStyle#renderer} to perform the actual rendering of this style for a given label. This interface extends the {@link yfiles.lang.ICloneable} + * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style + * implementations may return themselves. + *

+ *

+ * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 10 Custom Label Style
  • + *
+ * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface ILabelStyle extends Object,yfiles.lang.ICloneable{ + /** + * 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.view.IVisualCreator} implementation for a given style is: + *

+ * @abstract + * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + } + var ILabelStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.styles.ILabelStyle} implementations to query the actual {@link yfiles.view.IVisualCreator}, + * {@link yfiles.view.IVisibilityTestable}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, and {@link yfiles.input.IMarqueeTestable} + * implementations for a label and an associated style. + *

+ * Implementations of this interface should be designed to be sharable between multiple style instances and should + * therefore not contain style specific state. + *

+ * @see yfiles.styles.ILabelStyle + * @see yfiles.graph.ILabel + * @see yfiles.styles.INodeStyleRenderer + * @see yfiles.styles.IEdgeStyleRenderer + * @see yfiles.styles.IPortStyleRenderer + * @interface + */ + export interface ILabelStyleRenderer extends Object{ + /** + * Gets an implementation of the {@link yfiles.view.IBoundsProvider} interface that can handle the provided label and its + * associated style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.ILabel} label The label to provide an instance for + * @param {yfiles.styles.ILabelStyle} style The style to use for the calculating the painting bounds + * @returns {yfiles.view.IBoundsProvider} An implementation that may be used to subsequently query the label'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 + * @abstract + */ + getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; + /** + * Gets a temporary context instance that can be used to query additional information for the label's style. + *

+ * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. + *

+ * @param {yfiles.graph.ILabel} label The label to provide a context instance for. + * @param {yfiles.styles.ILabelStyle} style The style to use for the context. + * @returns {yfiles.graph.ILookup} An non-null lookup implementation. + * @see yfiles.graph.ILookup#EMPTY + * @see yfiles.graph.ILookup + * @abstract + */ + getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; + /** + * Gets an implementation of the {@link yfiles.input.IHitTestable} interface that can handle the provided label and its associated + * style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.ILabel} label The label to provide an instance for + * @param {yfiles.styles.ILabelStyle} style The style to use for the querying hit tests + * @returns {yfiles.input.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 label cannot be hit tested. + * @abstract + */ + getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} interface that can handle the provided label and its + * associated style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.ILabel} label The label to provide an instance for + * @param {yfiles.styles.ILabelStyle} style The style to use for the querying marquee intersection test. + * @returns {yfiles.input.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 + * @abstract + */ + getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; + /** + * 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.styles.ILabelStyle} style The style instance that uses this instance as its {@link yfiles.styles.ILabelStyle#renderer} + * @returns {yfiles.geometry.Size} A size that can be used as the {@link yfiles.graph.ILabel#preferredSize} if this renderer renders the label using the associated style. + * @abstract + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; + /** + * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} interface that can handle the provided label and its + * associated style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.ILabel} label The label to provide an instance for + * @param {yfiles.styles.ILabelStyle} style The style to use for the testing the visibility + * @returns {yfiles.view.IVisibilityTestable} An implementation that may be used to subsequently query the label'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 + * @abstract + */ + getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; + /** + * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided label and its associated + * style. + *

+ * This method may return a flyweight implementation, but never null. + *

+ * @param {yfiles.graph.ILabel} label The label to provide an instance for + * @param {yfiles.styles.ILabelStyle} style The style to use for the creation of the visual + * @returns {yfiles.view.IVisualCreator} An implementation that may be used to subsequently create or update the visual for the label. 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.view.VoidVisualCreator#INSTANCE void} implementation + * instead. + * @see yfiles.view.VoidVisualCreator#INSTANCE + * @abstract + */ + getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; + } + var ILabelStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A void implementation of the {@link yfiles.styles.IShapeGeometry} interface that does nothing and behaves like an empty + * geometry. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidShapeGeometry#INSTANCE} of this + * class instead of null were null is not allowed. The {@link yfiles.styles.VoidNodeStyleRenderer} does so for example. + *

+ * @class yfiles.styles.VoidShapeGeometry + * @implements {yfiles.styles.IShapeGeometry} + * @final + */ + export interface VoidShapeGeometry extends Object,yfiles.styles.IShapeGeometry{} + export class VoidShapeGeometry { + /** + * This implementation always returns null (a {@link T} with no value). + * @param {yfiles.geometry.Point} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.Point} outer The second point of the line that is outside the shape. + * @returns {yfiles.geometry.Point} A {@link T} with no value. + * @see yfiles.styles.IShapeGeometry#getIntersection + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * This implementation returns an empty path. + *

+ * This means that the outline never intersects any line or contains any point. + *

+ * @returns {yfiles.geometry.GeneralPath} The empty path. + * @see yfiles.styles.IShapeGeometry#getOutline + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * This implementation always returns false. + * @param {yfiles.geometry.Point} location The point to test. + * @returns {boolean} false + * @see yfiles.styles.IShapeGeometry#isInside + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * The {@link yfiles.styles.VoidShapeGeometry} singleton. + * @const + * @static + * @type {yfiles.styles.IShapeGeometry} + */ + static INSTANCE:yfiles.styles.IShapeGeometry; + static $class:yfiles.lang.Class; + } + /** + * 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.styles.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}. + *

+ * @class yfiles.styles.VoidNodeStyle + * @implements {yfiles.styles.INodeStyle} + * @final + */ + export interface VoidNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class VoidNodeStyle { + /** + * Returns this. + * @returns {Object} this + */ + clone():Object; + /** + * The {@link yfiles.styles.VoidNodeStyle} singleton. + * @const + * @static + * @type {yfiles.styles.INodeStyle} + */ + static INSTANCE:yfiles.styles.INodeStyle; + /** + * Yields the {@link yfiles.styles.VoidNodeStyleRenderer#INSTANCE VoidNodeStyleRenderer instance}. + * @see yfiles.styles.INodeStyle#renderer + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A void implementation of a node style renderer that does nothing. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidNodeStyleRenderer#INSTANCE} of this + * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.INodeStyle#renderer} property of an + * {@link yfiles.styles.INodeStyle}. + *

+ * @class yfiles.styles.VoidNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @final + */ + export interface VoidNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer{} + export class VoidNodeStyleRenderer { + /** + * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.view.IBoundsProvider} + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.graph.ILookup} + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.input.IHitTestable} + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.input.IMarqueeTestable} + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * This implementation always returns the {@link yfiles.styles.VoidShapeGeometry#INSTANCE VoidShapeGeometry instance}. + * @param {yfiles.graph.INode} node The node to provide an instance for + * @param {yfiles.styles.INodeStyle} style The style to use for the rendering + * @returns {yfiles.styles.IShapeGeometry} The {@link yfiles.styles.VoidShapeGeometry#INSTANCE VoidShapeGeometry instance}. + * @see yfiles.styles.INodeStyleRenderer#getShapeGeometry + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.view.IVisibilityTestable} + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * The {@link yfiles.styles.VoidNodeStyleRenderer} singleton. + * @const + * @static + * @type {yfiles.styles.INodeStyleRenderer} + */ + static INSTANCE:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Style 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.view.CanvasComponent}. It is up to + * the implementation to interpret the visual appearance of a node. The framework uses the associated, possibly shared {@link yfiles.styles.INodeStyle#renderer} to + * perform the actual rendering of this style for a given node. This interface extends the {@link yfiles.lang.ICloneable} + * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style + * implementations may return themselves. + *

+ *

+ * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 01 Custom Node Style
  • + *
+ * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface INodeStyle extends Object,yfiles.lang.ICloneable{ + /** + * 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.view.IVisualCreator} implementation for a given style is: + *

+ * @abstract + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + } + var INodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.styles.INodeStyle} implementations that can be used to query the actual + * {@link yfiles.view.IVisualCreator}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, and {@link yfiles.input.IMarqueeTestable} + * implementations for a node and an associated style. + *

+ * Implementations of this interface should be designed to be sharable between multiple style instances and should + * therefore not contain style specific state. + *

+ * @see yfiles.styles.INodeStyle + * @see yfiles.graph.INode + * @see yfiles.styles.IEdgeStyleRenderer + * @see yfiles.styles.ILabelStyleRenderer + * @see yfiles.styles.IPortStyleRenderer + * @interface + */ + export interface INodeStyleRenderer extends Object{ + /** + * Gets an implementation of the {@link yfiles.view.IBoundsProvider} 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.styles.INodeStyle} style The style to use for the calculating the painting bounds + * @returns {yfiles.view.IBoundsProvider} An implementation that may be used to subsequently query the node'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 + * @abstract + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Gets a temporary context instance that can be used to query additional information for the node's style. + *

+ * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. + *

+ * @param {yfiles.graph.INode} node The node to provide a context instance for. + * @param {yfiles.styles.INodeStyle} style The style to use for the context. + * @returns {yfiles.graph.ILookup} An non-null lookup implementation. + * @see yfiles.graph.ILookup#EMPTY + * @see yfiles.graph.ILookup + * @abstract + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Gets an implementation of the {@link yfiles.input.IHitTestable} 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.styles.INodeStyle} style The style to use for the querying hit tests + * @returns {yfiles.input.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 node cannot be hit tested. + * @abstract + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} 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.styles.INodeStyle} style The style to use for the querying marquee intersection test. + * @returns {yfiles.input.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 + * @abstract + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * Gets an implementation of the {@link yfiles.styles.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.styles.INodeStyle} style The style to use for the rendering + * @returns {yfiles.styles.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 + * @abstract + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} 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.styles.INodeStyle} style The style to use for the testing the visibility + * @returns {yfiles.view.IVisibilityTestable} An implementation that may be used to subsequently query the node'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 + * @abstract + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided node and its associated + * style. + *

+ * This method may return a flyweight implementation, but never null. + *

+ * @param {yfiles.graph.INode} node The node to provide an instance for + * @param {yfiles.styles.INodeStyle} style The style to use for the creation of the visual + * @returns {yfiles.view.IVisualCreator} An implementation that may be used to subsequently create or update the visual for the node. 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.view.VoidVisualCreator#INSTANCE void} implementation + * instead. + * @see yfiles.view.VoidVisualCreator#INSTANCE + * @abstract + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + } + var INodeStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is used mainly by {@link yfiles.styles.IEdgeStyleRenderer} implementations to reveal geometric details about the + * visualization of an edge's path. + * @interface + */ + export interface IPathGeometry extends Object{ + /** + * Returns a representation of the visible path of the edge in form of a {@link yfiles.geometry.GeneralPath} + * @returns {yfiles.geometry.GeneralPath} An instance that describes the visible path or null if this is not applicable for the current geometry. + * @abstract + */ + getPath():yfiles.geometry.GeneralPath; + /** + * Returns the number of "segments" this edge's path consists of. + * @returns {number} the number of segments or -1 if there is no such thing as a segment for this edge. + * @abstract + */ + getSegmentCount():number; + /** + * Calculates the tangent on the edge's path at the given ratio point for the given segment. + * @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 + * @returns {yfiles.geometry.Tangent} The tangential line, if any exists. + * @see yfiles.styles.IPathGeometry#getTangent + * @see yfiles.styles.IPathGeometry#getSegmentCount + * @abstract + */ + getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; + /** + * Calculates the tangent on the edge's path at the given ratio point. + * @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 + * @returns {yfiles.geometry.Tangent} The tangential line, if any exists. + * @abstract + */ + getTangent(ratio:number):yfiles.geometry.Tangent; + } + var IPathGeometry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A void implementation of a port style renderer that does nothing. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidPortStyleRenderer#INSTANCE} of this + * class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IPortStyle#renderer} property of an + * {@link yfiles.styles.IPortStyle}. + *

+ * @class yfiles.styles.VoidPortStyleRenderer + * @implements {yfiles.styles.IPortStyleRenderer} + * @final + */ + export interface VoidPortStyleRenderer extends Object,yfiles.styles.IPortStyleRenderer{} + export class VoidPortStyleRenderer { + /** + * Yields the {@link yfiles.view.IBoundsProvider#EMPTY} that will return empty bounds. + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + * @returns {yfiles.view.IBoundsProvider} + */ + getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; + /** + * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + * @returns {yfiles.graph.ILookup} + */ + getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; + /** + * Yields the {@link yfiles.input.IHitTestable#NEVER} that will always report misses. + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + * @returns {yfiles.input.IHitTestable} + */ + getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; + /** + * Yields the {@link yfiles.input.IMarqueeTestable#NEVER} that will always report misses. + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + * @returns {yfiles.input.IMarqueeTestable} + */ + getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; + /** + * Yields the {@link yfiles.view.IVisibilityTestable#NEVER} that will always claim invisibility. + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + * @returns {yfiles.view.IVisibilityTestable} + */ + getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; + /** + * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. + * @param {yfiles.graph.IPort} port + * @param {yfiles.styles.IPortStyle} style + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; + /** + * The {@link yfiles.styles.VoidPortStyleRenderer} singleton. + * @const + * @static + * @type {yfiles.styles.IPortStyleRenderer} + */ + static INSTANCE:yfiles.styles.IPortStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * 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.styles.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}. + *

+ * @class yfiles.styles.VoidPortStyle + * @implements {yfiles.styles.IPortStyle} + * @final + */ + export interface VoidPortStyle extends Object,yfiles.styles.IPortStyle{} + export class VoidPortStyle { + /** + * Returns this. + * @returns {Object} this + */ + clone():Object; + /** + * The {@link yfiles.styles.VoidPortStyle} singleton. + * @const + * @static + * @type {yfiles.styles.IPortStyle} + */ + static INSTANCE:yfiles.styles.IPortStyle; + /** + * Yields the {@link yfiles.styles.VoidPortStyleRenderer#INSTANCE VoidPortStyleRenderer instance}. + * @see yfiles.styles.IPortStyle#renderer + * @type {yfiles.styles.IPortStyleRenderer} + */ + renderer:yfiles.styles.IPortStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Style 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.view.CanvasComponent}. It is up to + * the implementation to interpret the visual appearance of a port. The framework uses the associated, possibly shared {@link yfiles.styles.IPortStyle#renderer} to + * perform the actual rendering of this style for a given port. This interface extends the {@link yfiles.lang.ICloneable} + * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style + * implementations may return themselves. + *

+ *

+ * Working with styles (and their style renderers) is explained in detail in the section {@link @DGUIDE_PREFIX@/view_visualization-graph-elements.html Visualization of Graph Elements}. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 22 Custom Ports
  • + *
+ * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface IPortStyle extends Object,yfiles.lang.ICloneable{ + /** + * 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.view.IVisualCreator} implementation for a given style is: + *

+ * @abstract + * @type {yfiles.styles.IPortStyleRenderer} + */ + renderer:yfiles.styles.IPortStyleRenderer; + } + var IPortStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.styles.IPortStyle} implementations that can be used to query the actual + * {@link yfiles.view.IVisualCreator}, {@link yfiles.view.IBoundsProvider}, {@link yfiles.input.IHitTestable}, {@link yfiles.view.IVisibilityTestable}, and + * {@link yfiles.input.IMarqueeTestable} implementations for a port and an associated style. + *

+ * Implementations of this interface should be designed to be sharable between multiple style instances and should + * therefore not contain style specific state. + *

+ * @see yfiles.styles.IPortStyle + * @see yfiles.graph.IPort + * @see yfiles.styles.INodeStyleRenderer + * @see yfiles.styles.IEdgeStyleRenderer + * @see yfiles.styles.ILabelStyleRenderer + * @interface + */ + export interface IPortStyleRenderer extends Object{ + /** + * Gets an implementation of the {@link yfiles.view.IBoundsProvider} interface that can handle the provided port and its associated + * style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.IPort} port The port to provide an instance for + * @param {yfiles.styles.IPortStyle} style The style to use for the calculating the painting bounds + * @returns {yfiles.view.IBoundsProvider} An implementation that may be used to subsequently query the port'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 + * @abstract + */ + getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; + /** + * Gets a temporary context instance that can be used to query additional information for the port's style. + *

+ * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. + *

+ * @param {yfiles.graph.IPort} port The port to provide a context instance for. + * @param {yfiles.styles.IPortStyle} style The style to use for the context. + * @returns {yfiles.graph.ILookup} An non-null lookup implementation. + * @see yfiles.graph.ILookup#EMPTY + * @see yfiles.graph.ILookup + * @abstract + */ + getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; + /** + * Gets an implementation of the {@link yfiles.input.IHitTestable} interface that can handle the provided port and its associated + * style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.IPort} port The port to provide an instance for + * @param {yfiles.styles.IPortStyle} style The style to use for the querying hit tests + * @returns {yfiles.input.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 port cannot be hit tested. + * @abstract + */ + getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.input.IMarqueeTestable} interface that can handle the provided port and its + * associated style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.IPort} port The port to provide an instance for + * @param {yfiles.styles.IPortStyle} style The style to use for the querying marquee intersection test. + * @returns {yfiles.input.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 + * @abstract + */ + getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; + /** + * Gets an implementation of the {@link yfiles.view.IVisibilityTestable} interface that can handle the provided port and its + * associated style. + *

+ * This method may return a flyweight implementation. + *

+ * @param {yfiles.graph.IPort} port The port to provide an instance for + * @param {yfiles.styles.IPortStyle} style The style to use for the testing the visibility + * @returns {yfiles.view.IVisibilityTestable} An implementation that may be used to subsequently query the port'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 + * @abstract + */ + getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; + /** + * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided port and its associated + * style. + *

+ * This method may return a flyweight implementation, but never null. + *

+ * @param {yfiles.graph.IPort} port The port to provide an instance for + * @param {yfiles.styles.IPortStyle} style The style to use for the creation of the visual + * @returns {yfiles.view.IVisualCreator} An implementation that may be used to subsequently create or update the visual for the port. 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.view.VoidVisualCreator#INSTANCE void} implementation + * instead. + * @see yfiles.view.VoidVisualCreator#INSTANCE + * @abstract + */ + getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; + } + var IPortStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that describes the geometry of a shape which has an interior and an exterior. + *

Related demos:

+ *
    + *
  • Tutorial: 02 Custom Styles, step 04 IsInside
  • + *
  • Tutorial: 02 Custom Styles, step 06 GetBounds
  • + *
+ * @interface + */ + export interface IShapeGeometry extends Object{ + /** + * Returns the intersection for the given line with this shape's geometry. + * @param {yfiles.geometry.Point} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.Point} outer The second point of the line that is outside the shape. + * @returns {yfiles.geometry.Point} The coordinates of the intersection point, if an intersection was found. + * @abstract + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Returns the outline of the shape or null. + * @returns {yfiles.geometry.GeneralPath} The outline or null if no outline can be provided. + * @abstract + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. + * @param {yfiles.geometry.Point} location The point to test. + * @returns {boolean} True if the point lies within the shape. + * @abstract + */ + isInside(location:yfiles.geometry.Point):boolean; + } + var IShapeGeometry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.view.IVisualCreator} for use in a {@link yfiles.view.CanvasComponent} that renders a {@link yfiles.graph.IGraph} instance in a + * sloppy overview style. + * @class yfiles.styles.GraphOverviewSvgVisualCreator + * @implements {yfiles.view.IVisualCreator} + */ + export interface GraphOverviewSvgVisualCreator extends Object,yfiles.view.IVisualCreator{} + export class GraphOverviewSvgVisualCreator { + /** + * Creates a new instance for the given graph. + * @param {yfiles.graph.IGraph} graph + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * Callback that returns and/or configures a edge style for the given edge to render. + * @param {yfiles.graph.IEdge} edge The edge to render. + * @returns {yfiles.styles.IEdgeStyle} The style or null + * @protected + */ + getEdgeStyle(edge:yfiles.graph.IEdge):yfiles.styles.IEdgeStyle; + /** + * Obtains the {@link yfiles.view.IVisualCreator} for the given edge. + * @param {yfiles.view.IRenderContext} context The context. + * @param {yfiles.graph.IEdge} edge The edge. + * @returns {yfiles.view.IVisualCreator} The visual creator that is obtained from the {@link yfiles.styles.GraphOverviewSvgVisualCreator#getEdgeStyle}'s {@link yfiles.styles.IEdgeStyleRenderer#getVisualCreator} + * method. + * @protected + */ + getEdgeVisualCreator(context:yfiles.view.IRenderContext,edge:yfiles.graph.IEdge):yfiles.view.IVisualCreator; + /** + * 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. + * @returns {yfiles.styles.INodeStyle} The style or null + * @protected + */ + getGroupNodeStyle(node:yfiles.graph.INode):yfiles.styles.INodeStyle; + /** + * Obtains the {@link yfiles.view.IVisualCreator} for the given group node. + * @param {yfiles.view.IRenderContext} context The context. + * @param {yfiles.graph.INode} node The group node. + * @returns {yfiles.view.IVisualCreator} The visual creator that is obtained from the {@link yfiles.styles.GraphOverviewSvgVisualCreator#getGroupNodeStyle}'s {@link yfiles.styles.INodeStyleRenderer#getVisualCreator} + * method. + * @protected + */ + getGroupNodeVisualCreator(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.IVisualCreator; + /** + * Callback that returns and/or configures a node style for the given node to render. + * @param {yfiles.graph.INode} node The node to render. + * @returns {yfiles.styles.INodeStyle} The style or null + * @protected + */ + getNodeStyle(node:yfiles.graph.INode):yfiles.styles.INodeStyle; + /** + * Obtains the {@link yfiles.view.IVisualCreator} for the given node. + * @param {yfiles.view.IRenderContext} context The context. + * @param {yfiles.graph.INode} node The node. + * @returns {yfiles.view.IVisualCreator} The visual creator that is obtained from the {@link yfiles.styles.GraphOverviewSvgVisualCreator#getNodeStyle}'s {@link yfiles.styles.INodeStyleRenderer#getVisualCreator} + * method. + * @protected + */ + getNodeVisualCreator(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.IVisualCreator; + /** + * Gets or sets the overview node style. + * @type {yfiles.styles.INodeStyle} + */ + nodeStyle:yfiles.styles.INodeStyle; + /** + * Gets or sets the overview group node style. + * @type {yfiles.styles.INodeStyle} + */ + groupNodeStyle:yfiles.styles.INodeStyle; + /** + * Gets or sets the overview edge style. + * @type {yfiles.styles.IEdgeStyle} + */ + edgeStyle:yfiles.styles.IEdgeStyle; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IEdgeStyle}. + *

+ * The only method that needs to be implemented by subclasses is {@link yfiles.styles.EdgeStyleBase#createVisual}, however to + * improve rendering performance it is highly recommended to implement at least + * {@link yfiles.styles.EdgeStyleBase#updateVisual}, too. + *

+ *

+ * This implementation differs from the straightforward {@link yfiles.styles.IEdgeStyle} implementation in that there is no visible + * separation between the style and its + * {@link yfiles.styles.IEdgeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to + * the style instance. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 16 Custom Edge Style
  • + *
  • Tutorial: 02 Custom Styles, step 17 Edge Hit Test
  • + *
  • Tutorial: 02 Custom Styles, step 18 Edge Cropping
  • + *
+ * @class yfiles.styles.EdgeStyleBase + * @implements {yfiles.styles.IEdgeStyle} + */ + export interface EdgeStyleBase extends Object,yfiles.styles.IEdgeStyle{} + export class EdgeStyleBase { + /** + * Initializes a new instance of the {@link yfiles.styles.EdgeStyleBase} class. + * @protected + * @constructor + */ + constructor(); + /** + * Convenience method that adds the arrows to a given container. + * @param {yfiles.view.IRenderContext} context The context for the rendering. + * @param {SVGGElement} group The container to which the arrows should be added. + * @param {yfiles.graph.IEdge} edge The edge that is being rendered. + * @param {yfiles.geometry.GeneralPath} edgePath The edge path. + * @param {yfiles.styles.IArrow} sourceArrow The source arrow. + * @param {yfiles.styles.IArrow} targetArrow The target arrow. + * @protected + */ + addArrows(context:yfiles.view.IRenderContext,group:SVGGElement,edge:yfiles.graph.IEdge,edgePath:yfiles.geometry.GeneralPath,sourceArrow:yfiles.styles.IArrow,targetArrow:yfiles.styles.IArrow):void; + /** + * Creates a new object that is a copy of the current instance. + *

+ * Immutable subclasses should consider returning this. + *

+ * @returns {Object} A new object that is a copy of this instance using {@link Object#memberwiseClone}. + */ + clone():Object; + /** + * Callback that creates the visual. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been + * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.EdgeStyleBase#updateVisual + * @protected + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext,edge:yfiles.graph.IEdge):yfiles.view.Visual; + /** + * Convenience method that crops the edge's path at the nodes. + *

+ * This implementation uses the {@link yfiles.styles.IEdgePathCropper} instances found in the {@link yfiles.graph.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.geometry.GeneralPath} path The path that should be cropped. + * @param {yfiles.styles.IArrow} sourceArrow The source arrow instance. + * @param {yfiles.styles.IArrow} targetArrow The target arrow instance. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + * @protected + */ + cropPath(edge:yfiles.graph.IEdge,sourceArrow:yfiles.styles.IArrow,targetArrow:yfiles.styles.IArrow,path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + /** + * Gets the bounds of the visual for the edge in the given context. + *

+ * This method is called in response to a {@link yfiles.view.IBoundsProvider#getBounds} call to the instance that has been queried + * from the {@link yfiles.styles.EdgeStyleBase#renderer}. This implementation simply yields a {@link yfiles.geometry.Rect 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.view.ICanvasContext} context The canvas context. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @returns {yfiles.geometry.Rect} The visual bounds of the visual representation. + * @protected + */ + getBounds(context:yfiles.view.ICanvasContext,edge:yfiles.graph.IEdge):yfiles.geometry.Rect; + /** + * Gets the path of the edge. + * @param {yfiles.graph.IEdge} edge The edge. + * @returns {yfiles.geometry.GeneralPath} The path. + * @protected + */ + getPath(edge:yfiles.graph.IEdge):yfiles.geometry.GeneralPath; + /** + * Gets the number of segments of the edge. + * @param {yfiles.graph.IEdge} edge The edge. + * @returns {number} The segment count. + * @protected + */ + getSegmentCount(edge:yfiles.graph.IEdge):number; + /** + * Convenience method that calculates the source arrow anchor and direction for a a given arrow and path. + * @param {yfiles.geometry.GeneralPath} path The path of the edge. + * @param {yfiles.styles.IArrow} arrow The arrow. + * @returns {yfiles.geometry.Tangent} The anchor and directional vector of the arrow, if any exist. + * @protected + */ + getSourceArrowAnchor(path:yfiles.geometry.GeneralPath,arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; + /** + * 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. + * @returns {yfiles.geometry.Tangent} The tangent, if any exists. + * @protected + */ + getTangent(edge:yfiles.graph.IEdge,segmentIndex:number,ratio:number):yfiles.geometry.Tangent; + /** + * 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. + * @returns {yfiles.geometry.Tangent} The tangent, if any exists. + * @protected + */ + getTangent(edge:yfiles.graph.IEdge,ratio:number):yfiles.geometry.Tangent; + /** + * Convenience method that calculates the target arrow anchor and direction for a a given arrow and path. + * @param {yfiles.geometry.GeneralPath} path The path of the edge. + * @param {yfiles.styles.IArrow} arrow The arrow. + * @returns {yfiles.geometry.Tangent} The anchor and directional vector of the arrow, if any exist. + * @protected + */ + getTargetArrowAnchor(path:yfiles.geometry.GeneralPath,arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; + /** + * 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.input.IHitTestable#isHit} call to the instance that has been queried from + * the {@link yfiles.styles.EdgeStyleBase#renderer}. + *

+ *

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

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} location The point to test. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @returns {boolean} true if the specified edge representation is hit; false otherwise. + * @see yfiles.geometry.Point#hitsPolyline + * @protected + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,edge:yfiles.graph.IEdge):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.input.IMarqueeTestable#isInBox} call to the instance that has been queried + * from the {@link yfiles.styles.EdgeStyleBase#renderer}. + *

+ *

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

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} rectangle The marquee selection box. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @returns {boolean} true if the specified edge is visible is selected by the marquee rectangle; false otherwise. + * @protected + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,edge:yfiles.graph.IEdge):boolean; + /** + * Determines whether the visualization for the specified edge is visible in the context. + *

+ * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been + * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.EdgeStyleBase#getBounds bounds} intersect the clip. + *

+ * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.geometry.Rect} rectangle The clipping rectangle. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @returns {boolean} true if the specified edge is visible in the clipping rectangle; false otherwise. + * @protected + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,edge:yfiles.graph.IEdge):boolean; + /** + * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IEdgeStyleRenderer#getContext} that has been + * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. + *

+ * This implementation yields null for everything but: + *

+ *
    + *
  • {@link yfiles.input.IHitTestable}
  • + *
  • {@link yfiles.view.IVisualCreator}
  • + *
  • {@link yfiles.view.IBoundsProvider}
  • + *
  • {@link yfiles.view.IVisibilityTestable}
  • + *
  • {@link yfiles.input.IMarqueeTestable}
  • + *
  • {@link yfiles.graph.ILookup}
  • + *
  • {@link yfiles.styles.IPathGeometry}
  • + *
+ *

+ * 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. + * @returns {Object} An implementation of the type or null. + * @protected + */ + lookup(edge:yfiles.graph.IEdge,type:yfiles.lang.Class):Object; + /** + * Convenience method that updates the arrows in a given container. + * @param {yfiles.view.IRenderContext} context The context for the rendering. + * @param {SVGGElement} group The container to which the arrows should be added. + * @param {yfiles.graph.IEdge} edge The edge that is being rendered. + * @param {yfiles.geometry.GeneralPath} edgePath The edge path. + * @param {yfiles.styles.IArrow} sourceArrow The source arrow. + * @param {yfiles.styles.IArrow} targetArrow The target arrow. + * @protected + */ + updateArrows(context:yfiles.view.IRenderContext,group:SVGGElement,edge:yfiles.graph.IEdge,edgePath:yfiles.geometry.GeneralPath,sourceArrow:yfiles.styles.IArrow,targetArrow:yfiles.styles.IArrow):void; + /** + * Callback that updates the visual previously created by {@link yfiles.styles.EdgeStyleBase#createVisual}. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been + * queried from the {@link yfiles.styles.EdgeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.EdgeStyleBase#createVisual} so subclasses should + * override to improve rendering performance. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.view.Visual} oldVisual The visual that has been created in the call to {@link yfiles.styles.EdgeStyleBase#createVisual}. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.EdgeStyleBase#createVisual + * @protected + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,edge:yfiles.graph.IEdge):yfiles.view.Visual; + /** + * Gets the renderer implementation for this instance. + *

+ * The private implementation will delegate all API calls back to this instance. + *

+ * @type {yfiles.styles.IEdgeStyleRenderer} + */ + renderer:yfiles.styles.IEdgeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Decorates an arbitrary node styles with an additional collapse/expand handle. + *

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

+ *

+ * By default, this handle is rendered as a plus ("+") sign when in collapsed state, and a minus ("-") sign when in + * expanded state. + *

+ *

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

+ * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer + * @class yfiles.styles.CollapsibleNodeStyleDecorator + * @implements {yfiles.styles.INodeStyle} + */ + export interface CollapsibleNodeStyleDecorator extends Object,yfiles.styles.INodeStyle{} + export class CollapsibleNodeStyleDecorator { + /** + * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecorator} class using the provided style for the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} + * property and the provided {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} as renderer. + * @param {yfiles.styles.INodeStyle} wrapped The decorated style. + * @param {yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} [renderer=null] An instance of {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} to render this style. + * @constructor + */ + constructor(wrapped:yfiles.styles.INodeStyle,renderer?:yfiles.styles.CollapsibleNodeStyleDecoratorRenderer); + /** + * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecorator} class using the provided style for the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} + * property and the provided {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} as renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.wrapped The decorated style. + * @param {yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} [options.renderer=null] An instance of {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} to render this style. + * @param {yfiles.graph.ILabelModelParameter} options.buttonPlacement An {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the expanded state. + *

+ * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#buttonPlacement} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets to use for the {@link yfiles.input.INodeInsetsProvider} that will be reported by the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.graph.ILookup}. + *

+ * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#insets} property on the created object. + *

+ * @constructor + */ + constructor(options:{wrapped:yfiles.styles.INodeStyle,renderer?:yfiles.styles.CollapsibleNodeStyleDecoratorRenderer,buttonPlacement?:yfiles.graph.ILabelModelParameter,insets?:yfiles.geometry.Insets}); + /** + * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecorator} class. + *

+ * The {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} property will be initialized with a {@link yfiles.styles.ShapeNodeStyle}. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.graph.ILabelModelParameter} options.buttonPlacement An {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the expanded state. + *

+ * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#buttonPlacement} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets to use for the {@link yfiles.input.INodeInsetsProvider} that will be reported by the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.graph.ILookup}. + *

+ * This option sets the {@link yfiles.styles.CollapsibleNodeStyleDecorator#insets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{buttonPlacement?:yfiles.graph.ILabelModelParameter,insets?:yfiles.geometry.Insets}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets 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. + *

+ * @default 'yWorks.yFiles.UI.LabelModels.InteriorLabelModel.NorthWest' + * @type {yfiles.graph.ILabelModelParameter} + */ + buttonPlacement:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the insets to use for the {@link yfiles.input.INodeInsetsProvider} that will be reported by the + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.graph.ILookup}. + *

+ * This effectively influences the way the bounds of a group node are being calculated. The default {@link yfiles.graph.IGroupBoundsCalculator} + * implementation will use these insets to determine the minimum size of a group node given a set of contained nodes. + *

+ * @default '5, 16, 5, 5' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + /** + * Gets or sets the wrapped node style that will be used to perform the actual rendering of the node. + * @type {yfiles.styles.INodeStyle} + */ + wrapped:yfiles.styles.INodeStyle; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.styles.INodeStyleRenderer} implementation that can be used in conjunction with {@link yfiles.styles.CollapsibleNodeStyleDecorator} + * instances. + * @class yfiles.styles.CollapsibleNodeStyleDecoratorRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface CollapsibleNodeStyleDecoratorRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class CollapsibleNodeStyleDecoratorRenderer { + /** + * Initializes a new instance of the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer} class. + * @constructor + */ + constructor(); + /** + * Adds the toggle expansion state command to the given button visual. + *

+ * This method adds event listeners for click and tap events to the given button visual that execute + * {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE}. It is called by + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createButton}. + *

+ * @param {yfiles.view.SvgVisual} 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.view.IRenderContext} context The context. + * @static + */ + static addToggleExpansionStateCommand(button:yfiles.view.SvgVisual,currentNode:yfiles.graph.INode,context:yfiles.view.IRenderContext):void; + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} and {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} properies have been populated by the + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getVisualCreator}, + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getBoundsProvider}, + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getHitTestable}, or {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * Creates the button visual. + *

+ * This method is called from {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createVisual} to create the button. Custom + * implementations can override this method to use a custom button visualization. + *

+ *

+ * This implementation adds the {@link yfiles.input.ICommand#TOGGLE_EXPANSION_STATE} command to the button. The created button is + * automatically unchecked if the group node is {@link yfiles.graph.IFoldingView#isExpanded expanded} and vice versa. + *

+ * @param {yfiles.view.IRenderContext} context The context. + * @param {boolean} expanded Specifies whether the button visual is created for the expanded or the collapsed state. + * @param {yfiles.geometry.Size} size The button size. + * @returns {yfiles.view.SvgVisual} + * @protected + */ + createButton(context:yfiles.view.IRenderContext,expanded:boolean,size:yfiles.geometry.Size):yfiles.view.SvgVisual; + /** + * Callback that provides a customized {@link yfiles.view.ISelectionIndicatorInstaller}. + * @returns {yfiles.view.ISelectionIndicatorInstaller} This implementation yields a {@link yfiles.view.RectangleIndicatorInstaller} that uses + * {@link yfiles.view.RectangleIndicatorInstaller#SELECTION_TEMPLATE_KEY}. + * @protected + */ + createSelectionInstaller():yfiles.view.ISelectionIndicatorInstaller; + /** + * Creates the visual for the given context. + *

+ * This method uses {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createButton} to create the togglebutton instance. + * It will then use the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getButtonLocationParameter} to determine the + * placement of the button and use the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} to create the + * visual for the actual node. + *

+ * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} and takes the button into account. + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and + * returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Yields the {@link yfiles.styles.CollapsibleNodeStyleDecorator#buttonPlacement} for the current {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} + * @returns {yfiles.graph.ILabelModelParameter} + * @protected + */ + getButtonLocationParameter():yfiles.graph.ILabelModelParameter; + /** + * Returns the size of new buttons. + * @returns {yfiles.geometry.Size} The size of new buttons + * @protected + */ + getButtonSize():yfiles.geometry.Size; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and + * returns this. + *

+ * As this method may be called often it will not automatically call + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure}, instead subclasses should ensure that in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#lookup} + * method call they should call {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} only if needed, i.e. if they + * decide to return this or an instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and + * returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and + * returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Configures the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} and {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} properties, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#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.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isInside + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and + * returns this. + *

+ * Unlike most of the other methods this implementation does not call + * {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure}. If the subclass implementation depends on this instance + * to be configured, it needs to call Configure in {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#configure} and + * returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#createVisual + * @see yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * Yields the {@link yfiles.styles.CollapsibleNodeStyleDecorator#wrapped} property for the current {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#style} + * @returns {yfiles.styles.INodeStyle} + * @protected + */ + getWrappedStyle():yfiles.styles.INodeStyle; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} and checks the button. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * Delegates to the {@link yfiles.styles.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Updates the button visual. + *

+ * This method is called from {@link yfiles.styles.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.view.IRenderContext} context The context. + * @param {boolean} expanded Specifies whether the button visual is updated for the expanded or the collapsed state. + * @param {yfiles.geometry.Size} size The button size. + * @param {yfiles.view.Visual} oldButton The old button visual. + * @returns {yfiles.view.SvgVisual} + * @protected + */ + updateButton(context:yfiles.view.IRenderContext,expanded:boolean,size:yfiles.geometry.Size,oldButton:yfiles.view.Visual):yfiles.view.SvgVisual; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.CollapsibleNodeStyleDecorator} + */ + style:yfiles.styles.CollapsibleNodeStyleDecorator; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.ILabelStyle}. + *

+ * Only {@link yfiles.styles.LabelStyleBase#createVisual} and {@link yfiles.styles.LabelStyleBase#getPreferredSize} need to be implemented + * by subclasses, however to improve rendering performance it is highly recommended to implement at least + * {@link yfiles.styles.LabelStyleBase#updateVisual}, too. + *

+ *

+ * This implementation differs from the straightforward {@link yfiles.styles.ILabelStyle} implementation in that there is no + * visible separation between the style and its + * {@link yfiles.styles.ILabelStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to + * the style instance. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 10 Custom Label Style
  • + *
  • Tutorial: 02 Custom Styles, step 11 Label Preferred Size
  • + *
  • Tutorial: 02 Custom Styles, step 12 High Performance Rendering of Label
  • + *
+ * @class yfiles.styles.LabelStyleBase + * @implements {yfiles.styles.ILabelStyle} + */ + export interface LabelStyleBase extends Object,yfiles.styles.ILabelStyle{} + export class LabelStyleBase { + /** + * Initializes a new instance of the {@link yfiles.styles.LabelStyleBase} class. + * @protected + * @constructor + */ + constructor(); + /** + * Creates a new object that is a copy of the current instance. + *

+ * Immutable subclasses should consider returning this. + *

+ * @returns {Object} A new object that is a copy of this instance using {@link Object#memberwiseClone}. + */ + clone():Object; + /** + * Creates a transform matrix that can be applied to a {@link yfiles.view.Visual} to arrange it according to the given layout and autoFlip + * rule. + * @param {yfiles.geometry.IOrientedRectangle} layout The layout used to create the transform matrix. + * @param {boolean} autoFlip Whether to automatically flip the mtrix by 180 degrees, if the result would be pointing downwards. + * @returns {yfiles.geometry.Matrix} The transform matrix. + * @static + */ + static createLayoutTransform(layout:yfiles.geometry.IOrientedRectangle,autoFlip:boolean):yfiles.geometry.Matrix; + /** + * Callback that creates the visual. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been + * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.LabelStyleBase#updateVisual + * @protected + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.view.Visual; + /** + * Gets the bounds of the visual for the label in the given context. + *

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

+ *

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

+ * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {yfiles.geometry.Rect} The visual bounds of the visual representation. + * @protected + */ + getBounds(context:yfiles.view.ICanvasContext,label:yfiles.graph.ILabel):yfiles.geometry.Rect; + /** + * Callback that returns the preferred {@link yfiles.geometry.Size size} of the label. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {yfiles.geometry.Size} The preferred size. + * @protected + * @abstract + */ + getPreferredSize(label:yfiles.graph.ILabel):yfiles.geometry.Size; + /** + * 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.input.IHitTestable#isHit} call to the instance that has been queried from + * the {@link yfiles.styles.LabelStyleBase#renderer}. + *

+ *

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

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} location The point to test. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {boolean} true if the specified label representation is hit; false otherwise. + * @protected + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,label:yfiles.graph.ILabel):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.input.IMarqueeTestable#isInBox} call to the instance that has been queried + * from the {@link yfiles.styles.LabelStyleBase#renderer}. + *

+ *

+ * This implementation returns the result of the {@link yfiles.geometry.Rect#intersects} method invoked on rectangle for the {@link yfiles.graph.ILabel#layout layout} + * of the label and the context. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} rectangle The marquee selection box. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {boolean} true if the specified label is visible is selected by the marquee rectangle; false otherwise. + * @protected + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,label:yfiles.graph.ILabel):boolean; + /** + * Determines whether the visualization for the specified label is visible in the context. + *

+ * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been + * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. + *

+ *

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

+ * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.geometry.Rect} rectangle The clipping rectangle. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {boolean} true if the specified label is visible in the clipping rectangle; false otherwise. + * @protected + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,label:yfiles.graph.ILabel):boolean; + /** + * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.ILabelStyleRenderer#getContext} that has been + * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. + *

+ * This implementation yields null for everything but: + *

+ *
    + *
  • {@link yfiles.input.IHitTestable}
  • + *
  • {@link yfiles.view.IVisualCreator}
  • + *
  • {@link yfiles.view.IBoundsProvider}
  • + *
  • {@link yfiles.view.IVisibilityTestable}
  • + *
  • {@link yfiles.input.IMarqueeTestable}
  • + *
  • {@link yfiles.graph.ILookup}
  • + *
+ *

+ * 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. + * @returns {Object} An implementation of the type or null. + * @protected + */ + lookup(label:yfiles.graph.ILabel,type:yfiles.lang.Class):Object; + /** + * Callback that updates the visual previously created by {@link yfiles.styles.LabelStyleBase#createVisual}. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been + * queried from the {@link yfiles.styles.LabelStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.LabelStyleBase#createVisual} so subclasses + * should override to improve rendering performance. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.view.Visual} oldVisual The visual that has been created in the call to {@link yfiles.styles.LabelStyleBase#createVisual}. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.LabelStyleBase#createVisual + * @protected + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,label:yfiles.graph.ILabel):yfiles.view.Visual; + /** + * Gets the renderer implementation for this instance. + *

+ * The private implementation will delegate all API calls back to this instance. + *

+ * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.INodeStyle}. + *

+ * The only method that needs to be implemented by subclasses is {@link yfiles.styles.NodeStyleBase#createVisual}, however to + * improve rendering performance it is highly recommended to implement at least + * {@link yfiles.styles.NodeStyleBase#updateVisual}, too. + *

+ *

+ * This implementation differs from the straightforward {@link yfiles.styles.INodeStyle} implementation in that there is no visible + * separation between the style and its + * {@link yfiles.styles.INodeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to + * the style instance. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 01 Custom Node Style
  • + *
  • Tutorial: 02 Custom Styles, step 03 UpdateVisual and RenderDataCache
  • + *
  • Tutorial: 02 Custom Styles, step 05 Hit Test
  • + *
+ * @class yfiles.styles.NodeStyleBase + * @implements {yfiles.styles.INodeStyle} + */ + export interface NodeStyleBase extends Object,yfiles.styles.INodeStyle{} + export class NodeStyleBase { + /** + * Initializes a new instance of the {@link yfiles.styles.NodeStyleBase} class. + * @protected + * @constructor + */ + constructor(); + /** + * Creates a new object that is a copy of the current instance. + *

+ * Immutable subclasses should consider returning this. + *

+ * @returns {Object} A new object that is a copy of this instance using {@link Object#memberwiseClone}. + */ + clone():Object; + /** + * Callback that creates the visual. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been + * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.NodeStyleBase#updateVisual + * @protected + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.Visual; + /** + * Gets the bounds of the visual for the node in the given context. + *

+ * This method is called in response to a {@link yfiles.view.IBoundsProvider#getBounds} call to the instance that has been queried + * from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply yields the {@link yfiles.graph.INode#layout}. + *

+ * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {yfiles.geometry.Rect} The visual bounds of the visual representation. + * @protected + */ + getBounds(context:yfiles.view.ICanvasContext,node:yfiles.graph.INode):yfiles.geometry.Rect; + /** + * Gets the intersection of a line with the visual representation of the node. + *

+ * This method is called in response to a {@link yfiles.styles.IShapeGeometry#getIntersection} call to the instance that has been + * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply uses the {@link yfiles.styles.NodeStyleBase#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.styles.NodeStyleBase#getOutline} to improve performance. + *

+ * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.Point} inner The coordinates of a point lying {@link yfiles.styles.NodeStyleBase#isInside inside} the shape. + * @param {yfiles.geometry.Point} outer The coordinates of a point lying outside the shape. + * @returns {yfiles.geometry.Point} The intersection point if one has been found or null, otherwise. + * @see yfiles.styles.NodeStyleBase#isInside + * @protected + */ + getIntersection(node:yfiles.graph.INode,inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * 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.styles.NodeStyleBase#isInside} and {@link yfiles.styles.NodeStyleBase#getIntersection} since the default + * implementations delegate to it. + *

+ * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {yfiles.geometry.GeneralPath} The outline of the visual representation or null. + * @protected + */ + getOutline(node:yfiles.graph.INode):yfiles.geometry.GeneralPath; + /** + * 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.input.IHitTestable#isHit} call to the instance that has been queried from + * the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation uses the {@link yfiles.styles.NodeStyleBase#getOutline outline} to determine whether the node has been hit. + *

+ * @param {yfiles.input.IInputModeContext} context The canvas context. + * @param {yfiles.geometry.Point} location The point to test. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {boolean} true if the specified node representation is hit; false otherwise. + * @protected + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,node:yfiles.graph.INode):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.input.IMarqueeTestable#isInBox} call to the instance that has been queried + * from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.NodeStyleBase#getBounds bounds} intersect the marquee box. + *

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} rectangle The marquee selection box. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {boolean} true if the specified node is visible is selected by the marquee rectangle; false otherwise. + * @protected + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,node:yfiles.graph.INode):boolean; + /** + * Determines whether the provided point is geometrically inside the visual bounds of the node. + *

+ * This method is called in response to a {@link yfiles.styles.IShapeGeometry#isInside} call to the instance that has been queried + * from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply uses the {@link yfiles.styles.NodeStyleBase#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.styles.NodeStyleBase#getOutline} to improve performance. + *

+ * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.Point} location The point to test. + * @returns {boolean} Whether the point is considered to lie inside the shape. + * @protected + */ + isInside(node:yfiles.graph.INode,location:yfiles.geometry.Point):boolean; + /** + * Determines whether the visualization for the specified node is visible in the context. + *

+ * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been + * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.NodeStyleBase#getBounds bounds} intersect the clip. + *

+ * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.geometry.Rect} rectangle The clipping rectangle. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {boolean} true if the specified node is visible in the clipping rectangle; false otherwise. + * @protected + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,node:yfiles.graph.INode):boolean; + /** + * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.INodeStyleRenderer#getContext} that has been + * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. + *

+ * This implementation yields null for everything but: + *

+ *
    + *
  • {@link yfiles.input.IHitTestable}
  • + *
  • {@link yfiles.view.IVisualCreator}
  • + *
  • {@link yfiles.view.IBoundsProvider}
  • + *
  • {@link yfiles.view.IVisibilityTestable}
  • + *
  • {@link yfiles.input.IMarqueeTestable}
  • + *
  • {@link yfiles.graph.ILookup}
  • + *
  • {@link yfiles.styles.IShapeGeometry}
  • + *
+ *

+ * 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. + * @returns {Object} An implementation of the type or null. + * @protected + */ + lookup(node:yfiles.graph.INode,type:yfiles.lang.Class):Object; + /** + * Callback that updates the visual previously created by {@link yfiles.styles.NodeStyleBase#createVisual}. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been + * queried from the {@link yfiles.styles.NodeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.NodeStyleBase#createVisual} so subclasses should + * override to improve rendering performance. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.view.Visual} oldVisual The visual that has been created in the call to {@link yfiles.styles.NodeStyleBase#createVisual}. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.NodeStyleBase#createVisual + * @protected + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,node:yfiles.graph.INode):yfiles.view.Visual; + /** + * Gets the renderer implementation for this instance. + *

+ * The private implementation will delegate all API calls back to this instance. + *

+ * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * 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. + * @class yfiles.styles.NodeStyleLabelStyleAdapter + * @implements {yfiles.styles.ILabelStyle} + */ + export interface NodeStyleLabelStyleAdapter extends Object,yfiles.styles.ILabelStyle{} + export class 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.styles.INodeStyle} nodeStyle The style to use for rendering the background of the label. + * @param {yfiles.styles.ILabelStyle} labelStyle The style to use for rendering the foreground of the label. + * @constructor + */ + constructor(nodeStyle:yfiles.styles.INodeStyle,labelStyle:yfiles.styles.ILabelStyle); + /** + * 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 {Object} options The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.nodeStyle The style to use for rendering the background of the label. + * @param {yfiles.styles.ILabelStyle} options.labelStyle The style to use for rendering the foreground of the label. + * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. + *

+ * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.labelStyleInsets The insets to apply for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} as margins. + *

+ * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyleInsets} property on the created object. + *

+ * @constructor + */ + constructor(options:{nodeStyle:yfiles.styles.INodeStyle,labelStyle:yfiles.styles.ILabelStyle,autoFlip?:boolean,labelStyleInsets?:yfiles.geometry.Insets}); + /** + * Initializes a new instance of the {@link yfiles.styles.NodeStyleLabelStyleAdapter} class. + *

+ * This constructor uses a {@link yfiles.styles.ShapeNodeStyle} and a {@link yfiles.styles.DefaultLabelStyle} for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#nodeStyle} and {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} properties. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. + *

+ * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#autoFlip} property on the created object. + *

+ * @param {yfiles.styles.ILabelStyle} options.labelStyle The {@link yfiles.styles.ILabelStyle} that is used for rendering the foreground of the label. + *

+ * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.labelStyleInsets The insets to apply for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} as margins. + *

+ * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyleInsets} property on the created object. + *

+ * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the background of the label. + *

+ * This option sets the {@link yfiles.styles.NodeStyleLabelStyleAdapter#nodeStyle} property on the created object. + *

+ * @constructor + */ + constructor(options?:{autoFlip?:boolean,labelStyle?:yfiles.styles.ILabelStyle,labelStyleInsets?:yfiles.geometry.Insets,nodeStyle?:yfiles.styles.INodeStyle}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * + * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + /** + * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the background of the label. + * @type {yfiles.styles.INodeStyle} + */ + nodeStyle:yfiles.styles.INodeStyle; + /** + * Gets the {@link yfiles.styles.ILabelStyle} that is used for rendering the foreground of the label. + * @type {yfiles.styles.ILabelStyle} + */ + labelStyle:yfiles.styles.ILabelStyle; + /** + * Gets a value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented + * downwards, otherwise. + * @default true + * @type {boolean} + */ + autoFlip:boolean; + /** + * Gets or sets the insets to apply for the {@link yfiles.styles.NodeStyleLabelStyleAdapter#labelStyle} as margins. + * @default '0' + * @type {yfiles.geometry.Insets} + */ + labelStyleInsets:yfiles.geometry.Insets; + static $class:yfiles.lang.Class; + } + /** + * A port style decorator that uses a node style instance to render the port. + * @class yfiles.styles.NodeStylePortStyleAdapter + * @implements {yfiles.styles.IPortStyle} + */ + export interface NodeStylePortStyleAdapter extends Object,yfiles.styles.IPortStyle{} + export class 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.styles.INodeStyle} nodeStyle The style to use for rendering the port. + * @constructor + */ + constructor(nodeStyle:yfiles.styles.INodeStyle); + /** + * 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 {Object} options The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.nodeStyle The style to use for rendering the port. + * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.MutableSize} of the port that will be displayed using {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle}. + *

+ * This option sets the {@link yfiles.styles.NodeStylePortStyleAdapter#renderSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{nodeStyle:yfiles.styles.INodeStyle,renderSize?:yfiles.geometry.Size}); + /** + * Initializes a new instance of the {@link yfiles.styles.NodeStylePortStyleAdapter} class. + *

+ * This constructor uses an ellipse {@link yfiles.styles.ShapeNodeStyle} with a black brush for the {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle} property. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the port. + *

+ * This option sets the {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.MutableSize} of the port that will be displayed using {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle}. + *

+ * This option sets the {@link yfiles.styles.NodeStylePortStyleAdapter#renderSize} property on the created object. + *

+ * @constructor + */ + constructor(options?:{nodeStyle?:yfiles.styles.INodeStyle,renderSize?:yfiles.geometry.Size}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * + * @type {yfiles.styles.IPortStyleRenderer} + */ + renderer:yfiles.styles.IPortStyleRenderer; + /** + * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the port. + * @type {yfiles.styles.INodeStyle} + */ + nodeStyle:yfiles.styles.INodeStyle; + /** + * Gets or sets the {@link yfiles.geometry.MutableSize} of the port that will be displayed using {@link yfiles.styles.NodeStylePortStyleAdapter#nodeStyle}. + *

+ * The default value is (5,5). + *

+ * @default '5,5' + * @type {yfiles.geometry.Size} + */ + renderSize:yfiles.geometry.Size; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IPortStyle}. + *

+ * Only {@link yfiles.styles.PortStyleBase#createVisual} and {@link yfiles.styles.PortStyleBase#getBounds} need to be implemented by + * subclasses, however to improve rendering performance it is highly recommended to implement at least + * {@link yfiles.styles.PortStyleBase#updateVisual}, too. + *

+ *

+ * This implementation differs from the straightforward {@link yfiles.styles.IPortStyle} implementation in that there is no visible + * separation between the style and its + * {@link yfiles.styles.IPortStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to + * the style instance. + *

+ *

Related demos:

+ *
    + *
  • Demo: SimpleCustomStyle, demo.yfiles.style.simplecustomstyle
  • + *
  • Tutorial: 02 Custom Styles, step 22 Custom Ports
  • + *
+ * @class yfiles.styles.PortStyleBase + * @implements {yfiles.styles.IPortStyle} + */ + export interface PortStyleBase extends Object,yfiles.styles.IPortStyle{} + export class PortStyleBase { + /** + * Initializes a new instance of the {@link yfiles.styles.PortStyleBase} class. + * @protected + * @constructor + */ + constructor(); + /** + * Creates a new object that is a copy of the current instance. + *

+ * Immutable subclasses should consider returning this. + *

+ * @returns {Object} A new object that is a copy of this instance using {@link Object#memberwiseClone}. + */ + clone():Object; + /** + * Callback that creates the visual. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been + * queried from the {@link yfiles.styles.PortStyleBase#renderer}. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.PortStyleBase#updateVisual + * @protected + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.view.Visual; + /** + * Callback that returns the bounds of the visual for the port in the given context. + * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @returns {yfiles.geometry.Rect} The visual bounds of the visual representation. + * @protected + * @abstract + */ + getBounds(context:yfiles.view.ICanvasContext,port:yfiles.graph.IPort):yfiles.geometry.Rect; + /** + * 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.input.IHitTestable#isHit} call to the instance that has been queried from + * the {@link yfiles.styles.PortStyleBase#renderer}. + *

+ *

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

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Point} location The point to test. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @returns {boolean} true if the specified port representation is hit; false otherwise. + * @protected + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point,port:yfiles.graph.IPort):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.input.IMarqueeTestable#isInBox} call to the instance that has been queried + * from the {@link yfiles.styles.PortStyleBase#renderer}. + *

+ *

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

+ * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.Rect} rectangle The marquee selection box. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @returns {boolean} true if the specified port is visible is selected by the marquee rectangle; false otherwise. + * @protected + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect,port:yfiles.graph.IPort):boolean; + /** + * Determines whether the visualization for the specified port is visible in the context. + *

+ * This method is called in response to a {@link yfiles.view.IVisibilityTestable#isVisible} call to the instance that has been + * queried from the {@link yfiles.styles.PortStyleBase#renderer}. This implementation simply tests whether the {@link yfiles.styles.PortStyleBase#getBounds bounds} intersect the clip. + *

+ * @param {yfiles.view.ICanvasContext} context The canvas context. + * @param {yfiles.geometry.Rect} rectangle The clipping rectangle. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @returns {boolean} true if the specified port is visible in the clipping rectangle; false otherwise. + * @protected + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect,port:yfiles.graph.IPort):boolean; + /** + * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IPortStyleRenderer#getContext} that has been + * queried from the {@link yfiles.styles.PortStyleBase#renderer}. + *

+ * This implementation yields null for everything but: + *

+ *
    + *
  • {@link yfiles.input.IHitTestable}
  • + *
  • {@link yfiles.view.IVisualCreator}
  • + *
  • {@link yfiles.view.IBoundsProvider}
  • + *
  • {@link yfiles.view.IVisibilityTestable}
  • + *
  • {@link yfiles.input.IMarqueeTestable}
  • + *
  • {@link yfiles.graph.ILookup}
  • + *
+ *

+ * 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. + * @returns {Object} An implementation of the type or null. + * @protected + */ + lookup(port:yfiles.graph.IPort,type:yfiles.lang.Class):Object; + /** + * Callback that updates the visual previously created by {@link yfiles.styles.PortStyleBase#createVisual}. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been + * queried from the {@link yfiles.styles.PortStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.PortStyleBase#createVisual} so subclasses should + * override to improve rendering performance. + *

+ * @param {yfiles.view.IRenderContext} context The render context. + * @param {yfiles.view.Visual} oldVisual The visual that has been created in the call to {@link yfiles.styles.PortStyleBase#createVisual}. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.PortStyleBase#createVisual + * @protected + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,port:yfiles.graph.IPort):yfiles.view.Visual; + /** + * Gets the renderer implementation for this instance. + *

+ * The private implementation will delegate all API calls back to this instance. + *

+ * @type {yfiles.styles.IPortStyleRenderer} + */ + renderer:yfiles.styles.IPortStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A utility class that provides {@link yfiles.styles.TextRenderSupport#measureText text size measurement} and {@link yfiles.styles.TextRenderSupport#addText text placement} functionality, for instance, for label rendering + * and measurement. + * @class yfiles.styles.TextRenderSupport + */ + export interface TextRenderSupport extends Object{} + export class TextRenderSupport { + /** + * Add the text content to the provided SVG 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.view.Font} font The {@link yfiles.view.Font} that defines the font properties to apply to the added text. + * @param {yfiles.geometry.Size} maximumSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. + * @param {yfiles.view.TextWrapping} [wrapping=yfiles.view.TextWrapping.NONE] The {@link yfiles.view.TextWrapping} policy to apply when the text exceeds the provided maximumSize; {@link yfiles.view.TextWrapping#WORD} + * per default. + * @param {yfiles.styles.TextMeasurePolicy} [measurePolicy=yfiles.styles.TextMeasurePolicy.AUTOMATIC] The measure policy to use for measuring the size of the text; {@link yfiles.styles.TextMeasurePolicy#AUTOMATIC} per default. + * @returns {string} The text that was actually placed in the targetElement. + * @static + */ + static addText(targetElement:SVGTextElement,text:string,font:yfiles.view.Font,maximumSize:yfiles.geometry.Size,wrapping?:yfiles.view.TextWrapping,measurePolicy?:yfiles.styles.TextMeasurePolicy):string; + /** + * Add the text content to the provided SVG text element. + * @param {Object} options The parameters to pass. + * @param {SVGTextElement} options.targetElement An SVG text element to add the provided text to (either as textContent, or by appending tspan elements). + * @param {string} options.text The text content to add to the provided text element (may contain newline characters). + * @param {yfiles.view.Font} options.font The {@link yfiles.view.Font} that defines the font properties to apply to the added text. + * @param {yfiles.geometry.Size} options.maximumSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. + * @param {yfiles.view.TextWrapping} [options.wrapping=yfiles.view.TextWrapping.NONE] The {@link yfiles.view.TextWrapping} policy to apply when the text exceeds the provided maximumSize; {@link yfiles.view.TextWrapping#WORD} + * per default. + * @param {yfiles.styles.TextMeasurePolicy} [options.measurePolicy=yfiles.styles.TextMeasurePolicy.AUTOMATIC] The measure policy to use for measuring the size of the text; {@link yfiles.styles.TextMeasurePolicy#AUTOMATIC} per default. + * @returns {string} The text that was actually placed in the targetElement. + * @static + */ + static addText(options:{targetElement:SVGTextElement,text:string,font:yfiles.view.Font,maximumSize:yfiles.geometry.Size,wrapping?:yfiles.view.TextWrapping,measurePolicy?:yfiles.styles.TextMeasurePolicy}):string; + /** + * Calculate the width and height required to render the provided text using the provided {@link yfiles.view.Font}. + * @param {string} text The text that should be measured. + * @param {yfiles.view.Font} font The {@link yfiles.view.Font} to apply to the text before measuring. + * @param {yfiles.styles.TextMeasurePolicy} [measurePolicy=yfiles.styles.TextMeasurePolicy.AUTOMATIC] The measure policy to use for measuring the size of the text; {@link yfiles.styles.TextMeasurePolicy#AUTOMATIC} per default. + * @returns {yfiles.geometry.Size} The measured text size + * @static + */ + static measureText(text:string,font:yfiles.view.Font,measurePolicy?:yfiles.styles.TextMeasurePolicy):yfiles.geometry.Size; + static $class:yfiles.lang.Class; + } + export enum TextMeasurePolicy{ + /** + * The measure policy will be determined heuristically. + */ + AUTOMATIC, + /** + * Use getBBox() to measure the size of text elements. + */ + SVG, + /** + * Use CanvasRenderingContext2D.measureText() to measure the width of text elements. + */ + CANVAS + } + /** + * A basic label style which renders the label's {@link yfiles.graph.ILabel#text} and optionally a {@link yfiles.styles.DefaultLabelStyle#backgroundFill background} and {@link yfiles.styles.DefaultLabelStyle#backgroundStroke border}. + * @class yfiles.styles.DefaultLabelStyle + * @implements {yfiles.styles.ILabelStyle} + */ + export interface DefaultLabelStyle extends Object,yfiles.styles.ILabelStyle{} + export class DefaultLabelStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.ILabelStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderer:yfiles.styles.ILabelStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.ILabelStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#autoFlip} property on the created object. + *

+ * @param {yfiles.view.Fill} options.backgroundFill The brush to use for the background box of the label. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundFill} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.backgroundStroke The pen to use for the background box of the label. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundStroke} property on the created object. + *

+ * @param {boolean} options.clipText A value that determines whether text should be clipped. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#clipText} property on the created object. + *

+ * @param {yfiles.view.HorizontalTextAlignment} options.horizontalTextAlignment The text alignment. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#horizontalTextAlignment} property on the created object. + *

+ * @param {yfiles.view.Fill} options.textFill The brush to use for the label's text. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#textFill} property on the created object. + *

+ * @param {number} options.textSize The size of the text. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#textSize} property on the created object. + *

+ * @param {yfiles.view.TextWrapping} options.wrapping The text trimming. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#wrapping} property on the created object. + *

+ * @param {yfiles.view.Font} options.font The typeface to use for the label. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#font} property on the created object. + *

+ * @param {yfiles.view.VerticalTextAlignment} options.verticalTextAlignment The vertical text alignment to use if the label is assigned more space than needed. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#verticalTextAlignment} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.ILabelStyleRenderer,autoFlip?:boolean,backgroundFill?:yfiles.view.Fill,backgroundStroke?:yfiles.view.Stroke,clipText?:boolean,horizontalTextAlignment?:yfiles.view.HorizontalTextAlignment,textFill?:yfiles.view.Fill,textSize?:number,wrapping?:yfiles.view.TextWrapping,font?:yfiles.view.Font,verticalTextAlignment?:yfiles.view.VerticalTextAlignment}); + /** + * Creates a new instance using {@link yfiles.styles.DefaultLabelStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} options.autoFlip A value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented downwards, otherwise. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#autoFlip} property on the created object. + *

+ * @param {yfiles.view.Fill} options.backgroundFill The brush to use for the background box of the label. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundFill} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.backgroundStroke The pen to use for the background box of the label. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#backgroundStroke} property on the created object. + *

+ * @param {boolean} options.clipText A value that determines whether text should be clipped. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#clipText} property on the created object. + *

+ * @param {yfiles.view.HorizontalTextAlignment} options.horizontalTextAlignment The text alignment. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#horizontalTextAlignment} property on the created object. + *

+ * @param {yfiles.view.Fill} options.textFill The brush to use for the label's text. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#textFill} property on the created object. + *

+ * @param {number} options.textSize The size of the text. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#textSize} property on the created object. + *

+ * @param {yfiles.view.TextWrapping} options.wrapping The text trimming. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#wrapping} property on the created object. + *

+ * @param {yfiles.view.Font} options.font The typeface to use for the label. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#font} property on the created object. + *

+ * @param {yfiles.view.VerticalTextAlignment} options.verticalTextAlignment The vertical text alignment to use if the label is assigned more space than needed. + *

+ * This option sets the {@link yfiles.styles.DefaultLabelStyle#verticalTextAlignment} property on the created object. + *

+ * @constructor + */ + constructor(options?:{autoFlip?:boolean,backgroundFill?:yfiles.view.Fill,backgroundStroke?:yfiles.view.Stroke,clipText?:boolean,horizontalTextAlignment?:yfiles.view.HorizontalTextAlignment,textFill?:yfiles.view.Fill,textSize?:number,wrapping?:yfiles.view.TextWrapping,font?:yfiles.view.Font,verticalTextAlignment?:yfiles.view.VerticalTextAlignment}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the brush to use for the background box of the label. + *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.view.Fill} + */ + backgroundFill:yfiles.view.Fill; + /** + * Gets or sets the vertical text alignment to use if the label is assigned more space than needed. + *

+ * The default value is {@link yfiles.view.VerticalTextAlignment#TOP}. + *

+ * @default 1 + * @type {yfiles.view.VerticalTextAlignment} + */ + verticalTextAlignment:yfiles.view.VerticalTextAlignment; + /** + * Gets or sets the text alignment. + *

+ * The default value is {@link yfiles.view.HorizontalTextAlignment#LEFT}. + *

+ * @default 1 + * @type {yfiles.view.HorizontalTextAlignment} + */ + horizontalTextAlignment:yfiles.view.HorizontalTextAlignment; + /** + * Gets or sets the text trimming. + *

+ * The default value is {@link yfiles.view.TextWrapping#NONE}. + *

+ * @default 0 + * @type {yfiles.view.TextWrapping} + */ + wrapping:yfiles.view.TextWrapping; + /** + * Gets or sets a value that determines whether text should be clipped. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + clipText:boolean; + /** + * Gets or sets the pen to use for the background box of the label. + *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.view.Stroke} + */ + backgroundStroke:yfiles.view.Stroke; + /** + * + * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + /** + * Gets or sets the typeface to use for the label. + *

+ * The default value is an instance of {@link yfiles.styles.DefaultLabelStyle#font} for Arial". + *

+ * @throws {Stubs.Exceptions.ArgumentError} value cannot be null! + * @type {yfiles.view.Font} + */ + font:yfiles.view.Font; + /** + * Gets or sets a value indicating whether the label should be flipped 180 degrees automatically, if it would be oriented + * downwards, otherwise. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + autoFlip:boolean; + /** + * Gets or sets the brush to use for the label's text. + *

+ * The default value is {@link yfiles.view.Fill#BLACK}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} value cannot be null! + * @default 'Black' + * @type {yfiles.view.Fill} + */ + textFill:yfiles.view.Fill; + /** + * Gets or sets the size of the text. + *

+ * This property delegates to the size of the {@link yfiles.styles.DefaultLabelStyle#font} property. + *

+ *

+ * The default value is 12.0d. + *

+ * @default 12 + * @type {number} + */ + textSize:number; + static $class:yfiles.lang.Class; + } + /** + * A label style that draws an icon in addtion to the text. + *

+ * This style draws the icon at the location specified by {@link yfiles.styles.IconLabelStyle#iconPlacement} and delegates the drawing of the label's text to the {@link yfiles.styles.IconLabelStyle#wrapped} style. + *

+ * @class yfiles.styles.IconLabelStyle + * @implements {yfiles.styles.ILabelStyle} + */ + export interface IconLabelStyle extends Object,yfiles.styles.ILabelStyle{} + export class IconLabelStyle { + /** + * Creates a new instance using the provided icon and renderer. + * @param {string} icon The icon to draw. + * @param {yfiles.styles.ILabelStyleRenderer} [renderer=null] The custom renderer for this style instance. + * @constructor + */ + constructor(icon:string,renderer?:yfiles.styles.ILabelStyleRenderer); + /** + * Creates a new instance using the provided icon and renderer. + * @param {Object} options The parameters to pass. + * @param {string} options.icon The icon to draw. + * @param {yfiles.styles.ILabelStyleRenderer} [options.renderer=null] The custom renderer for this style instance. + * @param {boolean} options.autoFlip A value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#autoFlip} property on the created object. + *

+ * @param {yfiles.graph.ILabelModelParameter} options.iconPlacement The parameter the specifies the icon placement. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#iconPlacement} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.iconSize The size of the icon to paint for the label. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#iconSize} property on the created object. + *

+ * @param {yfiles.styles.ILabelStyle} options.wrapped The style that renders the text of the label. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#wrapped} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.wrappedInsets The insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#wrappedInsets} property on the created object. + *

+ * @constructor + */ + constructor(options:{icon:string,renderer?:yfiles.styles.ILabelStyleRenderer,autoFlip?:boolean,iconPlacement?:yfiles.graph.ILabelModelParameter,iconSize?:yfiles.geometry.Size,wrapped?:yfiles.styles.ILabelStyle,wrappedInsets?:yfiles.geometry.Insets}); + /** + * Creates a new instance using no icon and {@link yfiles.styles.IconLabelStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} options.autoFlip A value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#autoFlip} property on the created object. + *

+ * @param {string} options.icon The icon to paint for the label. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#icon} property on the created object. + *

+ * @param {yfiles.graph.ILabelModelParameter} options.iconPlacement The parameter the specifies the icon placement. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#iconPlacement} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.iconSize The size of the icon to paint for the label. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#iconSize} property on the created object. + *

+ * @param {yfiles.styles.ILabelStyle} options.wrapped The style that renders the text of the label. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#wrapped} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.wrappedInsets The insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. + *

+ * This option sets the {@link yfiles.styles.IconLabelStyle#wrappedInsets} property on the created object. + *

+ * @constructor + */ + constructor(options?:{autoFlip?:boolean,icon?:string,iconPlacement?:yfiles.graph.ILabelModelParameter,iconSize?:yfiles.geometry.Size,wrapped?:yfiles.styles.ILabelStyle,wrappedInsets?:yfiles.geometry.Insets}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the icon to paint for the label. + * @type {string} + */ + icon:string; + /** + * Gets or sets the size of the icon to paint for the label. + *

+ * The default value is {@link yfiles.geometry.Size#EMPTY}. + *

+ * @type {yfiles.geometry.Size} + */ + iconSize:yfiles.geometry.Size; + /** + * Gets or sets the parameter the specifies the icon placement. + *

+ * All valid node label model parameters can be used. The label's {@link yfiles.graph.ILabel#layout 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. + *

+ *

+ * The default value is {@link yfiles.graph.ExteriorLabelModel#WEST}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} value is null. + * @type {yfiles.graph.ILabelModelParameter} + */ + iconPlacement:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the style that renders the text of the label. + *

+ * This style will be rendered before the icon and is responsible for rendering the {@link yfiles.graph.ILabel#text}, since {@link yfiles.styles.IconLabelStyleRenderer} + * will only render the {@link yfiles.styles.IconLabelStyle#icon}. + *

+ *

+ * The default value is {@link yfiles.styles.DefaultLabelStyle}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} value is null. + * @type {yfiles.styles.ILabelStyle} + */ + wrapped:yfiles.styles.ILabelStyle; + /** + * Gets or sets the insets that should be applied for the {@link yfiles.graph.ILabel#layout layout} of the {@link yfiles.styles.IconLabelStyle#wrapped wrapped style} rendering. + *

+ * The {@link yfiles.styles.IconLabelStyleRenderer#getPreferredSize} will take the preferred size of the {@link yfiles.styles.IconLabelStyle#wrapped}'s {@link yfiles.styles.ILabelStyleRenderer} + * and add these insets to it. During the {@link yfiles.view.IVisualCreator rendering} these insets will be used to offset the rendering of the wrapped + * style. + *

+ *

+ * The default insets are empty. + *

+ * @default '0' + * @type {yfiles.geometry.Insets} + */ + wrappedInsets:yfiles.geometry.Insets; + /** + * + * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + /** + * Gets a value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout layout}'s {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + autoFlip:boolean; + static $class:yfiles.lang.Class; + } + /** + * A simple {@link yfiles.styles.ILabelStyleRenderer} implementation that can handle {@link yfiles.styles.DefaultLabelStyle} instances. + *

+ * This implementation will just draw the label's {@link yfiles.graph.ILabel#text} using the properties provided by {@link yfiles.styles.DefaultLabelStyle} into + * the label's {@link yfiles.graph.ILabel#layout layout} area. + *

+ * @class yfiles.styles.DefaultLabelStyleRenderer + * @implements {yfiles.styles.ILabelStyleRenderer} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface DefaultLabelStyleRenderer extends Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class DefaultLabelStyleRenderer { + /** + * Creates a new default instance. + * @constructor + */ + constructor(); + /** + * Add the text content to the provided SVG text element. + * @param {SVGTextElement} textElement An SVG text element to add the provided text to. + * @param {yfiles.view.Font} font The {@link yfiles.view.Font} that defines the font properties to apply to the added text. + * @param {string} text The text content to add to the provided text element (may contain newline characters). + * @param {yfiles.geometry.Size} maxSize The bounds that shouldn't be exceeded when placing the text; null or not provided means unbound. + * @param {yfiles.view.TextWrapping} wrapping The {@link yfiles.view.TextWrapping} policy to apply when the text exceeds the provided maxSize. + * @returns {string} + * @protected + */ + addTextElements(textElement:SVGTextElement,font:yfiles.view.Font,text:string,maxSize:yfiles.geometry.Size,wrapping:yfiles.view.TextWrapping):string; + /** + * Prepares this instance for subsequent calls after the style and label have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.DefaultLabelStyleRenderer#style} and {@link yfiles.styles.DefaultLabelStyleRenderer#label} properties have been populated by the + * {@link yfiles.styles.DefaultLabelStyleRenderer#getVisualCreator}, {@link yfiles.styles.DefaultLabelStyleRenderer#getBoundsProvider}, + * {@link yfiles.styles.DefaultLabelStyleRenderer#getHitTestable}, or {@link yfiles.styles.DefaultLabelStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * Stores the {@link yfiles.graph.ILabel#layout layout} into {@link yfiles.styles.DefaultLabelStyleRenderer#layout}. Subclasses which to override this method should call the base implementation. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.DefaultLabelStyleRenderer#getBounds + */ + getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and label parameters, does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns + * this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.DefaultLabelStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.DefaultLabelStyleRenderer#lookup} method call they should call + * {@link yfiles.styles.DefaultLabelStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that + * depends on a correctly configured this. + *

+ * @param {yfiles.graph.ILabel} label The label to query the context for. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.DefaultLabelStyleRenderer#lookup + */ + getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to query hit test with. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.DefaultLabelStyleRenderer#isHit + */ + getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; + /** + * Determines how the text should be aligned within the assigned label bounds. + * @returns {yfiles.view.HorizontalTextAlignment} This value as obtained from the style. + * @protected + */ + getHorizontalTextAlignment():yfiles.view.HorizontalTextAlignment; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.DefaultLabelStyleRenderer#isInBox + */ + getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.geometry.Size} + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; + /** + * Calculates the preferred size given the current state of the renderer. + * @returns {yfiles.geometry.Size} The size as suggested by this renderer. + * @protected + */ + getPreferredSizeCore():yfiles.geometry.Size; + /** + * Determines how the text should be aligned vertically within the assigned label bounds. + * @returns {yfiles.view.VerticalTextAlignment} This value as obtained from the style. + * @protected + */ + getVerticalTextAlignment():yfiles.view.VerticalTextAlignment; + /** + * Configures the style and label parameters, does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns + * this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.DefaultLabelStyleRenderer#configure}. If + * the subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.DefaultLabelStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.ILabel} label The label to query visibility tests. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.DefaultLabelStyleRenderer#isVisible + */ + getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.DefaultLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.DefaultLabelStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.DefaultLabelStyleRenderer#createVisual + * @see yfiles.styles.DefaultLabelStyleRenderer#updateVisual + */ + getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; + /** + * Determines how the text should be trimmed to fit the assigned label bounds. + * @returns {yfiles.view.TextWrapping} This value as obtained from the style. + * @protected + */ + getWrapping():yfiles.view.TextWrapping; + /** + * Delegates to {@link yfiles.styles.DefaultLabelStyle#autoFlip} + * @returns {boolean} Whether to flip the drawing if it is upside down. + * @protected + */ + isAutoFlip():boolean; + /** + * Determines whether text should be forced to be clipped inside the rectangle. + * @returns {boolean} This value as obtained from the style. + * @protected + */ + isClippingText():boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Uses the {@link yfiles.graph.ILabel#layout} to determine whether the clip intersects. + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implements the {@link yfiles.graph.ILookup} interface. + *

+ * This method will be used by default if {@link yfiles.styles.DefaultLabelStyleRenderer#getContext} has been queried for a lookup + * implementation. Note that it cannot be assumed that {@link yfiles.styles.DefaultLabelStyleRenderer#configure} has already been + * invoked. However, normally {@link yfiles.styles.DefaultLabelStyleRenderer#label} and {@link yfiles.styles.DefaultLabelStyleRenderer#style} 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.styles.DefaultLabelStyleRenderer#configure} + * on success and return this. + *

+ * @param {yfiles.lang.Class} type The type to query for. + * @returns {Object} An implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Calculate the width and height required to render the provided text using the provided {@link yfiles.view.Font}. + * @param {string} text The text that should be measured. + * @param {yfiles.view.Font} font The {@link yfiles.view.Font} to apply to the text before measuring. + * @returns {yfiles.geometry.Size} The text size. + * @protected + */ + measureText(text:string,font:yfiles.view.Font):yfiles.geometry.Size; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Retrieves the current {@link yfiles.graph.ILabel#layout layout}. + * @protected + * @type {yfiles.geometry.IOrientedRectangle} + */ + layout:yfiles.geometry.IOrientedRectangle; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.DefaultLabelStyle} + */ + style:yfiles.styles.DefaultLabelStyle; + /** + * Gets or sets the currently configured label. + * @protected + * @type {yfiles.graph.ILabel} + */ + label:yfiles.graph.ILabel; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.ILabelStyleRenderer} that can handle {@link yfiles.styles.IconLabelStyle} instances. + *

+ * This implementation renders the label's inner style and an icon. + *

+ * @class yfiles.styles.IconLabelStyleRenderer + * @implements {yfiles.styles.ILabelStyleRenderer} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface IconLabelStyleRenderer extends Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class IconLabelStyleRenderer { + /** + * Creates a new instance of this renderer. + * @constructor + */ + constructor(); + /** + * + * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.IconLabelStyleRenderer#getBounds + */ + getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and label parameters, does not call {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.IconLabelStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.IconLabelStyleRenderer#lookup} method call they should call {@link yfiles.styles.IconLabelStyleRenderer#configure} + * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.ILabel} label The label to query the context for. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.IconLabelStyleRenderer#lookup + */ + getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to query hit test with. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.IconLabelStyleRenderer#isHit + */ + getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; + /** + * Retrieves the {@link yfiles.styles.IconLabelStyle#icon} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. + * @returns {string} The icon. + * @protected + */ + getIcon():string; + /** + * Retrieves the {@link yfiles.styles.IconLabelStyle#iconPlacement} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. + * @returns {yfiles.graph.ILabelModelParameter} The placement parameter. + * @protected + */ + getIconPlacement():yfiles.graph.ILabelModelParameter; + /** + * Gets the size of the icon from the {@link yfiles.styles.IconLabelStyle#iconSize} property. + * @returns {yfiles.geometry.Size} The size to use for the icon. + * @protected + */ + getIconSize():yfiles.geometry.Size; + /** + * Retrieves the {@link yfiles.styles.IconLabelStyle#wrappedInsets} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. + * @returns {yfiles.geometry.Insets} The insets. + * @protected + */ + getInnerStyleInsets():yfiles.geometry.Insets; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.IconLabelStyleRenderer#isInBox + */ + getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; + /** + * + * @param {yfiles.graph.ILabel} label + * @param {yfiles.styles.ILabelStyle} style + * @returns {yfiles.geometry.Size} + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; + /** + * Calculates the preferred size given the current state of the renderer. + * @returns {yfiles.geometry.Size} The size as suggested by this renderer. + * @protected + */ + getPreferredSizeCore():yfiles.geometry.Size; + /** + * Configures the style and label parameters, does not call {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.IconLabelStyleRenderer#configure}. If the + * subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.IconLabelStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.ILabel} label The label to query visibility tests. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.IconLabelStyleRenderer#isVisible + */ + getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and label parameters, calls {@link yfiles.styles.IconLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.IconLabelStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.IconLabelStyleRenderer#createVisual + * @see yfiles.styles.IconLabelStyleRenderer#updateVisual + */ + getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; + /** + * Retrieves the {@link yfiles.styles.IconLabelStyle#wrapped} from the {@link yfiles.styles.IconLabelStyleRenderer#style}. + * @returns {yfiles.styles.ILabelStyle} The style. + * @protected + */ + getWrappedStyle():yfiles.styles.ILabelStyle; + /** + * Retrieves the {@link yfiles.styles.IconLabelStyle#autoFlip} property from the {@link yfiles.styles.IconLabelStyleRenderer#style}. + * @returns {boolean} The autoflip property value. + * @protected + */ + isAutoFlip():boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implements the {@link yfiles.graph.ILookup} interface. + *

+ * This method will be used by default if {@link yfiles.styles.IconLabelStyleRenderer#getContext} has been queried for a lookup + * implementation. Note that it cannot be assumed that {@link yfiles.styles.IconLabelStyleRenderer#configure} has already been + * invoked. However, normally {@link yfiles.styles.IconLabelStyleRenderer#label} and {@link yfiles.styles.IconLabelStyleRenderer#style} 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.styles.IconLabelStyleRenderer#configure} + * on success and return this. + *

+ * @param {yfiles.lang.Class} type The type to query for. + * @returns {Object} An implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns whether the icon bounds should be considered for hit testing. + * @returns {boolean} true + * @protected + */ + shouldHitTestIcon():boolean; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.IconLabelStyle} + */ + style:yfiles.styles.IconLabelStyle; + /** + * Gets or sets the currently configured label. + * @protected + * @type {yfiles.graph.ILabel} + */ + label:yfiles.graph.ILabel; + static $class:yfiles.lang.Class; + } + /** + * A node style that can display node shapes with a boundary that is defined by a {@link yfiles.geometry.GeneralPath} instance. + * @class yfiles.styles.GeneralPathNodeStyle + * @implements {yfiles.styles.INodeStyle} + */ + export interface GeneralPathNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class GeneralPathNodeStyle { + /** + * Creates a new instance using the specified path and a custom renderer instance. + * @param {yfiles.geometry.GeneralPath} path The path that defines the boundary of this style. + * @param {yfiles.styles.GeneralPathNodeStyleRenderer} [renderer=null] Custom renderer instance for this style + * @constructor + */ + constructor(path:yfiles.geometry.GeneralPath,renderer?:yfiles.styles.GeneralPathNodeStyleRenderer); + /** + * Creates a new instance using the specified path and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {yfiles.geometry.GeneralPath} options.path The path that defines the boundary of this style. + * @param {yfiles.styles.GeneralPathNodeStyleRenderer} [options.renderer=null] Custom renderer instance for this style + * @param {yfiles.view.Fill} options.fill The {@link yfiles.view.Fill} that is used to draw the shape. + *

+ * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#fill} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.view.Stroke} that is used to draw the shape. + *

+ * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#stroke} property on the created object. + *

+ * @constructor + */ + constructor(options:{path:yfiles.geometry.GeneralPath,renderer?:yfiles.styles.GeneralPathNodeStyleRenderer,fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke}); + /** + * Creates a new instance using a simple rectangular path and {@link yfiles.styles.GeneralPathNodeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Fill} options.fill The {@link yfiles.view.Fill} that is used to draw the shape. + *

+ * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#fill} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.path The path that defines the boundary of the shape. + *

+ * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#path} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.view.Stroke} that is used to draw the shape. + *

+ * This option sets the {@link yfiles.styles.GeneralPathNodeStyle#stroke} property on the created object. + *

+ * @constructor + */ + constructor(options?:{fill?:yfiles.view.Fill,path?:yfiles.geometry.GeneralPath,stroke?:yfiles.view.Stroke}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Get or sets 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. + *

+ *

+ * The default is a simple rectangular path. + *

+ * @type {yfiles.geometry.GeneralPath} + */ + path:yfiles.geometry.GeneralPath; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + /** + * Gets or sets the {@link yfiles.view.Fill} that is used to draw the shape. + *

+ * The default value is {@link yfiles.view.Fill#WHITE}. + *

+ * @default 'System.Drawing.Brushes.White' + * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + /** + * Gets or sets the {@link yfiles.view.Stroke} that is used to draw the shape. + *

+ * The default value is {@link yfiles.view.Stroke#BLACK}. + *

+ * @default 'System.Drawing.Pens.Black' + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.INodeStyleRenderer} implementation that can handle {@link yfiles.styles.GeneralPathNodeStyle} instances. + * @class yfiles.styles.GeneralPathNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface GeneralPathNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class GeneralPathNodeStyleRenderer { + /** + * Initializes a new instance of the {@link yfiles.styles.GeneralPathNodeStyleRenderer} class. + * @constructor + */ + constructor(); + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} properties have been populated by the + * {@link yfiles.styles.GeneralPathNodeStyleRenderer#getVisualCreator}, + * {@link yfiles.styles.GeneralPathNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.GeneralPathNodeStyleRenderer#getHitTestable}, + * or {@link yfiles.styles.GeneralPathNodeStyleRenderer#getMarqueeTestable} methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns + * this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#lookup} method call they should + * call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an + * instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Configures the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} properties, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#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.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#isInside + * @see yfiles.styles.GeneralPathNodeStyleRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns + * this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure}. If + * the subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.GeneralPathNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.GeneralPathNodeStyleRenderer#createVisual + * @see yfiles.styles.GeneralPathNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * Determines visibility by checking for an intersection with the {@link yfiles.styles.GeneralPathNodeStyleRenderer#layout}. + * @param {yfiles.view.ICanvasContext} context The context. + * @param {yfiles.geometry.Rect} rectangle The current clip + * @returns {boolean} Whether the {@link yfiles.styles.GeneralPathNodeStyleRenderer#layout} is visible in the clip. + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implements the {@link yfiles.graph.ILookup} interface. + *

+ * This method will be used by default if {@link yfiles.styles.GeneralPathNodeStyleRenderer#getContext} has been queried for a + * lookup implementation. Note that it cannot be assumed that {@link yfiles.styles.GeneralPathNodeStyleRenderer#configure} has + * already been invoked. However, normally {@link yfiles.styles.GeneralPathNodeStyleRenderer#node} and {@link yfiles.styles.GeneralPathNodeStyleRenderer#style} 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.styles.GeneralPathNodeStyleRenderer#configure} + * on success and return this. + *

+ * @param {yfiles.lang.Class} type The type to query for. + * @returns {Object} An implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.GeneralPathNodeStyle} + */ + style:yfiles.styles.GeneralPathNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class for {@link yfiles.styles.IEdgeStyleRenderer} implementations that are based on the calculation of a + * {@link yfiles.geometry.GeneralPath}. + * Type parameter TStyle: The exact type of style to use for this instance. + * @class yfiles.styles.PathBasedEdgeStyleRenderer. + * @implements {yfiles.styles.IEdgeStyleRenderer} + * @implements {yfiles.styles.IPathGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + * @implements {yfiles.view.IObstacleProvider} + * @template TStyle + */ + export interface PathBasedEdgeStyleRenderer extends Object,yfiles.styles.IEdgeStyleRenderer,yfiles.styles.IPathGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator,yfiles.view.IObstacleProvider{} + export class PathBasedEdgeStyleRenderer { + /** + * + * @param {yfiles.lang.Class} edgeStyleType The exact type of style to use for this instance. + */ + constructor(edgeStyleType:yfiles.lang.Class); + /** + * Prepares this instance for subsequent calls after the style and edge have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} and {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} properties have been populated by the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getVisualCreator}, {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getBoundsProvider}, {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable}, + * or {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getMarqueeTestable} methods. + *

+ *

+ * Subclasses which override this method have to call the base implementation, first. + *

+ * @protected + */ + configure():void; + /** + * This method should create the basic uncropped path given the control points. + * @returns {yfiles.geometry.GeneralPath} A path that has to be cropped, yet. + * @protected + * @abstract + */ + createPath():yfiles.geometry.GeneralPath; + /** + * 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. + * @returns {yfiles.geometry.GeneralPath} A path that describes a rectangular self loop. + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createSelfLoopPath + * @protected + * @static + */ + static createRectangleSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.geometry.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. + * @returns {yfiles.geometry.GeneralPath} A path that describes a round self loop. + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createSelfLoopPath + * @protected + * @static + */ + static createRoundSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.geometry.GeneralPath; + /** + * Special implementation that will create a self loop path. + * @param {boolean} roundSelfLoop + * @returns {yfiles.geometry.GeneralPath} + * @protected + */ + createSelfLoopPath(roundSelfLoop:boolean):yfiles.geometry.GeneralPath; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Crops the edge's path at the nodes. + *

+ * This implementation uses the {@link yfiles.styles.IEdgePathCropper} instances found in the {@link yfiles.graph.ILookup#lookup} of the + * source and target port of the edge to perform the actual cropping. + *

+ * @param {yfiles.geometry.GeneralPath} path The path that should be cropped. + * @returns {yfiles.geometry.GeneralPath} The cropped path. This is can be either the same instance of the given path or a newly created instance. + * @protected + */ + cropPath(path:yfiles.geometry.GeneralPath):yfiles.geometry.GeneralPath; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. + * @param {yfiles.graph.IEdge} edge The edge to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} property. + * @param {yfiles.styles.IEdgeStyle} style The style to associate with the edge. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getBounds + */ + getBoundsProvider(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IBoundsProvider; + /** + * Yields the {@link yfiles.view.IBridgeCreator} to use for {@link yfiles.styles.PathBasedEdgeStyleRenderer.#addBridges adding bridges} to the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath created path}. + *

+ * The return value of this method (which may be null) will be passed to the {@link yfiles.view.BridgeManager}'s {@link yfiles.view.BridgeManager#addBridges} + * method. + *

+ * @returns {yfiles.view.IBridgeCreator} This implementation returns null. + * @protected + */ + getBridgeCreator():yfiles.view.IBridgeCreator; + /** + * Configures the style and edge parameters, does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}, instead subclasses should ensure that in + * the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#lookup} method call they should call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} only if needed, i.e. if they decide to return this or an instance + * that depends on a correctly configured this. + *

+ * @param {yfiles.graph.IEdge} edge The edge to query the context for. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} property. + * @param {yfiles.styles.IEdgeStyle} style The style to associate with the edge. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#lookup + */ + getContext(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.graph.ILookup; + /** + * Configures the style and edge parameters and returns this. + *

+ * This implementation does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}. If subclasses depend on a configured instance in an override of {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isHit}, + * they need to override this method, too and call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} if the base call returns a non-null value. + *

+ * @param {yfiles.graph.IEdge} edge + * @param {yfiles.styles.IEdgeStyle} style + * @returns {yfiles.input.IHitTestable} + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isHit + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure + * @see yfiles.styles.IEdgeStyleRenderer#getHitTestable + */ + getHitTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IHitTestable; + /** + * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. + * @param {yfiles.graph.IEdge} edge The edge to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} property. + * @param {yfiles.styles.IEdgeStyle} style The style to associate with the edge. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isInBox + */ + getMarqueeTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.input.IMarqueeTestable; + /** + * Returns {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath} unless {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible} yields false for the provided context and {@link yfiles.view.IRenderContext#clip}. + * @param {yfiles.view.IRenderContext} context The context to yield the obstacles for. + * @returns {yfiles.geometry.GeneralPath} Either null or the result of {@link yfiles.styles.PathBasedEdgeStyleRenderer.#createPath}. + * @see yfiles.view.IObstacleProvider + */ + getObstacles(context:yfiles.view.IRenderContext):yfiles.geometry.GeneralPath; + /** + * + * @returns {yfiles.geometry.GeneralPath} + */ + getPath():yfiles.geometry.GeneralPath; + /** + * Gets an implementation of the {@link yfiles.styles.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.styles.IEdgeStyle} style The style to use for the painting + * @returns {yfiles.styles.IPathGeometry} this + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getSegmentCount + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPath + */ + getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.styles.IPathGeometry; + /** + * Returns the number of "segments" this edge's path consists of. + *

+ * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will + * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. + *

+ * @returns {number} the number of segments or -1 if there is no such thing as a segment for this edge. + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry + * @abstract + */ + getSegmentCount():number; + /** + * 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. + *

+ * @returns {number} The radius of the arcs to use at the bends of the path. + * @protected + */ + getSmoothingLength():number; + /** + * Gets the source arrow from the style. + * @returns {yfiles.styles.IArrow} The arrow to use. + * @protected + * @abstract + */ + getSourceArrow():yfiles.styles.IArrow; + /** + * Calculate and update the anchor and the source arrow's direction vector. + * @param {yfiles.styles.IArrow} arrow The arrow to calculate the anchor for. + * @returns {yfiles.geometry.Tangent} The anchor and directional vector of the arrow, if any exist. + * @protected + */ + getSourceArrowAnchor(arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; + /** + * Gets the {@link yfiles.view.Stroke} to use to render the path. + * @returns {yfiles.view.Stroke} The {@link yfiles.view.Stroke} or null. + * @protected + * @abstract + */ + getStroke():yfiles.view.Stroke; + /** + * 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.styles.IPathGeometry} interface, that is implemented by this class. This interface will + * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. + *

+ * @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 + * @returns {yfiles.geometry.Tangent} The tangential line, if any exists. + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getTangent + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getSegmentCount + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry + * @abstract + */ + getTangent(segmentIndex:number,ratio:number):yfiles.geometry.Tangent; + /** + * Calculates the tangent on the edge's path at the given ratio point. + *

+ * This method is part of the {@link yfiles.styles.IPathGeometry} interface, that is implemented by this class. This interface will + * be returned by {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry}. + *

+ * @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 + * @returns {yfiles.geometry.Tangent} The tangential line, if any exists. + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getPathGeometry + * @abstract + */ + getTangent(ratio:number):yfiles.geometry.Tangent; + /** + * Gets the target arrow from the style. + * @returns {yfiles.styles.IArrow} The arrow to use. + * @protected + * @abstract + */ + getTargetArrow():yfiles.styles.IArrow; + /** + * Calculate and update the anchor and the target arrow's direction vector. + * @param {yfiles.styles.IArrow} arrow The arrow to calculate the anchor for. + * @returns {yfiles.geometry.Tangent} The anchor and directional vector of the arrow, if any exist. + * @protected + */ + getTargetArrowAnchor(arrow:yfiles.styles.IArrow):yfiles.geometry.Tangent; + /** + * Configures the style and edge parameters, does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure}. If the subclass implementation depends on + * this instance to be configured, it needs to call Configure in {@link yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible}. + *

+ * @param {yfiles.graph.IEdge} edge The edge to query visibility tests. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} property. + * @param {yfiles.styles.IEdgeStyle} style The style to associate with the edge. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#isVisible + */ + getVisibilityTestable(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and edge parameters, calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and returns this. + * @param {yfiles.graph.IEdge} edge The edge to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} property. + * @param {yfiles.styles.IEdgeStyle} style The style to associate with the edge. The value will be stored in the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#createVisual + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#updateVisual + */ + getVisualCreator(edge:yfiles.graph.IEdge,style:yfiles.styles.IEdgeStyle):yfiles.view.IVisualCreator; + /** + * This method is overridden for performance reasons. + *

+ * This implementation uses {@link yfiles.styles.PathBasedEdgeStyleRenderer.#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.styles.PathBasedEdgeStyleRenderer.#configure} has already been called. This may not be the case. If your + * subclass depends on Configure being called, override {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable} and call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} after the base class call. + *

+ * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getHitTestable + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#configure + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Calls {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} and test the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#edge} using the {@link yfiles.styles.PathBasedEdgeStyleRenderer.#style} for a visible intersection with the clip bounds. + *

+ * This simple implementation uses {@link yfiles.styles.PathBasedEdgeStyleRenderer.#getBounds} to determine the visibility. Subclasses may choose to override this behavior + * for improved performance but need to make sure to call {@link yfiles.styles.PathBasedEdgeStyleRenderer.#configure} if they depend on a configured instance. + *

+ * @param {yfiles.view.ICanvasContext} context the current canvas context + * @param {yfiles.geometry.Rect} rectangle the clip bounds + * @returns {boolean} true if the edge may be painted within the clip bounds. + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getVisibilityTestable + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * The path instance that this instance is working with. + * @protected + * @type {yfiles.geometry.GeneralPath} + */ + path:yfiles.geometry.GeneralPath; + /** + * Gets or sets the currently configured style. + * @protected + * @type {TStyle} + */ + style:TStyle; + /** + * Gets or sets the currently configured edge. + * @protected + * @type {yfiles.graph.IEdge} + */ + edge:yfiles.graph.IEdge; + /** + * Determines whether the rendered path should use the {@link yfiles.view.BridgeManager} to {@link yfiles.view.BridgeManager#addBridges add bridges to it.} + * @see yfiles.styles.PathBasedEdgeStyleRenderer.#getBridgeCreator + * @protected + * @type {boolean} + */ + addBridges:boolean; + /** + * Gets or sets the distance between the node's layout and its self loop control points. + * @type {number} + */ + selfLoopDistance:number; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.IEdgeStyleRenderer} that will render {@link yfiles.styles.PolylineEdgeStyle} instances. + * @class yfiles.styles.PolylineEdgeStyleRenderer + * @extends {yfiles.styles.PathBasedEdgeStyleRenderer.} + */ + export interface PolylineEdgeStyleRenderer extends yfiles.styles.PathBasedEdgeStyleRenderer{} + export class PolylineEdgeStyleRenderer { + constructor(); + static $class:yfiles.lang.Class; + } + /** + * A polygonal {@link yfiles.styles.IEdgeStyle} where straight line segments are used to connect the bends. + * @class yfiles.styles.PolylineEdgeStyle + * @implements {yfiles.styles.IEdgeStyle} + */ + export interface PolylineEdgeStyle extends Object,yfiles.styles.IEdgeStyle{} + export class PolylineEdgeStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.PolylineEdgeStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderer:yfiles.styles.PolylineEdgeStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.PolylineEdgeStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} property on the created object. + *

+ * @param {number} options.smoothingLength The smoothing length used for creating smooth bends. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#smoothingLength} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#sourceArrow} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#targetArrow} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.PolylineEdgeStyleRenderer,stroke?:yfiles.view.Stroke,smoothingLength?:number,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); + /** + * Creates a new instance using {@link yfiles.styles.PolylineEdgeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} property on the created object. + *

+ * @param {number} options.smoothingLength The smoothing length used for creating smooth bends. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#smoothingLength} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#sourceArrow} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.PolylineEdgeStyle#targetArrow} property on the created object. + *

+ * @constructor + */ + constructor(options?:{stroke?:yfiles.view.Stroke,smoothingLength?:number,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); + /** + * Performs a {@link Object#memberwiseClone} + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the {@link yfiles.styles.PolylineEdgeStyle#stroke} for the line. + *

+ * The default value is {@link yfiles.view.Stroke#BLACK}. + *

+ * @default 'System.Drawing.Pens.Black' + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Gets or sets the smoothing length used for creating smooth bends. + *

+ * A value of 0.0d will disable smoothing. + *

+ *

+ * The default value is 0. + *

+ * @default 0.0 + * @type {number} + */ + smoothingLength:number; + /** + * 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. + *

+ *

+ * This property may not be null. To have no target arrow set, use {@link yfiles.styles.IArrow#NONE} instead. + *

+ *

+ * The default value is {@link yfiles.styles.IArrow#NONE}. + *

+ * @default 'None' + * @type {yfiles.styles.IArrow} + */ + targetArrow:yfiles.styles.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. + *

+ *

+ * This property may not be null. To have no source arrow set, use {@link yfiles.styles.IArrow#NONE} instead. + *

+ *

+ * The default value is {@link yfiles.styles.IArrow#NONE}. + *

+ * @default 'None' + * @type {yfiles.styles.IArrow} + */ + sourceArrow:yfiles.styles.IArrow; + /** + * Gets the renderer implementation that has been supplied to this instance in the constructor. + * @type {yfiles.styles.IEdgeStyleRenderer} + */ + renderer:yfiles.styles.IEdgeStyleRenderer; + static $class:yfiles.lang.Class; + } + 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 + } + /** + * Default renderer implementation that can be used for {@link yfiles.styles.ShapeNodeStyle} instances. + * @class yfiles.styles.ShapeNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface ShapeNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class ShapeNodeStyleRenderer { + constructor(); + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.ShapeNodeStyleRenderer#style} and {@link yfiles.styles.ShapeNodeStyleRenderer#node} properies have been populated by the {@link yfiles.styles.ShapeNodeStyleRenderer#getVisualCreator}, + * {@link yfiles.styles.ShapeNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.ShapeNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ShapeNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Returns the layout bounds as an upper bound for the painting bound. + *

+ * This implementation simply sets the {@link yfiles.styles.ShapeNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. + *

+ * @param {yfiles.view.ICanvasContext} context the context to calculate the bounds for + * @returns {yfiles.geometry.Rect} the bounds or null to indicate an unbound area + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.ShapeNodeStyleRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.ShapeNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.ShapeNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} + * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.ShapeNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Get the brush that is currently used by this renderer. + *

+ * This implementation retrieves the brush from the owning style + *

+ * @returns {yfiles.view.Fill} The brush that is currently used by this renderer. + * @protected + */ + getFill():yfiles.view.Fill; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.ShapeNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.ShapeNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Get the shape that is currently used by this renderer. + *

+ * This implementation retrieves the shape from the owning style + *

+ * @returns {yfiles.styles.ShapeNodeShape} The shape that is currently used by this renderer. + * @protected + */ + getShape():yfiles.styles.ShapeNodeShape; + /** + * Configures the {@link yfiles.styles.ShapeNodeStyleRenderer#style} and {@link yfiles.styles.ShapeNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ShapeNodeStyleRenderer#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.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.ShapeNodeStyleRenderer#isInside + * @see yfiles.styles.ShapeNodeStyleRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Get the pen that is currently used by this renderer. + *

+ * This implementation retrieves the {@link yfiles.view.Stroke} from the owning style + *

+ * @returns {yfiles.view.Stroke} The {@link yfiles.view.Stroke} that is currently used by this renderer. + * @protected + */ + getStroke():yfiles.view.Stroke; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ShapeNodeStyleRenderer#configure}. If the + * subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.ShapeNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.ShapeNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShapeNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShapeNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.ShapeNodeStyleRenderer#createVisual + * @see yfiles.styles.ShapeNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Tests the {@link yfiles.styles.ShapeNodeStyleRenderer#node node} using the current {@link yfiles.styles.ShapeNodeStyleRenderer#style} for an intersection with the given box. + *

+ * This implementation uses the {@link yfiles.styles.ShapeNodeStyleRenderer#layout} to determine whether the node is in the box. + *

+ * @param {yfiles.input.IInputModeContext} context the current input mode context + * @param {yfiles.geometry.Rect} rectangle the box describing the marquee's bounds + * @returns {boolean} true if the node is considered to be captured by the marquee + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * Determines visibility by checking for an intersection with the {@link yfiles.styles.ShapeNodeStyleRenderer#layout}. + * @param {yfiles.view.ICanvasContext} context The context. + * @param {yfiles.geometry.Rect} rectangle The current clip + * @returns {boolean} Whether the {@link yfiles.styles.ShapeNodeStyleRenderer#layout} is visible in the clip. + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implements the {@link yfiles.graph.ILookup} interface. + *

+ * This method will be used by default if {@link yfiles.styles.ShapeNodeStyleRenderer#getContext} has been queried for a lookup + * implementation. Note that it cannot be assumed that {@link yfiles.styles.ShapeNodeStyleRenderer#configure} has already been + * invoked. However, normally {@link yfiles.styles.ShapeNodeStyleRenderer#node} and {@link yfiles.styles.ShapeNodeStyleRenderer#style} 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.styles.ShapeNodeStyleRenderer#configure} + * on success and return this. + *

+ * @param {yfiles.lang.Class} type The type to query for. + * @returns {Object} An implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.ShapeNodeStyle} + */ + style:yfiles.styles.ShapeNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * Gets or sets the radius that is used to draw rounded edges. + * @type {number} + */ + roundRectArcRadius:number; + static $class:yfiles.lang.Class; + } + /** + * Node style implementation that can show predefined shapes of type {@link yfiles.styles.ShapeNodeShape}. + *

+ * This style can be used together with {@link yfiles.styles.ShapeNodeStyleRenderer} instances. + *

+ * @class yfiles.styles.ShapeNodeStyle + * @implements {yfiles.styles.INodeStyle} + */ + export interface ShapeNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class ShapeNodeStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.ShapeNodeStyleRenderer} renderer Custom renderer instance for this style. + * @constructor + */ + constructor(renderer:yfiles.styles.ShapeNodeStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.ShapeNodeStyleRenderer} options.renderer Custom renderer instance for this style. + * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.ShapeNodeStyle#fill} for this style. + *

+ * This option sets the {@link yfiles.styles.ShapeNodeStyle#fill} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. + *

+ * This option sets the {@link yfiles.styles.ShapeNodeStyle#stroke} property on the created object. + *

+ * @param {yfiles.styles.ShapeNodeShape} options.shape The shape for this style. + *

+ * This option sets the {@link yfiles.styles.ShapeNodeStyle#shape} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.ShapeNodeStyleRenderer,fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke,shape?:yfiles.styles.ShapeNodeShape}); + /** + * Creates a new instance using {@link yfiles.styles.ShapeNodeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Fill} options.fill The {@link yfiles.styles.ShapeNodeStyle#fill} for this style. + *

+ * This option sets the {@link yfiles.styles.ShapeNodeStyle#fill} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. + *

+ * This option sets the {@link yfiles.styles.ShapeNodeStyle#stroke} property on the created object. + *

+ * @param {yfiles.styles.ShapeNodeShape} options.shape The shape for this style. + *

+ * This option sets the {@link yfiles.styles.ShapeNodeStyle#shape} property on the created object. + *

+ * @constructor + */ + constructor(options?:{fill?:yfiles.view.Fill,stroke?:yfiles.view.Stroke,shape?:yfiles.styles.ShapeNodeShape}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the {@link yfiles.styles.ShapeNodeStyle#stroke} for this style. + *

+ * The default value is {@link yfiles.view.Stroke#BLACK}. + *

+ * @default 'System.Drawing.Pens.Black' + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Gets or sets the {@link yfiles.styles.ShapeNodeStyle#fill} for this style. + *

+ * The default value is {@link yfiles.view.Fill#WHITE}. + *

+ * @default 'System.Drawing.Brushes.White' + * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + /** + * Gets or sets the shape for this style. + *

+ * The default value is {@link yfiles.styles.ShapeNodeShape#RECTANGLE}. + *

+ * @default 0 + * @type {yfiles.styles.ShapeNodeShape} + */ + shape:yfiles.styles.ShapeNodeShape; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Default renderer implementation for {@link yfiles.styles.ArcEdgeStyle} + * @class yfiles.styles.ArcEdgeStyleRenderer + * @extends {yfiles.styles.PathBasedEdgeStyleRenderer.} + */ + export interface ArcEdgeStyleRenderer extends yfiles.styles.PathBasedEdgeStyleRenderer{} + export class ArcEdgeStyleRenderer { + constructor(); + /** + * Retrieves the {@link yfiles.styles.ArcEdgeStyle#height} of the style. + * @returns {number} the height. + */ + getHeight():number; + /** + * Gets a value indicating whether this {@link yfiles.styles.ArcEdgeStyleRenderer#getHeight} should be interpreted as an absolute + * or relative value. + * @returns {boolean} true if the height value should be interpreted as a fixed value, otherwise, false. + * @see yfiles.styles.ArcEdgeStyleRenderer#getHeight + */ + isFixedHeight():boolean; + /** + * Overridden to return false since the flattening interferes with its own obstacles. + * @protected + * @type {boolean} + */ + addBridges:boolean; + static $class:yfiles.lang.Class; + } + /** + * Provides an arc representation for an edge. + *

+ * The rendering does not take into account bends of an edge, instead the arc's height is determined as a fixed ratio or + * fixed height. + *

+ *

+ * This style uses an {@link yfiles.styles.ArcEdgeStyleRenderer} for its visualization. + *

+ * @class yfiles.styles.ArcEdgeStyle + * @implements {yfiles.styles.IEdgeStyle} + */ + export interface ArcEdgeStyle extends Object,yfiles.styles.IEdgeStyle{} + export class ArcEdgeStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.ArcEdgeStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderer:yfiles.styles.ArcEdgeStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.ArcEdgeStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {boolean} options.fixedHeight A value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative value. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} property on the created object. + *

+ * @param {number} options.height The "height" of the arc. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#height} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#stroke} property on the created object. + *

+ * @param {boolean} options.provideHeightHandle A value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#provideHeightHandle} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#sourceArrow} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#targetArrow} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.ArcEdgeStyleRenderer,fixedHeight?:boolean,height?:number,stroke?:yfiles.view.Stroke,provideHeightHandle?:boolean,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); + /** + * Creates a new instance using {@link yfiles.styles.ArcEdgeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {boolean} options.fixedHeight A value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative value. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#fixedHeight} property on the created object. + *

+ * @param {number} options.height The "height" of the arc. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#height} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#stroke} property on the created object. + *

+ * @param {boolean} options.provideHeightHandle A value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#provideHeightHandle} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.sourceArrow The visual arrow at the source end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#sourceArrow} property on the created object. + *

+ * @param {yfiles.styles.IArrow} options.targetArrow The visual arrow at the target end of edges that use this style. + *

+ * This option sets the {@link yfiles.styles.ArcEdgeStyle#targetArrow} property on the created object. + *

+ * @constructor + */ + constructor(options?:{fixedHeight?:boolean,height?:number,stroke?:yfiles.view.Stroke,provideHeightHandle?:boolean,sourceArrow?:yfiles.styles.IArrow,targetArrow?:yfiles.styles.IArrow}); + /** + * Performs a {@link Object#memberwiseClone} + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the {@link yfiles.styles.ArcEdgeStyle#stroke} that is used to draw the arc + *

+ * The default value is {@link yfiles.view.Stroke#BLACK}. + *

+ * @default 'System.Drawing.Pens.Black' + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Gets or sets the "height" of the arc. + *

+ * Depending on the setting of {@link yfiles.styles.ArcEdgeStyle#fixedHeight}, this value is interpreted differently: If {@link yfiles.styles.ArcEdgeStyle#fixedHeight} is disabled, 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 {@link yfiles.styles.ArcEdgeStyle#fixedHeight} feature is enabled, this value + * will be interpreted as the absolute height. + *

+ *

+ * The default value is 0. + *

+ * @default 0 + * @type {number} + */ + height:number; + /** + * Gets or sets a value indicating whether this {@link yfiles.styles.ArcEdgeStyle} interprets the {@link yfiles.styles.ArcEdgeStyle#height} value as an absolute or relative + * value. + *

+ * The default value is true. + *

+ * @see yfiles.styles.ArcEdgeStyle#height + * @default true + * @type {boolean} + */ + fixedHeight:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.styles.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} if + * queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.styles.ArcEdgeStyle#height} of this instance. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + provideHeightHandle:boolean; + /** + * 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. + *

+ *

+ * The default value is {@link yfiles.styles.IArrow#NONE}. + *

+ * @default 'None' + * @type {yfiles.styles.IArrow} + */ + targetArrow:yfiles.styles.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. + *

+ *

+ * The default value is {@link yfiles.styles.IArrow#NONE}. + *

+ * @default 'None' + * @type {yfiles.styles.IArrow} + */ + sourceArrow:yfiles.styles.IArrow; + /** + * Gets the renderer implementation that has been supplied to this instance in the constructor. + * @type {yfiles.styles.IEdgeStyleRenderer} + */ + renderer:yfiles.styles.IEdgeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a rounded rectangle with a bevel border in a 'shiny plate' + * fashion. + * @class yfiles.styles.BevelNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface BevelNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class BevelNodeStyleRenderer { + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.BevelNodeStyleRenderer#style} and {@link yfiles.styles.BevelNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.BevelNodeStyleRenderer#getVisualCreator}, + * {@link yfiles.styles.BevelNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.BevelNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.BevelNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Returns the layout bounds as an upper bound for the painting bound. + *

+ * This implementation simply sets the {@link yfiles.styles.BevelNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. + *

+ * @param {yfiles.view.ICanvasContext} context the context to calculate the bounds for + * @returns {yfiles.geometry.Rect} the bounds or null to indicate an unbound area + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.BevelNodeStyleRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.BevelNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.BevelNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.BevelNodeStyleRenderer#configure} + * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.BevelNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.BevelNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.BevelNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Configures the {@link yfiles.styles.BevelNodeStyleRenderer#style} and {@link yfiles.styles.BevelNodeStyleRenderer#node} properties, calls {@link yfiles.styles.BevelNodeStyleRenderer#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.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.BevelNodeStyleRenderer#isInside + * @see yfiles.styles.BevelNodeStyleRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.BevelNodeStyleRenderer#configure}. If the + * subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.BevelNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.BevelNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.BevelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.BevelNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.BevelNodeStyleRenderer#createVisual + * @see yfiles.styles.BevelNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Tests the {@link yfiles.styles.BevelNodeStyleRenderer#node node} using the current {@link yfiles.styles.BevelNodeStyleRenderer#style} for an intersection with the given box. + *

+ * This implementation uses the {@link yfiles.styles.BevelNodeStyleRenderer#layout} to determine whether the node is in the box. + *

+ * @param {yfiles.input.IInputModeContext} context the current input mode context + * @param {yfiles.geometry.Rect} rectangle the box describing the marquee's bounds + * @returns {boolean} true if the node is considered to be captured by the marquee + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * Determines visibility by checking for an intersection with the {@link yfiles.styles.BevelNodeStyleRenderer#layout}. + * @param {yfiles.view.ICanvasContext} context The context. + * @param {yfiles.geometry.Rect} rectangle The current clip + * @returns {boolean} Whether the {@link yfiles.styles.BevelNodeStyleRenderer#layout} is visible in the clip. + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.BevelNodeStyle} + */ + style:yfiles.styles.BevelNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * Retrieves the color from the style. + * @protected + * @type {yfiles.view.Color} + */ + color:yfiles.view.Color; + /** + * Retrieves the inset from the style. + * @protected + * @type {number} + */ + inset:number; + /** + * Retrieves the radius to use from the style. + * @protected + * @type {number} + */ + radius:number; + /** + * 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.styles.BevelNodeStyleRenderer#lookup} + * of this instance if this feature is enabled. + *

+ * @default false + * @type {boolean} + */ + provideRadiusHandle:boolean; + static $class:yfiles.lang.Class; + } + /** + * An implementation of the {@link yfiles.styles.INodeStyle} that can be used to create rectangular nodes with rounded corners, a + * bevel border, and a shining background. + *

+ * Optionally, this style renders a drop shadow by itself. + *

+ *

+ * This style uses the {@link yfiles.styles.BevelNodeStyleRenderer} to visualize a node. + *

+ * @see yfiles.styles.BevelNodeStyleRenderer + * @class yfiles.styles.BevelNodeStyle + * @implements {yfiles.styles.INodeStyle} + */ + export interface BevelNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class BevelNodeStyle { + /** + * Creates a new instance using the provided renderer to share. + * @param {yfiles.styles.BevelNodeStyleRenderer} renderer + * @constructor + */ + constructor(renderer:yfiles.styles.BevelNodeStyleRenderer); + /** + * Creates a new instance using the provided renderer to share. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.BevelNodeStyleRenderer} options.renderer + * @param {yfiles.view.Color} options.color The base color to use. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#color} property on the created object. + *

+ * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#drawShadow} property on the created object. + *

+ * @param {number} options.inset The insets to use for the bevel. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#inset} property on the created object. + *

+ * @param {number} options.radius The radius of the corner of the rounded rectangle. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#radius} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.BevelNodeStyleRenderer,color?:yfiles.view.Color,drawShadow?:boolean,inset?:number,radius?:number}); + /** + * Creates a new instance using {@link yfiles.styles.BevelNodeStyleRenderer} as renderer to share. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Color} options.color The base color to use. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#color} property on the created object. + *

+ * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#drawShadow} property on the created object. + *

+ * @param {number} options.inset The insets to use for the bevel. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#inset} property on the created object. + *

+ * @param {number} options.radius The radius of the corner of the rounded rectangle. + *

+ * This option sets the {@link yfiles.styles.BevelNodeStyle#radius} property on the created object. + *

+ * @constructor + */ + constructor(options?:{color?:yfiles.view.Color,drawShadow?:boolean,inset?:number,radius?:number}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the insets to use for the bevel. + *

+ * The default value is 3. + *

+ * @type {number} + */ + inset:number; + /** + * Gets or sets the radius of the corner of the rounded rectangle. + *

+ * The default value is 10. + *

+ * @type {number} + */ + radius:number; + /** + * Gets or sets the base color to use. + *

+ * The default value is {@link yfiles.view.Color#BLACK}. + *

+ * @default 'Black' + * @type {yfiles.view.Color} + */ + color:yfiles.view.Color; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + /** + * Gets or sets a value indicating whether to draw a drop shadow. + *

+ * The default value is false. + *

+ * @default false + * @type {boolean} + */ + drawShadow:boolean; + static $class:yfiles.lang.Class; + } + /** + * A style renderer implementation that can be used together with {@link yfiles.styles.ImageNodeStyle} instances. + * @class yfiles.styles.ImageNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface ImageNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class ImageNodeStyleRenderer { + constructor(); + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.ImageNodeStyleRenderer#style} and {@link yfiles.styles.ImageNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.ImageNodeStyleRenderer#getVisualCreator}, + * {@link yfiles.styles.ImageNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.ImageNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ImageNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Returns the layout bounds as an upper bound for the painting bound. + *

+ * This implementation simply sets the {@link yfiles.styles.ImageNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. + *

+ * @param {yfiles.view.ICanvasContext} context the context to calculate the bounds for + * @returns {yfiles.geometry.Rect} the bounds or null to indicate an unbound area + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.ImageNodeStyleRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.ImageNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.ImageNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.ImageNodeStyleRenderer#configure} + * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.ImageNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Get the style's fallback image. + * @returns {string} + * @protected + */ + getFallbackImage():string; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.ImageNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * Get the image that is currently used to render the style. + * @returns {string} + * @protected + */ + getImage():string; + /** + * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the intersection calculation, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.ImageNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to create the outline shape path, otherwise reverts to default (rectangular) behavior. + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Gets the value that determines whether the aspect ratio of the image should be preserved. + * @returns {boolean} false + * @protected + */ + getPreserveAspectRatio():boolean; + /** + * Configures the {@link yfiles.styles.ImageNodeStyleRenderer#style} and {@link yfiles.styles.ImageNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ImageNodeStyleRenderer#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.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.ImageNodeStyleRenderer#isInside + * @see yfiles.styles.ImageNodeStyleRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ImageNodeStyleRenderer#configure}. If the + * subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.ImageNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.ImageNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ImageNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ImageNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.ImageNodeStyleRenderer#createVisual + * @see yfiles.styles.ImageNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * Tries to use {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the hit test analysis, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.input.IInputModeContext} context the context the hit test is performed in + * @param {yfiles.geometry.Point} location the coordinates in world coordinate system + * @returns {boolean} whether something has been hit + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the marquee intersection analysis, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Tries to use the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} to perform the contains test, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * Determines visibility by checking for an intersection with the {@link yfiles.styles.ImageNodeStyleRenderer#layout}. + * @param {yfiles.view.ICanvasContext} context The context. + * @param {yfiles.geometry.Rect} rectangle The current clip + * @returns {boolean} Whether the {@link yfiles.styles.ImageNodeStyleRenderer#layout} is visible in the clip. + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implements the {@link yfiles.graph.ILookup} interface. + *

+ * This method will be used by default if {@link yfiles.styles.ImageNodeStyleRenderer#getContext} has been queried for a lookup + * implementation. Note that it cannot be assumed that {@link yfiles.styles.ImageNodeStyleRenderer#configure} has already been + * invoked. However, normally {@link yfiles.styles.ImageNodeStyleRenderer#node} and {@link yfiles.styles.ImageNodeStyleRenderer#style} 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.styles.ImageNodeStyleRenderer#configure} + * on success and return this. + *

+ * @param {yfiles.lang.Class} type The type to query for. + * @returns {Object} An implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.ImageNodeStyle} + */ + style:yfiles.styles.ImageNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * A {@link string} 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.styles.ImageNodeStyle#fallbackImage fallback image}. + * @const + * @static + * @type {string} + */ + static TEMPLATE_KEY:string; + static $class:yfiles.lang.Class; + } + /** + * A node style that can use an image for the visual representation of a node. + *

+ * This style can be used together with {@link yfiles.styles.ImageNodeStyleRenderer} instances. + *

+ * @class yfiles.styles.ImageNodeStyle + * @implements {yfiles.styles.INodeStyle} + */ + export interface ImageNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class ImageNodeStyle { + /** + * Creates a new instance that uses the specified image and a custom renderer instance. + * @param {string} image The image. + * @param {string} [fallbackImage=null] The fallback image. + * @param {yfiles.styles.ImageNodeStyleRenderer} [renderer=null] The renderer for this instance + * @constructor + */ + constructor(image:string,fallbackImage?:string,renderer?:yfiles.styles.ImageNodeStyleRenderer); + /** + * Creates a new instance that uses the specified image and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.image The image. + * @param {string} [options.fallbackImage=null] The fallback image. + * @param {yfiles.styles.ImageNodeStyleRenderer} [options.renderer=null] The renderer for this instance + * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of the image that will be displayed. + *

+ * This option sets the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} property on the created object. + *

+ * @constructor + */ + constructor(options:{image:string,fallbackImage?:string,renderer?:yfiles.styles.ImageNodeStyleRenderer,normalizedOutline?:yfiles.geometry.GeneralPath}); + /** + * Creates a new instance with no image and {@link yfiles.styles.ImageNodeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {string} [options.fallbackImage=null] Sets the fallbackImage property. + * @param {string} options.image The image that is used for the style instance. + *

+ * This option sets the {@link yfiles.styles.ImageNodeStyle#image} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of the image that will be displayed. + *

+ * This option sets the {@link yfiles.styles.ImageNodeStyle#normalizedOutline} property on the created object. + *

+ * @constructor + */ + constructor(options?:{fallbackImage?:string,image?:string,normalizedOutline?:yfiles.geometry.GeneralPath}); + /** + * This implementation performs a shallow copy with respect to the {@link yfiles.styles.ImageNodeStyle#image} property. + *

+ * If clients need to have a deep copy of this instance, they need to manually clone and reassign the {@link yfiles.styles.ImageNodeStyle#image} to the clone. + *

+ * @returns {Object} A shallow copy of this instance. + */ + clone():Object; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + /** + * Gets or sets the image that is used for the style instance. + *

+ * The default value is null. + *

+ * @type {string} + */ + image:string; + /** + * + * @default null + * @type {string} + */ + fallbackImage:string; + /** + * Gets or sets the normalized outline of the image that will be displayed. + *

+ * This shape will be used to satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} + * and may be left null to indicate default (rectangular) behavior. + *

+ *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.geometry.GeneralPath} + */ + normalizedOutline:yfiles.geometry.GeneralPath; + static $class:yfiles.lang.Class; + } + /** + * An implementation of {@link yfiles.styles.INodeStyle} that draws a simple floating panel with a slight gradient, a thin border + * and optionally a drop shadow. + *

+ * This style can be used to create the visual representation for group nodes, for example. By default, it a drop shadow by + * itself. + *

+ *

+ * This style uses the {@link yfiles.styles.PanelNodeStyleRenderer} to visualize a node. + *

+ * @see yfiles.styles.PanelNodeStyleRenderer + * @class yfiles.styles.PanelNodeStyle + * @implements {yfiles.styles.INodeStyle} + */ + export interface PanelNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class PanelNodeStyle { + /** + * Creates a new instance using the provided renderer to share. + * @param {yfiles.styles.PanelNodeStyleRenderer} renderer + * @constructor + */ + constructor(renderer:yfiles.styles.PanelNodeStyleRenderer); + /** + * Creates a new instance using the provided renderer to share. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.PanelNodeStyleRenderer} options.renderer + * @param {yfiles.view.Color} options.color The base color to use. + *

+ * This option sets the {@link yfiles.styles.PanelNodeStyle#color} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. + *

+ * This option sets the {@link yfiles.styles.PanelNodeStyle#insets} property on the created object. + *

+ * @param {yfiles.view.Color} options.labelInsetsColor The base color to use for drawing the label insets background. + *

+ * This option sets the {@link yfiles.styles.PanelNodeStyle#labelInsetsColor} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.PanelNodeStyleRenderer,color?:yfiles.view.Color,insets?:yfiles.geometry.Insets,labelInsetsColor?:yfiles.view.Color}); + /** + * Creates a new instance using {@link yfiles.styles.PanelNodeStyleRenderer} as renderer to share. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Color} options.color The base color to use. + *

+ * This option sets the {@link yfiles.styles.PanelNodeStyle#color} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. + *

+ * This option sets the {@link yfiles.styles.PanelNodeStyle#insets} property on the created object. + *

+ * @param {yfiles.view.Color} options.labelInsetsColor The base color to use for drawing the label insets background. + *

+ * This option sets the {@link yfiles.styles.PanelNodeStyle#labelInsetsColor} property on the created object. + *

+ * @constructor + */ + constructor(options?:{color?:yfiles.view.Color,insets?:yfiles.geometry.Insets,labelInsetsColor?:yfiles.view.Color}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the base color to use. + *

+ * The default value is {@link yfiles.view.Color#BLACK}. + *

+ * @default 'Black' + * @type {yfiles.view.Color} + */ + color:yfiles.view.Color; + /** + * Gets or sets the base color to use for drawing the label insets background. + *

+ * Setting this to null effectively disables label insets background coloring. + *

+ *

+ * The default value is {@link yfiles.view.Color#LIGHT_GRAY}. + *

+ * @default 'LightGray' + * @type {yfiles.view.Color} + */ + labelInsetsColor:yfiles.view.Color; + /** + * Gets or sets the instance to use that provides the insets for this style. + *

+ * The {@link yfiles.styles.PanelNodeStyleRenderer} will use these insets and return them via an {@link yfiles.input.INodeInsetsProvider} + * if such an instance is queried through the {@link yfiles.styles.INodeStyleRenderer#getContext context lookup}. + *

+ *

+ * The default insets are set to (5,5,5,5). + *

+ * @see yfiles.input.INodeInsetsProvider + * @default '5, 5, 5, 5' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a simple floating panel with a slight gradient, a thin + * border and a simple drop shadow. + * @see yfiles.styles.PanelNodeStyle + * @class yfiles.styles.PanelNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface PanelNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class PanelNodeStyleRenderer { + /** + * The style that it currently assigned to this renderer instance. + * @constructor + */ + constructor(); + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.PanelNodeStyleRenderer#style} and {@link yfiles.styles.PanelNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.PanelNodeStyleRenderer#getVisualCreator}, + * {@link yfiles.styles.PanelNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.PanelNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.PanelNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Determines whether to draw the drop shadow. + * @returns {boolean} true, always. + * @protected + */ + drawShadow():boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.PanelNodeStyleRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.PanelNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.PanelNodeStyleRenderer#lookup} method call they should call {@link yfiles.styles.PanelNodeStyleRenderer#configure} + * only if needed, i.e. if they decide to return this or an instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.PanelNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.PanelNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * Finds an intersection for the current {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the {@link yfiles.styles.PanelNodeStyleRenderer#style}. + *

+ * This implementation returns the intersection for the {@link yfiles.styles.PanelNodeStyleRenderer#layout}. + *

+ * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} True if an intersection was actually found + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.PanelNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * Returns the outline of the shape using the node's {@link yfiles.styles.PanelNodeStyleRenderer#layout}. + * @returns {yfiles.geometry.GeneralPath} The outline of the bounds of the node. + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Configures the {@link yfiles.styles.PanelNodeStyleRenderer#style} and {@link yfiles.styles.PanelNodeStyleRenderer#node} properties, calls {@link yfiles.styles.PanelNodeStyleRenderer#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.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.PanelNodeStyleRenderer#isInside + * @see yfiles.styles.PanelNodeStyleRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.PanelNodeStyleRenderer#configure}. If the + * subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.PanelNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.PanelNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.PanelNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.PanelNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.PanelNodeStyleRenderer#createVisual + * @see yfiles.styles.PanelNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * Hit tests the {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the current {@link yfiles.styles.PanelNodeStyleRenderer#style}. + *

+ * This implementation uses the {@link yfiles.styles.PanelNodeStyleRenderer#layout} to determine whether the node has been hit. The check is delegated to {@link yfiles.geometry.Rect#containsWithEps} + * using {@link yfiles.view.ICanvasContext#hitTestRadius} as the last argument. + *

+ * @param {yfiles.input.IInputModeContext} context the context the hit test is performed in + * @param {yfiles.geometry.Point} location the coordinates in world coordinate system + * @returns {boolean} whether something has been hit + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Tests the {@link yfiles.styles.PanelNodeStyleRenderer#node node} using the current {@link yfiles.styles.PanelNodeStyleRenderer#style} for an intersection with the given box. + *

+ * This implementation uses the {@link yfiles.styles.PanelNodeStyleRenderer#layout} to determine whether the node is in the box. + *

+ * @param {yfiles.input.IInputModeContext} context the current input mode context + * @param {yfiles.geometry.Rect} rectangle the box describing the marquee's bounds + * @returns {boolean} true if the node is considered to be captured by the marquee + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Checks whether the given coordinate lies within the shape's geometric bounds. + *

+ * This implementation checks for containment in the {@link yfiles.styles.PanelNodeStyleRenderer#layout}. + *

+ * @param {yfiles.geometry.Point} location + * @returns {boolean} True if the point lies within the geometry of the rendering. + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.PanelNodeStyle} + */ + style:yfiles.styles.PanelNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * Retrieves the color from the style. + * @protected + * @type {yfiles.view.Color} + */ + color:yfiles.view.Color; + static $class:yfiles.lang.Class; + } + /** + * Decorates other node styles with a smooth drop shadow. + *

+ * 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. + *

+ * @class yfiles.styles.ShadowNodeStyleDecorator + * @implements {yfiles.styles.INodeStyle} + */ + export interface ShadowNodeStyleDecorator extends Object,yfiles.styles.INodeStyle{} + export class 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.styles.INodeStyle} wrapped The style to wrap. + * @constructor + */ + constructor(wrapped:yfiles.styles.INodeStyle); + /** + * Creates a new instance wrapping a simple {@link yfiles.styles.ShapeNodeStyle}. + *

+ * The provided instance is used by reference, so subsequent changes to the style will affect the appearance of this + * style. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.wrapped The wrapped node style instance by reference. + *

+ * This option sets the {@link yfiles.styles.ShadowNodeStyleDecorator#wrapped} property on the created object. + *

+ * @see yfiles.styles.ShadowNodeStyleDecorator#wrapped + * @constructor + */ + constructor(options?:{wrapped?:yfiles.styles.INodeStyle}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the wrapped node style instance by reference. + * @type {yfiles.styles.INodeStyle} + */ + wrapped:yfiles.styles.INodeStyle; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Implementation of the {@link yfiles.styles.INodeStyle} which creates rectangular nodes with rounded corners and a highlighted + * ('shiny plate') interior. + *

+ * By default, this style renders a drop shadow by itself. + *

+ *

+ * This style uses the {@link yfiles.styles.ShinyPlateNodeStyleRenderer} to visualize a node. + *

+ * @see yfiles.styles.ShinyPlateNodeStyleRenderer + * @class yfiles.styles.ShinyPlateNodeStyle + * @implements {yfiles.styles.INodeStyle} + */ + export interface ShinyPlateNodeStyle extends Object,yfiles.styles.INodeStyle{} + export class ShinyPlateNodeStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.ShinyPlateNodeStyleRenderer} renderer + * @constructor + */ + constructor(renderer:yfiles.styles.ShinyPlateNodeStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.ShinyPlateNodeStyleRenderer} options.renderer + * @param {yfiles.view.Fill} options.fill The background brush for this style. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#fill} property on the created object. + *

+ * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#insets} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} property on the created object. + *

+ * @param {number} options.radius The corner radius of the rounded rectangle + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#radius} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.ShinyPlateNodeStyleRenderer,fill?:yfiles.view.Fill,drawShadow?:boolean,insets?:yfiles.geometry.Insets,stroke?:yfiles.view.Stroke,radius?:number}); + /** + * Creates a new instance using {@link yfiles.styles.ShinyPlateNodeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.view.Fill} options.fill The background brush for this style. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#fill} property on the created object. + *

+ * @param {boolean} options.drawShadow A value indicating whether to draw a drop shadow. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The instance to use that provides the insets for this style. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#insets} property on the created object. + *

+ * @param {yfiles.view.Stroke} options.stroke The {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} property on the created object. + *

+ * @param {number} options.radius The corner radius of the rounded rectangle + *

+ * This option sets the {@link yfiles.styles.ShinyPlateNodeStyle#radius} property on the created object. + *

+ * @constructor + */ + constructor(options?:{fill?:yfiles.view.Fill,drawShadow?:boolean,insets?:yfiles.geometry.Insets,stroke?:yfiles.view.Stroke,radius?:number}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Gets or sets the background brush for this style. + *

+ * The default value is {@link yfiles.view.Fill#BLACK}. + *

+ * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + /** + * Gets or sets the {@link yfiles.styles.ShinyPlateNodeStyle#stroke} to use for the outline. + *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Gets or sets the corner radius of the rounded rectangle + *

+ * The default value is 5. + *

+ * @default 5 + * @type {number} + */ + radius:number; + /** + * Gets or sets a value indicating whether to draw a drop shadow. + *

+ * The default value is true. + *

+ * @default true + * @type {boolean} + */ + drawShadow:boolean; + /** + * Gets or sets the instance to use that provides the insets for this style. + *

+ * The {@link yfiles.styles.ShinyPlateNodeStyleRenderer} will use these insets and return them via an {@link yfiles.input.INodeInsetsProvider} + * if such an instance is queried through the {@link yfiles.styles.INodeStyleRenderer#getContext context lookup}. + *

+ *

+ * The default insets are set to (5,5,5,5). + *

+ * @see yfiles.input.INodeInsetsProvider + * @default '5,5,5,5' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.INodeStyle} {@link yfiles.styles.INodeStyleRenderer renderer} implementation that draws a simple floating shinyPlate with a slight gradient, a + * thin border and a simple drop shadow. + * @see yfiles.styles.ShinyPlateNodeStyle + * @class yfiles.styles.ShinyPlateNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface ShinyPlateNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class ShinyPlateNodeStyleRenderer { + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} and {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} properties have been populated by the + * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getVisualCreator}, {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getBoundsProvider}, + * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.ShinyPlateNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Determines whether to draw the drop shadow. + * @returns {boolean} {@link yfiles.styles.ShinyPlateNodeStyle#drawShadow}. + * @protected + */ + drawShadow():boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#getBounds + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns + * this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#lookup} method call they should + * call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an + * instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query hit test with. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Configures the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} and {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} properties, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#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.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.styles.IShapeGeometry} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isInside + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#getIntersection + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns + * this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure}. If + * the subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.ShinyPlateNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.ShinyPlateNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#createVisual + * @see yfiles.styles.ShinyPlateNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Tests the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#node node} using the current {@link yfiles.styles.ShinyPlateNodeStyleRenderer#style} for an intersection with the given box. + *

+ * This implementation uses the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#layout} to determine whether the node is in the box. + *

+ * @param {yfiles.input.IInputModeContext} context the current input mode context + * @param {yfiles.geometry.Rect} rectangle the box describing the marquee's bounds + * @returns {boolean} true if the node is considered to be captured by the marquee + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.ShinyPlateNodeStyle} + */ + style:yfiles.styles.ShinyPlateNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + /** + * Retrieves the brush from the style. + * @protected + * @type {yfiles.view.Fill} + */ + fill:yfiles.view.Fill; + /** + * Retrieves the {@link yfiles.styles.ShinyPlateNodeStyleRenderer#stroke} from the style. + * @protected + * @type {yfiles.view.Stroke} + */ + stroke:yfiles.view.Stroke; + /** + * Retrieves the radius from the style. + * @protected + * @type {number} + */ + radius:number; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.INodeStyle} for {@link yfiles.graph.ITable tables}. + *

+ * This implementations stores the table instance and therefore, its instances cannot be shared among different table + * instances. + *

+ * @class yfiles.styles.TableNodeStyle + * @implements {yfiles.styles.INodeStyle} + * @implements {yfiles.lang.IPropertyObservable} + */ + export interface TableNodeStyle extends Object,yfiles.styles.INodeStyle,yfiles.lang.IPropertyObservable{} + export class TableNodeStyle { + /** + * Constructor with a custom renderer implementation that uses table as backing table model. + * @param {yfiles.graph.ITable} table The table instance that defines the tabular structure. + * @param {yfiles.styles.TableNodeStyleRenderer} [renderer=null] Custom renderer instance for this style. + * @constructor + */ + constructor(table:yfiles.graph.ITable,renderer?:yfiles.styles.TableNodeStyleRenderer); + /** + * Constructor with a custom renderer implementation that uses table as backing table model. + * @param {Object} options The parameters to pass. + * @param {yfiles.graph.ITable} options.table The table instance that defines the tabular structure. + * @param {yfiles.styles.TableNodeStyleRenderer} [options.renderer=null] Custom renderer instance for this style. + * @param {yfiles.styles.INodeStyle} options.backgroundStyle The style that is used to draw the background of the table + *

+ * This option sets the {@link yfiles.styles.TableNodeStyle#backgroundStyle} property on the created object. + *

+ * @param {yfiles.styles.TableRenderingOrder} options.tableRenderingOrder The order in which rows and columns are rendered. + *

+ * This option sets the {@link yfiles.styles.TableNodeStyle#tableRenderingOrder} property on the created object. + *

+ * @constructor + */ + constructor(options:{table:yfiles.graph.ITable,renderer?:yfiles.styles.TableNodeStyleRenderer,backgroundStyle?:yfiles.styles.INodeStyle,tableRenderingOrder?:yfiles.styles.TableRenderingOrder}); + /** + * Default constructor that creates an empty table. + * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.backgroundStyle The style that is used to draw the background of the table + *

+ * This option sets the {@link yfiles.styles.TableNodeStyle#backgroundStyle} property on the created object. + *

+ * @param {yfiles.graph.ITable} options.table The {@link yfiles.graph.ITable} instance that defines the tabular structure. + *

+ * This option sets the {@link yfiles.styles.TableNodeStyle#table} property on the created object. + *

+ * @param {yfiles.styles.TableRenderingOrder} options.tableRenderingOrder The order in which rows and columns are rendered. + *

+ * This option sets the {@link yfiles.styles.TableNodeStyle#tableRenderingOrder} property on the created object. + *

+ * @constructor + */ + constructor(options?:{backgroundStyle?:yfiles.styles.INodeStyle,table?:yfiles.graph.ITable,tableRenderingOrder?:yfiles.styles.TableRenderingOrder}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Create a copy of the background style when this style instance is cloned + * @param {yfiles.styles.INodeStyle} style The original background node style + * @returns {yfiles.styles.INodeStyle} This implementation always returns the original style instance. + * @protected + */ + copyBackgroundStyle(style:yfiles.styles.INodeStyle):yfiles.styles.INodeStyle; + /** + * Create a copy of the table when this style instance is cloned + * @param {yfiles.graph.ITable} table The original table instance + * @returns {yfiles.graph.ITable} This implementation always tries to {@link yfiles.lang.ICloneable#clone} clone the original table instance, if possible, + * otherwise it returns table unchanged. + * @protected + */ + copyTable(table:yfiles.graph.ITable):yfiles.graph.ITable; + /** + * Raises the {@link yfiles.styles.TableNodeStyle#addPropertyChangedListener PropertyChanged} event. + *

+ * Called when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. + *

+ * @param {yfiles.lang.PropertyChangedEventArgs} evt The {@link yfiles.lang.PropertyChangedEventArgs} instance containing the event data. + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Gets or sets the order in which rows and columns are rendered. + * @default 0 + * @type {yfiles.styles.TableRenderingOrder} + */ + tableRenderingOrder:yfiles.styles.TableRenderingOrder; + /** + * Gets or sets the style that is used to draw the background of the table + * @default 'TableNodeStyle.defaultBackgroundStyle' + * @type {yfiles.styles.INodeStyle} + */ + backgroundStyle:yfiles.styles.INodeStyle; + /** + * Adds the given listener for the PropertyChanged event that occurs when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.styles.TableNodeStyle#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when the value of the {@link yfiles.styles.TableNodeStyle#table} property changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.styles.TableNodeStyle#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the {@link yfiles.graph.ITable} instance that defines the tabular structure. + * @type {yfiles.graph.ITable} + */ + table:yfiles.graph.ITable; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Default renderer implementation that can be used for {@link yfiles.styles.TableNodeStyle} instances. + * @class yfiles.styles.TableNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface TableNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class TableNodeStyleRenderer { + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.TableNodeStyleRenderer#style} and {@link yfiles.styles.TableNodeStyleRenderer#node} properties have been populated by the {@link yfiles.styles.TableNodeStyleRenderer#getVisualCreator}, + * {@link yfiles.styles.TableNodeStyleRenderer#getBoundsProvider}, {@link yfiles.styles.TableNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.TableNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.view.Visual} + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Get the {@link yfiles.styles.INodeStyle background style} that is currently used by this renderer. + *

+ * This implementation retrieves the {@link yfiles.styles.TableNodeStyle#backgroundStyle} from the owning style + *

+ * @returns {yfiles.styles.INodeStyle} The {@link yfiles.styles.INodeStyle background style} that is currently used by this renderer. + * @protected + */ + getBackgroundStyle():yfiles.styles.INodeStyle; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.view.IBoundsProvider} + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.graph.ILookup} + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.input.IHitTestable} + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.input.IMarqueeTestable} + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.styles.IShapeGeometry} + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Gets the table object that should be used for rendering. + *

+ * This implementation delegates to the Table provided by the {@link yfiles.styles.TableNodeStyle#table} property. + *

+ * @returns {yfiles.graph.ITable} The table that should be used for the rendering process. + * @protected + */ + getTable():yfiles.graph.ITable; + /** + * Get the {@link yfiles.styles.TableRenderingOrder} that is currently used by this renderer. + *

+ * This implementation retrieves the {@link yfiles.styles.TableRenderingOrder} from the owning style + *

+ * @returns {yfiles.styles.TableRenderingOrder} The {@link yfiles.styles.TableRenderingOrder} that is currently used by this renderer. + * @protected + */ + getTableRenderingOrder():yfiles.styles.TableRenderingOrder; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.view.IVisibilityTestable} + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * + * @param {yfiles.graph.INode} node + * @param {yfiles.styles.INodeStyle} style + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * + * @param {yfiles.lang.Class} type + * @returns {Object} + */ + lookup(type:yfiles.lang.Class):Object; + /** + * + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual + * @returns {yfiles.view.Visual} + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.TableNodeStyle} + */ + style:yfiles.styles.TableNodeStyle; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + static $class:yfiles.lang.Class; + } + /** + * Base class for stripe styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.IStripe}s. + * @see yfiles.styles.TemplateStripeStyle + * @see yfiles.styles.StringTemplateStripeStyle + * @class yfiles.styles.TemplateStripeStyleBase + * @implements {yfiles.styles.IStripeStyle} + * @implements {yfiles.lang.IPropertyObservable} + * @implements {yfiles.lang.ICloneable} + */ + export interface TemplateStripeStyleBase extends Object,yfiles.styles.IStripeStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} + export class TemplateStripeStyleBase { + /** + * Constructs a new instance using the provided renderer. + * @param {yfiles.styles.TemplateStripeStyleRenderer} renderer + * @protected + * @constructor + */ + constructor(renderer:yfiles.styles.TemplateStripeStyleRenderer); + /** + * Constructs a new instance of this style with default values. + * @protected + * @constructor + */ + constructor(); + /** + * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateStripeStyleBase#styleTag} which is cloned, too, if it can be cloned. + * @returns {Object} A clone of this instance. + */ + clone():Object; + /** + * Factory method that is called by the {@link yfiles.styles.TemplateStripeStyleRenderer} to create the visual that will be used + * for the display of the stripe. + * @param {yfiles.view.IRenderContext} context The context for which the visual should be created. + * @param {yfiles.graph.IStripe} stripe The stripe that will be rendered. + * @returns {yfiles.view.SvgVisual} The readily styled visual. + */ + createTemplate(context:yfiles.view.IRenderContext,stripe:yfiles.graph.IStripe):yfiles.view.SvgVisual; + /** + * Loads all template script elements that have not been parsed, yet, and creates the respective template cache 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. + *

+ * @static + */ + static loadAllTemplates():void; + /** + * Raises the {@link yfiles.styles.TemplateStripeStyleBase#addPropertyChangedListener PropertyChanged} + * event. + * @param {yfiles.lang.PropertyChangedEventArgs} evt The {@link yfiles.lang.PropertyChangedEventArgs} instance containing the event data. + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Adds the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.styles.TemplateStripeStyleBase#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.styles.TemplateStripeStyleBase#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the tag that is associated with this style instance. + *

+ * The various style renderer 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.lang.IPropertyObservable property change notification} and can + * thus be data bound easily. + *

+ * @default null + * @type {Object} + */ + styleTag:Object; + /** + * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the + * implementation which is returned by calls to {@link yfiles.styles.IStripeStyleRenderer#getContext} that are made on the style + * renderer 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. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} + *

+ * @default 'Lookups.EmptyContextLookup' + * @type {yfiles.graph.IContextLookup} + */ + contextLookup:yfiles.graph.IContextLookup; + /** + * Convenience getter that yields the {@link yfiles.styles.TemplateStripeStyleRenderer} that is used by this instance. + * @see yfiles.styles.IStripeStyle#renderer + * @type {yfiles.styles.IStripeStyleRenderer} + */ + renderer:yfiles.styles.IStripeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.IStripeStyle} implementation that can render complex {@link yfiles.view.Visual}s for the visualization of + * {@link yfiles.graph.IStripe}s using a {@link yfiles.styles.TemplateStripeStyleRenderer}. + *

+ * The {@link yfiles.styles.TemplateStripeStyle#styleResourceKey} is used to determine the template that will be applied to the {@link yfiles.view.Visual}. + *

+ *

Related demos:

+ *
    + *
  • Demo: Control Styles Demo, Demo.yFiles.Graph.ControlStyles
  • + *
  • Demo: OrgChart Demo, Demo.yFiles.Graph.OrgChart
  • + *
+ * @class yfiles.styles.TemplateStripeStyle + * @extends {yfiles.styles.TemplateStripeStyleBase} + */ + export interface TemplateStripeStyle extends yfiles.styles.TemplateStripeStyleBase{} + export class TemplateStripeStyle { + /** + * Creates a new instance using the given resource key and a custom renderer instance. + * @param {string} styleResourceKey The key of the style resource that will be used for the component. + * @param {yfiles.styles.TemplateStripeStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(styleResourceKey:string,renderer:yfiles.styles.TemplateStripeStyleRenderer); + /** + * Creates a new instance using the given resource key and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.styleResourceKey The key of the style resource that will be used for the component. + * @param {yfiles.styles.TemplateStripeStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. + *

+ * @constructor + */ + constructor(options:{styleResourceKey:string,renderer:yfiles.styles.TemplateStripeStyleRenderer,styleTag?:Object}); + /** + * Creates a new instance using the given resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. + * @param {string} styleResourceKey The key of the style resource that will be used for the component. + * @constructor + */ + constructor(styleResourceKey:string); + /** + * Creates a new instance using the given resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. + * @param {Object} options The parameters to pass. + * @param {string} options.styleResourceKey The key of the style resource that will be used for the component. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. + *

+ * @constructor + */ + constructor(options:{styleResourceKey:string,styleTag?:Object}); + /** + * Creates a new instance with no style resource key and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. + *

+ * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyle#styleResourceKey} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,styleResourceKey?:string}); + /** + * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. + * @default null + * @type {string} + */ + styleResourceKey:string; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.IStripeStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.IStripe}s. + *

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

+ *

+ * It is vital that the {@link yfiles.styles.StringTemplateStripeStyle#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. + *

+ * @class yfiles.styles.StringTemplateStripeStyle + * @extends {yfiles.styles.TemplateStripeStyleBase} + */ + export interface StringTemplateStripeStyle extends yfiles.styles.TemplateStripeStyleBase{} + export class StringTemplateStripeStyle { + /** + * Creates a new instance using the given SVG template and a custom renderer instance. + * @param {string} svgContent The SVG snippet that will be used as a template for the component. + * @param {yfiles.styles.TemplateStripeStyleRenderer} renderer The custom renderer for this instance. + * @constructor + */ + constructor(svgContent:string,renderer:yfiles.styles.TemplateStripeStyleRenderer); + /** + * Creates a new instance using the given SVG template and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.svgContent The SVG snippet that will be used as a template for the component. + * @param {yfiles.styles.TemplateStripeStyleRenderer} options.renderer The custom renderer for this instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. + *

+ * @constructor + */ + constructor(options:{svgContent:string,renderer:yfiles.styles.TemplateStripeStyleRenderer,styleTag?:Object}); + /** + * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. + * @param {string} svgContent The SVG snippet that will be used as a template for the component. + * @constructor + */ + constructor(svgContent:string); + /** + * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. + * @param {Object} options The parameters to pass. + * @param {string} options.svgContent The SVG snippet that will be used as a template for the component. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. + *

+ * @constructor + */ + constructor(options:{svgContent:string,styleTag?:Object}); + /** + * Creates a new instance with no SVG template and {@link yfiles.styles.TemplateStripeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateStripeStyleBase#styleTag} property on the created object. + *

+ * @param {string} options.svgContent The SVG content that is the template for the stripe visualization. + *

+ * This option sets the {@link yfiles.styles.StringTemplateStripeStyle#svgContent} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,svgContent?:string}); + /** + * Gets or sets the SVG content that is the template for the stripe visualization. + * @default null + * @type {string} + */ + svgContent:string; + static $class:yfiles.lang.Class; + } + /** + * An implementation of the {@link yfiles.styles.IStripeStyleRenderer} interface that can render {@link yfiles.styles.TemplateStripeStyle} + * instances. + * @see yfiles.styles.TemplateStripeStyle + * @class yfiles.styles.TemplateStripeStyleRenderer + * @implements {yfiles.styles.IStripeStyleRenderer} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface TemplateStripeStyleRenderer extends Object,yfiles.styles.IStripeStyleRenderer,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class TemplateStripeStyleRenderer { + /** + * Prepares this instance for subsequent calls after the style and stripe have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.TemplateStripeStyleRenderer#style} and {@link yfiles.styles.TemplateStripeStyleRenderer#stripe} properties have been populated by the {@link yfiles.styles.TemplateStripeStyleRenderer#getVisualCreator} + * or {@link yfiles.styles.TemplateStripeStyleRenderer#getContext} methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * Creates the visual by delegating to CreateControl and then initializing the control with the context. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @returns {yfiles.view.Visual} The control that is used for rendering the stripe. + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Configures the style and stripe parameters, does not call {@link yfiles.styles.TemplateStripeStyleRenderer#configure} and returns + * this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateStripeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.TemplateStripeStyleRenderer#lookup} method call they should + * call {@link yfiles.styles.TemplateStripeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an + * instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.IStripe} stripe The stripe to query the context for. The value will be stored in the {@link yfiles.styles.TemplateStripeStyleRenderer#stripe} property. + * @param {yfiles.styles.IStripeStyle} style The style to associate with the stripe. The value will be stored in the {@link yfiles.styles.TemplateStripeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.TemplateStripeStyleRenderer#lookup + */ + getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; + /** + * Gets the context by delegating to {@link yfiles.styles.TemplateStripeStyleBase#contextLookup}. + * @param {yfiles.styles.TemplateStripeStyle} style + * @returns {yfiles.graph.IContextLookup} + * @protected + */ + getContextLookup(style:yfiles.styles.TemplateStripeStyle):yfiles.graph.IContextLookup; + /** + * Configures the style and stripe parameters, calls {@link yfiles.styles.TemplateStripeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.IStripe} stripe The stripe to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.TemplateStripeStyleRenderer#stripe} property. + * @param {yfiles.styles.IStripeStyle} style The style to associate with the stripe. The value will be stored in the {@link yfiles.styles.TemplateStripeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.TemplateStripeStyleRenderer#createVisual + * @see yfiles.styles.TemplateStripeStyleRenderer#updateVisual + */ + getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; + /** + * Implementation of the {@link yfiles.graph.ILookup#lookup} method. + *

+ * Delegates to the lookup returned by {@link yfiles.styles.TemplateStripeStyleRenderer#getContextLookup}, first. Last, it returns + * this class if it implements the queried type. + *

+ * @param {yfiles.lang.Class} type The type to query an instance for. + * @returns {Object} The implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Updates the component correspondingly. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @param {yfiles.view.Visual} oldVisual The currently rendered visual. + * @returns {yfiles.view.Visual} The control that is used for rendering the stripe. + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.TemplateStripeStyle} + */ + style:yfiles.styles.TemplateStripeStyle; + /** + * Gets or sets the currently configured stripe. + * @protected + * @type {yfiles.graph.IStripe} + */ + stripe:yfiles.graph.IStripe; + /** + * Returns the {@link yfiles.graph.IStripe#layout} of the stripe this renderer is currently configured for. + *

+ * Returns Stripe.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + static $class:yfiles.lang.Class; + } + /** + * The context of a TemplateBinding. This interface exposes properties of a graph element onto which a TemplateBinding can + * be bound. + * @interface + * @implements {yfiles.lang.IPropertyObservable} + */ + export interface ITemplateStyleBindingContext extends Object,yfiles.lang.IPropertyObservable{ + /** + * Gets the width of the visual. + * @abstract + * @type {number} + */ + width:number; + /** + * Gets the height of the visual. + * @abstract + * @type {number} + */ + height:number; + /** + * Gets or sets the {@link yfiles.view.CanvasComponent} instance this instance is used in. + * @abstract + * @type {yfiles.view.CanvasComponent} + */ + canvasComponent:yfiles.view.CanvasComponent; + /** + * Gets or sets a value indicating whether the item is currently selected. + *

+ * This state is bound to the {@link yfiles.view.IGraphSelection} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this + * value will write through to the {@link yfiles.view.IGraphSelection}. + *

+ * @abstract + * @type {boolean} + */ + itemSelected:boolean; + /** + * Gets or sets a value indicating whether the item is the currently focused item in the {@link yfiles.view.GraphComponent}. + *

+ * This state is bound to the {@link yfiles.view.GraphComponent#currentItem} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this value will write through to + * the {@link yfiles.view.GraphComponent#currentItem}. + *

+ * @abstract + * @type {boolean} + */ + itemFocused:boolean; + /** + * Gets or sets a value indicating whether the item is currently highlighted. + *

+ * This state is bound to the {@link yfiles.view.HighlightIndicatorManager.} which is used in the {@link yfiles.styles.ITemplateStyleBindingContext#canvasComponent} this visual is being used in. Setting this value will write through to + * the {@link yfiles.view.HighlightIndicatorManager.}'s {@link yfiles.view.HighlightIndicatorManager.#selectionModel} + *

+ * @abstract + * @type {boolean} + */ + itemHighlighted:boolean; + /** + * Gets or sets the item that is rendered by this instance. + * @abstract + * @type {yfiles.graph.IModelItem} + */ + item:yfiles.graph.IModelItem; + /** + * 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. + *

+ * @abstract + * @type {Object} + */ + styleTag:Object; + } + var ITemplateStyleBindingContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Base class for label styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.ILabel}s. + * @see yfiles.styles.TemplateLabelStyle + * @see yfiles.styles.StringTemplateLabelStyle + * @class yfiles.styles.TemplateLabelStyleBase + * @implements {yfiles.styles.ILabelStyle} + * @implements {yfiles.lang.IPropertyObservable} + * @implements {yfiles.lang.ICloneable} + */ + export interface TemplateLabelStyleBase extends Object,yfiles.styles.ILabelStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} + export class TemplateLabelStyleBase { + /** + * Constructs a new instance using the provided renderer. + * @param {yfiles.styles.TemplateLabelStyleRenderer} renderer + * @constructor + */ + constructor(renderer:yfiles.styles.TemplateLabelStyleRenderer); + /** + * Constructs a new instance of this style with default values. + * @protected + * @constructor + */ + constructor(); + /** + * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateLabelStyleBase#styleTag} which is cloned, too, if it can be cloned. + * @returns {Object} A clone of this instance. + */ + clone():Object; + /** + * Factory method that is called by the {@link yfiles.styles.TemplateLabelStyleRenderer} to create the visual that will be used for + * the display of the label. + * @param {yfiles.view.IRenderContext} context The context for which the visual should be created. + * @param {yfiles.graph.ILabel} label The label that will be rendered. + * @returns {yfiles.view.SvgVisual} The readily styled visual. + */ + createTemplate(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.view.SvgVisual; + /** + * Convenience method that determines the preferred size of the label if this style was applied. + * @param {yfiles.view.IRenderContext} context The context for which the size should be calculated. + * @param {yfiles.graph.ILabel} label The label to determine the preferred size of. + * @returns {yfiles.geometry.Size} The preferred size. + */ + getPreferredSize(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel):yfiles.geometry.Size; + /** + * Loads all template script elements that have not been parsed, yet, and creates the respective template cache 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. + *

+ * @static + */ + static loadAllTemplates():void; + /** + * Raises the {@link yfiles.styles.TemplateLabelStyleBase#addPropertyChangedListener PropertyChanged} event. + * @param {yfiles.lang.PropertyChangedEventArgs} evt The {@link yfiles.lang.PropertyChangedEventArgs} instance containing the event data. + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Adds the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.styles.TemplateLabelStyleBase#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.styles.TemplateLabelStyleBase#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the tag that is associated with this style instance. + *

+ * The various style renderer 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.lang.IPropertyObservable property change notification} and can + * thus be data bound easily. + *

+ * @default null + * @type {Object} + */ + styleTag:Object; + /** + * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the + * implementation which is returned by calls to {@link yfiles.styles.ILabelStyleRenderer#getContext} that are made on the style + * renderer 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. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} + *

+ * @default 'Lookups.EmptyContextLookup' + * @type {yfiles.graph.IContextLookup} + */ + contextLookup:yfiles.graph.IContextLookup; + /** + * Gets or sets the normalized outline of a label that will be displayed using the 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.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} and may be left null to + * indicate default (rectangular) behavior. + *

+ *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.geometry.GeneralPath} + */ + normalizedOutline:yfiles.geometry.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. + *

+ * @default true + * @type {boolean} + */ + autoFlip:boolean; + /** + * Gets or sets the preferred size of the labels that use this style. + * @type {yfiles.geometry.Size} + */ + preferredSize:yfiles.geometry.Size; + /** + * + * @type {yfiles.styles.ILabelStyleRenderer} + */ + renderer:yfiles.styles.ILabelStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.ILabelStyle} implementation that uses an SVG snippet as template for the visualization of + * {@link yfiles.graph.ILabel}s. + *

+ * The {@link yfiles.styles.TemplateLabelStyle#styleResourceKey} is used to determine the template that will be applied to the component. The template must be specified in the DOM + * in a script tag with type='text/yfiles-template'. + *

+ *

+ * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute + * value to the value of the property with the given name in the node's tag. + *

+ *

+ * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of + * well-defined properties of the label that are provided by the style. The available template binding properties are: + *

+ *
    + *
  • width: The width of the graph element
  • + *
  • height: The height of the graph element
  • + *
  • bounds: The bounding rectangle of the graph element
  • + *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • + *
  • itemSelected: Whether the element is selected
  • + *
  • itemFocused: Whether the element has the focus
  • + *
  • itemHighlighted: Whether the element is highlighted
  • + *
  • styleTag: The tag associated with the element's style instance
  • + *
+ * @class yfiles.styles.TemplateLabelStyle + * @extends {yfiles.styles.TemplateLabelStyleBase} + */ + export interface TemplateLabelStyle extends yfiles.styles.TemplateLabelStyleBase{} + export class TemplateLabelStyle { + /** + * Creates a new instance using the given render template id and a custom renderer instance. + * @param {string} renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {yfiles.styles.TemplateLabelStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderTemplateId:string,renderer:yfiles.styles.TemplateLabelStyleRenderer); + /** + * Creates a new instance using the given render template id and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {yfiles.styles.TemplateLabelStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#styleTag} property on the created object. + *

+ * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplateLabelStyleRenderer,styleTag?:Object,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); + /** + * Creates a new instance using the given render template id. + * @param {string} renderTemplateId The id of the render template that will be used for the component. + * @constructor + */ + constructor(renderTemplateId:string); + /** + * Creates a new instance using the given render template id. + * @param {Object} options The parameters to pass. + * @param {string} options.renderTemplateId The id of the render template that will be used for the component. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#styleTag} property on the created object. + *

+ * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderTemplateId:string,styleTag?:Object,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); + /** + * Creates a new instance with no render template id and {@link yfiles.styles.TemplateLabelStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#styleTag} property on the created object. + *

+ * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. + *

+ * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyle#styleResourceKey} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,styleResourceKey?:string}); + /** + * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. + *

+ * The default value is null. + *

+ * @default null + * @type {string} + */ + styleResourceKey:string; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.ILabelStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.ILabel}s. + *

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

+ *

+ * It is vital that the {@link yfiles.styles.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. + *

+ *

+ * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute + * value to the value of the property with the given name in the node's tag. + *

+ *

+ * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of + * well-defined properties of the label that are provided by the style. The available template binding properties are: + *

+ *
    + *
  • width: The width of the graph element
  • + *
  • height: The height of the graph element
  • + *
  • bounds: The bounding rectangle of the graph element
  • + *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • + *
  • itemSelected: Whether the element is selected
  • + *
  • itemFocused: Whether the element has the focus
  • + *
  • itemHighlighted: Whether the element is highlighted
  • + *
  • styleTag: The tag associated with the element's style instance
  • + *
+ * @class yfiles.styles.StringTemplateLabelStyle + * @extends {yfiles.styles.TemplateLabelStyleBase} + */ + export interface StringTemplateLabelStyle extends yfiles.styles.TemplateLabelStyleBase{} + export class StringTemplateLabelStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.TemplateLabelStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderer:yfiles.styles.TemplateLabelStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.TemplateLabelStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#styleTag} property on the created object. + *

+ * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. + *

+ * @param {string} options.svgContent The SVG content that is the template for the label visualization. + *

+ * This option sets the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.TemplateLabelStyleRenderer,styleTag?:Object,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,svgContent?:string}); + /** + * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplateLabelStyle#svgContent}. + * @param {string} svgContent The SVG snippet to use as template. + * @constructor + */ + constructor(svgContent:string); + /** + * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplateLabelStyle#svgContent}. + * @param {Object} options The parameters to pass. + * @param {string} options.svgContent The SVG snippet to use as template. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#styleTag} property on the created object. + *

+ * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{svgContent:string,styleTag?:Object,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size}); + /** + * Initializes a new instance of this class. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#styleTag} property on the created object. + *

+ * @param {boolean} options.autoFlip A value indicating whether the rendering should automatically be flipped (rotated by 180 degrees) if otherwise it would be rendered upside-down. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a label that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.preferredSize The preferred size of the labels that use this style. + *

+ * This option sets the {@link yfiles.styles.TemplateLabelStyleBase#preferredSize} property on the created object. + *

+ * @param {string} options.svgContent The SVG content that is the template for the label visualization. + *

+ * This option sets the {@link yfiles.styles.StringTemplateLabelStyle#svgContent} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,autoFlip?:boolean,normalizedOutline?:yfiles.geometry.GeneralPath,preferredSize?:yfiles.geometry.Size,svgContent?:string}); + /** + * Gets or sets the SVG content that is the template for the label visualization. + * @default null + * @type {string} + */ + svgContent:string; + static $class:yfiles.lang.Class; + } + /** + * An implementation of the {@link yfiles.styles.ILabelStyleRenderer} interface that can render {@link yfiles.styles.TemplateLabelStyleBase} + * instances. + * @see yfiles.styles.TemplateLabelStyle + * @see yfiles.styles.StringTemplateLabelStyle + * @class yfiles.styles.TemplateLabelStyleRenderer + * @implements {yfiles.styles.ILabelStyleRenderer} + * @implements {yfiles.view.IVisualCreator} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.graph.ILookup} + */ + export interface TemplateLabelStyleRenderer extends Object,yfiles.styles.ILabelStyleRenderer,yfiles.view.IVisualCreator,yfiles.view.IBoundsProvider,yfiles.input.IHitTestable,yfiles.input.IMarqueeTestable,yfiles.view.IVisibilityTestable,yfiles.graph.ILookup{} + export class TemplateLabelStyleRenderer { + /** + * Stores the {@link yfiles.graph.ILabel#layout layout}. + *

+ * Subclasses should override this method, call the super implementation and configure their painting entities. + *

+ * @protected + */ + configure():void; + /** + * Creates the visual by delegating to {@link yfiles.styles.TemplateLabelStyleBase#createTemplate} and then initializing the + * control with the context. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @returns {yfiles.view.Visual} The visual that is used for rendering the label. + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.TemplateLabelStyleRenderer#getBounds + */ + getBoundsProvider(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IBoundsProvider; + /** + * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateLabelStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.TemplateLabelStyleRenderer#lookup} method call they should + * call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} only if needed, i.e. if they decide to return this or an + * instance that depends on a correctly configured this. + *

+ * @param {yfiles.graph.ILabel} label The label to query the context for. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.TemplateLabelStyleRenderer#lookup + */ + getContext(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.graph.ILookup; + /** + * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to query hit test with. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.TemplateLabelStyleRenderer#isHit + */ + getHitTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IHitTestable; + /** + * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.TemplateLabelStyleRenderer#isInBox + */ + getMarqueeTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.input.IMarqueeTestable; + /** + * Gets the normalized outline by delegating to {@link yfiles.styles.TemplateLabelStyleBase#normalizedOutline}. + * @param {yfiles.styles.TemplateLabelStyleBase} style + * @returns {yfiles.geometry.GeneralPath} + * @protected + */ + getNormalizedOutline(style:yfiles.styles.TemplateLabelStyleBase):yfiles.geometry.GeneralPath; + /** + * Calculates the preferred size for the given label and style. + * @param {yfiles.graph.ILabel} label The label instance. + * @param {yfiles.styles.ILabelStyle} style The style instance to apply. + * @returns {yfiles.geometry.Size} The preferred size for the given label and style. + * @see yfiles.styles.TemplateLabelStyleRenderer#getPreferredSizeCore + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; + /** + * Gets the size of the preferred for the current configuration using the provided context. + * @param {yfiles.view.IRenderContext} context The context. + * @returns {yfiles.geometry.Size} + * @protected + */ + getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; + /** + * Calculates the preferred size for the given label and style. + * @param {yfiles.view.IRenderContext} context + * @param {yfiles.graph.ILabel} label The label instance. + * @param {yfiles.styles.ILabelStyle} style The style instance to apply. + * @returns {yfiles.geometry.Size} The preferred size for the given label and style. + * @see yfiles.styles.TemplateLabelStyleRenderer#getPreferredSizeCore + */ + getPreferredSizeWithContext(context:yfiles.view.IRenderContext,label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.geometry.Size; + /** + * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplateLabelStyleRenderer#configure}. If + * the subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.TemplateLabelStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.ILabel} label The label to query visibility tests. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.TemplateLabelStyleRenderer#isVisible + */ + getVisibilityTestable(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the {@link yfiles.styles.TemplateLabelStyleRenderer#style} and {@link yfiles.styles.TemplateLabelStyleRenderer#label} properties, calls {@link yfiles.styles.TemplateLabelStyleRenderer#configure} and returns this. + * @param {yfiles.graph.ILabel} label The label to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#label} property. + * @param {yfiles.styles.ILabelStyle} style The style to associate with the label. The value will be stored in the {@link yfiles.styles.TemplateLabelStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.TemplateLabelStyleRenderer#createVisual + * @see yfiles.styles.TemplateLabelStyleRenderer#updateVisual + */ + getVisualCreator(label:yfiles.graph.ILabel,style:yfiles.styles.ILabelStyle):yfiles.view.IVisualCreator; + /** + * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase}'s {@link yfiles.styles.TemplateLabelStyleBase#autoFlip} property. + * @param {yfiles.styles.TemplateLabelStyleBase} style + * @returns {boolean} + * @protected + */ + isAutoFlip(style:yfiles.styles.TemplateLabelStyleBase):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Uses the {@link yfiles.graph.ILabel#layout layout} to determine whether the clip intersects. + * @param {yfiles.view.ICanvasContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase#contextLookup} of the {@link yfiles.styles.ILabelStyle}. + * @param {yfiles.lang.Class} type The type to query an instance for. + * @returns {Object} The implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Delegates to the {@link yfiles.styles.TemplateLabelStyleBase}'s {@link yfiles.styles.TemplateLabelStyleBase#contextLookup}. + * @param {yfiles.styles.TemplateLabelStyleBase} 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. + * @returns {Object} The result from the context or null. + * @protected + */ + lookupContext(style:yfiles.styles.TemplateLabelStyleBase,label:yfiles.graph.ILabel,type:yfiles.lang.Class):Object; + /** + * Updates the component correspondingly. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @param {yfiles.view.Visual} oldVisual The currently rendered visual. + * @returns {yfiles.view.Visual} The visual that is used for rendering the label. + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Holds the layout of the current label. + *

+ * This value is set during {@link yfiles.styles.TemplateLabelStyleRenderer#configure} to the label's {@link yfiles.graph.ILabel#layout layout} + *

+ * @protected + * @type {yfiles.geometry.IOrientedRectangle} + */ + layout:yfiles.geometry.IOrientedRectangle; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.TemplateLabelStyleBase} + */ + style:yfiles.styles.TemplateLabelStyleBase; + /** + * Gets or sets the currently configured label. + * @protected + * @type {yfiles.graph.ILabel} + */ + label:yfiles.graph.ILabel; + static $class:yfiles.lang.Class; + } + /** + * Base class for node styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.INode}s. + * @see yfiles.styles.TemplateNodeStyle + * @see yfiles.styles.StringTemplateNodeStyle + * @class yfiles.styles.TemplateNodeStyleBase + * @implements {yfiles.styles.INodeStyle} + * @implements {yfiles.lang.IPropertyObservable} + * @implements {yfiles.lang.ICloneable} + */ + export interface TemplateNodeStyleBase extends Object,yfiles.styles.INodeStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} + export class TemplateNodeStyleBase { + /** + * Constructs a new instance using the provided renderer. + * @param {yfiles.styles.TemplateNodeStyleRenderer} renderer + * @protected + * @constructor + */ + constructor(renderer:yfiles.styles.TemplateNodeStyleRenderer); + /** + * Constructs a new instance of this style with default values. + * @protected + * @constructor + */ + constructor(); + /** + * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplateNodeStyleBase#styleTag} which is cloned, too, if it can be cloned. + * @returns {Object} A clone of this instance. + */ + clone():Object; + /** + * Factory method that is called by the {@link yfiles.styles.TemplateNodeStyleRenderer} to create the visual that will be used for + * the display of the node. + * @param {yfiles.view.IRenderContext} context The context for which the visual should be created. + * @param {yfiles.graph.INode} node The node that will be rendered. + * @returns {yfiles.view.SvgVisual} The readily styled visual. + */ + createTemplate(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.view.SvgVisual; + /** + * Convenience method that determines the preferred size of the node if this style was applied. + * @param {yfiles.view.IRenderContext} context The context for which the size should be calculated. Can be obtained through + * {@link yfiles.view.CanvasComponent#createRenderContext}. + * @param {yfiles.graph.INode} node The node to determine the preferred size of. Can be a live node or an {@link yfiles.graph.SimpleNode}. + * @returns {yfiles.geometry.Size} The preferred size. + * @see yfiles.view.CanvasComponent#createRenderContext + */ + getPreferredSize(context:yfiles.view.IRenderContext,node:yfiles.graph.INode):yfiles.geometry.Size; + /** + * Loads all template script elements that have not been parsed, yet, and creates the respective template cache 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. + *

+ * @static + */ + static loadAllTemplates():void; + /** + * Raises the {@link yfiles.styles.TemplateNodeStyleBase#addPropertyChangedListener PropertyChanged} event. + * @param {yfiles.lang.PropertyChangedEventArgs} evt The {@link yfiles.lang.PropertyChangedEventArgs} instance containing the event data. + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Adds the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.styles.TemplateNodeStyleBase#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.styles.TemplateNodeStyleBase#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the tag that is associated with this style instance. + *

+ * The various style renderer 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.lang.IPropertyObservable property change notification} and can + * thus be data bound easily. + *

+ * @default null + * @type {Object} + */ + styleTag:Object; + /** + * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the + * implementation which is returned by calls to {@link yfiles.styles.INodeStyleRenderer#getContext} that are made on the style + * renderer 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.view.ISelectionIndicatorInstaller}, + * {@link yfiles.view.IHighlightIndicatorInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.INodeSizeConstraintProvider}, and + * {@link yfiles.input.INodeInsetsProvider}. Simple style implementations can use {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} + * but may not use null for this property. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} + *

+ * @default 'Lookups.EmptyContextLookup' + * @type {yfiles.graph.IContextLookup} + */ + contextLookup:yfiles.graph.IContextLookup; + /** + * Gets or sets the insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this + * instance. + *

+ * This is especially useful if this style is used for 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.Insets} insets with 5 for all insets. + *

+ * @see yfiles.input.INodeInsetsProvider + * @see yfiles.styles.INodeStyleRenderer#getContext + * @default '5' + * @type {yfiles.geometry.Insets} + */ + insets:yfiles.geometry.Insets; + /** + * Gets or sets the minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should + * yield. + *

+ * The default value is {@link yfiles.geometry.Size#EMPTY}. + *

+ * @see yfiles.input.INodeSizeConstraintProvider + * @default 'Empty' + * @type {yfiles.geometry.Size} + */ + minimumSize:yfiles.geometry.Size; + /** + * Gets or sets the normalized outline of a node that will be displayed using the created visual. + *

+ * This shape will be used to satisfy requests to {@link yfiles.input.IMarqueeTestable#isInBox}, {@link yfiles.input.IHitTestable#isHit}, + * as well as for {@link yfiles.styles.IShapeGeometry} methods (which affect edge cropping at the node outline). + *

+ *

+ * This property may be left at or set to null to indicate default (rectangular) behavior. + *

+ *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.geometry.GeneralPath} + */ + normalizedOutline:yfiles.geometry.GeneralPath; + /** + * + * @type {yfiles.styles.INodeStyleRenderer} + */ + renderer:yfiles.styles.INodeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.INodeStyle} implementation that uses an SVG snippet as template for the visualization of + * {@link yfiles.graph.INode}s. + *

+ * The {@link yfiles.styles.TemplateNodeStyle#styleResourceKey} is used to determine the template that will be applied to the {@link yfiles.view.Visual}. The template must be specified in + * the DOM in a script tag with type='text/yfiles-template'. + *

+ *

+ * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute + * value to the value of the property with the given name in the node's tag. + *

+ *

+ * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of + * well-defined properties of the node that are provided by the style. The available template binding properties are: + *

+ *
    + *
  • width: The width of the graph element
  • + *
  • height: The height of the graph element
  • + *
  • bounds: The bounding rectangle of the graph element
  • + *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • + *
  • itemSelected: Whether the element is selected
  • + *
  • itemFocused: Whether the element has the focus
  • + *
  • itemHighlighted: Whether the element is highlighted
  • + *
  • styleTag: The tag associated with the element's style instance
  • + *
+ *

Related demos:

+ *
    + *
  • Demo: OrgChart Demo, Demo.yFiles.Graph.OrgChart
  • + *
  • Demo: Collapse Demo, Demo.yFiles.Graph.Collapse
  • + *
+ * @class yfiles.styles.TemplateNodeStyle + * @extends {yfiles.styles.TemplateNodeStyleBase} + */ + export interface TemplateNodeStyle extends yfiles.styles.TemplateNodeStyleBase{} + export class TemplateNodeStyle { + /** + * Creates a new instance using the given render template id and a custom renderer instance. + * @param {string} renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {yfiles.styles.TemplateNodeStyleRenderer} renderer The custom renderer for this instance. + * @constructor + */ + constructor(renderTemplateId:string,renderer:yfiles.styles.TemplateNodeStyleRenderer); + /** + * Creates a new instance using the given render template id and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {yfiles.styles.TemplateNodeStyleRenderer} options.renderer The custom renderer for this instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplateNodeStyleRenderer,styleTag?:Object,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); + /** + * Creates a new instance using the given render template id and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. + * @param {string} renderTemplateId The id of the SVG snippet that will be used for the component. + * @constructor + */ + constructor(renderTemplateId:string); + /** + * Creates a new instance using the given render template id and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. + * @param {Object} options The parameters to pass. + * @param {string} options.renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderTemplateId:string,styleTag?:Object,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); + /** + * Creates a new instance with no render template id key and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. + *

+ * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyle#styleResourceKey} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath,styleResourceKey?:string}); + /** + * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. + *

+ * The default value is null. + *

+ * @default null + * @type {string} + */ + styleResourceKey:string; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.INodeStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.INode}s. + *

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

+ *

+ * It is vital that the {@link yfiles.styles.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. + *

+ *

+ * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute + * value to the value of the property with the given name in the node's tag. + *

+ *

+ * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of + * well-defined properties of the node that are provided by the style. The available template binding properties are: + *

+ *
    + *
  • width: The width of the graph element
  • + *
  • height: The height of the graph element
  • + *
  • bounds: The bounding rectangle of the graph element
  • + *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • + *
  • itemSelected: Whether the element is selected
  • + *
  • itemFocused: Whether the element has the focus
  • + *
  • itemHighlighted: Whether the element is highlighted
  • + *
  • styleTag: The tag associated with the element's style instance
  • + *
+ * @class yfiles.styles.StringTemplateNodeStyle + * @extends {yfiles.styles.TemplateNodeStyleBase} + */ + export interface StringTemplateNodeStyle extends yfiles.styles.TemplateNodeStyleBase{} + export class StringTemplateNodeStyle { + /** + * Creates a new instance using the given SVG template and a custom renderer instance. + * @param {string} svgContent The SVG snippet that will be used as a template for the component. + * @param {yfiles.styles.TemplateNodeStyleRenderer} renderer The custom renderer for this instance. + * @constructor + */ + constructor(svgContent:string,renderer:yfiles.styles.TemplateNodeStyleRenderer); + /** + * Creates a new instance using the given SVG template and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.svgContent The SVG snippet that will be used as a template for the component. + * @param {yfiles.styles.TemplateNodeStyleRenderer} options.renderer The custom renderer for this instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. + *

+ * @constructor + */ + constructor(options:{svgContent:string,renderer:yfiles.styles.TemplateNodeStyleRenderer,styleTag?:Object,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); + /** + * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. + * @param {string} svgContent The SVG snippet that will be used as a template for the component. + * @constructor + */ + constructor(svgContent:string); + /** + * Creates a new instance using the given SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. + * @param {Object} options The parameters to pass. + * @param {string} options.svgContent The SVG snippet that will be used as a template for the component. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. + *

+ * @constructor + */ + constructor(options:{svgContent:string,styleTag?:Object,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath}); + /** + * Creates a new instance with no SVG template and {@link yfiles.styles.TemplateNodeStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.Insets} options.insets The insets the {@link yfiles.input.INodeInsetsProvider} implementation for {@link yfiles.graph.INode} should yield for this instance. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#insets} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.minimumSize The minimum size an {@link yfiles.input.INodeSizeConstraintProvider} implementation for {@link yfiles.graph.INode} should yield. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#minimumSize} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a node that will be displayed using the created visual. + *

+ * This option sets the {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline} property on the created object. + *

+ * @param {string} options.svgContent The SVG content that is the template for the node visualization. + *

+ * This option sets the {@link yfiles.styles.StringTemplateNodeStyle#svgContent} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,insets?:yfiles.geometry.Insets,minimumSize?:yfiles.geometry.Size,normalizedOutline?:yfiles.geometry.GeneralPath,svgContent?:string}); + /** + * Gets or sets the SVG content that is the template for the node visualization. + * @default null + * @type {string} + */ + svgContent:string; + static $class:yfiles.lang.Class; + } + /** + * An implementation of the {@link yfiles.styles.INodeStyleRenderer} interface that can render {@link yfiles.styles.TemplateNodeStyleBase} + * instances. + * @see yfiles.styles.TemplateNodeStyle + * @see yfiles.styles.StringTemplateNodeStyle + * @class yfiles.styles.TemplateNodeStyleRenderer + * @implements {yfiles.styles.INodeStyleRenderer} + * @implements {yfiles.styles.IShapeGeometry} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface TemplateNodeStyleRenderer extends Object,yfiles.styles.INodeStyleRenderer,yfiles.styles.IShapeGeometry,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class TemplateNodeStyleRenderer { + /** + * Prepares this instance for subsequent calls after the style and node have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.TemplateNodeStyleRenderer#style} and {@link yfiles.styles.TemplateNodeStyleRenderer#node} properties have been populated by the + * {@link yfiles.styles.TemplateNodeStyleRenderer#getVisualCreator}, {@link yfiles.styles.TemplateNodeStyleRenderer#getBoundsProvider}, + * {@link yfiles.styles.TemplateNodeStyleRenderer#getHitTestable}, or {@link yfiles.styles.TemplateNodeStyleRenderer#getMarqueeTestable} + * methods. + *

+ *

+ * This is an empty implementation. Subclasses might have to override this method. + *

+ * @protected + */ + configure():void; + /** + * Creates the visual by delegating to {@link yfiles.styles.TemplateNodeStyleBase#createTemplate} and then initializing the control + * with the context. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @returns {yfiles.view.Visual} The visual that is used for rendering the node. + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * Returns the layout bounds as an upper bound for the painting bound. + *

+ * This implementation simply sets the {@link yfiles.styles.TemplateNodeStyleRenderer#layout}'s bounds to the scratch variable and returns. + *

+ * @param {yfiles.view.ICanvasContext} context the context to calculate the bounds for + * @returns {yfiles.geometry.Rect} the bounds or null to indicate an unbound area + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Provides a {@link yfiles.view.IBoundsProvider bounds calculation} implementation for the given style and node. + *

+ * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.view.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.styles.INodeStyle} style The style whose provider is queried. + * @returns {yfiles.view.IBoundsProvider} An implementation that can calculate visual bounds. + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns + * this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.TemplateNodeStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.TemplateNodeStyleRenderer#lookup} method call they should call + * {@link yfiles.styles.TemplateNodeStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that + * depends on a correctly configured this. + *

+ * @param {yfiles.graph.INode} node The node to query the context for. The value will be stored in the {@link yfiles.styles.TemplateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.TemplateNodeStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.TemplateNodeStyleRenderer#lookup + */ + getContext(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.graph.ILookup; + /** + * Gets the context by delegating to {@link yfiles.styles.TemplateNodeStyleBase#contextLookup}. + * @param {yfiles.styles.TemplateNodeStyleBase} style + * @returns {yfiles.graph.IContextLookup} + * @protected + */ + getContextLookup(style:yfiles.styles.TemplateNodeStyleBase):yfiles.graph.IContextLookup; + /** + * Provides a {@link yfiles.input.IHitTestable hit testing} implementation for the given style and node. + *

+ * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.input.IHitTestable} interface than this instance will be returned, otherwise + * the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} will be used to perform the hit testing. + *

+ * @param {yfiles.graph.INode} node The node to query the tester for. + * @param {yfiles.styles.INodeStyle} style The style whose tester is queried. + * @returns {yfiles.input.IHitTestable} An implementation that can perform the hit testing. + * @see yfiles.styles.TemplateNodeStyleRenderer#isHit + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IHitTestable; + /** + * Gets the insets by delegating to {@link yfiles.styles.TemplateNodeStyleBase#insets}. + * @param {yfiles.styles.TemplateNodeStyleBase} style + * @returns {yfiles.geometry.Insets} + * @protected + */ + getInsets(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.Insets; + /** + * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the intersection calculation, otherwise reverts to default (rectangular) + * behavior. + * @param {yfiles.geometry.Point} inner + * @param {yfiles.geometry.Point} outer + * @returns {yfiles.geometry.Point} + */ + getIntersection(inner:yfiles.geometry.Point,outer:yfiles.geometry.Point):yfiles.geometry.Point; + /** + * Provides a {@link yfiles.input.IMarqueeTestable marquee testing} implementation for the given style and node. + *

+ * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.input.IMarqueeTestable} interface than this instance will be returned, + * otherwise the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline 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.styles.INodeStyle} style The style whose tester is queried. + * @returns {yfiles.input.IMarqueeTestable} An implementation that can test for marquee intersections. + * @see yfiles.styles.TemplateNodeStyleRenderer#isInBox + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.input.IMarqueeTestable; + /** + * Gets the minimum size by delegating to {@link yfiles.styles.TemplateNodeStyleBase#minimumSize}. + * @param {yfiles.styles.TemplateNodeStyleBase} style + * @returns {yfiles.geometry.Size} + * @protected + */ + getMinimumSize(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.Size; + /** + * Gets the normalized outline by delegating to {@link yfiles.styles.TemplateNodeStyleBase#normalizedOutline}. + * @param {yfiles.styles.TemplateNodeStyleBase} style + * @returns {yfiles.geometry.GeneralPath} + * @protected + */ + getNormalizedOutline(style:yfiles.styles.TemplateNodeStyleBase):yfiles.geometry.GeneralPath; + /** + * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to create the outline shape path, otherwise reverts to default (rectangular) behavior. + * @returns {yfiles.geometry.GeneralPath} + */ + getOutline():yfiles.geometry.GeneralPath; + /** + * Calculates the preferred size for the given node and style in the provided context. + * @param {yfiles.view.IRenderContext} context The context for which the preferred size should be calculated. + * @param {yfiles.graph.INode} node The node instance. + * @param {yfiles.styles.INodeStyle} style The style instance to apply. + * @returns {yfiles.geometry.Size} The preferred size for the given label and style. + * @see yfiles.styles.TemplateNodeStyleRenderer#getPreferredSizeCore + */ + getPreferredSize(context:yfiles.view.IRenderContext,node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.geometry.Size; + /** + * Calculates the preferred size for the given node and style. + * @param {yfiles.graph.INode} node The node instance. + * @param {yfiles.styles.INodeStyle} style The style instance to apply. + * @returns {yfiles.geometry.Size} The preferred size for the given label and style. + * @see yfiles.styles.TemplateNodeStyleRenderer#getPreferredSizeCore + */ + getPreferredSize(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.geometry.Size; + /** + * Calculates the preferred size given the current state of the renderer for the given context. + * @param {yfiles.view.IRenderContext} context The render context for which the preferred size should be calculated. + * @returns {yfiles.geometry.Size} The size as suggested by this renderer. + * @protected + */ + getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; + /** + * Provides the geometry for the visual representation. + *

+ * If {@link yfiles.styles.TemplateNodeStyleBase#contextLookup} provides an implementation of the {@link yfiles.styles.IShapeGeometry} interface than this instance will be returned, + * otherwise the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline 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.styles.INodeStyle} style The style for which the geometry is queried. + * @returns {yfiles.styles.IShapeGeometry} An implementation that describes the outline geometry of the shape. + * @see yfiles.styles.TemplateNodeStyleRenderer#isInside + * @see yfiles.styles.TemplateNodeStyleRenderer#getOutline + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.styles.IShapeGeometry; + /** + * Configures the style and node parameters, does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns + * this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplateNodeStyleRenderer#configure}. If + * the subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.TemplateNodeStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.INode} node The node to query visibility tests. The value will be stored in the {@link yfiles.styles.TemplateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.TemplateNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.TemplateNodeStyleRenderer#isVisible + */ + getVisibilityTestable(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and node parameters, calls {@link yfiles.styles.TemplateNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.TemplateNodeStyleRenderer#node} property. + * @param {yfiles.styles.INodeStyle} style The style to associate with the node. The value will be stored in the {@link yfiles.styles.TemplateNodeStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.TemplateNodeStyleRenderer#createVisual + * @see yfiles.styles.TemplateNodeStyleRenderer#updateVisual + */ + getVisualCreator(node:yfiles.graph.INode,style:yfiles.styles.INodeStyle):yfiles.view.IVisualCreator; + /** + * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the hit test analysis, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.input.IInputModeContext} context the context the hit test is performed in + * @param {yfiles.geometry.Point} location the hit point in world coordinates + * @returns {boolean} whether something has been hit + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the marquee intersection analysis, otherwise reverts to default (rectangular) + * behavior. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Tries to use the {@link yfiles.styles.TemplateNodeStyleRenderer#getNormalizedOutline outline shape} to perform the contains test, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isInside(location:yfiles.geometry.Point):boolean; + /** + * Determines visibility by checking for an intersection with the {@link yfiles.styles.TemplateNodeStyleRenderer#layout}. + * @param {yfiles.view.ICanvasContext} context The context. + * @param {yfiles.geometry.Rect} rectangle The current clip + * @returns {boolean} Whether the {@link yfiles.styles.TemplateNodeStyleRenderer#layout} is visible in the clip. + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implementation of the {@link yfiles.graph.ILookup#lookup} method. + *

+ * Delegates to the lookup returned by {@link yfiles.styles.TemplateNodeStyleRenderer#getContextLookup}, first. Returns special {@link yfiles.input.INodeInsetsProvider} + * or {@link yfiles.input.INodeSizeConstraintProvider} implementations if asked for. Last, it returns this class if it implements + * the queried type. + *

+ * @param {yfiles.lang.Class} type The type to query an instance for. + * @returns {Object} The implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Updates the component correspondingly. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @param {yfiles.view.Visual} oldVisual The currently rendered visual. + * @returns {yfiles.view.Visual} The visual that is used for rendering the node. + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.TemplateNodeStyleBase} + */ + style:yfiles.styles.TemplateNodeStyleBase; + /** + * Gets or sets the currently configured node. + * @protected + * @type {yfiles.graph.INode} + */ + node:yfiles.graph.INode; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently configured for. + *

+ * Returns Node.Layout. + *

+ * @type {yfiles.geometry.IRectangle} + */ + layout:yfiles.geometry.IRectangle; + static $class:yfiles.lang.Class; + } + /** + * Base class for port styles that use a SVG snippet as template for the visualization of {@link yfiles.graph.IPort}s. + * @see yfiles.styles.TemplatePortStyle + * @see yfiles.styles.TemplatePortStyle + * @class yfiles.styles.TemplatePortStyleBase + * @implements {yfiles.styles.IPortStyle} + * @implements {yfiles.lang.IPropertyObservable} + * @implements {yfiles.lang.ICloneable} + */ + export interface TemplatePortStyleBase extends Object,yfiles.styles.IPortStyle,yfiles.lang.IPropertyObservable,yfiles.lang.ICloneable{} + export class TemplatePortStyleBase { + /** + * Constructs a new instance using the provided renderer. + * @param {yfiles.styles.TemplatePortStyleRenderer} renderer + * @protected + * @constructor + */ + constructor(renderer:yfiles.styles.TemplatePortStyleRenderer); + /** + * Constructs a new instance of this style with default values. + * @protected + * @constructor + */ + constructor(); + /** + * Performs a shallow clone of this instance, except for the value of {@link yfiles.styles.TemplatePortStyleBase#styleTag} which is cloned, too, if it can be cloned. + * @returns {Object} A clone of this instance. + */ + clone():Object; + /** + * Factory method that is called by the {@link yfiles.styles.TemplatePortStyleRenderer} to create the visual that will be used for + * the display of the port. + * @param {yfiles.view.IRenderContext} context The context for which the visual should be created. + * @param {yfiles.graph.IPort} port The port that will be rendered. + * @returns {yfiles.view.SvgVisual} The readily styled visual. + */ + createTemplate(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.view.SvgVisual; + /** + * Convenience method that determines the preferred {@link yfiles.styles.TemplatePortStyleBase#renderSize} of the port if this style was applied. + * @param {yfiles.view.IRenderContext} context The context for which the size should be calculated. + * @param {yfiles.graph.IPort} port The port to determine the preferred size of. + * @returns {yfiles.geometry.Size} The preferred size. + */ + getPreferredSize(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort):yfiles.geometry.Size; + /** + * Loads all template script elements that have not been parsed, yet, and creates the respective template cache 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. + *

+ * @static + */ + static loadAllTemplates():void; + /** + * Raises the {@link yfiles.styles.TemplatePortStyleBase#addPropertyChangedListener PropertyChanged} event. + * @param {yfiles.lang.PropertyChangedEventArgs} evt The {@link yfiles.lang.PropertyChangedEventArgs} instance containing the event data. + * @protected + */ + onPropertyChanged(evt:yfiles.lang.PropertyChangedEventArgs):void; + /** + * Adds the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to add. + * @see yfiles.styles.TemplatePortStyleBase#removePropertyChangedListener + */ + addPropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Removes the given listener for the PropertyChanged event that occurs when a property value changes. + * @param {function(Object, yfiles.lang.PropertyChangedEventArgs): void} listener The listener to remove. + * @see yfiles.styles.TemplatePortStyleBase#addPropertyChangedListener + */ + removePropertyChangedListener(listener:(sender:Object,args:yfiles.lang.PropertyChangedEventArgs)=>void):void; + /** + * Gets or sets the tag that is associated with this style instance. + *

+ * The various style renderer 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.lang.IPropertyObservable property change notification} and can + * thus be data bound easily. + *

+ * @default null + * @type {Object} + */ + styleTag:Object; + /** + * Gets or sets an implementation of {@link yfiles.graph.IContextLookup} that can be used to satisfy queries that are made to the + * implementation which is returned by calls to {@link yfiles.styles.IPortStyleRenderer#getContext} that are made on the style + * renderer 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.view.ISelectionIndicatorInstaller}, + * {@link yfiles.view.IHighlightIndicatorInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.INodeSizeConstraintProvider}, and + * {@link yfiles.input.INodeInsetsProvider}. Simple style implementations can use {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} + * but may not use null for this property. The default value is {@link yfiles.graph.IContextLookup#EMPTY_CONTEXT_LOOKUP} + *

+ * @default 'Lookups.EmptyContextLookup' + * @type {yfiles.graph.IContextLookup} + */ + contextLookup:yfiles.graph.IContextLookup; + /** + * Gets or sets the {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This size will be used to arrange the visual correctly. The default value is (5,5). + *

+ * @default '5,5' + * @type {yfiles.geometry.Size} + */ + renderSize:yfiles.geometry.Size; + /** + * Gets or sets the normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate 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.input.IMarqueeTestable#isInBox} and {@link yfiles.input.IHitTestable#isHit} and may be left null to + * indicate default (rectangular) behavior. + *

+ *

+ * The default value is null. + *

+ * @default null + * @type {yfiles.geometry.GeneralPath} + */ + normalizedOutline:yfiles.geometry.GeneralPath; + /** + * + * @type {yfiles.styles.IPortStyleRenderer} + */ + renderer:yfiles.styles.IPortStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.styles.IPortStyle} that uses an SVG snippet as template for the visualization of {@link yfiles.graph.IPort}s. + *

+ * The {@link yfiles.styles.TemplatePortStyle#styleResourceKey} is used to determine the template that will be applied to the component. The template must be specified in the DOM + * in a script tag with type='text/yfiles-template'. + *

+ *

+ * Note that the {@link yfiles.styles.TemplatePortStyleBase#renderSize} should be specified to match the size of the visual's template. + *

+ *

+ * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute + * value to the value of the property with the given name in the node's tag. + *

+ *

+ * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of + * well-defined properties of the port that are provided by the style. The available template binding properties are: + *

+ *
    + *
  • width: The width of the graph element
  • + *
  • height: The height of the graph element
  • + *
  • bounds: The bounding rectangle of the graph element
  • + *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • + *
  • itemSelected: Whether the element is selected
  • + *
  • itemFocused: Whether the element has the focus
  • + *
  • itemHighlighted: Whether the element is highlighted
  • + *
  • styleTag: The tag associated with the element's style instance
  • + *
+ * @class yfiles.styles.TemplatePortStyle + * @extends {yfiles.styles.TemplatePortStyleBase} + */ + export interface TemplatePortStyle extends yfiles.styles.TemplatePortStyleBase{} + export class TemplatePortStyle { + /** + * Creates a new instance using the given render template id and a custom renderer instance. + * @param {string} renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {yfiles.styles.TemplatePortStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderTemplateId:string,renderer:yfiles.styles.TemplatePortStyleRenderer); + /** + * Creates a new instance using the given render template id and a custom renderer instance. + * @param {Object} options The parameters to pass. + * @param {string} options.renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {yfiles.styles.TemplatePortStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderTemplateId:string,renderer:yfiles.styles.TemplatePortStyleRenderer,styleTag?:Object,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); + /** + * Creates a new instance using the given resource key and a custom renderer instance.{@link yfiles.styles.TemplatePortStyleRenderer} + * as renderer. + * @param {string} renderTemplateId The id of the SVG snippet that will be used for the component. + * @constructor + */ + constructor(renderTemplateId:string); + /** + * Creates a new instance using the given resource key and a custom renderer instance.{@link yfiles.styles.TemplatePortStyleRenderer} + * as renderer. + * @param {Object} options The parameters to pass. + * @param {string} options.renderTemplateId The id of the SVG snippet that will be used for the component. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderTemplateId:string,styleTag?:Object,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); + /** + * Creates a new instance with no render template id and {@link yfiles.styles.TemplatePortStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. + *

+ * @param {string} options.styleResourceKey The {@link string} that will be used to look up the template that is applied to the component. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyle#styleResourceKey} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size,styleResourceKey?:string}); + /** + * Gets or sets the {@link string} that will be used to look up the template that is applied to the component. + *

+ * The default value is null. + *

+ * @default null + * @type {string} + */ + styleResourceKey:string; + static $class:yfiles.lang.Class; + } + /** + * An implementation of the {@link yfiles.styles.IPortStyleRenderer} interface that can render {@link yfiles.styles.TemplatePortStyleBase} + * instances. + * @see yfiles.styles.TemplatePortStyle + * @see yfiles.styles.StringTemplatePortStyle + * @class yfiles.styles.TemplatePortStyleRenderer + * @implements {yfiles.styles.IPortStyleRenderer} + * @implements {yfiles.view.IBoundsProvider} + * @implements {yfiles.view.IVisibilityTestable} + * @implements {yfiles.input.IMarqueeTestable} + * @implements {yfiles.input.IHitTestable} + * @implements {yfiles.graph.ILookup} + * @implements {yfiles.view.IVisualCreator} + */ + export interface TemplatePortStyleRenderer extends Object,yfiles.styles.IPortStyleRenderer,yfiles.view.IBoundsProvider,yfiles.view.IVisibilityTestable,yfiles.input.IMarqueeTestable,yfiles.input.IHitTestable,yfiles.graph.ILookup,yfiles.view.IVisualCreator{} + export class TemplatePortStyleRenderer { + constructor(); + /** + * Prepares this instance for subsequent calls after the style and port have been initialized. + *

+ * Upon invocation the {@link yfiles.styles.TemplatePortStyleRenderer#style} and {@link yfiles.styles.TemplatePortStyleRenderer#port} properties have been populated by the + * {@link yfiles.styles.TemplatePortStyleRenderer#getVisualCreator}, {@link yfiles.styles.TemplatePortStyleRenderer#getBoundsProvider}, + * {@link yfiles.styles.TemplatePortStyleRenderer#getHitTestable}, or {@link yfiles.styles.TemplatePortStyleRenderer#getMarqueeTestable} + * methods. + *

+ * @protected + */ + configure():void; + /** + * Creates the visual by delegating to {@link yfiles.styles.TemplatePortStyleBase#createTemplate} and then initializing the visual + * with the context. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @returns {yfiles.view.Visual} The visual that is used for rendering the port. + */ + createVisual(context:yfiles.view.IRenderContext):yfiles.view.Visual; + /** + * + * @param {yfiles.view.ICanvasContext} context + * @returns {yfiles.geometry.Rect} + */ + getBounds(context:yfiles.view.ICanvasContext):yfiles.geometry.Rect; + /** + * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. + * @param {yfiles.graph.IPort} port The port to retrieve the bounds provider for. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#port} property. + * @param {yfiles.styles.IPortStyle} style The style to associate with the port. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#style} property. + * @returns {yfiles.view.IBoundsProvider} this + * @see yfiles.styles.TemplatePortStyleRenderer#getBounds + */ + getBoundsProvider(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IBoundsProvider; + /** + * Configures the style and port parameters, does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns + * this. + *

+ * As this method may be called often it will not automatically call {@link yfiles.styles.TemplatePortStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.styles.TemplatePortStyleRenderer#lookup} method call they should call + * {@link yfiles.styles.TemplatePortStyleRenderer#configure} only if needed, i.e. if they decide to return this or an instance that + * depends on a correctly configured this. + *

+ * @param {yfiles.graph.IPort} port The port to query the context for. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#port} property. + * @param {yfiles.styles.IPortStyle} style The style to associate with the port. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#style} property. + * @returns {yfiles.graph.ILookup} this + * @see yfiles.styles.TemplatePortStyleRenderer#lookup + */ + getContext(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.graph.ILookup; + /** + * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. + * @param {yfiles.graph.IPort} port The port to query hit test with. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#port} property. + * @param {yfiles.styles.IPortStyle} style The style to associate with the port. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#style} property. + * @returns {yfiles.input.IHitTestable} this + * @see yfiles.styles.TemplatePortStyleRenderer#isHit + */ + getHitTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IHitTestable; + /** + * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. + * @param {yfiles.graph.IPort} port The port to query marquee intersection tests. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#port} property. + * @param {yfiles.styles.IPortStyle} style The style to associate with the port. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#style} property. + * @returns {yfiles.input.IMarqueeTestable} this + * @see yfiles.styles.TemplatePortStyleRenderer#isInBox + */ + getMarqueeTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.input.IMarqueeTestable; + /** + * Gets the normalized outline by delegating to {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline}. + * @param {yfiles.styles.TemplatePortStyleBase} style + * @returns {yfiles.geometry.GeneralPath} + * @protected + */ + getNormalizedOutline(style:yfiles.styles.TemplatePortStyleBase):yfiles.geometry.GeneralPath; + /** + * Calculates the preferred size for the given port and style. + * @param {yfiles.view.IRenderContext} context The render context which can be null. + * @param {yfiles.graph.IPort} port The port instance. + * @param {yfiles.styles.TemplatePortStyleBase} style The style instance to apply. + * @returns {yfiles.geometry.Size} The preferred size for the given port and style. + * @see yfiles.styles.TemplatePortStyleRenderer#getPreferredSizeCore + */ + getPreferredSize(context:yfiles.view.IRenderContext,port:yfiles.graph.IPort,style:yfiles.styles.TemplatePortStyleBase):yfiles.geometry.Size; + /** + * Gets the preferred size for the current configuration. + * @param {yfiles.view.IRenderContext} context + * @returns {yfiles.geometry.Size} The preferred size. + * @protected + */ + getPreferredSizeCore(context:yfiles.view.IRenderContext):yfiles.geometry.Size; + /** + * Gets the size of the rendering from the style. + * @returns {yfiles.geometry.Size} The {@link yfiles.styles.TemplatePortStyleBase#renderSize}. + * @protected + */ + getRenderSize():yfiles.geometry.Size; + /** + * Configures the style and port parameters, does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns + * this. + *

+ * Unlike most of the other methods this implementation does not call {@link yfiles.styles.TemplatePortStyleRenderer#configure}. If + * the subclass implementation depends on this instance to be configured, it needs to call Configure in + * {@link yfiles.styles.TemplatePortStyleRenderer#isVisible}. + *

+ * @param {yfiles.graph.IPort} port The port to query visibility tests. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#port} property. + * @param {yfiles.styles.IPortStyle} style The style to associate with the port. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#style} property. + * @returns {yfiles.view.IVisibilityTestable} this + * @see yfiles.styles.TemplatePortStyleRenderer#isVisible + */ + getVisibilityTestable(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisibilityTestable; + /** + * Configures the style and port parameters, calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and returns this. + * @param {yfiles.graph.IPort} port The port to retrieve the {@link yfiles.view.IVisualCreator} for. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#port} property. + * @param {yfiles.styles.IPortStyle} style The style to associate with the port. The value will be stored in the {@link yfiles.styles.TemplatePortStyleRenderer#style} property. + * @returns {yfiles.view.IVisualCreator} this + * @see yfiles.styles.TemplatePortStyleRenderer#createVisual + * @see yfiles.styles.TemplatePortStyleRenderer#updateVisual + */ + getVisualCreator(port:yfiles.graph.IPort,style:yfiles.styles.IPortStyle):yfiles.view.IVisualCreator; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Point} location + * @returns {boolean} + */ + isHit(context:yfiles.input.IInputModeContext,location:yfiles.geometry.Point):boolean; + /** + * + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.geometry.Rect} rectangle + * @returns {boolean} + */ + isInBox(context:yfiles.input.IInputModeContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Calls {@link yfiles.styles.TemplatePortStyleRenderer#configure} and test the {@link yfiles.styles.TemplatePortStyleRenderer#port} using the {@link yfiles.styles.TemplatePortStyleRenderer#style} for a visible intersection with the + * clip bounds. + *

+ * This simple implementation uses {@link yfiles.styles.TemplatePortStyleRenderer#getBounds} to determine the visibility. + * Subclasses may choose to override this behavior for improved performance but need to make sure to call {@link yfiles.styles.TemplatePortStyleRenderer#configure} if they depend on a configured + * instance. + *

+ * @param {yfiles.view.ICanvasContext} context the current canvas context + * @param {yfiles.geometry.Rect} rectangle the clip bounds + * @returns {boolean} true if the port may be painted within the clip bounds. + * @see yfiles.styles.TemplatePortStyleRenderer#getVisibilityTestable + */ + isVisible(context:yfiles.view.ICanvasContext,rectangle:yfiles.geometry.Rect):boolean; + /** + * Implements the {@link yfiles.graph.ILookup} interface. + *

+ * This method will be used by default if {@link yfiles.styles.TemplatePortStyleRenderer#getContext} has been queried for a lookup + * implementation. Note that it cannot be assumed that {@link yfiles.styles.TemplatePortStyleRenderer#configure} has already been + * invoked. However, normally {@link yfiles.styles.TemplatePortStyleRenderer#port} and {@link yfiles.styles.TemplatePortStyleRenderer#style} 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.styles.TemplatePortStyleRenderer#configure} + * on success and return this. + *

+ * @param {yfiles.lang.Class} type The type to query for. + * @returns {Object} An implementation or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Delegates to the {@link yfiles.styles.TemplatePortStyleBase}'s {@link yfiles.styles.TemplatePortStyleBase#contextLookup}. + * @param {yfiles.styles.TemplatePortStyleBase} style + * @param {yfiles.graph.IPort} port + * @param {yfiles.lang.Class} type + * @returns {Object} + * @protected + */ + lookupContext(style:yfiles.styles.TemplatePortStyleBase,port:yfiles.graph.IPort,type:yfiles.lang.Class):Object; + /** + * Updates the component correspondingly. + * @param {yfiles.view.IRenderContext} context The context for the creation. + * @param {yfiles.view.Visual} oldVisual The currently rendered visual. + * @returns {yfiles.view.Visual} The visual that is used for rendering the port. + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual):yfiles.view.Visual; + /** + * Gets the center of the port. + * @protected + * @type {yfiles.geometry.Point} + */ + center:yfiles.geometry.Point; + /** + * Gets or sets the currently configured style. + * @protected + * @type {yfiles.styles.TemplatePortStyleBase} + */ + style:yfiles.styles.TemplatePortStyleBase; + /** + * Gets or sets the currently configured port. + * @protected + * @type {yfiles.graph.IPort} + */ + port:yfiles.graph.IPort; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.styles.TemplatePortStyleBase} that uses an SVG snippet as template for the visualization of + * {@link yfiles.graph.IPort}s. + *

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

+ *

+ * It is vital that the {@link yfiles.styles.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. + *

+ *

+ * The SVG template snippet can contain bindings in the form attribute="{Binding propertyName}" that bind the attribute + * value to the value of the property with the given name in the node's tag. + *

+ *

+ * TemplateBindings in the form attribute="{TemplateBinding propertyName}" bind the attribute value to a set of + * well-defined properties of the port that are provided by the style. The available template binding properties are: + *

+ *
    + *
  • width: The width of the graph element
  • + *
  • height: The height of the graph element
  • + *
  • bounds: The bounding rectangle of the graph element
  • + *
  • canvas: The {@link yfiles.view.GraphComponent} the element is rendered in
  • + *
  • itemSelected: Whether the element is selected
  • + *
  • itemFocused: Whether the element has the focus
  • + *
  • itemHighlighted: Whether the element is highlighted
  • + *
  • styleTag: The tag associated with the element's style instance
  • + *
+ * @class yfiles.styles.StringTemplatePortStyle + * @extends {yfiles.styles.TemplatePortStyleBase} + */ + export interface StringTemplatePortStyle extends yfiles.styles.TemplatePortStyleBase{} + export class StringTemplatePortStyle { + /** + * Creates a new instance using the provided renderer. + * @param {yfiles.styles.TemplatePortStyleRenderer} renderer The custom renderer for this style instance. + * @constructor + */ + constructor(renderer:yfiles.styles.TemplatePortStyleRenderer); + /** + * Creates a new instance using the provided renderer. + * @param {Object} options The parameters to pass. + * @param {yfiles.styles.TemplatePortStyleRenderer} options.renderer The custom renderer for this style instance. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{renderer:yfiles.styles.TemplatePortStyleRenderer,styleTag?:Object,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); + /** + * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplatePortStyle#svgContent}. + * @param {string} svgContent The SVG snippet to use as template. + * @constructor + */ + constructor(svgContent:string); + /** + * Initializes a new instance of this class and sets the given string as its {@link yfiles.styles.StringTemplatePortStyle#svgContent}. + * @param {Object} options The parameters to pass. + * @param {string} options.svgContent The SVG snippet to use as template. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. + *

+ * @constructor + */ + constructor(options:{svgContent:string,styleTag?:Object,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size}); + /** + * Creates a new instance using {@link yfiles.styles.TemplatePortStyleRenderer} as renderer. + * @param {Object} [options=null] The parameters to pass. + * @param {Object} options.styleTag The tag that is associated with this style instance. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#styleTag} property on the created object. + *

+ * @param {yfiles.geometry.GeneralPath} options.normalizedOutline The normalized outline of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#normalizedOutline} property on the created object. + *

+ * @param {yfiles.geometry.Size} options.renderSize The {@link yfiles.geometry.Size size} of the of a port that will be displayed using the {@link yfiles.styles.TemplatePortStyleBase#createTemplate created visual}. + *

+ * This option sets the {@link yfiles.styles.TemplatePortStyleBase#renderSize} property on the created object. + *

+ * @param {string} options.svgContent The SVG content that is the template for the port visualization. + *

+ * This option sets the {@link yfiles.styles.StringTemplatePortStyle#svgContent} property on the created object. + *

+ * @constructor + */ + constructor(options?:{styleTag?:Object,normalizedOutline?:yfiles.geometry.GeneralPath,renderSize?:yfiles.geometry.Size,svgContent?:string}); + /** + * Gets or sets the SVG content that is the template for the port visualization. + * @default null + * @type {string} + */ + svgContent:string; + static $class:yfiles.lang.Class; + } + export enum TableRenderingOrder{ + /** + * Draw columns, then rows + */ + COLUMNS_FIRST, + /** + * Draw rows, then columns + */ + ROWS_FIRST + } + /** + * An abstract base class that makes it possible to easily implement a custom {@link yfiles.styles.IStripeStyle}. + *

+ * The only method that needs to be implemented by subclasses is {@link yfiles.styles.StripeStyleBase#createVisual}, however to + * improve rendering performance it is highly recommended to implement at least + * {@link yfiles.styles.StripeStyleBase#updateVisual}, too. + *

+ *

+ * This implementation differs from the straightforward {@link yfiles.styles.IStripeStyle} implementation in that there is no + * visible separation between the style and its + * {@link yfiles.styles.IStripeStyleRenderer}. Instead the renderer used by the base class is fixed and delegates all calls back to + * the style instance. + *

+ * @class yfiles.styles.StripeStyleBase + * @implements {yfiles.styles.IStripeStyle} + */ + export interface StripeStyleBase extends Object,yfiles.styles.IStripeStyle{} + export class StripeStyleBase { + /** + * Initializes a new instance of the {@link yfiles.styles.StripeStyleBase} class. + * @protected + * @constructor + */ + constructor(); + /** + * Creates a new object that is a copy of the current instance. + *

+ * Immutable subclasses should consider returning this. + *

+ * @returns {Object} A new object that is a copy of this instance using {@link Object#memberwiseClone}. + */ + clone():Object; + /** + * Callback that creates the visual. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#createVisual} call to the instance that has been + * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. + *

+ * @param {yfiles.view.IRenderContext} context + * @param {yfiles.graph.IStripe} stripe The stripe to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.StripeStyleBase#updateVisual + * @protected + * @abstract + */ + createVisual(context:yfiles.view.IRenderContext,stripe:yfiles.graph.IStripe):yfiles.view.Visual; + /** + * Performs the {@link yfiles.graph.ILookup#lookup} operation for the {@link yfiles.styles.IStripeStyleRenderer#getContext} that has been + * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. + *

+ * This implementation yields null for everything but: + *

+ *
    + *
  • {@link yfiles.view.IVisualCreator}
  • + *
  • {@link yfiles.graph.ILookup}
  • + *
+ *

+ * For these interfaces an implementation will be returned that delegates to the methods in this instance. + *

+ * @param {yfiles.graph.IStripe} stripe The stripe to use for the context lookup. + * @param {yfiles.lang.Class} type The type to query. + * @returns {Object} An implementation of the type or null. + * @protected + */ + lookup(stripe:yfiles.graph.IStripe,type:yfiles.lang.Class):Object; + /** + * Callback that updates the visual previously created by {@link yfiles.styles.StripeStyleBase#createVisual}. + *

+ * This method is called in response to a {@link yfiles.view.IVisualCreator#updateVisual} call to the instance that has been + * queried from the {@link yfiles.styles.StripeStyleBase#renderer}. This implementation simply delegates to {@link yfiles.styles.StripeStyleBase#createVisual} so subclasses + * should override to improve rendering performance. + *

+ * @param {yfiles.view.IRenderContext} context + * @param {yfiles.view.Visual} oldVisual The visual that has been created in the call to {@link yfiles.styles.StripeStyleBase#createVisual}. + * @param {yfiles.graph.IStripe} stripe The stripe to which this style instance is assigned. + * @returns {yfiles.view.Visual} The visual as required by the {@link yfiles.view.IVisualCreator#createVisual} interface. + * @see yfiles.styles.StripeStyleBase#createVisual + * @protected + */ + updateVisual(context:yfiles.view.IRenderContext,oldVisual:yfiles.view.Visual,stripe:yfiles.graph.IStripe):yfiles.view.Visual; + /** + * Gets the renderer implementation for this instance. + *

+ * The private implementation will delegate all API calls back to this instance. + *

+ * @type {yfiles.styles.IStripeStyleRenderer} + */ + renderer:yfiles.styles.IStripeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * Style implementation for {@link yfiles.graph.IStripe} instances in an {@link yfiles.graph.ITable}. + *

+ * It is up to the implementation to interpret the visual appearance of a stripe. The framework uses the associated, + * possibly shared {@link yfiles.styles.IStripeStyle#renderer} to perform the actual rendering of this style for a given stripe. This interface extends the {@link yfiles.lang.ICloneable} + * interface. This allows clients to obtain a persistent copy of the current state of this style. Immutable style + * implementations may return themselves. + *

+ *

Related demos:

+ *
    + *
  • Demo: TableNodeStyle, Demo.yFiles.Graph.TableNodeStyle
  • + *
+ * @interface + * @implements {yfiles.lang.ICloneable} + */ + export interface IStripeStyle extends Object,yfiles.lang.ICloneable{ + /** + * Gets the renderer implementation that can be queried for implementations that provide details about the visual + * appearance and visual behavior for a given stripe and this style instance. + *

+ * The idiom for retrieving, e.g. an {@link yfiles.view.IVisualCreator} implementation for a given stripe is: + *

+ * @abstract + * @type {yfiles.styles.IStripeStyleRenderer} + */ + renderer:yfiles.styles.IStripeStyleRenderer; + } + var IStripeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.styles.IStripeStyle} implementations that can be used to query the actual {@link yfiles.view.IVisualCreator} + * implementation for a stripe and an associated style. + *

+ * Implementations of this interface should be designed to be sharable between multiple style instances and should + * therefore not contain style specific state. + *

+ * @see yfiles.styles.IStripeStyle + * @see yfiles.graph.IStripe + * @interface + */ + export interface IStripeStyleRenderer extends Object{ + /** + * Gets a temporary context instance that can be used to query additional information for the stripe's style. + *

+ * Implementations may return {@link yfiles.graph.ILookup#EMPTY} if they don't support this, but may not return null. + *

+ * @param {yfiles.graph.IStripe} stripe The stripe to provide a context instance for. + * @param {yfiles.styles.IStripeStyle} style The style to use for the context. + * @returns {yfiles.graph.ILookup} An non-null lookup implementation. + * @see yfiles.graph.ILookup#EMPTY + * @see yfiles.graph.ILookup + * @abstract + */ + getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; + /** + * Gets an implementation of the {@link yfiles.view.IVisualCreator} interface that can handle the provided stripe and its + * associated style. + *

+ * This method may return a flyweight implementation, but never null. + *

+ * @param {yfiles.graph.IStripe} stripe The nstripeode to provide an instance for + * @param {yfiles.styles.IStripeStyle} style The style to use for the creation of the visual + * @returns {yfiles.view.IVisualCreator} An implementation that may be used to subsequently create or update the visual for the stripe. 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.view.VoidVisualCreator#INSTANCE void} implementation + * instead. + * @see yfiles.view.VoidVisualCreator#INSTANCE + * @abstract + */ + getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; + } + var IStripeStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A void implementation of a stripe style that does nothing and behaves like an invisible style. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidStripeStyle#INSTANCE} of this class + * instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.graph.IStripe#style} property of an + * {@link yfiles.graph.IStripe}. + *

+ * @class yfiles.styles.VoidStripeStyle + * @implements {yfiles.styles.IStripeStyle} + * @final + */ + export interface VoidStripeStyle extends Object,yfiles.styles.IStripeStyle{} + export class VoidStripeStyle { + /** + * Returns this. + * @returns {Object} this + */ + clone():Object; + /** + * The {@link yfiles.styles.VoidStripeStyle} singleton. + * @const + * @static + * @type {yfiles.styles.IStripeStyle} + */ + static INSTANCE:yfiles.styles.IStripeStyle; + /** + * Yields the {@link yfiles.styles.VoidStripeStyleRenderer#INSTANCE VoidStripeStyleRenderer instance}. + * @see yfiles.styles.IStripeStyle#renderer + * @type {yfiles.styles.IStripeStyleRenderer} + */ + renderer:yfiles.styles.IStripeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A void implementation of a stripe style renderer that does nothing. + *

+ * This class implements the singleton pattern. Use the shared static {@link yfiles.styles.VoidStripeStyleRenderer#INSTANCE} of + * this class instead of null where null is not allowed. For example you cannot assign null to the {@link yfiles.styles.IStripeStyle#renderer} property of an + * {@link yfiles.styles.IStripeStyle}. + *

+ * @class yfiles.styles.VoidStripeStyleRenderer + * @implements {yfiles.styles.IStripeStyleRenderer} + * @final + */ + export interface VoidStripeStyleRenderer extends Object,yfiles.styles.IStripeStyleRenderer{} + export class VoidStripeStyleRenderer { + /** + * Yields the {@link yfiles.graph.ILookup#EMPTY} that will not yield anything. + * @param {yfiles.graph.IStripe} stripe + * @param {yfiles.styles.IStripeStyle} style + * @returns {yfiles.graph.ILookup} + */ + getContext(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.graph.ILookup; + /** + * Yields the {@link yfiles.view.VoidVisualCreator#INSTANCE} that will do nothing. + * @param {yfiles.graph.IStripe} stripe + * @param {yfiles.styles.IStripeStyle} style + * @returns {yfiles.view.IVisualCreator} + */ + getVisualCreator(stripe:yfiles.graph.IStripe,style:yfiles.styles.IStripeStyle):yfiles.view.IVisualCreator; + /** + * The {@link yfiles.styles.VoidStripeStyleRenderer} singleton. + * @const + * @static + * @type {yfiles.styles.IStripeStyleRenderer} + */ + static INSTANCE:yfiles.styles.IStripeStyleRenderer; + static $class:yfiles.lang.Class; + } + /** + * A stripe style decorator that uses a node style instance to render the stripe. + * @class yfiles.styles.NodeStyleStripeStyleAdapter + * @implements {yfiles.styles.IStripeStyle} + */ + export interface NodeStyleStripeStyleAdapter extends Object,yfiles.styles.IStripeStyle{} + export class NodeStyleStripeStyleAdapter { + /** + * Creates a stripe style that uses the provided node style to render the stripe. + *

+ * Note that the styles will be stored by reference, thus modifying the style will directly affect the rendering of this + * instance. + *

+ * @param {yfiles.styles.INodeStyle} nodeStyle The node style to use for rendering the stripe. + * @constructor + */ + constructor(nodeStyle:yfiles.styles.INodeStyle); + /** + * Initializes a new instance of the {@link yfiles.styles.NodeStyleStripeStyleAdapter} class. + *

+ * This constructor uses an rectangular {@link yfiles.styles.ShapeNodeStyle} with a transparent brush and a black pen for the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} + * property. + *

+ * @param {Object} [options=null] The parameters to pass. + * @param {yfiles.styles.INodeStyle} options.nodeStyle The {@link yfiles.styles.INodeStyle} that is used for rendering the stripe. + *

+ * This option sets the {@link yfiles.styles.NodeStyleStripeStyleAdapter#nodeStyle} property on the created object. + *

+ * @constructor + */ + constructor(options?:{nodeStyle?:yfiles.styles.INodeStyle}); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * + * @type {yfiles.styles.IStripeStyleRenderer} + */ + renderer:yfiles.styles.IStripeStyleRenderer; + /** + * Gets the {@link yfiles.styles.INodeStyle} that is used for rendering the stripe. + * @type {yfiles.styles.INodeStyle} + */ + nodeStyle:yfiles.styles.INodeStyle; + static $class:yfiles.lang.Class; + } + }export namespace binding{ + /** + * This class is an adapter that populates a {@link yfiles.binding.GraphBuilderBase#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.GraphBuilderBase#nodesSource}, {@link yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphBuilder#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.GraphBuilderBase#nodeIdBinding} is + * set, the {@link yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding} should yield these IDs instead of the node business objects. + *

+ *

+ * The method {@link yfiles.binding.GraphBuilderBase#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.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. + *

+ *

+ * The visual appearance of the graph constructed from the business objects can be configured using the {@link yfiles.graph.IGraph#nodeDefaults}, the {@link yfiles.graph.IGraph#groupNodeDefaults}, and the {@link yfiles.graph.IGraph#edgeDefaults} of + * the {@link yfiles.graph.IGraph}. + *

+ * @class yfiles.binding.AdjacentNodesGraphBuilder + * @extends {yfiles.binding.GraphBuilderBase} + */ + export interface AdjacentNodesGraphBuilder extends yfiles.binding.GraphBuilderBase{} + export class AdjacentNodesGraphBuilder { + /** + * Initializes a new instance of this class using the given graph. + *

+ * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is called. + *

+ * @param {yfiles.graph.IGraph} graph + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * 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} source The source node of the edge. + * @param {yfiles.graph.INode} target The target node of the edge. + * @returns {yfiles.graph.IEdge} The created edge. + * @protected + */ + createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode):yfiles.graph.IEdge; + /** + * Updates an existing edge connecting the given nodes when {@link yfiles.binding.GraphBuilderBase#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} source The source node of the edge. + * @param {yfiles.graph.INode} target The target node of the edge. + * @protected + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,source:yfiles.graph.INode,target:yfiles.graph.INode):void; + /** + * 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.GraphBuilderBase#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.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @see yfiles.binding.AdjacentNodesGraphBuilder#predecessorsBinding + * @type {Object} + */ + 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.GraphBuilderBase#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.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @see yfiles.binding.AdjacentNodesGraphBuilder#successorsBinding + * @type {Object} + */ + predecessorsBinding:Object; + static $class:yfiles.lang.Class; + } + /** + * This class is an adapter that populates a {@link yfiles.binding.GraphBuilderBase#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.GraphBuilderBase#nodesSource}, {@link yfiles.binding.GraphBuilderBase#groupsSource} and {@link yfiles.binding.GraphBuilder#edgesSource} properties. + *

+ *

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

+ *

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

+ *

+ * The visual appearance of the graph constructed from the business objects can be configured using the {@link yfiles.graph.IGraph#nodeDefaults}, the {@link yfiles.graph.IGraph#groupNodeDefaults}, and the {@link yfiles.graph.IGraph#edgeDefaults} of + * the {@link yfiles.graph.IGraph}. + *

+ * @class yfiles.binding.GraphBuilder + * @extends {yfiles.binding.GraphBuilderBase} + */ + export interface GraphBuilder extends yfiles.binding.GraphBuilderBase{} + export class GraphBuilder { + /** + * Initializes a new instance of this class using the given graph. + *

+ * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} and {@link yfiles.binding.GraphBuilder#edgesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is + * called. + *

+ * @param {yfiles.graph.IGraph} graph + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * Creates a new edge connecting the given nodes and assigns the businessObjectparameter to the edge's {@link yfiles.graph.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} source The source node of the edge. + * @param {yfiles.graph.INode} target The target node of the edge. + * @param {Object} labelData The optional label data of the edge if an {@link yfiles.binding.GraphBuilder#edgeLabelBinding} is specified. + * @param {Object} businessObject The business data associated with the edge. + * @returns {yfiles.graph.IEdge} The created edge. + * @protected + */ + createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:Object,businessObject:Object):yfiles.graph.IEdge; + /** + * Retrieves the associated edge in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilder#edgesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.GraphBuilder#edgesSource} to get the edge for. + * @returns {yfiles.graph.IEdge} The edge associated with the business object or null for unknown objects. + * @see yfiles.binding.GraphBuilderBase#getBusinessObject + * @see yfiles.binding.GraphBuilderBase#getNode + * @see yfiles.binding.GraphBuilderBase#getGroup + */ + getEdge(businessObject:Object):yfiles.graph.IEdge; + /** + * Updates an existing edge when {@link yfiles.binding.GraphBuilderBase#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.GraphBuilder#edgeLabelBinding} is specified. + * @param {Object} businessObject The business data associated with the edge. + * @protected + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,labelData:Object,businessObject:Object):void; + /** + * 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.GraphBuilderBase#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.GraphBuilderBase#nodesSource}. Otherwise, if this property is true, an edge is created for each item of {@link yfiles.binding.GraphBuilder#edgesSource} and nodes are + * created for the source and target as needed. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @see yfiles.binding.GraphBuilder#edgesSource + * @type {boolean} + */ + lazyNodeDefinition:boolean; + /** + * Get or set the business objects to be represented as edges of the {@link yfiles.binding.GraphBuilderBase#graph}. + *

+ * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.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. + *

+ * @type {Object} + */ + 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.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @see yfiles.binding.GraphBuilder#targetNodeBinding + * @see yfiles.binding.GraphBuilder#edgesSource + * @type {Object} + */ + 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.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @see yfiles.binding.GraphBuilder#sourceNodeBinding + * @see yfiles.binding.GraphBuilder#edgesSource + * @type {Object} + */ + 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.GraphBuilder#createEdge} + * and {@link yfiles.binding.GraphBuilder#updateEdge}. + *

+ *

+ * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilder#edgesSource + * @type {Object} + */ + edgeLabelBinding:Object; + static $class:yfiles.lang.Class; + } + /** + * Base class for adapters that populate a {@link yfiles.binding.GraphBuilderBase#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.GraphBuilder} + * or {@link yfiles.binding.AdjacentNodesGraphBuilder}. + *

+ * @class yfiles.binding.GraphBuilderBase + */ + export interface GraphBuilderBase extends Object{} + export class GraphBuilderBase { + /** + * Initializes a new instance of this class using the given graph. + *

+ * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.GraphBuilderBase#nodesSource} when {@link yfiles.binding.GraphBuilderBase#buildGraph} is called. + *

+ * @param {yfiles.graph.IGraph} graph + * @protected + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * Populates the graph instance with items generated 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. + *

+ * @returns {yfiles.graph.IGraph} The created graph. + * @see yfiles.binding.GraphBuilderBase#updateGraph + */ + buildGraph():yfiles.graph.IGraph; + /** + * Creates a new group node and assigns the businessObjectparameter to the group node's {@link yfiles.graph.ITagOwner#tag Tag} property. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {Object} businessObject The business data associated with the group node. + * @returns {yfiles.graph.INode} The created node. + * @protected + */ + createGroupNode(graph:yfiles.graph.IGraph,businessObject:Object):yfiles.graph.INode; + /** + * Creates a new node with the specified parent and assigns the businessObjectparameter to the node's {@link yfiles.graph.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.IGraph} graph The graph. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.Point} location The location of the node. + * @param {Object} labelData The optional label data of the node if an {@link yfiles.binding.GraphBuilderBase#nodeLabelBinding} is specified. + * @param {Object} businessObject The business data associated with the node. + * @returns {yfiles.graph.INode} The created node. + * @protected + */ + createNode(graph:yfiles.graph.IGraph,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:Object,businessObject:Object):yfiles.graph.INode; + /** + * Retrieves the associated business object for a given {@link yfiles.graph.IModelItem graph item} from the {@link yfiles.binding.GraphBuilderBase#graph}. + * @param {yfiles.graph.IModelItem} item The item of the graph to get the business object for. + * @returns {Object} The business object associated with the graph item. + * @see yfiles.binding.GraphBuilderBase#getNode + * @see yfiles.binding.GraphBuilderBase#getGroup + */ + getBusinessObject(item:yfiles.graph.IModelItem):Object; + /** + * Retrieves the associated group node in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilderBase#groupsSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.GraphBuilderBase#groupsSource} to get the group for. + * @returns {yfiles.graph.INode} The group associated with the business object or null for unknown objects. + * @see yfiles.binding.GraphBuilderBase#getBusinessObject + * @see yfiles.binding.GraphBuilderBase#getNode + */ + getGroup(businessObject:Object):yfiles.graph.INode; + /** + * Retrieves the associated node in the {@link yfiles.binding.GraphBuilderBase#graph} for a business object from the {@link yfiles.binding.GraphBuilderBase#nodesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.GraphBuilderBase#nodesSource} to get the node for. + * @returns {yfiles.graph.INode} The node associated with the business object or null for unknown objects. + * @see yfiles.binding.GraphBuilderBase#getBusinessObject + * @see yfiles.binding.GraphBuilderBase#getGroup + */ + getNode(businessObject:Object):yfiles.graph.INode; + /** + * Updates the graph instance to fit the bound business data. + *

+ * This method can be used to update the graph to fit changed business data. In contrast to + * {@link yfiles.binding.GraphBuilderBase#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; + /** + * Updates an existing group node when {@link yfiles.binding.GraphBuilderBase#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.IGraph} graph The graph. + * @param {yfiles.graph.INode} groupNode The group node to update. + * @param {Object} businessObject The business data associated with the group node. + * @protected + */ + updateGroupNode(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode,businessObject:Object):void; + /** + * Updates an existing node when {@link yfiles.binding.GraphBuilderBase#updateGraph} is called and the node should remain in the + * graph. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} node The node to update. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.Point} location The location of the node. + * @param {Object} labelData The optional label data of the node if an {@link yfiles.binding.GraphBuilderBase#nodeLabelBinding} is specified. + * @param {Object} businessObject The business data associated with the node. + * @protected + */ + updateNode(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:Object,businessObject:Object):void; + /** + * Returns the {@link yfiles.graph.IGraph graph} used by this class. + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + /** + * Gets or sets the business objects to be represented as nodes of the {@link yfiles.binding.GraphBuilderBase#graph}. + *

+ * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.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. + *

+ * @type {Object} + */ + nodesSource:Object; + /** + * Gets or sets the business objects to be represented as group nodes of the {@link yfiles.binding.GraphBuilderBase#graph}. + *

+ * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.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. + *

+ * @type {Object} + */ + groupsSource: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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @type {Object} + */ + 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. + *

+ *

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

+ *

+ * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. Functions will be called with both this and the first and only argument as the value to convert. + *

+ * @see yfiles.binding.GraphBuilderBase#groupsSource + * @type {Object} + */ + 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.GraphBuilderBase#groupsSource}, then the node for o1 becomes a child node of the group for o2. + *

+ *

+ * If a {@link yfiles.binding.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @type {Object} + */ + 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.GraphBuilderBase#groupsSource}, then the group for o1 becomes a child node of the group for o2. + *

+ *

+ * If a {@link yfiles.binding.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @type {Object} + */ + locationYBinding:Object; + static $class:yfiles.lang.Class; + } + /** + * This class is an adapter which populates a {@link yfiles.binding.TreeBuilder#graph} from hierarchical business data. + *

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

+ *

+ * Graph items will be visualized using the styles defined in the {@link yfiles.graph.IGraph#nodeDefaults}, {@link yfiles.graph.IGraph#edgeDefaults} and {@link yfiles.graph.IGraph#groupNodeDefaults} property of the {@link yfiles.binding.TreeBuilder#graph}. + *

+ *

+ * The created {@link yfiles.binding.TreeBuilder#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.GraphBuilderBase#groupBinding} has to be defined. Group nodes can be nested using the {@link yfiles.binding.GraphBuilderBase#parentGroupBinding} property. Labels for the edges + * can be defined by setting a suitable {@link yfiles.binding.TreeBuilder#edgeLabelBinding}, which is resolved on the target (child) node. + *

+ *

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

+ * @see yfiles.binding.TreeBuilder#nodesSource + * @see yfiles.binding.TreeBuilder#childBinding + * @class yfiles.binding.TreeBuilder + */ + export interface TreeBuilder extends Object{} + export class TreeBuilder { + /** + * Creates a new empty instance using the given graph. + *

+ * The graph will be {@link yfiles.graph.IGraph#clear cleared} and re-built from the data in {@link yfiles.binding.TreeBuilder#nodesSource} when {@link yfiles.binding.TreeBuilder#buildGraph} is called. The {@link yfiles.binding.TreeBuilder#childBinding} + * needs to be set in order to actually create a tree. + *

+ * @param {yfiles.graph.IGraph} graph + * @constructor + */ + constructor(graph:yfiles.graph.IGraph); + /** + * Populates the graph instance with items generated 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. + *

+ * @returns {yfiles.graph.IGraph} The created graph. + * @see yfiles.binding.TreeBuilder#updateGraph + */ + buildGraph():yfiles.graph.IGraph; + /** + * Creates an edge between the source and target node. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} source The source node of the edge. + * @param {yfiles.graph.INode} target The target node of the edge. + * @param {Object} labelData The optional label data of the edge if an {@link yfiles.binding.TreeBuilder#edgeLabelBinding} is specified. + * @returns {yfiles.graph.IEdge} The created edge. + * @protected + */ + createEdge(graph:yfiles.graph.IGraph,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:Object):yfiles.graph.IEdge; + /** + * Creates a new group node and assigns the businessObjectparameter to the group node's {@link yfiles.graph.ITagOwner#tag Tag} property. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {Object} businessObject The business data associated with the group node. + * @returns {yfiles.graph.INode} The created node. + * @protected + */ + createGroupNode(graph:yfiles.graph.IGraph,businessObject:Object):yfiles.graph.INode; + /** + * Creates a node with the specified parent and assigns the businessObject parameter to the node's {@link yfiles.graph.ITagOwner#tag Tag} property. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.Point} location The location of the node. + * @param {Object} labelData The optional label data of the node if an {@link yfiles.binding.TreeBuilder#nodeLabelBinding} is specified. + * @param {Object} businessObject The business data associated with the node. + * @returns {yfiles.graph.INode} The created node. + * @protected + */ + createNode(graph:yfiles.graph.IGraph,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:Object,businessObject:Object):yfiles.graph.INode; + /** + * Retrieves the associated business object for a given {@link yfiles.graph.INode node} from the {@link yfiles.binding.TreeBuilder#graph}. + * @param {yfiles.graph.IModelItem} item The node of the graph to get the business object for. + * @returns {Object} The business object associated with the graph element. + * @see yfiles.binding.TreeBuilder#getNode + */ + getBusinessObject(item:yfiles.graph.IModelItem):Object; + /** + * Retrieves the associated node in the {@link yfiles.binding.TreeBuilder#graph} for a business object from the {@link yfiles.binding.TreeBuilder#nodesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.TreeBuilder#nodesSource} to get the node for. + * @returns {yfiles.graph.INode} The node associated with the business object or null for unknown objects. + * @see yfiles.binding.TreeBuilder#getBusinessObject + */ + getNode(businessObject: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} source The edge's source node. + * @param {yfiles.graph.INode} target The edge's target node. + * @param {Object} labelData The business data associated with the edge. + * @protected + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,source:yfiles.graph.INode,target:yfiles.graph.INode,labelData:Object):void; + /** + * Updates the graph instance to fit the bound business data. + *

+ * This method can be used to update the graph to fit changed business data. In contrast to + * {@link yfiles.binding.TreeBuilder#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; + /** + * Updates an existing group node when {@link yfiles.binding.TreeBuilder#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.IGraph} graph The graph. + * @param {yfiles.graph.INode} groupNode The group node to update. + * @param {Object} businessObject The business data associated with the group node. + * @protected + */ + updateGroupNode(graph:yfiles.graph.IGraph,groupNode:yfiles.graph.INode,businessObject:Object):void; + /** + * Updates a node with the given data. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} node The node to update. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.Point} location The location of the node. + * @param {Object} labelData The optional label data of the edge if an {@link yfiles.binding.TreeBuilder#nodeLabelBinding} is specified. + * @param {Object} businessObject The business data associated with the node. + * @protected + */ + updateNode(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.Point,labelData:Object,businessObject:Object):void; + /** + * Returns the {@link yfiles.graph.IGraph graph} used by this instance. + * @type {yfiles.graph.IGraph} + */ + 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.collections.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.TreeBuilder#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.TreeBuilder#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. + *

+ * @type {Object} + */ + nodesSource:Object; + /** + * Gets or sets the business objects to be represented as group nodes of the {@link yfiles.binding.TreeBuilder#graph}. + *

+ * This can either be an array of objects, a plain JavaScript object or an {@link yfiles.collections.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. + *

+ * @type {Object} + */ + groupsSource:Object; + /** + * Gets or sets the binding for the children of a node. + *

+ * 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.GraphBuilderBase#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.GraphBuilderBase#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.GraphBuilderBase#nodesSource + * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.TreeBuilder#nodesSource + * @type {Object} + */ + 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.TreeBuilder#createEdge} and {@link yfiles.binding.TreeBuilder#updateEdge}. + *

+ *

+ * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @type {Object} + */ + 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. + *

+ *

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

+ *

+ * The binding can either be a plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.TreeBuilder#nodesSource + * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.TreeBuilder#nodesSource + * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.TreeBuilder#nodesSource + * @type {Object} + */ + 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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.TreeBuilder#groupsSource + * @type {Object} + */ + 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.TreeBuilder#groupsSource}, then the node for o1 becomes a child node of the group for o2. + *

+ *

+ * If a {@link yfiles.binding.TreeBuilder#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @see yfiles.binding.TreeBuilder#nodesSource + * @type {Object} + */ + 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.TreeBuilder#groupsSource}, then the group for o1 becomes a child node of the group for o2. + *

+ *

+ * If a {@link yfiles.binding.TreeBuilder#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 plain JavaScript function, a String, null, or an array which contains the same types + * recursively. A function is called with the business object to convert as first and only parameter, and the function's this + * is set to the business object, too. + *

+ * @type {Object} + */ + parentGroupBinding:Object; + static $class:yfiles.lang.Class; + } + }export namespace algorithms{ + /** + * 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 that is currently executed on the given graph. + *

+ *

+ * Client Code Usage + *

+ *

+ * An instance of this class can be attached to a graph using method {@link yfiles.algorithms.AbortHandler#createForGraph}. 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. Algorithms can check for these requests and handle them appropriately. + *

+ *
    + *
  • + * Stop � The algorithm should terminate gracefully, delivering a consistent result. Although the termination will be early, it + * will usually not be immediate. + *
  • + *
  • Cancel � The algorithm should terminate immediately and all work done so far will be discarded.
  • + *
+ *

+ * If a graph with an attached handler is processed by multiple algorithms (or multiple times by the same 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. + *

+ *

+ * 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}. Then, the algorithm 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. + *

+ * @class yfiles.algorithms.AbortHandler + */ + export interface AbortHandler extends Object{} + export class AbortHandler { + /** + * Creates a new {@link yfiles.algorithms.AbortHandler} instance. + * @see yfiles.algorithms.AbortHandler#stopDuration + * @see yfiles.algorithms.AbortHandler#cancelDuration + * @see yfiles.algorithms.AbortHandler#reset + * @constructor + */ + constructor(); + /** + * Determines whether or not an algorithm should terminate immediately. + *

+ * This method returns true if the algorithm should terminate gracefully and ensures that the processed graph remains in a + * consistent state. + *

+ * @returns {boolean} true, if the algorithm should terminate immediately, false otherwise + * @throws {yfiles.algorithms.AlgorithmAbortedError} if the algorithm should terminate immediately + * @see yfiles.algorithms.AbortHandler#stop + */ + check():boolean; + /** + * Determines whether or not an algorithm should terminate immediately. + *

+ * This method returns true if the algorithm should terminate gracefully and ensures that the processed graph remains in a + * consistent state. + *

+ *

+ * This convenience method is meant for one-time checks only. For performance critical code that needs to check 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. + *

+ * @param {yfiles.algorithms.Graph} graph + * @returns {boolean} true, if the algorithm should stop immediately while still providing some valid result, false otherwise + * @throws {yfiles.algorithms.AlgorithmAbortedError} if the algorithm should terminate immediately + * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null + * @see yfiles.algorithms.AbortHandler#check + * @see yfiles.algorithms.AbortHandler#stop + * @static + */ + static check(graph:yfiles.algorithms.Graph):boolean; + /** + * Attaches the {@link yfiles.algorithms.AbortHandler} instance of the given source graph to the target graph as well. + * @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 {Stubs.Exceptions.ArgumentError} if the given source is null + * @static + */ + static copyHandler(source:yfiles.algorithms.Graph,target:yfiles.algorithms.Graph):void; + /** + * Creates an {@link yfiles.algorithms.AbortHandler handler} instance and attaches it to the given graph. + *

+ * If the given graph has already an attached handler instance, this is the instance that will be returned and this method + * will not create a new {@link yfiles.algorithms.AbortHandler}. + *

+ *

+ * 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 + * @returns {yfiles.algorithms.AbortHandler} the {@link yfiles.algorithms.AbortHandler} instance for the given graph + * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null. + * @see yfiles.algorithms.AbortHandler#hasHandler + * @static + */ + static createForGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler; + /** + * Returns an {@link yfiles.algorithms.AbortHandler} instance for the given graph. + *

+ * If {@link yfiles.algorithms.AbortHandler#createForGraph} has been used for attaching a new handler to the given graph, this is + * the instance that will be returned. Otherwise, a non-functional instance is returned whose methods do nothing. Use {@link yfiles.algorithms.AbortHandler#hasHandler} + * to check whether or not a handler has been already attached to the given graph. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {yfiles.algorithms.AbortHandler} an {@link yfiles.algorithms.AbortHandler} for the given graph or a non-functional instance if no handler has been previously + * created + * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null + * @see yfiles.algorithms.AbortHandler#createForGraph + * @see yfiles.algorithms.AbortHandler#hasHandler + * @static + */ + static getFromGraph(graph:yfiles.algorithms.Graph):yfiles.algorithms.AbortHandler; + /** + * Determines whether or not an {@link yfiles.algorithms.AbortHandler} instance is attached to the given graph. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if a handler is attached to the given graph, false otherwise + * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null + * @static + */ + static hasHandler(graph:yfiles.algorithms.Graph):boolean; + /** + * Removes any attached {@link yfiles.algorithms.AbortHandler} instance from the given graph. + * @param {yfiles.algorithms.Graph} graph the given graph + * @throws {Stubs.Exceptions.ArgumentError} if the given graph is null. + * @static + */ + static removeFromGraph(graph:yfiles.algorithms.Graph):void; + /** + * Resets the state of the {@link yfiles.algorithms.AbortHandler handler}. + *

+ * Resetting the {@link yfiles.algorithms.AbortHandler handler} discards any previous stop or cancel requests. Moreover, the handler's internal timestamp that is + * used for determining whether or not an algorithm should be stopped or cancelled automatically is reset 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 yfiles.algorithms.AbortHandler#cancelDuration + * @see yfiles.algorithms.AbortHandler#stopDuration + */ + reset():void; + /** + * Schedules a stop request. + *

+ * Algorithms that detect stop requests should terminate gracefully and ensure that the processed graph remains in a + * consistent state. + *

+ *

+ * If a Cancel request has already been scheduled for this handler, the stop request is ignored. If a Cancel request is + * scheduled later on, the stop request is overridden. + *

+ * @see yfiles.algorithms.AbortHandler#check + * @see yfiles.algorithms.AbortHandler#cancelDuration + */ + stop():void; + /** + * Determines the remaining time (in milliseconds) until an algorithm that {@link yfiles.algorithms.AbortHandler#check checks} this handler is cancelled automatically. + * @returns {yfiles.lang.TimeSpan} the remaining time until the algorithm is cancelled automatically. + * @see yfiles.algorithms.AbortHandler#cancelDuration + * @see yfiles.algorithms.AbortHandler#reset + * @see yfiles.algorithms.AbortHandler#cancelDuration + */ + timeToCancel():yfiles.lang.TimeSpan; + /** + * Determines the remaining time until an algorithm that {@link yfiles.algorithms.AbortHandler#check checks} this handler is stopped automatically. + *

+ * If the {@link yfiles.algorithms.AbortHandler#stopDuration stop duration} is less than or equal to zero, -1 will be returned which means that the algorithm may run + * unrestricted. + *

+ * @returns {yfiles.lang.TimeSpan} the remaining time until the algorithm is stopped automatically or -1 if the algorithm may run unrestricted + * @see yfiles.algorithms.AbortHandler#stopDuration + * @see yfiles.algorithms.AbortHandler#reset + * @see yfiles.algorithms.AbortHandler#stop + */ + timeToStop():yfiles.lang.TimeSpan; + /** + * Data provider key for attaching an AbortHandler instance to a graph + *

+ * Only instances of {@link yfiles.algorithms.AbortHandler} should be assigned to this {@link yfiles.algorithms.IDataProvider}, otherwise a + * {@link yfiles.lang.Exception} will occur. Layout algorithms will use the attached handler to check for requests to cancel or + * stop the layout process. + *

+ * @const + * @static + * @type {yfiles.algorithms.GraphDpKey.} + */ + static ABORT_HANDLER_DP_KEY:yfiles.algorithms.GraphDpKey; + /** + * Returns whether or not a stop request was scheduled explicitly with the {@link yfiles.algorithms.AbortHandler#stop} method. + * @type {boolean} + */ + stopRequested:boolean; + /** + * Gets or sets the duration an algorithm may run before being stopped automatically. + *

+ * An algorithm is terminated gracefully, if the time in between {@link yfiles.algorithms.AbortHandler creating} or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler and calling {@link yfiles.algorithms.AbortHandler#check} + * exceeds the stop duration. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the duration is negative + * @see yfiles.algorithms.AbortHandler#timeToStop + * @see yfiles.algorithms.AbortHandler#reset + * @see yfiles.algorithms.AbortHandler#stop + * @type {yfiles.lang.TimeSpan} + */ + stopDuration:yfiles.lang.TimeSpan; + /** + * Gets or sets the duration an algorithm may run before being cancelled automatically. + *

+ * An algorithm is terminated immediately, if the time in between {@link yfiles.algorithms.AbortHandler creating} or {@link yfiles.algorithms.AbortHandler#reset resetting} this handler and calling {@link yfiles.algorithms.AbortHandler#check} + * exceeds the cancel duration. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the duration is negative + * @see yfiles.algorithms.AbortHandler#reset + * @see yfiles.algorithms.AbortHandler#cancelDuration + * @type {yfiles.lang.TimeSpan} + */ + cancelDuration:yfiles.lang.TimeSpan; + /** + * Gets whether or not methods {@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.AlgorithmAbortedError} or + * returned true to indicate that the calling algorithm should terminate gracefully. Otherwise, this method returns false. + *

+ * @see yfiles.algorithms.AbortHandler#check + * @see yfiles.algorithms.AbortHandler#check + * @type {boolean} + */ + checkFailed:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class provides services that center around breadth first search (BFS). + *

+ * Breadth first search starts at a given set of nodes and explores the neighboring nodes first, before visiting the next + * level neighbors. + *

+ *

+ * A breadth first search run can be either directed or undirected. All methods require a list of nodes that are considered + * as the core nodes from which the breadth first search starts. These nodes can be identified either with a {@link yfiles.algorithms.NodeList} + * or with a {@link yfiles.algorithms.IDataProvider} that returns true for core nodes and false for all other nodes. The output is + * given as an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0},"n":[[-35,-35,1,[[-25.34,-10.65,10.67,18.7,"0"]]],[-35,85,[[-25.34,109.35,10.67,18.7,"1"]]],[85,-35,[[94.66,-10.65,10.67,18.7,"1"]]],[85,85,[[94.66,109.35,10.67,18.7,"2"]]],[205,-35,[[214.66,-10.65,10.67,18.7,"3"]]],[205,85,[[214.66,109.35,10.67,18.7,"4"]]]],"e":[[4,3],[2,0],[0,1],[1,3],[2,3],[4,5]],"vp":[-35.0,-35.0,270.0,150.0]}} Example for a BFS run. The marked node is the core node from which BFS starts while node labels indicate the resulting + * layers. + *

+ * @class yfiles.algorithms.Bfs + * @static + */ + export interface Bfs extends Object{} + export class Bfs { + /** + * Returns the layers of nodes constructed by a directed/undirected breadth first search where the maximum number of layers + * is restricted. + *

+ * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes + * from which a breadth first search to the other nodes starts. The algorithm fills the provided {@link yfiles.algorithms.INodeMap} + * with an integer indicating the layer of each node. + *

+ *

+ * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.NodeList} coreNodes the list of core nodes + * @param {yfiles.algorithms.BfsDirection} direction one of the predefined direction specifiers + * @param {yfiles.algorithms.INodeMap} layerIDMap the {@link yfiles.algorithms.INodeMap} that will be filled during the BFS execution and holds the zero-based index of the BFS + * layer to which each node belongs or -1 if the node is not reachable + * @param {number} [maxLayers=0] the number of layers that will be returned or 0 if all layers are required + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer + * @throws {Stubs.Exceptions.ArgumentError} if the given direction is not supported + * @static + */ + static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,direction:yfiles.algorithms.BfsDirection,layerIDMap:yfiles.algorithms.INodeMap,maxLayers?:number):yfiles.algorithms.NodeList[]; + /** + * Returns the layers of nodes constructed by a directed/undirected breadth first search where the maximum number of layers + * is restricted. + *

+ * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes + * from which either a directed or undirected breadth first search to the other nodes starts. The algorithm fills the + * provided {@link yfiles.algorithms.INodeMap} with an integer indicating the layer of each node. + *

+ *

+ * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.NodeList} coreNodes the list of core nodes from which the BFS starts + * @param {boolean} directed true if the graph should be considered directed, false otherwise + * @param {yfiles.algorithms.INodeMap} layerIDMap the {@link yfiles.algorithms.INodeMap} that will be filled during the BFS execution and holds the zero-based index of the BFS + * layer to which each node belongs or -1 if the node is not reachable + * @param {number} [maxLayers=0] the number of layers that will be returned or 0 if all layers are required + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer + * @static + */ + static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,directed:boolean,layerIDMap:yfiles.algorithms.INodeMap,maxLayers?:number):yfiles.algorithms.NodeList[]; + /** + * Returns the layers of nodes constructed by a breadth first search. + *

+ * The first of these layers contains all nodes within the given {@link yfiles.algorithms.NodeList}. These nodes are the core nodes + * from which an undirected breadth first search to the other nodes starts. The algorithm fills the provided {@link yfiles.algorithms.INodeMap} + * with an integer indicating the layer of each node. + *

+ *

+ * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.NodeList} coreNodes the list of core nodes from which the BFS starts + * @param {yfiles.algorithms.INodeMap} layerIDMap the {@link yfiles.algorithms.INodeMap} that will be filled during the BFS execution and holds the zero-based index of the BFS + * layer to which each node belongs or -1 if the node is not reachable + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer + * @static + */ + static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[]; + /** + * Returns the layers of nodes constructed by a breadth first search. + *

+ * The first of these layers contains all nodes for which the given {@link yfiles.algorithms.IDataProvider} returns true. These + * nodes are the core nodes from which an undirected breadth first search to the other nodes starts. The algorithm fills + * the provided {@link yfiles.algorithms.INodeMap} with an integer indicating the layer of each node. + *

+ *

+ * In the i-th layer are previously unassigned nodes that are connected to nodes in the (i-1)-th layer. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.IDataProvider} isCoreNode the {@link yfiles.algorithms.IDataProvider} that contains the nodes from which the BFS starts; core nodes are marked with a true + * value + * @param {yfiles.algorithms.INodeMap} layerIDMap the {@link yfiles.algorithms.INodeMap} that will be filled during the BFS execution and holds the zero-based index of the BFS + * layer to which each node belongs or -1 if the node is not reachable + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer + * @static + */ + static getLayers(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider,layerIDMap:yfiles.algorithms.INodeMap):yfiles.algorithms.NodeList[]; + /** + * Returns the layers of nodes calculated by a breadth first search. + *

+ * The first of these layers contains all nodes within the given + * {@link yfiles.algorithms.NodeList}. These nodes are the core nodes from which an undirected breadth 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. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.NodeList} coreNodes the list of core nodes from which the BFS starts + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer + * @static + */ + static getLayers(graph:yfiles.algorithms.Graph,coreNodes:yfiles.algorithms.NodeList):yfiles.algorithms.NodeList[]; + /** + * Returns the layers of nodes constructed by a breadth first search. + *

+ * The first of these layers contains all nodes for which the given {@link yfiles.algorithms.IDataProvider} returns + * true. These nodes are the core nodes from which an undirected breadth 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. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.IDataProvider} isCoreNode the {@link yfiles.algorithms.IDataProvider} that contains the nodes from which the BFS starts; core nodes are marked with a true + * value + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes of a particular layer + * @static + */ + static getLayers(graph:yfiles.algorithms.Graph,isCoreNode:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList[]; + static $class:yfiles.lang.Class; + } + /** + * This class provides methods to determine whether a graph is bipartite and to obtain the corresponding partitions. + *

+ * A bipartite graph is a graph whose nodes can be partitioned into two sets such that each edges connects two nodes of different + * sets. In other words, there are no edges connecting nodes that belong to the same partition. + *

+ *

+ * The two sets/partitions are represented by two {@link Object} constants i.e., {@link yfiles.algorithms.Bipartitions#RED} or + * {@link yfiles.algorithms.Bipartitions#BLUE}. + *

+ *

+ * {@graph {"ann":{"s":[40,40],"d":0, "b":0},"styles":{"6":{"c":1, "b":0}},"n":[[365,205,6],[365,305,6],[365,405,6],[505,205],[505,305],[505,405]],"e":[[0,4],[0,3],[0,5],[1,4],[2,3],[2,5],[1,5]],"vp":[365.0,200.0,170.0,250.0]}} Example of a bipartite graph. Circular and rectangular nodes represent the two partitions. + *

+ * @class yfiles.algorithms.Bipartitions + * @static + */ + export interface Bipartitions extends Object{} + export class Bipartitions { + /** + * 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 be set in the given {@link yfiles.algorithms.INodeMap}, depending on the partition to which each node belongs. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.INodeMap} markMap the {@link yfiles.algorithms.INodeMap} that will be filled during the BFS execution and returns the partition (either {@link yfiles.algorithms.Bipartitions#RED} + * or {@link yfiles.algorithms.Bipartitions#BLUE}) to which each node belongs + * @returns {boolean} true if the graph is bipartite, false otherwise + * @static + */ + static getBipartition(graph:yfiles.algorithms.Graph,markMap:yfiles.algorithms.INodeMap):boolean; + /** + * Determines whether or not the given graph is bipartite. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is bipartite, false otherwise + * @static + */ + static isBipartite(graph:yfiles.algorithms.Graph):boolean; + /** + * A constant for marking a node that belongs to the red partition. + * @const + * @static + * @type {Object} + */ + static RED:Object; + /** + * A constant for marking a node that belongs to the blue partition. + * @const + * @static + * @type {Object} + */ + static BLUE:Object; + static $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 double value 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 such that they lie within + * the interval [0,1]. + *

+ *

+ * Definitions + *

+ *
    + *
  • Betweenness centrality is a measure for how often a node/edge lies on a shortest path between each pair of nodes in the graph.
  • + *
  • Closeness centrality is the reciprocal of the sum of shortest path distances of a node to all other nodes in the graph.
  • + *
  • Graph centrality is the reciprocal of the maximum of all shortest path distances from a node to all other nodes in the graph.
  • + *
  • + * Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall + * degree). + *
  • + *
  • Weight centrality measures the weight associated with incoming, outgoing, or all edges of a node.
  • + *
+ * @class yfiles.algorithms.Centrality + * @static + */ + export interface Centrality extends Object{} + export class Centrality { + /** + * 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. If the sum of the + * shortest path distances is 0, the closeness of a node is set to {@link number#POSITIVE_INFINITY}. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} closeness the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (centrality) for each + * node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} edgeCosts the {@link yfiles.algorithms.IDataProvider} that returns a positive double value (cost) or null if the edges are of equal cost + * @static + */ + static closenessCentrality(graph:yfiles.algorithms.Graph,closeness:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; + /** + * Computes the degree centrality for the nodes of a given graph. + *

+ * Degree centrality is the number of the incoming, outgoing or overall edges incident to a node (measures incoming, outgoing and overall + * degree). + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} centrality the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (centrality) for each + * node + * @param {boolean} considerInEdges true if the incoming edges should be considered, false otherwise + * @param {boolean} considerOutEdges true if the outgoing edges should be considered, false otherwise + * @static + */ + static degreeCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean):void; + /** + * Computes betweenness centrality for each edge of a given graph. + *

+ * Betweenness centrality is a measure for how often an edge lies on a shortest path between each pair of nodes in the graph. Removing a central + * edge will cause many shortest paths to change. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IEdgeMap} centrality the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns a double value (centrality) for each + * edge + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} edgeCosts the {@link yfiles.algorithms.IDataProvider} that returns a positive double value (cost) or null if the edges are of equal cost; + * for invalid input values the algorithm uses cost 1.0 + * @static + */ + static edgeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.IEdgeMap,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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} centrality the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (centrality) for each + * node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} edgeCosts the {@link yfiles.algorithms.IDataProvider} that returns a positive double value (cost) or null if the edges are of equal cost + * @static + */ + static graphCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; + /** + * 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 + * edge will cause many shortest paths to change. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} centrality the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (centrality) for each + * node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} edgeCosts the {@link yfiles.algorithms.IDataProvider} that returns a positive double value (cost) or null if the edges are of equal cost; + * for invalid input values the algorithm uses cost 1.0 + * @static + */ + static nodeBetweenness(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; + /** + * Computes betweenness centrality for each node and edge of a given graph. + *

+ * Betweenness centrality is a measure for how often a node/edge lies on a shortest path between each pair of nodes in the graph. Removing a + * central node/edge will cause many shortest paths to change. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} nodeCentrality the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (centrality) for each + * node + * @param {yfiles.algorithms.IEdgeMap} edgeCentrality the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns a double value (centrality) for each + * edge + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} edgeCosts the {@link yfiles.algorithms.IDataProvider} that returns a positive double value (cost) or null if the edges are of equal cost; + * for invalid input values the algorithm uses cost 1.0 + * @static + */ + static nodeEdgeBetweenness(graph:yfiles.algorithms.Graph,nodeCentrality:yfiles.algorithms.INodeMap,edgeCentrality:yfiles.algorithms.IEdgeMap,directed:boolean,edgeCosts:yfiles.algorithms.IDataProvider):void; + /** + * Normalizes the double values of a given {@link yfiles.algorithms.IEdgeMap} by dividing each of them by the maximum of all values + * (maximum norm). + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IEdgeMap} map the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns a double value from [0,1] interval + * @static + */ + static normalizeEdgeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.IEdgeMap):void; + /** + * Normalizes the double values of a given {@link yfiles.algorithms.INodeMap} by dividing each of them by the maximum of all values + * (maximum norm). + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} map the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value from [0,1] interval + * @static + */ + static normalizeNodeMap(graph:yfiles.algorithms.Graph,map:yfiles.algorithms.INodeMap):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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} centrality the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (centrality) for each + * node + * @param {boolean} considerInEdges true if the incoming edges should be considered, false otherwise + * @param {boolean} considerOutEdges true if the outgoing edges should be considered, false otherwise + * @param {yfiles.algorithms.IDataProvider} edgeWeights the {@link yfiles.algorithms.IDataProvider} that returns a positive double value (weight) or null if the edges are considered to + * have uniform weight of 1.0 + * @static + */ + static weightCentrality(graph:yfiles.algorithms.Graph,centrality:yfiles.algorithms.INodeMap,considerInEdges:boolean,considerOutEdges:boolean,edgeWeights:yfiles.algorithms.IDataProvider):void; + static $class:yfiles.lang.Class; + } + /** + * This class is responsible for finding cycles within a graph that have certain properties. + *

+ * Definitions + *

+ *
    + *
  • + * An edge path with vertices v0, v1, v2, ... , vk (with k > 0 and (vi-1,vi), 0 < i <= k is edge of the given graph) is + * called simple if no vertex appears more than once. + *
  • + *
  • An edge path forms a cycle if v0 = vk.
  • + *
  • A cycle is called simple if no vertex appears more than once.
  • + *
  • A graph that contains no cycles is called acyclic.
  • + *
+ *

+ * {@graph {"ann":{"s":[30,30],"d":1, "c":1},"n":[[45,5],[105,65],[-15,65],[45,125],[185,65],[-95,65]],"e":[[0,1],[0,2],[1,3],[2,3],[1,4],[2,5]],"vp":[-95.0,5.0,310.0,150.0]}} Example of an acyclic directed graph (edge directions are considered) {@graph {"ann":{"s":[30,30],"d":1, "c":1},"n":[[305,185],[385,125],[345,285],[505,125],[545,225],[465,305]],"e":[[0,1],[1,3],[4,5,1],[5,2,1],[2,0,1],[0,4,1]],"vp":[305.0,125.0,270.0,210.0]}} Example of a graph containing a cycle. Marked + * edges form a directed cycle. + *

+ * @class yfiles.algorithms.Cycles + * @static + */ + export interface Cycles extends Object{} + export class Cycles { + /** + * Returns an {@link yfiles.algorithms.EdgeList} that contains all the edges that are part of at least one directed or undirected + * simple cycle. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {boolean} directed true if the graph should be considered directed, false otherwise + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} that contains all the edges that are part of at least one directed or undirected simple + * cycle + * @static + */ + static findAllCycleEdges(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList; + /** + * Returns an {@link yfiles.algorithms.EdgeList} that contains the edges of a cycle found in the given graph. + *

+ * The edges are returned in the order they appear in the detected cycle. + *

+ *

+ * If the returned cycle is empty, no cycle has been found in the given graph. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {boolean} directed true if the graph should be considered directed, false otherwise + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the edges of a cycle or an empty {@link yfiles.algorithms.EdgeList} if the graph is + * acyclic + * @static + */ + static findCycle(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList; + /** + * Marks the edges of a given graph whose removal or reversal would make the graph acyclic while trying to minimize the + * cost associated with the marked edges. + *

+ * This minimization is performed heuristically, since it is a well known hard problem to come up with an optimal + * solution. + *

+ *

+ * The costs are assigned using a {@link yfiles.algorithms.IDataProvider} that holds a non-negative double value for each edge. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.IEdgeMap} cycleEdges the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns whether an edge is a detected cycle + * edge + * @param {yfiles.algorithms.IDataProvider} [costDP=null] the {@link yfiles.algorithms.IDataProvider} that holds the non-negative {@link number} reversal cost for each edge + * @static + */ + static findCycleEdges(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap,costDP?:yfiles.algorithms.IDataProvider):void; + /** + * Marks the edges of a given graph whose removal or reversal would make the graph acyclic based on a depth first search. + *

+ * The number of marked cycle edges is expected to be slightly greater than when using FindCycleEdges. The advantage of + * this method is that the result set is more stable when edges are added or removed over time. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.IEdgeMap} cycleEdges the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns a boolean value indicating whether + * or not an edge is a detected cycle edge + * @static + */ + static findCycleEdgesDFS(graph:yfiles.algorithms.Graph,cycleEdges:yfiles.algorithms.IEdgeMap):void; + static $class:yfiles.lang.Class; + } + /** + * Represents a dart of a face of a {@link yfiles.algorithms.PlanarEmbedding}. + *

+ * For each edge there exist two darts, one that represents the edge in its original direction (i.e., from source to + * target) and one that represents its reverse. Each dart is associated with a {@link yfiles.algorithms.Dart#face face}. + *

+ * @class yfiles.algorithms.Dart + * @final + */ + export interface Dart extends Object{} + export class Dart { + /** + * Gets the edge associated with this dart. + * @type {yfiles.algorithms.Edge} + */ + associatedEdge:yfiles.algorithms.Edge; + /** + * Gets whether this dart represents the original edge or its reverse. + * @type {boolean} + */ + reversed:boolean; + /** + * Gets the opposite dart. + *

+ * The opposite dart is associated with the same edge as this dart but with a different {@link yfiles.algorithms.Dart#reversed direction}. + *

+ * @type {yfiles.algorithms.Dart} + */ + oppositeDart:yfiles.algorithms.Dart; + /** + * Gets the face list associated with this dart. + * @type {yfiles.collections.IList.} + */ + face:yfiles.collections.IList; + static $class:yfiles.lang.Class; + } + /** + * Framework class for implementing depth first search (DFS) based algorithms. + *

+ * A depth first search starts from a specified node and traverses the neighbors within a branch as deeply as possible + * (i.e., without visiting any vertex twice) before backtracking. + *

+ *

+ * A depth first search traversal induces a DFS forest that may consist of more than one DFS tree. Based on these trees, + * the edges are divided into four categories (see example): + *

+ *
    + *
  • Tree Edges: The edges of the DFS forest.
  • + *
  • Back edges: Non-tree edges that connect nodes with their ancestors in the DFS tree. Self-loops are also considered as back edges.
  • + *
  • Forward edges: Edges that connect nodes of the DFS tree to one of their descendants.
  • + *
  • Cross edges: All other edges.
  • + *
+ *

+ * During a DFS run each node of the graph can be in one of the following states: + *

+ *
    + *
  • Undiscovered: A node that has not been visited yet.
  • + *
  • + * Discovered but not finished: A node that has been already visited, but has not been completed yet, i.e. it is still part of an active path of the + * DFS tree. + *
  • + *
  • + * Finished: A node that has been completed, i.e. it has been visited before and is not part of an active path of the DFS tree + * anymore. + *
  • + *
+ *

+ * Graph algorithms, which are based on a depth first search, can extend this class and override appropriate callback + * methods provided by this class. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1, "c":1},"styles" : {"6" : {"s" : "#000000", "d" : 1, "l" : [3] }, "7" : {"s" : "#000000", "d" : 1, "l" : [1,4] }, "8" : {"s" : "#000000", "d" : 1, "l" : [7] }},"n":[[145,-15,[[154.66,9.35,10.67,18.7,"1"]]],[65,65,[[74.66,89.35,10.67,18.7,"2"]]],[185,65,[[194.66,89.35,10.67,18.7,"8"]]],[45,225,[[54.66,249.35,10.67,18.7,"5"]]],[125,145,[[134.66,169.35,10.67,18.7,"7"]]],[65,145,[[74.66,169.35,10.67,18.7,"6"]]],[-35,225,[[-25.34,249.35,10.67,18.7,"4"]]],[5,145,[[14.66,169.35,10.67,18.7,"3"]]],[185,145,[[194.66,169.35,10.67,18.7,"9"]]]],"e":[[0,1],[1,7],[0,2],[7,3],[1,4],[1,5],[7,6],[2,1,6,[],[[118.33,72.85,35.34,18.7,"Cross"]]],[6,1,8,[-60,100,-60,100],[[-95.2,149.04,30.68,18.7,2.4492935982947064E-16,-1.0,"Back"]]],[0,3,7,[360,140],[[270.38,202.85,48.01,18.7,2.4492935982947064E-16,-1.0,"Forward"]]],[2,8]],"vp":[-96.0,-15.0,456.0,270.0]}} Example of a DFS traversal. Node labels indicate the order in which nodes are visited. Solid edges are the edges of the + * DFS tree while dashed edges represent back, forward and cross edges. + *

+ * @class yfiles.algorithms.Dfs + */ + export interface Dfs extends Object{} + export class Dfs { + /** + * Creates a new {@link yfiles.algorithms.Dfs} instance with default settings. + * @constructor + */ + constructor(); + /** + * Cancels the depth first search. + *

+ * It may be overridden to support custom implementations. + *

+ */ + cancel():void; + /** + * Callback method that will be invoked whenever DFS continues its search at a new root node. + *

+ * By default, this method does nothing. It may be overridden to support custom implementations. + *

+ * @param {yfiles.algorithms.Node} v the new root node + * @protected + */ + lookFurther(v:yfiles.algorithms.Node):void; + /** + * Callback method that will be invoked after the DFS has returned from the given node. + *

+ * By default, this method does nothing. It may be overridden to support custom implementations. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge + * @param {yfiles.algorithms.Node} node the node that has been reached via the given edge + * @protected + */ + postTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node):void; + /** + * Callback method that will be invoked whenever a node visit has been completed. + *

+ * By default, this method does nothing. It may be overridden to support custom implementations. + *

+ * @param {yfiles.algorithms.Node} node the given node + * @param {number} dfsNumber the DFS number of the given node + * @param {number} compNumber the completion number of the given node + * @protected + */ + postVisit(node:yfiles.algorithms.Node,dfsNumber:number,compNumber:number):void; + /** + * Callback method that will be invoked if the given edge will be considered the first (and only) time during the DFS. + *

+ * By default, this method does nothing. It may be overridden to support custom implementations. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge + * @param {yfiles.algorithms.Node} node the node to be visited next only if treeEdge == true + * @param {boolean} treeEdge true if the node will be visited, false otherwise + * @protected + */ + preTraverse(edge:yfiles.algorithms.Edge,node:yfiles.algorithms.Node,treeEdge:boolean):void; + /** + * Callback method that will be invoked whenever a formerly unvisited node gets visited for the first time. + *

+ * By default, this method does nothing. It may be overridden to support custom implementations. + *

+ * @param {yfiles.algorithms.Node} node the given node + * @param {number} dfsNumber the DFS number of the given node + * @protected + */ + preVisit(node:yfiles.algorithms.Node,dfsNumber:number):void; + /** + * Starts a depth first search from a given {@link yfiles.algorithms.Node} of the input graph. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} start the given start node + */ + start(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node):void; + /** + * Starts a depth first search on the given graph. + *

+ * The first node of the graph will be visited first. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + */ + start(graph:yfiles.algorithms.Graph):void; + /** + * A {@link yfiles.algorithms.INodeMap} that holds for each {@link yfiles.algorithms.Node} an {@link Object} indicating the current state of the given + * node as it is visited by this algorithm. + *

+ * Each node will be assigned one of the {@link yfiles.algorithms.Dfs#WHITE WHITE}, {@link yfiles.algorithms.Dfs#GRAY GRAY} or {@link yfiles.algorithms.Dfs#BLACK BLACK} objects that describe the state of the nodes. + *

+ * @protected + * @type {yfiles.algorithms.INodeMap} + */ + stateMap:yfiles.algorithms.INodeMap; + /** + * A constant indicating a node has not been visited yet. + * @protected + * @const + * @static + * @type {Object} + */ + static WHITE:Object; + /** + * A constant indicating a node has already been visited, but has not been completed yet. + *

+ * Such a node is still part of an active path of the DFS tree. + *

+ * @protected + * @const + * @static + * @type {Object} + */ + static GRAY:Object; + /** + * A constant indicating a node has been completed. + *

+ * Such a node has been visited before and is no longer part of an active path of the DFS tree. + *

+ * @protected + * @const + * @static + * @type {Object} + */ + static BLACK:Object; + /** + * Sets whether or not to interpret the edges of the graph as directed. + * @type {boolean} + */ + directedMode:boolean; + /** + * Sets whether or not to continue the depth first search after all nodes reachable from the first node have been visited. + * @type {boolean} + */ + lookFurtherMode:boolean; + static $class:yfiles.lang.Class; + } + /** + * This is the base class of all look-up keys that are used to register {@link yfiles.algorithms.IDataProvider} with a + * {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.DpKeyBase. + * @template TValue + */ + export interface DpKeyBase extends Object{} + export class DpKeyBase { + /** + * Initializes a new instance of the {@link yfiles.algorithms.DpKeyBase.} class. + * @param {yfiles.lang.Class} valueType The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + /** + * Returns whether this key is equal to the specified other. + * @param {yfiles.algorithms.DpKeyBase.} other The other key to compare with this instance. + * @returns {boolean} true if the specified key is equal to this instance; otherwise, false. + * @protected + */ + equalsCore(other:yfiles.algorithms.DpKeyBase):boolean; + /** + * Gets the type that declares this key. + * @type {yfiles.lang.Class} + */ + declaringType:yfiles.lang.Class; + /** + * Gets the name of this key. + * @type {string} + */ + name:string; + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.Edge}s with a + * {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.EdgeDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface EdgeDpKey extends yfiles.algorithms.DpKeyBase{} + export class EdgeDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.EdgeDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for the {@link yfiles.algorithms.Graph} itself + * with a graph. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.GraphDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface GraphDpKey extends yfiles.algorithms.DpKeyBase{} + export class GraphDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.GraphDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.GraphObject}s + * with a {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.GraphObjectDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface GraphObjectDpKey extends yfiles.algorithms.DpKeyBase{} + export class GraphObjectDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.GraphObjectDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for IEdgeLabelLayouts with a + * {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.IEdgeLabelLayoutDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface IEdgeLabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} + export class IEdgeLabelLayoutDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.IEdgeLabelLayoutDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for INodeLabelLayouts with a + * {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.INodeLabelLayoutDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface INodeLabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} + export class INodeLabelLayoutDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.INodeLabelLayoutDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for ILabelLayouts with a + * {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.ILabelLayoutDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface ILabelLayoutDpKey extends yfiles.algorithms.DpKeyBase{} + export class ILabelLayoutDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.ILabelLayoutDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * This class is used as look-up key for registering {@link yfiles.algorithms.IDataProvider} for {@link yfiles.algorithms.Node}s with a + * {@link yfiles.algorithms.Graph}. + * Type parameter TValue: The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.algorithms.Graph#getDataProvider + * @see yfiles.algorithms.Graph#removeDataProvider + * @class yfiles.algorithms.NodeDpKey. + * @extends {yfiles.algorithms.DpKeyBase.} + * @template TValue + */ + export interface NodeDpKey extends yfiles.algorithms.DpKeyBase{} + export class NodeDpKey { + /** + * Initializes a new instance of the {@link yfiles.algorithms.NodeDpKey.} class. + * @param {yfiles.lang.Class} valueType1 The type of the values that are returned by the {@link yfiles.algorithms.IDataProvider} registered with this class. + * @param {yfiles.lang.Class} declaringType Type that declares this key. + * @param {string} name The name of this key. + * @constructor + */ + constructor(valueType1:yfiles.lang.Class,declaringType:yfiles.lang.Class,name:string); + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.algorithms.Edge + * @extends {yfiles.algorithms.GraphObject} + */ + export interface Edge extends yfiles.algorithms.GraphObject{} + export class Edge { + /** + * 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.
  • + *
+ * @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}. + * @param {yfiles.algorithms.Graph} g + * @constructor + */ + constructor(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); + /** + * 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. + * @returns {yfiles.algorithms.Edge} The newly created Edge object. + */ + createCopy(g:yfiles.algorithms.Graph,v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Callback method that is invoked from a graph just before this edge will be reinserted into that graph. + */ + onReinsert():void; + /** + * 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. + *

+ * @param {yfiles.algorithms.Node} v + * @returns {yfiles.algorithms.Node} + */ + opposite(v:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Gets 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. + *

+ * @type {yfiles.algorithms.Graph} + */ + graph:yfiles.algorithms.Graph; + /** + * Gets 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. + *

+ * @see yfiles.algorithms.Graph#removeEdge + * @see yfiles.algorithms.Graph#hide + * @see yfiles.algorithms.Graph#reInsertEdge + * @see yfiles.algorithms.Graph#unhide + * @see yfiles.algorithms.Graph#moveToFirst + * @see yfiles.algorithms.Graph#moveToLast + * @type {number} + */ + index:number; + /** + * Gets the source node connected to this edge. + * @see yfiles.algorithms.Edge#target + * @type {yfiles.algorithms.Node} + */ + source:yfiles.algorithms.Node; + /** + * Gets the target node connected to this edge. + * @see yfiles.algorithms.Edge#source + * @type {yfiles.algorithms.Node} + */ + target:yfiles.algorithms.Node; + /** + * Gets 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. + *

+ * @type {boolean} + */ + selfLoop:boolean; + /** + * Gets 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. + *

+ * @see yfiles.algorithms.Edge#prevOutEdge + * @see yfiles.algorithms.Edge#nextInEdge + * @type {yfiles.algorithms.Edge} + */ + nextOutEdge:yfiles.algorithms.Edge; + /** + * Gets 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. + *

+ * @see yfiles.algorithms.Edge#prevInEdge + * @see yfiles.algorithms.Edge#nextOutEdge + * @type {yfiles.algorithms.Edge} + */ + nextInEdge:yfiles.algorithms.Edge; + /** + * Gets 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. + *

+ * @see yfiles.algorithms.Edge#nextOutEdge + * @see yfiles.algorithms.Edge#prevInEdge + * @type {yfiles.algorithms.Edge} + */ + prevOutEdge:yfiles.algorithms.Edge; + /** + * Gets 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. + *

+ * @see yfiles.algorithms.Edge#nextInEdge + * @see yfiles.algorithms.Edge#prevOutEdge + * @type {yfiles.algorithms.Edge} + */ + prevInEdge:yfiles.algorithms.Edge; + static $class:yfiles.lang.Class; + } + /** + * Specialized list implementation for instances of type {@link yfiles.algorithms.Edge}. + * @class yfiles.algorithms.EdgeList + * @extends {yfiles.algorithms.YList} + * @implements {yfiles.collections.IEnumerable.} + */ + export interface EdgeList extends yfiles.algorithms.YList{} + export class EdgeList { + /** + * Creates a list that is initialized with an EdgeList. + * @param {yfiles.algorithms.EdgeList} edgeList + * @constructor + */ + constructor(edgeList:yfiles.algorithms.EdgeList); + /** + * Creates a list that is initialized with a single edge provided. + * @param {yfiles.algorithms.Edge} e + * @constructor + */ + constructor(e:yfiles.algorithms.Edge); + /** + * 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#getBoolean 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. + * @constructor + */ + constructor(ec:yfiles.algorithms.IEdgeCursor,predicate:yfiles.algorithms.IDataProvider); + /** + * Creates a list that is initialized with the edges provided by the given array of edges. + * @param {Array.} a + * @constructor + */ + constructor(a:yfiles.algorithms.Edge[]); + /** + * Creates a list that is initialized with the edges provided by the given EdgeCursor object. + * @param {yfiles.algorithms.IEdgeCursor} c + * @constructor + */ + constructor(c:yfiles.algorithms.IEdgeCursor); + /** + * Creates an empty edge list. + * @constructor + */ + constructor(); + /** + * Returns an edge cursor for this edge list. + * @returns {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. + * @returns {yfiles.algorithms.Edge} The first edge in the list. + */ + firstEdge():yfiles.algorithms.Edge; + /** + * Returns an enumerator for this collection. + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Returns the last edge in this list, or null when the list is empty. + * @returns {yfiles.algorithms.Edge} The last edge in the list. + */ + lastEdge():yfiles.algorithms.Edge; + /** + * Removes the first edge from this list and returns it. + * @returns {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. + * @returns {Array.} + */ + toEdgeArray():yfiles.algorithms.Edge[]; + static $class:yfiles.lang.Class; + } + export enum BfsDirection{ + /** + * An edge direction specifier for incoming edges. + * @see yfiles.algorithms.Bfs#getLayers + */ + PREDECESSOR, + /** + * An edge direction specifier for outgoing edges. + * @see yfiles.algorithms.Bfs#getLayers + */ + SUCCESSOR, + /** + * An edge direction specifier for both incoming and outgoing edges. + * @see yfiles.algorithms.Bfs#getLayers + */ + BOTH + } + 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 + } + 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 + } + export enum DistanceMetric{ + /** + * A specifier for euclidean distance metric. + * @see yfiles.algorithms.Groups#kMeansClustering + */ + EUCLIDEAN, + /** + * A specifier for euclidean squared distance metric. + * @see yfiles.algorithms.Groups#kMeansClustering + */ + EUCLIDEAN_SQUARED, + /** + * A specifier for Manhattan distance metric. + * @see yfiles.algorithms.Groups#kMeansClustering + */ + MANHATTAN, + /** + * A specifier for Chebychev distance metric. + * @see yfiles.algorithms.Groups#kMeansClustering + */ + CHEBYCHEV + } + export enum Linkage{ + /** + * A specifier for single-linkage clustering. + *

+ * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most + * "similar" clusters are merged together until all nodes belong to the same cluster. + *

+ * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + */ + SINGLE, + /** + * A specifier for complete-linkage clustering. + *

+ * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most + * "dissimilar" clusters are merged and the distance equals to the distance of those two nodes that are farthest away from + * each other. The algorithm continues until all nodes belong to the same cluster. + *

+ * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + */ + COMPLETE, + /** + * A specifier for average-linkage clustering. + *

+ * At the beginning, each element belongs to its own cluster. At each step of the clustering algorithm the two most + * "similar" clusters are combined and the distance between them is defined as the average all distances between the nodes + * that belong to the two clusters that are combined. The algorithm continues until all nodes belong to the same cluster. + *

+ * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + */ + AVERAGE + } + /** + * 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. + *

+ *

+ * 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. + *

+ * @class yfiles.algorithms.Graph + */ + export interface Graph extends Object{} + export class 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. If no cursor is specified, the + * complete graph is copied. 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. + *

+ * @param {yfiles.algorithms.Graph} graph The graph to be (partially) copied. + * @param {yfiles.algorithms.ICursor} [subNodes=null] A cursor to iterate over the nodes that actually induce the subgraph to be copied. + * @constructor + */ + constructor(graph:yfiles.algorithms.Graph,subNodes?:yfiles.algorithms.ICursor); + /** + * Instantiates an empty Graph object. + * @constructor + */ + constructor(); + /** + * 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. + *

+ * @param {Object} providerKey + * @param {yfiles.algorithms.IDataProvider} data + */ + addDataProvider(providerKey:Object,data:yfiles.algorithms.IDataProvider):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.
  • + *
+ * @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}. + */ + changeEdge(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. + *

+ * 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.
  • + *
+ * @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}. + */ + changeEdge(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. + *

+ * The edge is appended to the lists of incoming and outgoing edges at the given source node and target node, + * respectively. + *

+ * @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; + /** + * 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 edge. + * @param {yfiles.algorithms.Edge} e + * @returns {boolean} + */ + contains(e:yfiles.algorithms.Edge):boolean; + /** + * Whether or not this graph contains the given node. + * @param {yfiles.algorithms.Node} v + * @returns {boolean} + */ + contains(v:yfiles.algorithms.Node):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. + * @returns {boolean} + * @see yfiles.algorithms.Node#getEdgeTo + * @see yfiles.algorithms.Node#getEdgeFrom + * @see yfiles.algorithms.Node#getEdge + */ + containsEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):boolean; + /** + * Creates a copy of this graph. + *

+ * Invokes {@link yfiles.algorithms.Graph#Graph}. + *

+ * @returns {yfiles.algorithms.Graph} The newly created Graph object. + */ + createCopy():yfiles.algorithms.Graph; + /** + * 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.
  • + *
+ * @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}. + * @returns {yfiles.algorithms.Edge} The newly created Edge object. + */ + createEdge(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; + /** + * 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. + * @returns {yfiles.algorithms.Edge} The newly created Edge object. + */ + createEdge(v:yfiles.algorithms.Node,w:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * 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. + *

+ * @returns {yfiles.algorithms.IEdgeMap} + */ + createEdgeMap():yfiles.algorithms.IEdgeMap; + /** + * Creates an empty base object of the same type as this graph. + *

+ * Subclasses should override this method. + *

+ * @returns {yfiles.algorithms.Graph} + */ + createGraph():yfiles.algorithms.Graph; + /** + * Creates a new node in this graph and fires a corresponding notification event to inform registered listeners. + * @returns {yfiles.algorithms.Node} The newly created Node object. + */ + createNode():yfiles.algorithms.Node; + /** + * 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. + *

+ * @returns {yfiles.algorithms.INodeMap} + */ + createNodeMap():yfiles.algorithms.INodeMap; + /** + * 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. + *

+ * @param {yfiles.algorithms.IEdgeMap} map + */ + disposeEdgeMap(map:yfiles.algorithms.IEdgeMap):void; + /** + * 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. + *

+ * @param {yfiles.algorithms.INodeMap} map + */ + disposeNodeMap(map:yfiles.algorithms.INodeMap):void; + /** + * Low-level iteration support for adjacent edges. + * @param {yfiles.algorithms.Node} v + * @returns {yfiles.algorithms.Edge} + * @protected + * @static + */ + static firstOutEdge(v:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * 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. + *

+ * @param {Object} providerKey + * @returns {yfiles.algorithms.IDataProvider} + */ + getDataProvider(providerKey:Object):yfiles.algorithms.IDataProvider; + /** + * Returns an array containing all edges of this graph. + * @returns {Array.} + */ + getEdgeArray():yfiles.algorithms.Edge[]; + /** + * Provides access to the edges of the graph. + * @returns {yfiles.algorithms.IEdgeCursor} An EdgeCursor to iterate over the edges in the graph. + */ + getEdgeCursor():yfiles.algorithms.IEdgeCursor; + /** + * Returns an array containing all nodes of this graph. + * @returns {Array.} + */ + getNodeArray():yfiles.algorithms.Node[]; + /** + * Provides access to the nodes of the graph. + * @returns {yfiles.algorithms.INodeCursor} A NodeCursor to iterate over the nodes in the graph. + */ + getNodeCursor():yfiles.algorithms.INodeCursor; + /** + * 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 event 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#unhide}. + *

+ * @param {yfiles.algorithms.Node} v + * @see yfiles.algorithms.Graph#hide + * @see yfiles.algorithms.Graph#unhide + */ + hide(v:yfiles.algorithms.Node):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 event 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#unhide}. + *

+ * @param {yfiles.algorithms.Edge} e + * @see yfiles.algorithms.Graph#hide + * @see yfiles.algorithms.Graph#unhide + */ + hide(e:yfiles.algorithms.Edge):void; + /** + * Moves the given edge to the first position within the sequence of edges in this graph. + * @param {yfiles.algorithms.Edge} e + */ + moveToFirst(e:yfiles.algorithms.Edge):void; + /** + * Moves the given node to the first position within the sequence of nodes in this graph. + * @param {yfiles.algorithms.Node} v + */ + moveToFirst(v:yfiles.algorithms.Node):void; + /** + * Moves the given edge to the last position within the sequence of edges in this graph. + * @param {yfiles.algorithms.Edge} e + */ + moveToLast(e:yfiles.algorithms.Edge):void; + /** + * Moves the given node to the last position within the sequence of nodes in this graph. + * @param {yfiles.algorithms.Node} v + */ + moveToLast(v:yfiles.algorithms.Node):void; + /** + * For internal debugging purposes only. + */ + printNodeSlotSize():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. + *

+ *

+ * Note that reinserting an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) + * causes an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. + *

+ * @param {yfiles.algorithms.Edge} e The edge to be reinserted. + * @see yfiles.algorithms.Graph#removeEdge + */ + reInsertEdge(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 yfiles.algorithms.Graph#removeNode + */ + reInsertNode(v:yfiles.algorithms.Node):void; + /** + * Removes the data provider that is registered using the given look-up key. + * @param {Object} providerKey + */ + removeDataProvider(providerKey:Object):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; + /** + * 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; + /** + * Reverses the given edge and fires corresponding notification events to inform registered listeners. + *

+ * This operation exchanges source and target node of the edge. + *

+ * @param {yfiles.algorithms.Edge} e + */ + reverseEdge(e:yfiles.algorithms.Edge):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.collections.IComparer.} inComparer The comparator used for the incoming edges at each node. + * @param {yfiles.collections.IComparer.} outComparer The comparator used for the outgoing edges at each node. + */ + sortEdges(inComparer:yfiles.collections.IComparer,outComparer:yfiles.collections.IComparer):void; + /** + * 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.collections.IComparer.} comparer The comparator used for the edges. + */ + sortEdges(comparer:yfiles.collections.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.collections.IComparer.} comparer The comparator used for the nodes. + */ + sortNodes(comparer:yfiles.collections.IComparer):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#hide}. + *

+ *

+ * The only difference to a proper node reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertNode} is that no event + * will be emitted that signals the structural change (i.e. the node's reinsertion). + *

+ * @param {yfiles.algorithms.Node} v + */ + unhide(v:yfiles.algorithms.Node):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#hide}. + *

+ *

+ * The only difference to a proper edge reinsertion as performed by {@link yfiles.algorithms.Graph#reInsertEdge} is that no event + * will be emitted that signals the structural change (i.e. the edge's reinsertion). + *

+ *

+ * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes + * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. + *

+ * @param {yfiles.algorithms.Edge} e + * @see yfiles.algorithms.Graph#hide + * @see yfiles.algorithms.Graph#unhide + */ + unhide(e:yfiles.algorithms.Edge):void; + /** + * Gets the number of nodes in this graph. + *

+ * Same as {@link yfiles.algorithms.Graph#nodeCount}. + *

+ * @type {number} + */ + n:number; + /** + * Gets the number of nodes in this graph. + * @type {number} + */ + nodeCount:number; + /** + * Gets the number of edges in this graph. + *

+ * Same as {@link yfiles.algorithms.Graph#edgeCount}. + *

+ * @type {number} + */ + e:number; + /** + * Gets the number of edges in this graph. + * @type {number} + */ + edgeCount:number; + /** + * Gets true if this graph contains no nodes. + * @type {boolean} + */ + empty:boolean; + /** + * Gets the first node in this graph. + * @type {yfiles.algorithms.Node} + */ + firstNode:yfiles.algorithms.Node; + /** + * Gets the first edge in this graph. + * @type {yfiles.algorithms.Edge} + */ + firstEdge:yfiles.algorithms.Edge; + /** + * Gets the last node in this graph. + * @type {yfiles.algorithms.Node} + */ + lastNode:yfiles.algorithms.Node; + /** + * Gets the last edge in this graph. + * @type {yfiles.algorithms.Edge} + */ + lastEdge:yfiles.algorithms.Edge; + /** + * Gets all node maps that have been created by this graph but have not yet been disposed. + * @see yfiles.algorithms.Graph#createNodeMap + * @see yfiles.algorithms.Graph#disposeNodeMap + * @type {Array.} + */ + registeredNodeMaps:yfiles.algorithms.INodeMap[]; + /** + * Gets all edge maps that have been created by this graph but have not yet been disposed. + * @see yfiles.algorithms.Graph#createEdgeMap + * @see yfiles.algorithms.Graph#disposeEdgeMap + * @type {Array.} + */ + registeredEdgeMaps:yfiles.algorithms.IEdgeMap[]; + /** + * Gets an array of all data provider look-up keys that are registered with this graph. + * @type {Array.} + */ + dataProviderKeys:Object[]; + /** + * 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + edges:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * This class provides methods that check structural properties of a given graph. + *

+ * Definitions + *

+ *
    + *
  • Cycle: An edge path with vertices v0, v1, v2, ... , vk forms a cycle if v0 = vk and consists of at least one edge.
  • + *
  • Acyclic graph: A graph that contains no directed cycle.
  • + *
  • Cyclic graph: A graph that contains a directed cycle.
  • + *
  • Connected graph: A graph in which there exists an undirected path of edges between every pair of nodes.
  • + *
  • Strongly connected graph: A graph in which there exists a directed path between each pair of nodes.
  • + *
  • Biconnected graph: A graph that has no cut vertex or articulation point (i.e., a node whose removal disconnects the graph).
  • + *
  • Bipartite graph: A graph whose nodes can be partitioned into two sets such that each edge connects two nodes of different sets.
  • + *
  • + * Tree graph: An acyclic graph, in which any pair of vertices is connected through a path. If one vertex of a tree is distinguished + * from the other vertices, then the tree is called rooted tree. + *
  • + *
  • N-ary tree graph: A directed rooted tree where each node has a maximum of n children.
  • + *
  • Forest graph: A graph whose connected components are trees.
  • + *
  • Simple graph: A graph that contains no self-loops and parallel edges.
  • + *
  • Planar graph: A graph that can be drawn on the plane without edge crossings.
  • + *
+ * @class yfiles.algorithms.GraphChecker + * @static + */ + export interface GraphChecker extends Object{} + export class GraphChecker { + /** + * Checks whether or not the given directed graph is acyclic. + *

+ * A graph is called acyclic if it contains no directed cycle. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is acyclic, false, otherwise + * @static + */ + static isAcyclic(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given undirected graph is biconnected. + *

+ * A graph is called biconnected if it has no cut vertex or articulation point, i.e., no node whose removal disconnects the graph. + *

+ * @param {yfiles.algorithms.Graph} graph the given undirected graph + * @returns {boolean} true if the graph is biconnected, false otherwise + * @static + */ + static isBiconnected(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given undirected graph is bipartite. + *

+ * A graph is called bipartite if its nodes can be partitioned into two sets such that each edge connects two nodes of different + * sets. + *

+ * @param {yfiles.algorithms.Graph} graph the given undirected graph + * @returns {boolean} true if the graph is bipartite, false otherwise + * @static + */ + static isBipartite(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given graph is connected. + *

+ * A graph is called connected if there exists an undirected path of edges between every pair of nodes. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is connected, false otherwise + * @static + */ + static isConnected(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given directed graph is cyclic. + *

+ * A graph is called cyclic if it contains a directed cycle. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is cyclic, false, otherwise + * @static + */ + static isCyclic(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether the given graph is a forest. + *

+ * A graph is a forest if its connected components are trees. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is a forest, false otherwise + * @static + */ + static isForest(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. + *

+ * @param {yfiles.algorithms.Graph} graph the given undirected graph + * @returns {boolean} true if the graph contains no multiple edges, false otherwise + * @static + */ + static isMultipleEdgeFree(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 + * @param {number} n + * @returns {boolean} true if the graph is a directed rooted tree where each node has at most n children, false otherwise + * @static + */ + static isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean; + /** + * Checks whether or not the given directed graph is a directed rooted tree. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is a directed rooted tree, false otherwise + * @static + */ + static isRootedTree(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given graph contains no self-loops. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph contains no self-loops, false otherwise + * @static + */ + static 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(). + *

+ * @param {yfiles.algorithms.Graph} graph the given directed graph + * @returns {boolean} true if the graph is simple, false otherwise + * @static + */ + static isSimple(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given directed graph is strongly connected. + *

+ * A graph is called strongly connected if there exists a directed path between each pair of nodes. + *

+ * @param {yfiles.algorithms.Graph} graph the given directed graph + * @returns {boolean} true if the graph is strongly connected, false, otherwise + * @static + */ + static isStronglyConnected(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given graph is an undirected tree. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is an undirected tree, false otherwise + * @static + */ + static isTree(graph:yfiles.algorithms.Graph):boolean; + static $class:yfiles.lang.Class; + } + /** + * This class provides algorithms for determining certain connectivity components within a graph. + *

+ * It also provides convenience methods for working with these components. + *

+ *

+ * Definitions + *

+ *
    + *
  • Connected graph: A graph is called connected if there exists an undirected path of edges between every pair of nodes.
  • + *
  • Strongly connected graph: A graph is called strongly connected if there exists a directed path between each pair of nodes.
  • + *
  • + * Biconnected graph: A graph is called biconnected if it has no cut vertex or articulation point (i.e., a node whose removal disconnects the + * remaining graph). + *
  • + *
+ * @class yfiles.algorithms.GraphConnectivity + * @static + */ + export interface GraphConnectivity extends Object{} + export class GraphConnectivity { + /** + * Calculates the biconnected components and the articulation points of a given undirected graph and returns the number of + * biconnected components. + *

+ * Articulation points are returned in the form of a {@link yfiles.algorithms.INodeMap} that returns for each node a boolean value + * indicating whether or not it is an articulation point. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IEdgeMap} compNum the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns the zero-based index of the + * biconnected component to which each edge belongs or -1 for self-loops + * @param {yfiles.algorithms.INodeMap} [aPoint=null] the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a boolean value indicating whether + * or not a given node is an articulation point + * @returns {number} the number of biconnected components + * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents + * @static + */ + static biconnectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,aPoint?:yfiles.algorithms.INodeMap):number; + /** + * Calculates the biconnected components of a given undirected graph. + *

+ * The result is returned as an array of + * {@link yfiles.algorithms.EdgeList}s each containing all edges that belong to the same biconnected component. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList}s each containing all edges that belong to the same biconnected component + * @see yfiles.algorithms.GraphConnectivity#biconnectedComponents + * @static + */ + static biconnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList[]; + /** + * Calculates the connected components of a given graph and returns their number. + *

+ * A graph G is called connected if there exists an undirected path of edges between every pair of nodes. + *

+ *

+ * The connected components of a graph are the maximal connected subgraphs of which the graph consists. + *

+ * @param {yfiles.algorithms.INodeMap} compNum the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns the zero-based index of the + * connected component to which each node belongs + * @param {yfiles.algorithms.Graph} graph + * @returns {number} the number of connected components of the given graph + * @static + */ + static connectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number; + /** + * Calculates the connected components of a given graph. + *

+ * A graph G is called connected if there exists an undirected path of edges between every pair of nodes. + *

+ *

+ * The connected components of a graph are the maximal connected subgraphs of which the graph consists. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes that belong to the same connected component + * @static + */ + static connectedComponents(graph:yfiles.algorithms.Graph):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.
  • + *
+ *

+ * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting + * set. + *

+ *

+ * To obtain the result, an integer value should be given as input that 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 to or smaller than + * this distance. + *

+ *

+ * Setting the maximum distance to 1 will only yield the direct neighbors of all start nodes. On the other hand, setting + * the maximum distance to graph.N() or larger will yield all neighbors of all start nodes. + *

+ * @param {yfiles.algorithms.Graph} graph + * @param {yfiles.algorithms.NodeList} startNodes + * @param {number} maxDistance + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} that contains all direct and indirect neighbors of a node + * @static + */ + static getNeighbors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; + /** + * Determines the direct or indirect predecessors of a given list of nodes. + *
    + *
  • A direct predecessor of a node is the source node of an incoming edge connected to a node.
  • + *
  • An indirect predecessor of a node is a direct predecessor to another predecessor of a node.
  • + *
+ *

+ * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting + * set. + *

+ *

+ * To obtain the result, an integer value should be given as input that 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 to or smaller than + * this distance. + *

+ *

+ * Setting the maximum distance to 1 will only yield the direct predecessors of all start nodes. On the other hand, setting + * the maximum distance to graph.N() or larger will yield all predecessors of all start nodes. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.NodeList} startNodes a {@link yfiles.algorithms.NodeList} containing the nodes from which the search starts + * @param {number} maxDistance an integer value that limits the distance between a start node and a returned node + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} that contains all direct and indirect predecessors of a node + * @static + */ + static getPredecessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; + /** + * Determines the direct or indirect successors of a given list 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.
  • + *
+ *

+ * The order of the returned nodes is determined by a breadth first search. No start node will be part of the resulting + * set. + *

+ *

+ * To obtain the result, an integer value should be given as input that 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 to or smaller than + * this distance. + *

+ *

+ * Setting the maximum distance to 1 will only yield the direct successors of all start nodes. On the other hand, setting + * the maximum distance to graph.N() or larger will yield all successors of all start nodes. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.NodeList} startNodes a {@link yfiles.algorithms.NodeList} containing the nodes from which the search starts + * @param {number} maxDistance an integer value that limits the distance between a start node and a returned node + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} that contains all direct and indirect successors of a node + * @static + */ + static getSuccessors(graph:yfiles.algorithms.Graph,startNodes:yfiles.algorithms.NodeList,maxDistance:number):yfiles.algorithms.NodeList; + /** + * Checks whether or not the given undirected graph is biconnected. + *

+ * A graph is called biconnected if it has no cut vertex or articulation point, i.e., no node whose removal disconnects the graph. + *

+ * @param {yfiles.algorithms.Graph} graph the given undirected graph + * @returns {boolean} true if the graph is biconnected, false otherwise + * @static + */ + static isBiconnected(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given graph is connected. + *

+ * A graph is called connected if there exists an undirected path of edges between every pair of nodes. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the graph is connected, false otherwise + * @static + */ + static isConnected(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given directed graph is strongly connected. + *

+ * A graph is called strongly connected if there exists a directed path between each pair of nodes. + *

+ * @param {yfiles.algorithms.Graph} graph the given directed graph + * @returns {boolean} true if the graph is strongly connected, false, otherwise + * @static + */ + static isStronglyConnected(graph:yfiles.algorithms.Graph):boolean; + /** + * Makes the given graph biconnected by inserting a minimum number of edges in the graph. + *

+ * The given graph is considered to be undirected. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the edges added to the graph + * @static + */ + static makeBiconnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; + /** + * Makes a graph connected by adding additional edges to the graph. + *

+ * The number of edges that will be added equals the number of separate components of the original graph minus 1. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the edges added to the graph + * @static + */ + static makeConnected(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; + /** + * Determines the set of nodes that are reachable from a given node when a set of edges that cannot be traversed is + * specified. + *

+ * The result is based on a depth first search. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.Node} start the node from which the search starts + * @param {boolean} directed true if the edges should be traversed from source to target, false if edges can be traversed in both directions + * @param {Array.} [forbidden=null] an array that holds for each {@link yfiles.algorithms.Edge} a {@link boolean} value indicating whether or not an edge can be traversed; an edge + * e is marked as forbidden if forbidden[e.index()] == true + * @param {Array.} reached an array that will be filled during the execution and returns for each {@link yfiles.algorithms.Node} a {@link boolean} value based on whether + * the node can be reached during the DFS; if a node v is reachable, then reached[v.index()] = true + * @static + */ + static reachable(graph:yfiles.algorithms.Graph,start:yfiles.algorithms.Node,directed:boolean,reached:boolean[],forbidden?:boolean[]):void; + /** + * Calculates the strongly connected components of a given graph and returns their number. + *

+ * A graph is called strongly connected if there exists a directed path between each pair of nodes. + *

+ *

+ * The strongly connected components of a graph are the strongly connected subgraphs of which it consists. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} compNum the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns the zero-based index of the + * connected component to which each node belongs + * @returns {number} the number of strongly connected components of the given graph + * @see yfiles.algorithms.GraphConnectivity#stronglyConnectedComponents + * @static + */ + static stronglyConnectedComponents(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap):number; + /** + * Calculates the strongly connected components of a given graph. + *

+ * A graph is called strongly connected if there exists a directed path between each pair of nodes. + *

+ *

+ * The strongly connected components of a graph are the strongly connected subgraphs of which it consists. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {Array.} an array of + * {@link yfiles.algorithms.NodeList}s each of which contains the nodes that belong to the same strongly connected component + * @see yfiles.algorithms.GraphConnectivity#stronglyConnectedComponents + * @static + */ + static stronglyConnectedComponents(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; + /** + * Transforms the return values of BiconnectedComponents to an array of {@link yfiles.algorithms.EdgeList}s, like it is returned by + * {@link yfiles.algorithms.GraphConnectivity#biconnectedComponents}. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IEdgeMap} compNum the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns the zero-based index of the + * connected component to which each edge belongs + * @param {number} maxCompNum the maximum number of biconnected components + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList}s each containing all edges that belong to the same biconnected component + * @static + */ + static toEdgeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.IEdgeMap,maxCompNum:number):yfiles.algorithms.EdgeList[]; + /** + * Transforms the return values of method {@link yfiles.algorithms.GraphConnectivity#connectedComponents} to an array of + * {@link yfiles.algorithms.NodeList}s, like it is returned by {@link yfiles.algorithms.GraphConnectivity#connectedComponents}. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} compNum the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns the zero-based index of the + * connected component to which each node belongs + * @param {number} maxCompNum the maximum number of connected components + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains the nodes that belong to the same connected component + * @static + */ + static toNodeListArray(graph:yfiles.algorithms.Graph,compNum:yfiles.algorithms.INodeMap,maxCompNum:number):yfiles.algorithms.NodeList[]; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.algorithms.GraphObject + */ + export interface GraphObject extends Object{} + export class GraphObject { + static $class:yfiles.lang.Class; + } + /** + * This class provides the result of hierarchical clustering algorithms by means of a binary tree structure. + *

+ * The dendrogram is created using the agglomerative strategy (i.e., a bottom-up approach) based on the following steps: + *

+ *
    + *
  • + * At the beginning (i.e., at level + * 0), each node belongs to its own cluster. At this point, each node of the original graph (the one that will be + * clustered) is mapped to one of the dendrogram nodes that represent a leaf node (i.e., a node with no children). + *
  • + *
  • + * At each step, pairs of clusters are merged while moving up to the hierarchy. In this case, a new dendrogram node is + * created and the corresponding dissimilarity value between the two merged clusters can be obtained using + * {@link yfiles.algorithms.Dendrogram#getDissimilarityValue}. The dissimilarity values are monotone increasing starting from zero + * which corresponds to the leaf nodes of the dendrogram. + *
  • + *
  • + * The algorithm continues until all nodes belong to the same cluster. At this point, the root of the dendrogram is reached + * and can be obtained using method {@link yfiles.algorithms.Dendrogram#root}. + *
  • + *
+ *

+ * The dendrogram is a binary tree that is directed from the root to the leaves. This means that one can iterate the + * dendrogram starting with the {@link yfiles.algorithms.Dendrogram#root root node}, moving on to its {@link yfiles.algorithms.Dendrogram#getChildren children}, then moving on to their children and so on. + *

+ *

+ * From each node of the dendrogram, it is possible to retrieve the set of nodes of the original graph that belong to this + * dendrogram node using {@link yfiles.algorithms.Dendrogram#getClusterNodes}. This method returns an array of + * {@link yfiles.algorithms.NodeList}s that contain the nodes of all clusters that are merged when this dendrogram node was + * created. For example, say that clusters C1 = {v1, v2} and C2 = {v3, v4} are merged, where {v1, v2, v3, v4} are nodes of + * the original graph. Say that dendrogram node u is created by this merging. Then, the cluster nodes of u will be returned + * as two {@link yfiles.algorithms.NodeList}s where the first contains nodes v1, v2 and the second v3, v4. + *

+ * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @class yfiles.algorithms.Dendrogram + */ + export interface Dendrogram extends Object{} + export class Dendrogram { + /** + * Returns a {@link yfiles.algorithms.NodeList} that contains the child nodes of the given parent node. + *

+ * If the given node is a {@link yfiles.algorithms.Dendrogram#isLeaf leaf} node, the returned list will be empty. + *

+ * @param {yfiles.algorithms.Node} parent the parent node for which to retrieve the child nodes + * @returns {yfiles.algorithms.NodeList} the list of child nodes of the given parent node + */ + getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns an array of + * {@link yfiles.algorithms.NodeList}s that contain the nodes of the original graph that are associated with the given dendrogram + * node. + *

+ * Each such {@link yfiles.algorithms.NodeList} represents nodes that belong to the same cluster. For example, say that clusters C1 = {v1, v2} + * and C2 = {v3, v4} are merged, where {v1, v2, v3, v4} are nodes of the original graph. Say that dendrogram node u is + * created by this merging. Then, the cluster nodes of u will be returned as two {@link yfiles.algorithms.NodeList}s where the + * first contains nodes v1, v2 and the second v3, v4. + *

+ * @param {yfiles.algorithms.Node} node the given dendrogram node + * @returns {Array.} an array of + * {@link yfiles.algorithms.NodeList}s that contain the nodes of the original graph that are associated with the given dendrogram + * node + */ + getClusterNodes(node:yfiles.algorithms.Node):yfiles.algorithms.NodeList[]; + /** + * Returns the dissimilarity value associated with the given node of the dendrogram. + * @param {yfiles.algorithms.Node} node the given dendrogram node + * @returns {number} the dissimilarity value associated with the given dendrogram node + */ + getDissimilarityValue(node:yfiles.algorithms.Node):number; + /** + * Returns the level of the given node of the dendrogram. + * @param {yfiles.algorithms.Node} node the given dendrogram node + * @returns {number} the level of the given dendrogram node + */ + getLevel(node:yfiles.algorithms.Node):number; + /** + * Returns the node of the dendrogram that belongs to the given level index. + *

+ * If the given level index is greater than the {@link yfiles.algorithms.Dendrogram#levelCount number of levels}, then this method will return null. + *

+ * @param {number} level the given level index + * @returns {yfiles.algorithms.Node} the node of the dendrogram that belongs to the given level index or null if there exists no level with the given index. + * @throws {Stubs.Exceptions.ArgumentError} if the given level is negative or greater than the {@link yfiles.algorithms.Dendrogram#nodeCount node count} minus one. + */ + getNodeAtLevel(level:number):yfiles.algorithms.Node; + /** + * Returns the node of original graph that is mapped with the given leaf node of the dendrogram. + * @param {yfiles.algorithms.Node} node the given leaf node + * @returns {yfiles.algorithms.Node} the node of original graph that is mapped with the given leaf node or null if the given node is an inner dendrogram + * node + */ + getOriginalNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Returns whether or not the given dendrogram node is a leaf node. + *

+ * A leaf node has no further children and represents a node of the original graph. The original node can be retrieved via + * {@link yfiles.algorithms.Dendrogram#getOriginalNode}. + *

+ * @param {yfiles.algorithms.Node} node a dendrogram node + * @returns {boolean} true if the given node is a leaf node, false otherwise + */ + isLeaf(node:yfiles.algorithms.Node):boolean; + /** + * Gets the root node of the dendrogram. + *

+ * A dendrogram traversal can be implemented by starting from this node, then moving on to its children using method + * {@link yfiles.algorithms.Dendrogram#getChildren}, and so on. + *

+ * @type {yfiles.algorithms.Node} + */ + root:yfiles.algorithms.Node; + /** + * Gets the number of nodes in this dendrogram. + * @type {number} + */ + nodeCount:number; + /** + * Gets the number of levels this dendrogram has. + * @type {number} + */ + levelCount:number; + static $class:yfiles.lang.Class; + } + /** + * An interface that determines the distance between two nodes of a graph. + *

+ * It is used by the hierarchical clustering algorithm in order to determine the distance between any two nodes of a + * graph. + *

+ * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @see yfiles.algorithms.Groups#hierarchicalClustering + * @interface + */ + export interface INodeDistanceProvider extends Object{ + /** + * Returns the distance between two given nodes of a graph. + *

+ * Implementations of this method have to guarantee that the returned value is greater or equal to zero. Furthermore, the + * distances between two nodes have to be symmetric, i.e., the distance between node n1 and n2 is equal to the distance + * between node n2 and n1. + *

+ * @param {yfiles.algorithms.Node} n1 the first node + * @param {yfiles.algorithms.Node} n2 the second node + * @returns {number} the distance between the two given nodes + * @abstract + */ + getDistance(n1:yfiles.algorithms.Node,n2:yfiles.algorithms.Node):number; + } + var INodeDistanceProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class provides methods for automatically partitioning nodes of a graph into groups. + *

+ * Partitions can be defined using edge betweenness centrality, biconnectivity, k-means clustering or hierarchical + * clustering. + *

+ *

+ * Definitions + *

+ *
    + *
  • Betweenness centrality is a measure for how often a node lies on a shortest path between each pair of nodes in the graph.
  • + *
  • Biconnected graph is a graph that has no cut vertex or articulation point (i.e., a node whose removal disconnects the graph).
  • + *
  • K-means clustering algorithm partitions the nodes of a graph into k-clusters based on their positions on the plane and a given distance metric.
  • + *
  • Hierarchical clustering creates a hierarchy of clusters in a bottom-to-top approach based on some distance metric and linkage.
  • + *
+ * @class yfiles.algorithms.Groups + * @static + */ + export interface Groups extends Object{} + export class Groups { + /** + * This method partitions the graph by analyzing its biconnected components. + *

+ * Nodes will be grouped such that the nodes within each group are biconnected. Nodes that belong to multiple biconnected + * components will be assigned to exactly one of these components. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} groupIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each node + * @returns {number} the resulting number of different groups + * @static + */ + static biconnectedComponentGrouping(graph:yfiles.algorithms.Graph,groupIDs:yfiles.algorithms.INodeMap):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 and 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). + *

+ *

+ * The method requires the maximum number of groups that will be returned. The smaller this value is, the faster the + * overall computation time. The upper bound on the number of groups is + * graph.N(). Also, the number of returned groups is never smaller than the number of connected components of the graph. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} clusterIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each 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 that will be returned + * @param {number} maxGroupCount the maximum number of groups that will be returned + * @param {boolean} refine true if the algorithm refines the current grouping, false if the algorithm discards the current grouping + * @returns {number} the resulting number of different groups + * @throws {Stubs.Exceptions.ArgumentError} if minGroupCount > maxGroupCount or minGroupCount > graph.N() or maxGroupCount <= 0 + * @static + */ + static edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,qualityTimeRatio:number,minGroupCount:number,maxGroupCount:number,refine:boolean):number; + /** + * Partitions the graph into groups using edge betweenness centrality. + *

+ * 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. + *

+ *

+ * The method requires the maximum number of groups that will be returned. The smaller this value is, the faster the + * overall computation time. The upper bound on the number of groups is + * graph.N(). Also, the number of returned groups is never smaller than the number of connected components of the graph. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} clusterIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {number} minGroupCount the minimum number of groups that will be returned + * @param {number} maxGroupCount the maximum number of groups that will be returned + * @param {yfiles.algorithms.IDataProvider} edgeCosts the {@link yfiles.algorithms.IDataProvider} that holds a positive {@link number} cost or null if the edges of the graph are considered to be + * of equal cost + * @returns {number} the resulting number of different groups + * @throws {Stubs.Exceptions.ArgumentError} if minGroupCount > maxGroupCount or minGroupCount > graph.N() or maxGroupCount <= 0 + * @static + */ + static edgeBetweennessClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,directed:boolean,minGroupCount:number,maxGroupCount:number,edgeCosts:yfiles.algorithms.IDataProvider):number; + /** + * Partitions the graph into clusters based on hierarchical clustering, while the dendrogram is cut based on a given + * maximum number of clusters. + *

+ * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the + * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the + * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances. The + * algorithm continues until all nodes belong to the same cluster. + *

+ *

+ * The result will be given based on the given maximum number of clusters value that is used for cutting the hierarchical + * tree at a point such that the number of remaining clusters equals to this value. + *

+ *

+ * The maximum number of clusters needs to be greater than zero and less than the number of the nodes of the graph. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {number} maxCluster the maximum number of clusters that determines where to cut the hierarchic tree into clusters + * @param {yfiles.algorithms.INodeMap} clusterIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each node + * @param {yfiles.algorithms.INodeDistanceProvider} distances a given {@link yfiles.algorithms.INodeDistanceProvider} object that determines the distance between any two graph nodes + * @param {yfiles.algorithms.Linkage} linkage one of the predefined linkage values + * @returns {number} the resulting number of clusters + * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is given or if the maximum number of clusters is less than or equal to zero or greater than the + * number of nodes of the graph + * @static + */ + static hierarchicalClustering(graph:yfiles.algorithms.Graph,maxCluster:number,clusterIDs:yfiles.algorithms.INodeMap,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage):number; + /** + * Partitions the graph into clusters based on hierarchical clustering, while the dendrogram is cut based on a given + * cut-off value. + *

+ * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the + * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the + * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances. The + * algorithm continues until all nodes belong to the same cluster. + *

+ *

+ * The result will be given based on the given cut-off value that is used for cutting the hierarchical tree at a point such + * that the dissimilarity values of the nodes that remain at the dendrogram are less than this value. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} clusterIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each node + * @param {yfiles.algorithms.INodeDistanceProvider} distances a given {@link yfiles.algorithms.INodeDistanceProvider} object that determines the distance between any two nodes + * @param {yfiles.algorithms.Linkage} linkage one of the predefined linkage values + * @param {number} cutOff the cut-off value that determines where to cut the hierarchic tree into clusters + * @returns {number} the resulting number of clusters + * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is used + * @static + */ + static hierarchicalClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage,cutOff:number):number; + /** + * Partitions the graph into clusters based on hierarchical clustering. + *

+ * The clustering is performed using the agglomerative strategy i.e., a bottom-up approach according to which at the + * beginning each node belongs to its own cluster. At each step pairs of clusters are merged while moving up to the + * hierarchy. The dissimilarity between clusters is determined based on the given linkage and the given node distances + * metric. The algorithm continues until all nodes belong to the same cluster. + *

+ *

+ * The result is returned as a {@link yfiles.algorithms.Dendrogram} object which represents the result of the clustering algorithm + * as a binary tree structure. It can easily be traversed by starting from the {@link yfiles.algorithms.Dendrogram#root root node} and moving on to nodes of the next + * level via method {@link yfiles.algorithms.Dendrogram#getChildren}. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeDistanceProvider} distances a given {@link yfiles.algorithms.INodeDistanceProvider} object that determines the distance between any two nodes + * @param {yfiles.algorithms.Linkage} linkage one of the predefined linkage values + * @returns {yfiles.algorithms.Dendrogram} a {@link yfiles.algorithms.Dendrogram} which represents the result of the clustering as a binary tree + * @throws {Stubs.Exceptions.ArgumentError} if an unknown linkage is given + * @static + */ + static hierarchicalClustering(graph:yfiles.algorithms.Graph,distances:yfiles.algorithms.INodeDistanceProvider,linkage:yfiles.algorithms.Linkage):yfiles.algorithms.Dendrogram; + /** + * Partitions the graph into clusters using k-means clustering algorithm. + *

+ * The nodes of the graph will be partitioned in k clusters based on their positions such that their distance from the + * cluster's mean (centroid) is minimized. + *

+ *

+ * The distance can be defined using diverse metrics as euclidean distance, euclidean-squared distance, manhattan distance + * or chebychev distance. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.INodeMap} clusterIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each node + * @param {yfiles.algorithms.IDataProvider} nodePositions the {@link yfiles.algorithms.IDataProvider} that holds a {@link yfiles.algorithms.YPoint point} representing the current position of each node in the graph + * @param {yfiles.algorithms.DistanceMetric} distanceMetric one of the predefined distance metrics + * @param {number} k the number of clusters + * @param {number} [iterations=100] the maximum number of iterations performed by the algorithm for convergence + * @param {Array.} [centroids=null] the initial centroids + * @returns {number} the number of resulting (non-empty) clusters + * @throws {Stubs.Exceptions.ArgumentError} if the given distance metric is not supported + * @static + */ + static kMeansClustering(graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,nodePositions:yfiles.algorithms.IDataProvider,distanceMetric:yfiles.algorithms.DistanceMetric,k:number,iterations?:number,centroids?:yfiles.algorithms.YPoint[]):number; + /** + * Partitions the graph into clusters using k-means clustering algorithm. + *

+ * The nodes of the graph will be partitioned in k clusters based on their positions such that their distance from the + * cluster's mean (centroid) is minimized. + *

+ *

+ * The distance can be defined using diverse metrics as euclidean distance, euclidean-squared distance, manhattan distance + * or chebychev distance. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.algorithms.Graph} options.graph the input graph + * @param {yfiles.algorithms.INodeMap} options.clusterIDs the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns an integer value (cluster ID) for + * each node + * @param {yfiles.algorithms.IDataProvider} options.nodePositions the {@link yfiles.algorithms.IDataProvider} that holds a {@link yfiles.algorithms.YPoint point} representing the current position of each node in the graph + * @param {yfiles.algorithms.DistanceMetric} options.distanceMetric one of the predefined distance metrics + * @param {number} options.k the number of clusters + * @param {number} [options.iterations=100] the maximum number of iterations performed by the algorithm for convergence + * @param {Array.} [options.centroids=null] the initial centroids + * @returns {number} the number of resulting (non-empty) clusters + * @throws {Stubs.Exceptions.ArgumentError} if the given distance metric is not supported + * @static + */ + static kMeansClustering(options:{graph:yfiles.algorithms.Graph,clusterIDs:yfiles.algorithms.INodeMap,nodePositions:yfiles.algorithms.IDataProvider,distanceMetric:yfiles.algorithms.DistanceMetric,k:number,iterations?:number,centroids?:yfiles.algorithms.YPoint[]}):number; + static $class:yfiles.lang.Class; + } + /** + * 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." + *

+ * @interface + */ + export interface ICursor extends Object{ + /** + * Moves this cursor one position forward. + * @abstract + */ + next():void; + /** + * Moves this cursor one position backward (optional). + * @abstract + */ + prev():void; + /** + * Moves this cursor to the first valid cursor position (optional). + * @abstract + */ + toFirst():void; + /** + * Moves this cursor to the last valid cursor position (optional). + * @abstract + */ + toLast():void; + /** + * Gets true if the current cursor position is valid. + * @abstract + * @type {boolean} + */ + ok:boolean; + /** + * Gets the object currently pointed on. + * @abstract + * @type {Object} + */ + current:Object; + /** + * Gets the number of elements that can be accessed with this cursor. + * @abstract + * @type {number} + */ + 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. + *

+ * @interface + */ + export interface IDataAcceptor extends Object{ + /** + * Sets an object value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @param {Object} value + * @abstract + */ + set(dataHolder:Object,value:Object):void; + /** + * Sets a boolean value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @param {boolean} value + * @abstract + */ + setBoolean(dataHolder:Object,value:boolean):void; + /** + * Sets an integer value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @param {number} value + * @abstract + */ + setInt(dataHolder:Object,value:number):void; + /** + * Sets a double value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @param {number} value + * @abstract + */ + setNumber(dataHolder:Object,value:number):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. + *

+ * @interface + * @implements {yfiles.algorithms.IDataProvider} + * @implements {yfiles.algorithms.IDataAcceptor} + */ + export interface IDataMap extends Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor{ + } + var IDataMap:{ + $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. + *

+ * @interface + */ + export interface IDataProvider extends Object{ + /** + * Returns an object value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @returns {Object} + * @abstract + */ + get(dataHolder:Object):Object; + /** + * Returns a boolean value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @returns {boolean} + * @abstract + */ + getBoolean(dataHolder:Object):boolean; + /** + * Returns an integer value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @returns {number} + * @abstract + */ + getInt(dataHolder:Object):number; + /** + * Returns a double value associated with the given data holder. + *

+ * This method may throw an UnsupportedOperationException. + *

+ * @param {Object} dataHolder + * @returns {number} + * @abstract + */ + getNumber(dataHolder:Object):number; + } + var IDataProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A cursor interface for iterating over edges. + * @interface + * @implements {yfiles.algorithms.ICursor} + */ + export interface IEdgeCursor extends Object,yfiles.algorithms.ICursor{ + /** + * 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. + *

+ * @abstract + */ + 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. + *

+ * @abstract + */ + cyclicPrev():void; + /** + * Gets the edge at the current location of the cursor. + *

+ * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}. + *

+ * @abstract + * @type {yfiles.algorithms.Edge} + */ + edge:yfiles.algorithms.Edge; + } + 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. + *

+ * @interface + * @implements {yfiles.algorithms.IDataProvider} + * @implements {yfiles.algorithms.IDataAcceptor} + * @implements {yfiles.algorithms.IDataMap} + */ + export interface IEdgeMap extends Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{ + } + var IEdgeMap:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class provides methods for calculating independent sets. + *

+ * An independent set is a set of nodes in a graph, in which no two nodes are adjacent. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0, "c":0},"styles":{"6":{"s":[35,35],"c":1, "f":"#FF0000", "b":0}},"n":[[425,305,6],[645,305],[425,525],[645,525,6],[485,365],[585,365,6],[485,465,6],[585,465]],"e":[[0,4],[0,1],[1,3],[3,2],[2,0],[4,6],[6,2],[6,7],[7,5],[5,4],[5,1],[7,3]],"vp":[425.0,305.0,250.0,250.0]}} Circular nodes represent one of the independent sets of the given graph + *

+ * @class yfiles.algorithms.IndependentSets + * @static + */ + export interface IndependentSets extends Object{} + export class IndependentSets { + /** + * Calculates an independent set for a given graph. + *

+ * A greedy heuristic is applied which tries to find a large independent set. + *

+ * @param {yfiles.algorithms.Graph} conflictGraph the input graph + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} containing an independent set of nodes + * @see yfiles.algorithms.IndependentSets#getIndependentSet + * @static + */ + static getIndependentSet(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; + /** + * Partitions the set of nodes of the given graph into independent sets. + *

+ * The method iteratively calls method {@link yfiles.algorithms.IndependentSets#getIndependentSet}. + *

+ * @param {yfiles.algorithms.Graph} conflictGraph the input graph + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList}s each of which contains an independent set of nodes + * @see yfiles.algorithms.IndependentSets#getIndependentSet + * @static + */ + static getIndependentSets(conflictGraph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; + static $class:yfiles.lang.Class; + } + /** + * A cursor interface for iterating over nodes. + * @interface + * @implements {yfiles.algorithms.ICursor} + */ + export interface INodeCursor extends Object,yfiles.algorithms.ICursor{ + /** + * 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. + *

+ * @abstract + */ + 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. + *

+ * @abstract + */ + cyclicPrev():void; + /** + * Gets the node at the current location of the cursor. + *

+ * This method is the typed variant of {@link yfiles.algorithms.ICursor#current}. + *

+ * @abstract + * @type {yfiles.algorithms.Node} + */ + node:yfiles.algorithms.Node; + } + 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. + *

+ * @interface + * @implements {yfiles.algorithms.IDataProvider} + * @implements {yfiles.algorithms.IDataAcceptor} + * @implements {yfiles.algorithms.IDataMap} + */ + export interface INodeMap extends Object,yfiles.algorithms.IDataProvider,yfiles.algorithms.IDataAcceptor,yfiles.algorithms.IDataMap{ + } + var INodeMap:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This is a generic interface for classes that provide an ordering for the nodes of a graph. + * @interface + */ + export interface INodeSequencer extends Object{ + /** + * Returns a cursor that grants access to all nodes of the given graph in some order. + * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.INodeCursor} a {@link yfiles.algorithms.INodeCursor} that grants access to all nodes of a graph + * @abstract + */ + nodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeCursor; + } + var INodeSequencer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * 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. + *

+ * @class yfiles.algorithms.ListCell + * @final + */ + export interface ListCell extends Object{} + export class ListCell { + /** + * Returns the predecessor cell of this cell. + *

+ * If there is no predecessor, then null is returned. + *

+ * @returns {yfiles.algorithms.ListCell} + */ + pred():yfiles.algorithms.ListCell; + /** + * Returns the successor cell of this cell. + *

+ * If there is no successor, then null is returned. + *

+ * @returns {yfiles.algorithms.ListCell} + */ + succ():yfiles.algorithms.ListCell; + /** + * Gets or sets the element stored in this cell. + * @type {Object} + */ + info:Object; + static $class:yfiles.lang.Class; + } + /** + * This class provides sophisticated algorithms for solving classical network flow problems. + *

+ * Definitions + *

+ *
    + *
  • + * Maximum flow problem: � Given a directed graph in which each edge has a capacity and given a source node s and a sink node t, find a flow of + * maximum value from s to t. + *
  • + *
  • + * Minimum cut problem: � Given a directed graph in which each edge has a capacity and given a source node s and a sink node t, find an s-t cut of + * minimum capacity (i.e., a set of edges of minimum capacity whose removal would disconnect t from s). + *
  • + *
  • + * Minimum cost flow problem: � Given a directed graph in which each edge has a cost and a capacity and each node has a supply or demand, find a flow of + * minimum total cost that satisfies the edge capacities and the node balances. + *
  • + *
  • + * Minimum cost maximum flow problem: � Given a directed graph in which each edge has a cost and a capacity and given a source node s and a sink node t, find a + * flow of maximum value from s to t that has the minimum total cost. + *
  • + *
+ * @class yfiles.algorithms.NetworkFlows + * @static + */ + export interface NetworkFlows extends Object{} + export class NetworkFlows { + /** + * Solves a maximum flow problem using the preflow-push method. + *

+ * The implementation is based on + *

+ *
    + *
  • 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 0x7FFFFFFF. + *

+ * @param {yfiles.algorithms.Graph} graph the given network + * @param {yfiles.algorithms.Node} source the source node of the network + * @param {yfiles.algorithms.Node} sink the sink node of the network + * @param {yfiles.algorithms.IDataProvider} eCapDP the {@link yfiles.algorithms.IEdgeMap} that returns the integer capacity of each edge or null if no bound is specified + * @param {yfiles.algorithms.IEdgeMap} flowEM the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution with an integer flow for each edge + * @returns {number} the maximum flow value + * @see yfiles.algorithms.NetworkFlows#calcMaxFlowMinCut + * @static + */ + static calcMaxFlow(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,sink:yfiles.algorithms.Node,eCapDP:yfiles.algorithms.IDataProvider,flowEM:yfiles.algorithms.IEdgeMap):number; + /** + * Solves a maximum flow problem using the preflow-push method but additionally marks all nodes that belong to the minimum + * cut set that is associated with the source of the network. + * @param {yfiles.algorithms.Graph} graph the given network + * @param {yfiles.algorithms.Node} source the source node of the network + * @param {yfiles.algorithms.Node} sink the sink node of the network + * @param {yfiles.algorithms.IDataProvider} eCapDP the {@link yfiles.algorithms.IEdgeMap} that returns the integer capacity of each edge or null if no bound is specified + * @param {yfiles.algorithms.IEdgeMap} flowEM the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution with an integer flow for each edge + * @param {yfiles.algorithms.INodeMap} sourceCutNM the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a boolean value indicating whether + * or not a node belongs to the cut set associated with the source of the network + * @returns {number} the maximum flow value + * @see yfiles.algorithms.NetworkFlows#calcMaxFlow + * @static + */ + static 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; + /** + * Solves a minimum cost maximum flow problem. + * @param {yfiles.algorithms.Graph} graph the given network + * @param {yfiles.algorithms.Node} s the source node of the network + * @param {yfiles.algorithms.Node} t the sink node of the network + * @param {yfiles.algorithms.IDataProvider} uCapDP the {@link yfiles.algorithms.IDataProvider} that returns the integer capacity of each edge or null if no bound is specified + * @param {yfiles.algorithms.IDataProvider} cost0DP the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for each edge + * @param {yfiles.algorithms.IEdgeMap} flowEM the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution with an integer flow for each edge + * @param {yfiles.algorithms.INodeMap} dualsNM the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with an integer value (dual value) for each node + * or null if no such values occur; dual values are also referred as potentials + * @returns {number} the total cost of the flow + * @see yfiles.algorithms.NetworkFlows#minCostFlow + * @see yfiles.algorithms.NetworkFlows#minCostFlow + * @static + */ + static minCostFlow(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 minimum cost flow problem with a capacity scaling algorithm. + *

+ * 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 0x7FFFFFFF. + *

+ *

+ * There are no restriction for the costs. In particular, they can also be negative. + *

+ * @param {yfiles.algorithms.Graph} graph the given network + * @param {yfiles.algorithms.IDataProvider} lCapDP the {@link yfiles.algorithms.IDataProvider} that returns the integer lower bound for the capacity of each edge or null if no + * bound is specified + * @param {yfiles.algorithms.IDataProvider} uCapDP the {@link yfiles.algorithms.IDataProvider} that returns the integer upper bound for the capacity of each edge or null if no + * bound is specified + * @param {yfiles.algorithms.IDataProvider} cost0DP the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) of each edge + * @param {yfiles.algorithms.IDataProvider} supplyDP the {@link yfiles.algorithms.IDataProvider} that returns the supply/demand of each node; supply is denoted by a positive value, + * demand by a negative value + * @param {yfiles.algorithms.IEdgeMap} flowEM the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution with an integer flow for each edge + * @param {yfiles.algorithms.INodeMap} dualsNM the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with an integer value (dual value) for each node + * or null if no such values occur; dual values are also referred as potentials + * @returns {number} the total cost of the flow + * @see yfiles.algorithms.NetworkFlows#minCostFlow + * @see yfiles.algorithms.NetworkFlows#minCostFlow + * @static + */ + static minCostFlow(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; + /** + * Uses method {@link yfiles.algorithms.NetworkFlows#minCostFlow} to solve a minimum cost flow problem. + * @param {yfiles.algorithms.Graph} graph the given network + * @param {yfiles.algorithms.IDataProvider} uCapDP the {@link yfiles.algorithms.IDataProvider} that returns the integer capacity of each edge or null if no bound is specified + * @param {yfiles.algorithms.IDataProvider} cost0DP the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for each edge + * @param {yfiles.algorithms.IDataProvider} supplyDP the {@link yfiles.algorithms.IDataProvider} that returns the supply/demand of each node; supply is denoted by a positive value, + * demand by a negative value + * @param {yfiles.algorithms.IEdgeMap} flowEM the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution with an integer flow for each edge + * @param {yfiles.algorithms.INodeMap} dualsNM the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with an integer value (dual value) for each node + * or null if no such values occur; dual values are also referred as potentials + * @returns {number} the total cost of the flow + * @see yfiles.algorithms.NetworkFlows#minCostFlow + * @see yfiles.algorithms.NetworkFlows#minCostFlow + * @static + */ + static 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; + static $class:yfiles.lang.Class; + } + /** + * 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}, GetInEdgeCursor, 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. + *

+ * @class yfiles.algorithms.Node + * @extends {yfiles.algorithms.GraphObject} + */ + export interface Node extends yfiles.algorithms.GraphObject{} + export class Node { + /** + * 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. + * @constructor + */ + constructor(g:yfiles.algorithms.Graph); + /** + * 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. + * @returns {yfiles.algorithms.Node} The newly created Node object. + */ + createCopy(g:yfiles.algorithms.Graph):yfiles.algorithms.Node; + /** + * 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. + *

+ * @param {yfiles.algorithms.Node} opposite + * @returns {yfiles.algorithms.Edge} + * @see yfiles.algorithms.Node#getEdgeFrom + * @see yfiles.algorithms.Node#getEdgeTo + */ + getEdge(opposite:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Returns an edge cursor for all incoming and outgoing edges at this node. + * @returns {yfiles.algorithms.IEdgeCursor} + */ + getEdgeCursor():yfiles.algorithms.IEdgeCursor; + /** + * Returns an incoming edge that connects the given node with this node, if such an edge exists. + *

+ * Otherwise null is returned. + *

+ * @param {yfiles.algorithms.Node} source + * @returns {yfiles.algorithms.Edge} + * @see yfiles.algorithms.Node#getEdge + * @see yfiles.algorithms.Node#getEdgeTo + */ + getEdgeFrom(source:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Returns an outgoing edge that connects this node with the given node, if such an edge exists. + *

+ * Otherwise null is returned. + *

+ * @param {yfiles.algorithms.Node} target + * @returns {yfiles.algorithms.Edge} + * @see yfiles.algorithms.Node#getEdge + * @see yfiles.algorithms.Node#getEdgeFrom + */ + getEdgeTo(target:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Returns an edge cursor for incoming edges at this node. + *

+ * If an edge is specified, the cursor starts at the given edge, and the cyclic sequence order is the same as returned by + * GetInEdgeCursor. + *

+ * @param {yfiles.algorithms.Edge} [startEdge=null] The first edge being accessed by the returned cursor. + * @returns {yfiles.algorithms.IEdgeCursor} + * @see yfiles.algorithms.Node#getOutEdgeCursor + */ + getInEdgeCursor(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. + *

+ * @returns {yfiles.algorithms.INodeCursor} + * @see yfiles.algorithms.Node#getPredecessorCursor + * @see yfiles.algorithms.Node#getSuccessorCursor + */ + getNeighborCursor():yfiles.algorithms.INodeCursor; + /** + * Returns an edge cursor for outgoing edges at this node. + *

+ * If an edge is specified, the cursor starts at the given edge, and the cyclic sequence order is the same as returned by + * GetOutEdgeCursor. + *

+ * @param {yfiles.algorithms.Edge} [startEdge=null] The first edge being accessed by the returned cursor. + * @returns {yfiles.algorithms.IEdgeCursor} + * @see yfiles.algorithms.Node#getInEdgeCursor + */ + getOutEdgeCursor(startEdge?:yfiles.algorithms.Edge):yfiles.algorithms.IEdgeCursor; + /** + * Returns a node cursor for all predecessor nodes of this node. + *

+ * Predecessor nodes are those at the opposite ends of incoming edges. + *

+ * @returns {yfiles.algorithms.INodeCursor} + * @see 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. + *

+ * @returns {yfiles.algorithms.INodeCursor} + * @see yfiles.algorithms.Node#getPredecessorCursor + */ + getSuccessorCursor():yfiles.algorithms.INodeCursor; + /** + * Sorts incoming edges at this node according to the given comparator. + * @param {yfiles.collections.IComparer.} c + * @see yfiles.algorithms.Node#sortOutEdges + */ + sortInEdges(c:yfiles.collections.IComparer):void; + /** + * Sorts outgoing edges at this node according to the given comparator. + * @param {yfiles.collections.IComparer.} c + * @see yfiles.algorithms.Node#sortInEdges + */ + sortOutEdges(c:yfiles.collections.IComparer):void; + /** + * Gets the overall number of incoming and outgoing edges at this node. + *

+ * Note that self-loops are counted twice. + *

+ * @see yfiles.algorithms.Edge + * @see yfiles.algorithms.Node#inDegree + * @see yfiles.algorithms.Node#outDegree + * @type {number} + */ + degree:number; + /** + * Gets the number of incoming edges at this node. + * @see yfiles.algorithms.Node#degree + * @see yfiles.algorithms.Node#outDegree + * @type {number} + */ + inDegree:number; + /** + * Gets the number of outgoing edges at this node. + * @see yfiles.algorithms.Node#degree + * @see yfiles.algorithms.Node#inDegree + * @type {number} + */ + outDegree:number; + /** + * Gets 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. + *

+ * @see yfiles.algorithms.Graph#removeNode + * @see yfiles.algorithms.Graph#hide + * @see yfiles.algorithms.Graph#reInsertNode + * @see yfiles.algorithms.Graph#unhide + * @see yfiles.algorithms.Graph#moveToFirst + * @see yfiles.algorithms.Graph#moveToLast + * @type {number} + */ + index:number; + /** + * Gets 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. + *

+ * @type {yfiles.algorithms.Graph} + */ + graph:yfiles.algorithms.Graph; + /** + * Gets the first outgoing edge at this node, or null if it does not exist. + * @see yfiles.algorithms.Node#firstInEdge + * @see yfiles.algorithms.Node#lastOutEdge + * @type {yfiles.algorithms.Edge} + */ + firstOutEdge:yfiles.algorithms.Edge; + /** + * Gets the first incoming edge at this node, or null if it does not exist. + * @see yfiles.algorithms.Node#firstOutEdge + * @see yfiles.algorithms.Node#lastInEdge + * @type {yfiles.algorithms.Edge} + */ + firstInEdge:yfiles.algorithms.Edge; + /** + * Gets the last outgoing edge at this node, or null if it does not exist. + * @see yfiles.algorithms.Node#firstOutEdge + * @see yfiles.algorithms.Node#lastInEdge + * @type {yfiles.algorithms.Edge} + */ + lastOutEdge:yfiles.algorithms.Edge; + /** + * Gets the last incoming edge at this node, or null if it does not exist. + * @see yfiles.algorithms.Node#firstInEdge + * @see yfiles.algorithms.Node#lastOutEdge + * @type {yfiles.algorithms.Edge} + */ + lastInEdge:yfiles.algorithms.Edge; + /** + * 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + 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). + *

+ * @type {yfiles.collections.IEnumerable.} + */ + 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + 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. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + neighbors:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * Specialized list implementation for instances of type {@link yfiles.algorithms.Node}. + * @class yfiles.algorithms.NodeList + * @extends {yfiles.algorithms.YList} + * @implements {yfiles.collections.IEnumerable.} + */ + export interface NodeList extends yfiles.algorithms.YList{} + export class 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 + * @constructor + */ + constructor(list:yfiles.algorithms.NodeList); + /** + * Creates a list that is initialized with a single node provided. + * @param {yfiles.algorithms.Node} v + * @constructor + */ + constructor(v:yfiles.algorithms.Node); + /** + * Creates a list that is initialized with the nodes provided by the given array of nodes. + * @param {Array.} a + * @constructor + */ + constructor(a:yfiles.algorithms.Node[]); + /** + * 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#getBoolean 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. + * @constructor + */ + constructor(nc:yfiles.algorithms.INodeCursor,predicate:yfiles.algorithms.IDataProvider); + /** + * Creates a list that is initialized with the nodes provided by the given NodeCursor object. + * @param {yfiles.algorithms.INodeCursor} c + * @constructor + */ + constructor(c:yfiles.algorithms.INodeCursor); + /** + * Creates an empty node list. + * @constructor + */ + constructor(); + /** + * Returns the first node in this list, or null when the list is empty. + * @returns {yfiles.algorithms.Node} The first node in the list. + */ + firstNode():yfiles.algorithms.Node; + /** + * Returns an enumerator for this collection. + * @returns {yfiles.collections.IEnumerator.} + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Returns the last node in this list, or null when the list is empty. + * @returns {yfiles.algorithms.Node} The last node in the list. + */ + lastNode():yfiles.algorithms.Node; + /** + * Returns a node cursor for this node list. + * @returns {yfiles.algorithms.INodeCursor} A node cursor granting access to the nodes within this list. + */ + nodes():yfiles.algorithms.INodeCursor; + /** + * Removes the first node from this list and returns it. + * @returns {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. + * @returns {Array.} + */ + toNodeArray():yfiles.algorithms.Node[]; + static $class:yfiles.lang.Class; + } + /** + * This class provides algorithms that order the nodes of a graph using specific criteria. + *

+ * Definitions + *

+ *
    + *
  • + * A topological ordering of the nodes of a directed graph is a linear ordering of the nodes such that for each directed edge (u,v), node u lies + * before v in the ordering. + *
  • + *
  • A DFS completion ordering of the nodes of a graph is a node ordering identical to the order of node completion events in a {@link yfiles.algorithms.Dfs depth first search}.
  • + *
  • An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that:
  • + *
+ * @class yfiles.algorithms.NodeOrders + * @static + */ + export interface NodeOrders extends Object{} + export class NodeOrders { + /** + * Calculates an ordering of the nodes identical to the order of node completion events in a depth first search. + *

+ * This ordering is a reversed topological ordering in case the input graph is acyclic. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {Array.} order an array of {@link number}s that returns for each {@link yfiles.algorithms.Node} v, its zero-based index within the calculated ordering, i.e., + * order[v.index()] == 5 means that v is the 6-th node within the ordering + * @see yfiles.algorithms.NodeOrders#topological + * @see yfiles.algorithms.NodeOrders#dfsCompletion + * @static + */ + static dfsCompletion(graph:yfiles.algorithms.Graph,order:number[]):void; + /** + * Calculates an ordering of the nodes identical to the order of node completion events in a depth first search. + *

+ * Like {@link yfiles.algorithms.NodeOrders#dfsCompletion} but the result is returned as a {@link yfiles.algorithms.NodeList}. + *

+ *

+ * This ordering is a reversed topological ordering in case the input graph is acyclic. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} containing the nodes of the graph in the order identical to the order of node completion + * events in a depth first search + * @see yfiles.algorithms.NodeOrders#topological + * @see yfiles.algorithms.NodeOrders#dfsCompletion + * @static + */ + static dfsCompletion(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; + /** + * Assigns an st-ordering to the nodes of a biconnected graph given the edge between source node s and sink node t. + *

+ * An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that: + *

+ *
    + *
  • Source node s and sink node t are connected by an edge.
  • + *
  • For each node v_i in the ordering other than s or t, there are neighbors v_j and v_k with j < i and k > i.
  • + *
+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {Array.} stOrder an array of {@link number}s that will be filled during the execution and returns for each {@link yfiles.algorithms.Node} v, its zero-based + * index within the calculated ordering, i.e., stOrder[v.index()] == 5 means that v is the 6-th node within the ordering + * @param {yfiles.algorithms.Edge} [stEdge=null] an {@link yfiles.algorithms.Edge} that connects source node s and sink node t + * @see yfiles.algorithms.NodeOrders#st + * @static + */ + static st(graph:yfiles.algorithms.Graph,stOrder:number[],stEdge?:yfiles.algorithms.Edge):void; + /** + * Assigns an st-ordering to the nodes of a biconnected graph. + *

+ * Like St but the result is returned as a {@link yfiles.algorithms.NodeList}. + *

+ *

+ * An st-ordering (v_1,v_2,....,v_n) of a biconnected graph is a node ordering which guarantees that: + *

+ *
    + *
  • Source node s and sink node t are connected by an edge.
  • + *
  • For each node v_i in the ordering other than s or t, there are neighbors v_j and v_k with j < i and k > i.
  • + *
+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} containing the nodes of the graph in the order defined by the st-ordering + * @see yfiles.algorithms.NodeOrders#st + * @static + */ + static st(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; + /** + * Converts an array-based result returned by a method of this class to a {@link yfiles.algorithms.NodeList} that contains all + * nodes in the order provided by the given array. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {Array.} order an array of {@link number}s that will be filled during the execution and returns for each {@link yfiles.algorithms.Node} v, its zero-based + * index within the calculated ordering, i.e., order[v.index()] == 5 means that v is the 6-th node within the ordering + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} containing the nodes of the graph in the order provided by the given array + * @static + */ + static toNodeList(graph:yfiles.algorithms.Graph,order:number[]):yfiles.algorithms.NodeList; + /** + * Copies an array-based result returned by a method of this class to a {@link yfiles.algorithms.INodeMap} that will provide values + * of basic type int. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {Array.} order an array of {@link number}s that returns for each {@link yfiles.algorithms.Node} v, its zero-based index within the calculated ordering, i.e., + * order[v.index()] == 5 means that v is the 6-th node within the ordering + * @param {yfiles.algorithms.INodeMap} result the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with the zero-based index of each node within + * the calculated ordering + * @static + */ + static toNodeMap(graph:yfiles.algorithms.Graph,order:number[],result:yfiles.algorithms.INodeMap):void; + /** + * Copies a {@link yfiles.algorithms.NodeList}-based result returned by a method of this class to a {@link yfiles.algorithms.INodeMap} that + * will provide values of basic type int. + * @param {yfiles.algorithms.NodeList} order a {@link yfiles.algorithms.NodeList} containing the nodes of the graph in the appropriate order + * @param {yfiles.algorithms.INodeMap} result the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with the zero-based index of each node within + * the calculated ordering + * @static + */ + static toNodeMap(order:yfiles.algorithms.NodeList,result:yfiles.algorithms.INodeMap):void; + /** + * Assigns a topological ordering to the nodes of a directed acyclic graph. + *

+ * A topological ordering of the nodes of a directed graph is a linear ordering of the nodes such that for each directed + * edge (u,v), node u lies before v in the ordering. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {Array.} order an array of {@link number}s that will be filled during the execution and returns for each {@link yfiles.algorithms.Node} v, its zero-based + * index within the calculated ordering, i.e., order[v.index()] == 5 means that v is the 6-th node within the ordering + * @returns {boolean} true if the graph is acyclic, false otherwise + * @see yfiles.algorithms.NodeOrders#topological + * @static + */ + static topological(graph:yfiles.algorithms.Graph,order:number[]):boolean; + /** + * Returns a topological ordering of the nodes of a directed acyclic graph. + * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} containing the nodes of the graph in the order they appear in the topological ordering + * @throws {Stubs.Exceptions.ArgumentError} if the graph is cyclic + * @see yfiles.algorithms.NodeOrders#topological + * @static + */ + static topological(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList; + static $class:yfiles.lang.Class; + } + /** + * This class provides methods for finding paths within a graph that have certain properties. + *

+ * Definitions + *

+ *
    + *
  • + * A path of length k from node u to node v in a graph is a sequence v0, v1, v2, ... , vk of nodes such that u = v0, v = vk and + * (vi-1, vi) in E, for each i = 1, 2, .. , k. + *
  • + *
  • A path is called simple if no node appears twice.
  • + *
  • A chain is a path of maximum length in which each internal node has degree 2.
  • + *
  • + * The longest path problem is the problem of finding a simple path of maximum length in a given graph. The longest path problem is + * NP-hard for undirected graphs, but can be solved in linear time for directed acyclic graphs. + *
  • + *
+ * @class yfiles.algorithms.Paths + * @static + */ + export interface Paths extends Object{} + export class Paths { + /** + * Constructs a {@link yfiles.algorithms.NodeList path of nodes} from a given {@link yfiles.algorithms.EdgeList path of edges}. + *

+ * 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. + *

+ * @param {yfiles.algorithms.EdgeList} path the given {@link yfiles.algorithms.EdgeList path of edges} + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList path of nodes} from the given {@link yfiles.algorithms.EdgeList path of edges} + * @static + */ + static constructNodePath(path:yfiles.algorithms.EdgeList):yfiles.algorithms.NodeList; + /** + * Returns all chains present in the given graph. + *

+ * A chain is a path of maximum length in which each internal node has degree 2. + *

+ *

+ * The internal nodes on directed chains all have in-degree 1 and out-degree 1. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {boolean} directed true if the chain should be considered as directed, false otherwise + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList}s each of which contains the edges (at least two) that make up a chain + * @see yfiles.algorithms.Paths#constructNodePath + * @static + */ + static findAllChains(graph:yfiles.algorithms.Graph,directed:boolean):yfiles.algorithms.EdgeList[]; + /** + * A variant of {@link yfiles.algorithms.Paths#findAllPaths} which returns all simple directed or undirected paths between two + * given nodes and, additionally, allows to specify a filter for the paths to be returned. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} startNode the given start node + * @param {yfiles.algorithms.Node} endNode the given end node + * @param {boolean} directed true if the path should be considered as directed, false otherwise + * @param {function(yfiles.algorithms.EdgeList): boolean} filter a predicate that accepts or rejects a found {@link yfiles.algorithms.EdgeList} and adds it to the result + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList}s each of which represents a path between the start and end node. + * @static + */ + static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean,filter:(obj:yfiles.algorithms.EdgeList)=>boolean):yfiles.algorithms.EdgeList[]; + /** + * Returns all simple directed or undirected paths that connect a start node with an end node. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} startNode the given start node + * @param {yfiles.algorithms.Node} endNode the given end node + * @param {boolean} directed true if the path should be considered as directed, false otherwise + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList}s each of which represents a path between the start and end node + * @static + */ + static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList[]; + /** + * Finds all edges that belong to a directed path from a start node to an end node. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} startNode the given start node + * @param {yfiles.algorithms.Node} endNode the given end node + * @param {yfiles.algorithms.IEdgeMap} pathEdges the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution with a boolean value indicating whether or not + * an edge belongs to a path connecting the two given nodes + * @static + */ + static findAllPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,pathEdges:yfiles.algorithms.IEdgeMap):void; + /** + * A variant of + * {@link yfiles.algorithms.Paths#findAllPaths}, which returns all simple directed or undirected paths between two given nodes 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}. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} startNode the given start node + * @param {yfiles.algorithms.Node} endNode the given end node + * @param {boolean} directed true if the path should be considered as directed, false otherwise + * @returns {yfiles.algorithms.ICursor} a {@link yfiles.algorithms.ICursor} that calculates the next path in the sequence + * @static + */ + static findAllPathsCursor(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.ICursor; + /** + * Returns the longest directed path in 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. + *

+ * @param {yfiles.algorithms.Graph} graph a directed acyclic graph + * @param {yfiles.algorithms.IDataProvider} [edgeLength=null] the {@link yfiles.algorithms.IDataProvider} that returns the non-negative integer length of each edge + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the edges of the longest directed path + * @static + */ + static findLongestPath(graph:yfiles.algorithms.Graph,edgeLength?:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; + /** + * Calculates the longest path from a given node to all other node in a given directed acyclic graph. + * @param {yfiles.algorithms.Graph} graph a directed acyclic graph + * @param {yfiles.algorithms.Node} startNode the node for which the distances are calculated + * @param {yfiles.algorithms.IEdgeMap} dist the {@link yfiles.algorithms.IEdgeMap} that returns the distance (i.e. weight) of type double for each edge + * @param {yfiles.algorithms.INodeMap} maxDist the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and holds the maximum distance between the given + * node and all other nodes + * @param {yfiles.algorithms.IEdgeMap} predicate the {@link yfiles.algorithms.IEdgeMap} that returns a boolean value indicating whether or not an edge should be considered + * during the path search + * @static + */ + static findLongestPaths(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,dist:yfiles.algorithms.IEdgeMap,maxDist:yfiles.algorithms.INodeMap,predicate:yfiles.algorithms.IEdgeMap):void; + /** + * Returns an {@link yfiles.algorithms.EdgeList} containing the edges of an undirected simple path within the given graph. + *

+ * The edges are returned in the order that they appear in the found path. + *

+ *

+ * A heuristic is used for finding 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 problem. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the edges of an undirected simple path + * @static + */ + static findLongPath(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; + /** + * Returns whether or not a directed path from a start node to another node in an acyclic graph exists. + * @param {yfiles.algorithms.Graph} graph an acyclic graph which contains the two nodes + * @param {yfiles.algorithms.NodeList} topSort a {@link yfiles.algorithms.NodeList list} of nodes sorted in topological order + * @param {yfiles.algorithms.IEdgeMap} predicate the {@link yfiles.algorithms.IEdgeMap} that returns a boolean value indicating whether or not an edge should be considered + * during the path search + * @param {yfiles.algorithms.Node} startNode + * @param {yfiles.algorithms.Node} endNode + * @returns {boolean} true if a directed path from a start node to another node exists, false otherwise + * @static + */ + static findPath(graph:yfiles.algorithms.Graph,topSort:yfiles.algorithms.NodeList,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,predicate:yfiles.algorithms.IEdgeMap):boolean; + /** + * Returns an {@link yfiles.algorithms.EdgeList} containing 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 that they appear in the found path. If the returned path is empty, no path between + * the given nodes was found. + *

+ * @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 true if the path should be directed, false otherwise + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the path edges between the start node and the end node + * @static + */ + static findPath(graph:yfiles.algorithms.Graph,startNode:yfiles.algorithms.Node,endNode:yfiles.algorithms.Node,directed:boolean):yfiles.algorithms.EdgeList; + static $class:yfiles.lang.Class; + } + /** + * Represents an embedding of a planar graph. + *

+ * A planar embedding is represented by a {@link yfiles.algorithms.PlanarEmbedding#faces list of faces}. Each face is represented by a list of {@link yfiles.algorithms.Dart darts} which describe the + * border of the face. + *

+ * @class yfiles.algorithms.PlanarEmbedding + * @final + */ + export interface PlanarEmbedding extends Object{} + export class PlanarEmbedding { + /** + * Creates a new embedding for the specified planar graph. + * @param {yfiles.algorithms.Graph} graph a planar graph + * @throws {Stubs.Exceptions.ArgumentError} if the specified graph is not planar + * @constructor + */ + constructor(graph:yfiles.algorithms.Graph); + /** + * Returns the cyclic next dart of the given dart. + * @param {yfiles.algorithms.Dart} dart a dart + * @returns {yfiles.algorithms.Dart} the cyclic next dart of the given dart + */ + getCyclicNext(dart:yfiles.algorithms.Dart):yfiles.algorithms.Dart; + /** + * Returns the cyclic previous dart of the given dart. + * @param {yfiles.algorithms.Dart} dart a dart + * @returns {yfiles.algorithms.Dart} the cyclic previous dart of the given dart + */ + getCyclicPrevious(dart:yfiles.algorithms.Dart):yfiles.algorithms.Dart; + /** + * Returns the two darts associated with the given edge. + * @param {yfiles.algorithms.Edge} edge an edge + * @returns {Array.} the two darts associated with the given edge + */ + getDarts(edge:yfiles.algorithms.Edge):yfiles.algorithms.Dart[]; + /** + * Returns a {@link yfiles.collections.IList.} containing the (cyclic ordered) outgoing darts of the specified node. + * @param {yfiles.algorithms.Node} node a node + * @returns {yfiles.collections.IList.} a {@link yfiles.collections.IList.} containing the (cyclic ordered) outgoing darts + */ + getOutgoingDarts(node:yfiles.algorithms.Node):yfiles.collections.IList; + /** + * Return whether or not the given graph is planar. + * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {boolean} true if the given graph is planar, false otherwise + * @static + */ + static isPlanar(graph:yfiles.algorithms.Graph):boolean; + /** + * Gets a {@link yfiles.collections.IList.} of face lists. + *

+ * More precisely, each entry of this list is another list that contains all {@link yfiles.algorithms.Dart darts} of a face. + *

+ * @type {yfiles.collections.IList.>} + */ + faces:yfiles.collections.IList>; + /** + * Gets the {@link yfiles.collections.IList.} that represents the outer face. + * @see yfiles.algorithms.PlanarEmbedding#faces + * @type {yfiles.collections.IList.} + */ + outerFace:yfiles.collections.IList; + static $class:yfiles.lang.Class; + } + /** + * This class provides algorithms for solving the rank assignment problem. + *

+ * Definitions Let G=(V,E) be a directed acyclic graph. Let length(e) denote the minimum length and weight(e) the weight of an edge + * e. + *

+ *

+ * The rank assignment problem is the problem of finding integer values rank(v) for all v in V, such that: + *

+ *
    + *
  • rank(v) - rank(w) >= length(v,w), for all (v,w) in E and,
  • + *
  • the sum ?(weight(v,w) * (rank(v) - rank(w))) over all (v,w) in E is minimized.
  • + *
+ * @class yfiles.algorithms.RankAssignments + * @static + */ + export interface RankAssignments extends Object{} + export class RankAssignments { + /** + * Like {@link yfiles.algorithms.RankAssignments#simple}, but arrays are used instead of {@link yfiles.algorithms.INodeMap}s and + * {@link yfiles.algorithms.IEdgeMap}s. + *

+ * Minimum edge length and weights should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph in which all the edges have directions, such that rank[source] < rank[target] and + * rank[target] - rank[source] >= minlength[edge] + * @param {Array.} rank an array that will be filled with the ranking r of each node v such that rank[v.index] == r + * @param {Array.} minLength an array holding a non-negative value len of each edge e such that minLength[e.index] == len + * @param {number} [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) + * @returns {number} the number of layers + * @see yfiles.algorithms.RankAssignments#simple + * @static + */ + static simple(graph:yfiles.algorithms.Graph,rank:number[],minLength:number[],maximalDuration?:number):number; + /** + * This method quickly calculates a tight tree given a maximum time duration for the algorithm. + *

+ * The algorithm is using a highly optimized version of Gansner's algorithm: + *

+ *
    + *
  • E.R. Gansner et al., A Technique for Drawing Directed Graphs, IEEE Transactions on Software Engineering, Vol.19, No.3, March 1993.
  • + *
+ *

+ * Minimum edge length and weights should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph in which all the edges have directions, such that rank[source] < rank[target] and + * rank[target] - rank[source] >= minlength[edge] + * @param {yfiles.algorithms.INodeMap} rank the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns the integer ranking of each node + * @param {yfiles.algorithms.IEdgeMap} minLength the {@link yfiles.algorithms.IEdgeMap} that returns an integer value (minimum/tight length) of each edge + * @param {number} [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) + * @returns {number} + * @see yfiles.algorithms.RankAssignments#simple + * @static + */ + static simple(graph:yfiles.algorithms.Graph,rank:yfiles.algorithms.INodeMap,minLength:yfiles.algorithms.IEdgeMap,maximalDuration?:number):number; + /** + * Similar to Simplex but, additionally, it is possible to provide a valid initial tree solution for the problem. + *

+ * Minimum edge length and weights should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.INodeMap} layer the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns the zero-based ranking index for + * each node + * @param {yfiles.algorithms.IDataProvider} w the {@link yfiles.algorithms.IDataProvider} that returns an integer value (weight) of each edge + * @param {yfiles.algorithms.IDataProvider} minLength the {@link yfiles.algorithms.IDataProvider} that returns an integer value (minimum length) of each edge + * @param {yfiles.algorithms.IEdgeMap} tree the {@link yfiles.algorithms.IEdgeMap} that returns a boolean value indicating whether or not an edge is a tree edge + * @param {yfiles.algorithms.Node} _root the given root node of the tree solution + * @param {boolean} validRanking true if the argument layer contains a valid ranking, false otherwise + * @param {number} [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) + * @returns {number} the number of layers + * @see yfiles.algorithms.RankAssignments#simplex + * @static + */ + static simplex(graph: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; + /** + * Solves the rank assignment problem using the simplex method given a maximum time duration for the algorithm. + *

+ * This method assigns a minimum 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.
  • + *
+ *

+ * Minimum edge length and weights should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.INodeMap} layer the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns the zero-based ranking index for + * each node + * @param {yfiles.algorithms.IDataProvider} w the {@link yfiles.algorithms.IDataProvider} that returns an integer value (weight) of each edge + * @param {yfiles.algorithms.IDataProvider} minLength the {@link yfiles.algorithms.IDataProvider} that returns an integer value (minimum length) of each edge + * @param {number} [maximalDuration=0x7FFFFFFFFFFFFFFF] a preferred time limit for the algorithm (in milliseconds) + * @returns {number} the number of layers + * @see yfiles.algorithms.RankAssignments#simplex + * @static + */ + static simplex(graph:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,w:yfiles.algorithms.IDataProvider,minLength:yfiles.algorithms.IDataProvider,maximalDuration?:number):number; + static $class:yfiles.lang.Class; + } + /** + * This class provides diverse algorithms and helper methods for solving the shortest path problem on weighted graphs. + *

+ * Definitions Given a weighted directed/undirected graph: + *

+ *
    + *
  • The shortest path problem is the problem of finding a shortest path between a source node s + * and a target node t such that the sum of the edge costs is minimized.
  • + *
  • The k-shortest path problem is the problem of finding k shortest paths between a source + * node s and a target node t such that the sum of the edge costs is minimized.
  • + *
  • The single-source shortest path problem is the problem of finding shortest paths from a source node + * s to all other nodes such that the sum of the edge costs is minimized.
  • + *
  • The single-source single-sink shortest path problem is the problem of finding shortest paths from a source node s to a target node t such that the sum of the edge costs is minimized.
  • + *
  • The all-pairs shortest path problem is the problem of finding shortest paths between every pair of + * nodes such that the sum of the edge costs is minimized.
  • + *
+ * @class yfiles.algorithms.ShortestPaths + * @static + */ + export interface ShortestPaths extends Object{} + export class ShortestPaths { + /** + * Solves the single-source shortest path problem for acyclic directed graphs. + *

+ * Each edge is associated with 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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @param {Array.} dist an array of values that will be filled during the execution and returns 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. + * @param {Array.} [pred=null] an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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. + * @returns {boolean} true if the input graph is acyclic, false otherwise + * @see yfiles.algorithms.ShortestPaths#acyclic + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @static + */ + static acyclic(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; + /** + * Solves the single-source shortest path problem for acyclic directed graphs. + *

+ * Each edge is associated with 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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns the double value (cost) for traversing each edge + * @param {yfiles.algorithms.INodeMap} dist the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (shortest distance) + * from node s to all other nodes or {@link number#POSITIVE_INFINITY} if no such paths exist + * @param {yfiles.algorithms.INodeMap} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @returns {boolean} true if the input graph is acyclic, false otherwise + * @see yfiles.algorithms.ShortestPaths#acyclic + * @static + */ + static acyclic(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 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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @param {Array.>} dist an array of values that will be filled during the execution and returns 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. + * @returns {boolean} true if the given graph does not contain a negative-cost cycle, false otherwise + * @static + */ + static allPairs(graph:yfiles.algorithms.Graph,directed:boolean,cost:number[],dist:number[][]):boolean; + /** + * Solves the single-source shortest path problem for arbitrary graphs. + *

+ * Each edge is associated with an arbitrary double value that represents the cost of this 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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the source node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns the double value (cost) for traversing each edge + * @param {yfiles.algorithms.INodeMap} dist the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (shortest distance) + * from node s to all other nodes or {@link number#POSITIVE_INFINITY} if no such paths exist + * @param {yfiles.algorithms.INodeMap} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @returns {boolean} + * @see yfiles.algorithms.ShortestPaths#bellmanFord + * @static + */ + static bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):boolean; + /** + * Solves the single-source shortest path problem for arbitrary graphs. + *

+ * Each edge is associated with an arbitrary double value that represents the cost of this 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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @param {Array.} dist an array of values that will be filled during the execution and returns 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. + * @param {Array.} [pred=null] an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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. + * @returns {boolean} + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @see yfiles.algorithms.ShortestPaths#bellmanFord + * @static + */ + static bellmanFord(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; + /** + * Convenience method that constructs an explicit {@link yfiles.algorithms.EdgeList path of edges} from the result returned by one of the shortest paths + * methods defined in this class. + *

+ * If there is no path from node s to t, then an empty list is returned. + *

+ * @param {yfiles.algorithms.Node} s the start node of the shortest path which must be the same start node that was specified when pred was calculated + * @param {yfiles.algorithms.Node} t the target node of the path + * @param {Array.} pred an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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. + * @returns {yfiles.algorithms.EdgeList} a {@link yfiles.algorithms.EdgeList list} containing the edges on the shortest path from s to t in the correct order + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @static + */ + static constructEdgePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.EdgeList; + /** + * Like {@link yfiles.algorithms.ShortestPaths#constructEdgePath} but the path edges are given by a + * {@link yfiles.algorithms.IDataProvider}. + *

+ * If there is no path from node s to t, then an empty list is returned. + *

+ * @param {yfiles.algorithms.Node} s the start node of the shortest path which must be the same start node that was specified when pred was calculated + * @param {yfiles.algorithms.Node} t the target node of the path + * @param {yfiles.algorithms.IDataProvider} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @returns {yfiles.algorithms.EdgeList} a {@link yfiles.algorithms.EdgeList list} containing the edges on the shortest path from s to t in the correct order + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @static + */ + static constructEdgePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; + /** + * Convenience method that constructs an explicit {@link yfiles.algorithms.NodeList path of nodes} from the result returned by one of the shortest paths + * methods defined in this class. + *

+ * If there is no path from node s to t, then an empty list is returned. + *

+ * @param {yfiles.algorithms.Node} s the start node of the shortest path which must be the same start node that was specified when pred was calculated + * @param {yfiles.algorithms.Node} t the target node of the path + * @param {Array.} pred an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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. + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList list} containing the nodes on the shortest path from s to t in the correct order + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @static + */ + static constructNodePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.Edge[]):yfiles.algorithms.NodeList; + /** + * Like {@link yfiles.algorithms.ShortestPaths#constructNodePath} but the path edges are given by a + * {@link yfiles.algorithms.IDataProvider}. + *

+ * If there is no path from node s to t, then an empty list is returned. + *

+ * @param {yfiles.algorithms.Node} s the start node of the shortest path which must be the same start node that was specified when pred was calculated + * @param {yfiles.algorithms.Node} t the target node of the path + * @param {yfiles.algorithms.IDataProvider} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList list} containing the nodes on the shortest path from s to t in the correct order + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @static + */ + static constructNodePath(s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,pred:yfiles.algorithms.IDataProvider):yfiles.algorithms.NodeList; + /** + * Solves the single-source shortest path problem for arbitrary graphs. + *

+ * Each edge is associated with a non-negative double value that represents the cost of the edge. + *

+ *

+ * This method yields the shortest distance from a given node s to all other nodes. + *

+ *

+ * The costs should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @param {Array.} dist an array of values that will be filled during the execution and returns 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. + * @param {Array.} [pred=null] an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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 yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @see yfiles.algorithms.ShortestPaths#dijkstra + * @static + */ + static dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):void; + /** + * Solves the single-source shortest path problem for arbitrary graphs. + *

+ * Each edge is associated with a non-negative double value that represents the cost of the edge. + *

+ *

+ * This method yields the shortest distance from a given node s to all other nodes. + *

+ *

+ * The costs should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns the double value (cost) for traversing each edge + * @param {yfiles.algorithms.INodeMap} dist the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (shortest distance) + * from node s to all other nodes or {@link number#POSITIVE_INFINITY} if no such paths exist + * @param {yfiles.algorithms.INodeMap} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @see yfiles.algorithms.ShortestPaths#dijkstra + * @static + */ + static dijkstra(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void; + /** + * Finds all nodes and edges that belong to a shortest path from a start node 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. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} start the start node + * @param {yfiles.algorithms.IDataProvider} targetMap the {@link yfiles.algorithms.IDataProvider} that returns a boolean value indicating whether or not a node belongs to the set of + * target nodes + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {number} maxLength the maximum edge length of the shortest paths + * @param {yfiles.algorithms.EdgeList} pathEdges a {@link yfiles.algorithms.EdgeList list} that will be filled during the execution and returns the edges on the shortest path from s to t in the correct + * order + * @param {yfiles.algorithms.NodeList} pathNodes a {@link yfiles.algorithms.NodeList list} that will be filled during the execution and returns the nodes on the shortest path from s to t in the correct + * order + * @static + */ + static findShortestUniformPaths(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; + /** + * Marks all edges that belong to a shortest path from start node to target node. + *

+ * This method assumes that each edge of the input graph has a cost of 1.0. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} start the start node + * @param {yfiles.algorithms.Node} end the target node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IEdgeMap} pathMap the {@link yfiles.algorithms.IEdgeMap} that will be filled during the execution and returns a boolean value indicating whether + * or not the edge belongs to a shortest path connecting the two nodes + * @static + */ + static 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 {@link yfiles.algorithms.EdgeList} objects. + *

+ *

+ * The cost should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} costDP the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for traversing each edge + * @param {yfiles.algorithms.Node} start the given start node + * @param {yfiles.algorithms.Node} end the given target node + * @param {number} k a non-negative integer value + * @returns {yfiles.algorithms.YList} a {@link yfiles.algorithms.YList list} of {@link yfiles.algorithms.EdgeList} objects each of which represents a path from start node to target node. The i-th + * path in the list contains the i-th shortest path between the start and target node. + * @static + */ + static 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 the result 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}. + *

+ *

+ * The cost should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} costDP the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for traversing each edge + * @param {yfiles.algorithms.Node} start the given start node + * @param {yfiles.algorithms.Node} end the given target node + * @param {number} k a non-negative integer value + * @returns {yfiles.algorithms.ICursor} a {@link yfiles.algorithms.ICursor cursor} that calculates the next path in the sequence only when needed + * @static + */ + static kShortestPathsCursor(graph:yfiles.algorithms.Graph,costDP:yfiles.algorithms.IDataProvider,start:yfiles.algorithms.Node,end:yfiles.algorithms.Node,k:number):yfiles.algorithms.ICursor; + /** + * Returns two edge-disjoint paths in a non-negatively weighted directed graph, such that both paths connect nodes s and t + * and have minimum total length. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} source the source node of the shortest pair + * @param {yfiles.algorithms.Node} target the target node of the shortest pair + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} costDP the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for traversing each edge + * @returns {Array.} a two-dimensional array of {@link yfiles.algorithms.EdgeList}s holding the resulting edge-disjoint paths or null if no such + * edge-disjoint paths exist + * @static + */ + static shortestPair(graph:yfiles.algorithms.Graph,source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,directed:boolean,costDP:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; + /** + * This method solves the single-source shortest path problem for arbitrary graphs. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @param {Array.} dist an array of values that will be filled during the execution and returns 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. + * @param {Array.} [pred=null] an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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. + * @returns {boolean} true if the weighted graph does not contain a negative-cost cycle, false otherwise + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @see yfiles.algorithms.ShortestPaths#singleSource + * @static + */ + static singleSource(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,cost:number[],dist:number[],pred?:yfiles.algorithms.Edge[]):boolean; + /** + * This method solves the single-source shortest path problem for arbitrary graphs. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the source node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns the double value (cost) for traversing each edge + * @param {yfiles.algorithms.INodeMap} dist the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (shortest distance) + * from node s to all other nodes or {@link number#POSITIVE_INFINITY} if no such paths exist + * @param {yfiles.algorithms.INodeMap} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @returns {boolean} true if the weighted graph does not contain a negative-cost cycle, false otherwise + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @see yfiles.algorithms.ShortestPaths#singleSource + * @static + */ + static singleSource(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 single-sink shortest path problem for arbitrary graphs. + *

+ * Each edge is associated with a non-negative double value that represents the cost of the edge. + *

+ *

+ * This method returns the shortest distance from node s to node + * t. It also returns information to construct the actual path between these two nodes. + *

+ *

+ * The costs should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the source node + * @param {yfiles.algorithms.Node} t the sink node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @param {Array.} pred an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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. + * @returns {number} the distance between sand t if a path between these two nodes exists or Double.POSITIVE_INFINITY otherwise + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @static + */ + static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:number[],pred:yfiles.algorithms.Edge[]):number; + /** + * Like {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but uses {@link yfiles.algorithms.INodeMap}s and + * {@link yfiles.algorithms.IDataProvider}s instead of arrays. + *

+ * Each edge is associated with a non-negative double value that represents the cost of the edge. + *

+ *

+ * The costs should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the source node + * @param {yfiles.algorithms.Node} t the sink node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns the double value (cost) for traversing each edge + * @param {yfiles.algorithms.INodeMap} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @returns {number} a shortest {@link yfiles.algorithms.EdgeList path of edges} between source and sink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @static + */ + static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider,pred:yfiles.algorithms.INodeMap):number; + /** + * Similar to {@link yfiles.algorithms.ShortestPaths#singleSourceSingleSink} but instead of returning the shortest distance between + * the source and sink the actual shortest edge path between these nodes will be returned. + *

+ * Each edge is associated with a non-negative double value that represents the cost of the edge. + *

+ *

+ * If the returned path is empty, then there is no path between the nodes. + *

+ *

+ * The costs should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the source node + * @param {yfiles.algorithms.Node} t the sink node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} cost an array of double values that returns the costs for traversing each edge; edge e has cost cost[e.index()] + * @returns {yfiles.algorithms.EdgeList} a shortest {@link yfiles.algorithms.EdgeList path of edges} between source and sink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @static + */ + static 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#singleSourceSingleSink} but instead of returning the shortest distance between + * the source and sink the actual shortest edge path between these nodes will be returned. + *

+ * Each edge is associated with a non-negative double value that represents the cost of the edge. + *

+ *

+ * If the returned path is empty, then there is no path between the nodes. + *

+ *

+ * The costs should be non-negative. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the source node + * @param {yfiles.algorithms.Node} t the sink node + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns the double value (cost) for traversing each edge + * @returns {yfiles.algorithms.EdgeList} a shortest {@link yfiles.algorithms.EdgeList path of edges} between source and sink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @see yfiles.algorithms.ShortestPaths#singleSourceSingleSink + * @static + */ + static singleSourceSingleSink(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node,directed:boolean,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; + /** + * Solves the single-source shortest path problem for arbitrary graphs in which each edge has a uniform cost of + * 1.0. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {Array.} dist an array of values that will be filled during the execution and returns 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. + * @param {Array.} [pred=null] an array of {@link yfiles.algorithms.Edge}s that will be filled during the execution and returns 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 yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @static + */ + static uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:number[],pred?:yfiles.algorithms.Edge[]):void; + /** + * Like Uniform but uses {@link yfiles.algorithms.INodeMap}s instead of arrays. + * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.Node} s the node from which the shortest path search starts + * @param {boolean} directed true if the graph should be considered as directed, false otherwise + * @param {yfiles.algorithms.INodeMap} dist the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns a double value (shortest distance) + * from node s to all other nodes or {@link number#POSITIVE_INFINITY} if no such paths exist + * @param {yfiles.algorithms.INodeMap} pred the {@link yfiles.algorithms.INodeMap} that will be filled during the execution and returns for each node t the last edge on the + * shortest path from s to t or null if t == s or no shortest path from s to t exists + * @see yfiles.algorithms.ShortestPaths#constructNodePath + * @see yfiles.algorithms.ShortestPaths#constructEdgePath + * @static + */ + static uniform(graph:yfiles.algorithms.Graph,s:yfiles.algorithms.Node,directed:boolean,dist:yfiles.algorithms.INodeMap,pred:yfiles.algorithms.INodeMap):void; + /** + * Convenience method that returns an array containing uniform edge costs of 1.0 for each edge of the given graph. + * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {Array.} an array that contains uniform edge costs of value 1.0 (i.e., for each edge e: cost[e.index()] == 1.0) + * @static + */ + static uniformCost(graph:yfiles.algorithms.Graph):number[]; + static $class:yfiles.lang.Class; + } + /** + * This class provides methods for efficiently sorting graph elements in graph structures. + * @class yfiles.algorithms.Sorting + * @static + */ + export interface Sorting extends Object{} + export class Sorting { + /** + * Sorts the nodes of a given graph by degree in ascending order. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {Array.} an array of {@link yfiles.algorithms.Node}s sorted by degree in ascending order + * @static + */ + static sortNodesByDegree(graph:yfiles.algorithms.Graph):yfiles.algorithms.Node[]; + /** + * Sorts the nodes of a given graph by an integer key associated with each node through a {@link yfiles.algorithms.IDataProvider}. + *

+ * The nodes are sorted in ascending order. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {yfiles.algorithms.IDataProvider} keys the {@link yfiles.algorithms.IDataProvider} that returns the keys based on which the nodes will be sorted + * @returns {Array.} an array of {@link yfiles.algorithms.Node}s sorted by an integer key in ascending order + * @static + */ + static sortNodesByIntKey(graph:yfiles.algorithms.Graph,keys:yfiles.algorithms.IDataProvider):yfiles.algorithms.Node[]; + static $class:yfiles.lang.Class; + } + /** + * This class provides (minimum) spanning tree algorithms for graphs. + *

+ * Definitions + *

+ *
    + *
  • A spanning tree of an undirected connected graph is a subset of its edges that induce a tree that connects all nodes of the graph.
  • + *
  • + * A minimum spanning tree of a weighted connected graph is a spanning tree whose edges have minimum overall cost among all spanning trees of + * that graph. + *
  • + *
+ * @class yfiles.algorithms.SpanningTrees + * @static + */ + export interface SpanningTrees extends Object{} + export class SpanningTrees { + /** + * Returns the overall cost of a previously calculated minimum spanning tree. + * @param {yfiles.algorithms.EdgeList} treeEdges the given {@link yfiles.algorithms.EdgeList list} of edges that form a minimum spanning tree + * @param {yfiles.algorithms.IDataProvider} edgeCost the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for each tree edge + * @returns {number} the overall cost of the tree edges + * @static + */ + static cost(treeEdges:yfiles.algorithms.EdgeList,edgeCost:yfiles.algorithms.IDataProvider):number; + /** + * 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.
  • + *
+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for each edge + * @returns {yfiles.algorithms.EdgeList} a {@link yfiles.algorithms.EdgeList list} containing the edges that form the minimum spanning tree + * @static + */ + static kruskal(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; + /** + * Calculates a minimum spanning tree for the given graph. + *

+ * Currently, the result is obtained by calling {@link yfiles.algorithms.SpanningTrees#prim}. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for each edge + * @returns {yfiles.algorithms.EdgeList} a {@link yfiles.algorithms.EdgeList list} containing the edges that form the minimum spanning tree + * @static + */ + static 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: + *

+ *
    + *
  • R.C. Prim. Shortest connection networks and some generalizations. Bell System Technical Journal, 36:1389-1401, 1957.
  • + *
+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} cost the {@link yfiles.algorithms.IDataProvider} that returns a double value (cost) for each edge + * @returns {yfiles.algorithms.EdgeList} a {@link yfiles.algorithms.EdgeList list} containing the edges that form the minimum spanning tree + * @static + */ + static prim(graph:yfiles.algorithms.Graph,cost:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList; + /** + * Calculates a spanning tree for the given graph in which each edge has a uniform cost of 1.0. + * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.algorithms.EdgeList} a {@link yfiles.algorithms.EdgeList list} containing the edges that form the minimum spanning tree + * @static + */ + static uniform(graph:yfiles.algorithms.Graph):yfiles.algorithms.EdgeList; + static $class:yfiles.lang.Class; + } + /** + * This class provides algorithms to compute reachability information for directed, acyclic graphs. + *

+ * Definitions + *

+ *
    + *
  • + * Reflexive, transitive closure: Let G = (V,E) be a directed acyclic graph. The reflexive, transitive closure of G is a graph which contains edge (v,w) only if there exists a path + * from v to w in G. + *
  • + *
  • + * Transitive reduction: Let G = (V,E) be a directed acyclic graph. The transitive reduction of G is a graph which contains edge (v,w) only if there exists no path + * from v to w in G of length 2 or more. + *
  • + *
+ * @class yfiles.algorithms.Transitivity + * @static + */ + export interface Transitivity extends Object{} + export class Transitivity { + /** + * Calculates the transitive closure for a directed acyclic graph. + *

+ * Given a G = (V,E) be a directed acyclic graph. The reflexive, transitive closure of G is a graph which contains edge (v,w) only if there exists a + * path from v to w in G. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph to which this method will add transitive edges, if necessary + * @param {yfiles.algorithms.EdgeList} [addedEdges=null] a {@link yfiles.algorithms.EdgeList list} that will be filled during the execution and contains the edges that have been added to the graph by this method + * @static + */ + static transitiveClosure(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. + *

+ *

+ * Given G = (V,E) be a directed acyclic graph. The transitive reduction of G is a graph which contains edge (v,w) only if there exists no path + * from v to w in G of length 2 or more. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.EdgeList} [transitiveEdges=null] a {@link yfiles.algorithms.EdgeList list} that will be filled during the execution and contains all transitive edges of the given graph; removal of these + * edges will yield the transitive reduction of the graph + * @static + */ + static transitiveReduction(graph:yfiles.algorithms.Graph,transitiveEdges?:yfiles.algorithms.EdgeList):void; + static $class:yfiles.lang.Class; + } + /** + * This class provides diverse algorithms and services for tree-structured graphs or subgraphs. + *

+ * Definitions + *

+ *
    + *
  • + * Tree: An acyclic graph, in which any pair of vertices (nodes) is connected through a path. If one vertex of a tree is + * distinguished from the other vertices, then this vertex is called the root and the tree is called a rooted tree. + *
  • + *
  • Directed rooted tree: A rooted tree where edges are directed from the root to the leaves.
  • + *
  • Depth: The depth of a vertex in a rooted tree is the number of edges of the unique path between this vertex and the root.
  • + *
  • + * Parent: In a rooted tree a vertex v is called parent of a vertex w if v and w are adjacent (i.e. connected by an edge) and the + * unique path between w and the root contains v. Note that each vertex except the root has exactly one parent. + *
  • + *
  • Children: In a rooted tree a vertex w is called child of a vertex v if v is the parent of w. A vertex may have several children.
  • + *
  • N-ary tree: A directed rooted tree where each node has a maximum of n children.
  • + *
  • Forest: A graph whose connected components are trees.
  • + *
  • + * Leaf: A leaf v is a node with out-degree (i.e., the number of edges having v as a target) zero if the input is a directed + * rooted tree, and a node with degree (i.e., the number of edges incident to v) one, otherwise. + *
  • + *
  • Subtree: A subtree of a tree T is a subgraph of T which is also a tree.
  • + *
  • + * Nearest or Lowest or Least common ancestor: The nearest common ancestor of two nodes u and v in a tree graph is the shared ancestor of u and v that is located + * farthest from the root. + *
  • + *
  • Eccentricity: The eccentricity of a tree node is the maximum distance to any other node.
  • + *
  • Center node: The center of a tree is the set of nodes that have minimal eccentricity.
  • + *
+ * @class yfiles.algorithms.Trees + * @static + */ + export interface Trees extends Object{} + export class Trees { + static collectSubtree(root:yfiles.algorithms.Node,nodes:yfiles.algorithms.NodeList):void; + /** + * Converts the given tree to a directed rooted tree with the given node as root element by reversing some edges. + *

+ * A list of all reversed edges will be returned by this method. + *

+ * @param {yfiles.algorithms.Graph} tree the given tree + * @param {yfiles.algorithms.Node} [root=null] the given root element + * @returns {yfiles.algorithms.EdgeList} an {@link yfiles.algorithms.EdgeList} containing the reversed edges + * @static + */ + static directTree(tree:yfiles.algorithms.Graph,root?:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; + /** + * 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. + *

+ * @param {yfiles.algorithms.Graph} tree the given undirected tree + * @returns {yfiles.algorithms.Node} the center node of the given undirected tree + * @static + */ + static getCenterRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node; + /** + * 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 true if the algorithm should consider the tree as directed, false otherwise + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} that contains all leaf nodes of the given tree + * @static + */ + static getLeafNodes(tree:yfiles.algorithms.Graph,directedRootedTree:boolean):yfiles.algorithms.NodeList; + /** + * Returns the nearest common ancestor of a subset of nodes within a directed rooted tree. + *

+ * It is not part of the given subset. + *

+ * @param {yfiles.algorithms.Graph} tree the given directed rooted tree + * @param {yfiles.algorithms.Node} root the root of the tree + * @param {boolean} rootedDownward true if the tree is directed from the root to the leaves, false otherwise + * @param {yfiles.algorithms.NodeList} nodes the subset of nodes + * @returns {yfiles.algorithms.Node} the {@link yfiles.algorithms.Node nearest common ancestor} of the given subset of nodes + * @static + */ + static getNearestCommonAncestor(tree:yfiles.algorithms.Graph,root:yfiles.algorithms.Node,rootedDownward:boolean,nodes:yfiles.algorithms.NodeList):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.
  • + *
  • If the input is a tree, the method returns a maximum weight center node as defined in GetWeightedCenterNode.
  • + *
  • If the input is not a tree, a node with indegree == 0 (or outdegree == 0) is returned.
  • + *
+ * @param {yfiles.algorithms.Graph} tree the given tree + * @returns {yfiles.algorithms.Node} a possible root for the given tree + * @static + */ + static getRoot(tree:yfiles.algorithms.Graph):yfiles.algorithms.Node; + /** + * Returns the depths of each subtree of a rooted directed tree. + * @param {yfiles.algorithms.Graph} tree a rooted directed tree graph + * @param {yfiles.algorithms.INodeMap} subtreeDepthMap the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with the depth of the subtree rooted at each + * node + * @static + */ + static getSubTreeDepths(tree:yfiles.algorithms.Graph,subtreeDepthMap:yfiles.algorithms.INodeMap):void; + /** + * Returns the size (number of nodes) of each subtree of a rooted directed tree. + * @param {yfiles.algorithms.Graph} tree a rooted directed tree graph + * @param {yfiles.algorithms.INodeMap} subtreeSizeMap the {@link yfiles.algorithms.INodeMap} that will be filled during the execution with the size of the subtree rooted at each + * node + * @static + */ + static getSubTreeSizes(tree:yfiles.algorithms.Graph,subtreeSizeMap:yfiles.algorithms.INodeMap):void; + /** + * Returns an array of {@link yfiles.algorithms.EdgeList} objects each containing edges that belong to a maximal directed subtree + * of the given graph. + *

+ * This 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 {Array.} [treeNodes=null] an array of {@link yfiles.algorithms.NodeList}s previously calculated by {@link yfiles.algorithms.Trees#getTreeNodes} + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList} objects each containing edges that belong to a maximal subtree + * @static + */ + static getTreeEdges(graph:yfiles.algorithms.Graph,treeNodes?:yfiles.algorithms.NodeList[]):yfiles.algorithms.EdgeList[]; + /** + * Returns an array of {@link yfiles.algorithms.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 in-degree of the root is at least two. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal directed subtree + * @static + */ + static getTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; + /** + * Returns an array of {@link yfiles.algorithms.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 + * @returns {Array.} an array of {@link yfiles.algorithms.NodeList} objects each containing nodes that belong to a maximal undirected subtree + * @static + */ + static getUndirectedTreeNodes(graph:yfiles.algorithms.Graph):yfiles.algorithms.NodeList[]; + /** + * Finds a node 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 {@link yfiles.algorithms.INodeMap}. + *

+ * @param {yfiles.algorithms.Graph} tree the given tree + * @param {yfiles.algorithms.INodeMap} [intWeight=null] the {@link yfiles.algorithms.INodeMap} that holds the number of paths per node + * @returns {yfiles.algorithms.Node} a {@link yfiles.algorithms.Node} used by the greatest number of all undirected paths + * @static + */ + static getWeightedCenterNode(tree:yfiles.algorithms.Graph,intWeight?:yfiles.algorithms.INodeMap):yfiles.algorithms.Node; + /** + * Checks whether or not 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. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @param {boolean} directedRootedTree true if the algorithm should check for directed rooted trees, false otherwise + * @returns {boolean} true if the given graph is a forest, false otherwise + * @static + */ + static isForest(graph:yfiles.algorithms.Graph,directedRootedTree:boolean):boolean; + /** + * Checks whether or not 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 + * @returns {boolean} true if the given graph is a forest, false otherwise + * @static + */ + static isForest(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given graph is a directed rooted tree in which each node has a maximum of n children. + * @param {yfiles.algorithms.Graph} graph the given graph + * @param {number} n the allowed maximum of children + * @returns {boolean} true if the given graph is a n-ary tree, false otherwise + * @static + */ + static isNaryTree(graph:yfiles.algorithms.Graph,n:number):boolean; + /** + * Checks whether or not the given graph is a directed rooted tree. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the given graph is a directed rooted tree, false otherwise + * @static + */ + static isRootedTree(graph:yfiles.algorithms.Graph):boolean; + /** + * Checks whether or not the given graph is an undirected tree. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {boolean} true if the given graph is an undirected tree, false otherwise + * @static + */ + static isTree(graph:yfiles.algorithms.Graph):boolean; + static $class:yfiles.lang.Class; + } + /** + * 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.collections.IList.} interface but does not support the {@link yfiles.algorithms.YList#subList} + * method. The implementation of this method will throw an {@link Stubs.Exceptions.NotSupportedError} if invoked. The {@link yfiles.algorithms.YList#cursor} + * returned by instances of this class is not fail fast. + *

+ * @class yfiles.algorithms.YList + * @implements {yfiles.collections.IList.} + */ + export interface YList extends Object,yfiles.collections.IList{} + export class YList { + /** + * Creates a list that is initialized with the elements provided by the given array of objects. + * @param {Array.} a + * @constructor + */ + constructor(a:Object[]); + /** + * 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#getBoolean 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. + * @constructor + */ + constructor(c:yfiles.algorithms.ICursor,predicate:yfiles.algorithms.IDataProvider); + /** + * Creates a list that is initialized with the elements provided by the given Collection object. + * @param {yfiles.collections.IEnumerable.} c + * @constructor + */ + constructor(c:yfiles.collections.IEnumerable); + /** + * Creates a list that is initialized with the elements provided by the given YCursor object. + * @param {yfiles.algorithms.ICursor} c + * @constructor + */ + constructor(c:yfiles.algorithms.ICursor); + /** + * Creates an empty doubly linked list. + * @constructor + */ + constructor(); + /** + * 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. + *

+ * @param {yfiles.algorithms.ICursor} c + */ + addAll(c:yfiles.algorithms.ICursor):void; + /** + * Appends all elements provided by the given collection to this list. + * @param {yfiles.collections.ICollection.} collection + * @returns {boolean} Whether there have been elements appended. + */ + addAll(collection:yfiles.collections.ICollection):boolean; + /** + * + * @param {number} index + * @param {yfiles.collections.ICollection.} c + * @returns {boolean} + */ + addAll(index:number,c:yfiles.collections.ICollection):boolean; + /** + * Inserts the given object at the head of this list. + * @param {Object} o + * @returns {yfiles.algorithms.ListCell} The newly created ListCell object that stores the given object. + */ + addFirst(o:Object):yfiles.algorithms.ListCell; + /** + * 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; + /** + * Inserts the given object at the tail of this list. + * @param {Object} o + * @returns {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; + /** + * Removes all elements from this list. + */ + clear():void; + /** + * Whether or not this list contains all the elements in the given collection. + *

+ * Equality of elements is defined by the {@link Object#equals} method. + *

+ * @param {yfiles.collections.ICollection.} collection + * @returns {boolean} + */ + containsAll(collection:yfiles.collections.ICollection):boolean; + /** + * Copies the elements of this collection to an array, starting at the specified array index. + * @param {Array.} array The one-dimensional array that is the destination of the elements copied from this collection. + * @param {number} arrayIndex The zero-based index in array at which copying begins. + */ + copyTo(array:Object[],arrayIndex:number):void; + /** + * 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. + *

+ * @returns {yfiles.algorithms.ICursor} + */ + cursor():yfiles.algorithms.ICursor; + /** + * Returns the cyclic predecessor cell of the given list cell. + *

+ * The last cell is returned as the cyclic predecessor of the first list cell. + *

+ * @param {yfiles.algorithms.ListCell} c + * @returns {yfiles.algorithms.ListCell} + */ + cyclicPred(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. + *

+ * @param {yfiles.algorithms.ListCell} c + * @returns {yfiles.algorithms.ListCell} + */ + cyclicSucc(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; + /** + * Returns the i-th element of this list. + * @param {number} i + * @returns {Object} + */ + elementAt(i:number):Object; + /** + * 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. + *

+ * @param {Object} o + * @returns {yfiles.algorithms.ListCell} the ListCell that contains the element or null if no such ListCell was found + */ + findCell(o:Object):yfiles.algorithms.ListCell; + /** + * Gets the element at the specified index. + * @param {number} index The zero-based index of the element to get or set. + * @returns {Object} The element at the specified index. + * @see yfiles.algorithms.YList#set + */ + get(index:number):Object; + /** + * Gets the cell at the given index. + * @param {number} index the zero-based index of the cell in this list. + * @returns {yfiles.algorithms.ListCell} The cell. + * @throws {Stubs.Exceptions.IndexOutOfRangeError} if the index is negative or greater or equal than the {@link yfiles.algorithms.YList#size} + */ + getCell(index:number):yfiles.algorithms.ListCell; + /** + * Returns an enumerator that iterates through this collection. + * @returns {yfiles.collections.IEnumerator.} An {@link yfiles.collections.IEnumerator.} that can be used to iterate through this collection. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Returns the element stored in the given list cell. + * @param {yfiles.algorithms.ListCell} c + * @returns {Object} + */ + getInfo(c:yfiles.algorithms.ListCell):Object; + /** + * Whether or not this list contains the given element. + *

+ * Equality of elements is defined by the {@link Object#equals} method. + *

+ * @param {Object} o + * @returns {boolean} + */ + includes(o:Object):boolean; + /** + * Returns the zero-based index of the given element in this list. + *

+ * If the given element is not in the list, -1 is returned. + *

+ * @param {Object} obj + * @returns {number} + */ + indexOf(obj:Object):number; + /** + * + * @param {number} index + * @param {Object} element + */ + insert(index:number,element:Object):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. + *

+ * @param {Object} o The object to be inserted. + * @param {yfiles.algorithms.ListCell} refCell The list cell used to reference the position. + * @returns {yfiles.algorithms.ListCell} The newly created ListCell object that stores object o. + */ + insertAfter(o:Object,refCell:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; + /** + * 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. + *

+ * @param {Object} o The object to be inserted. + * @param {yfiles.algorithms.ListCell} refCell The list cell used to reference the position. + * @returns {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 after the reference list cell refCell. + *

+ *

+ * Attention: If the ListCell object is still part of any list, then that list will be corrupted afterwards. + *

+ * @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 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. + *

+ * @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; + /** + * Checks whether this list contains elements. + * @returns {boolean} + */ + isEmpty():boolean; + /** + * + * @param {Object} o + * @returns {number} + */ + lastIndexOf(o:Object):number; + /** + * Equivalent to {@link yfiles.algorithms.YList#firstObject}. + * @returns {Object} + */ + peek():Object; + /** + * Removes the first element from this list and returns it. + * @returns {Object} + */ + pop():Object; + /** + * Removes the last element from this list and returns it. + * @returns {Object} + */ + popLast():Object; + /** + * Returns the predecessor cell of the given list cell. + * @param {yfiles.algorithms.ListCell} c + * @returns {yfiles.algorithms.ListCell} + */ + predCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; + /** + * Equivalent to {@link yfiles.algorithms.YList#addFirst}. + * @param {Object} o + * @returns {yfiles.algorithms.ListCell} + */ + push(o:Object):yfiles.algorithms.ListCell; + /** + * Removes the given object from this list. + *

+ * Only the first element for which equality to o holds gets removed. + *

+ * @param {Object} o + * @returns {boolean} + */ + remove(o:Object):boolean; + /** + * Removes the given collection of objects from this list. + * @param {yfiles.collections.ICollection.} collection + * @returns {boolean} Whether there have been elements removed. + */ + removeAll(collection:yfiles.collections.ICollection):boolean; + /** + * + * @param {number} index + */ + removeAt(index:number):void; + /** + * Removes the element pointed to by the given YCursor object. + * @param {yfiles.algorithms.ICursor} c + * @returns {Object} The removed element. + */ + removeAtCursor(c:yfiles.algorithms.ICursor):Object; + /** + * Removes the given list cell, and hence the element stored in it, from this list. + * @param {yfiles.algorithms.ListCell} c + * @returns {Object} The element that is stored in the removed cell. + */ + removeCell(c:yfiles.algorithms.ListCell):Object; + /** + * Retains only those elements in this list which are contained in the given collection. + * @param {yfiles.collections.ICollection.} collection + * @returns {boolean} Whether there have been elements removed. + */ + retainAll(collection:yfiles.collections.ICollection):boolean; + /** + * Reverses the sequence of elements in this list. + */ + reverse():void; + /** + * Sets the element at the specified index. + * @param {number} index The zero-based index of the element to get or set. + * @param value The element at the specified index. + * @see yfiles.algorithms.YList#get + */ + set(index:number,value:Object):void; + /** + * Updates the element stored in the given list cell with the given object. + * @param {yfiles.algorithms.ListCell} c + * @param {Object} value + */ + setInfo(c:yfiles.algorithms.ListCell,value:Object):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. + *

+ * @param {yfiles.collections.IComparer.} comparer + */ + sort(comparer:yfiles.collections.IComparer):void; + /** + * Sorts the elements in this list into ascending order, according to their natural ordering. + *

+ * All elements must implement the {@link yfiles.lang.IComparable} 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. + *

+ */ + 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. + *

+ * @param {yfiles.algorithms.YList} list + */ + splice(list:yfiles.algorithms.YList):void; + /** + * + * @param {number} fromIndex + * @param {number} toIndex + * @returns {yfiles.collections.IList.} + */ + subList(fromIndex:number,toIndex:number):yfiles.collections.IList; + /** + * Returns the successor cell of the given list cell. + * @param {yfiles.algorithms.ListCell} c + * @returns {yfiles.algorithms.ListCell} + */ + succCell(c:yfiles.algorithms.ListCell):yfiles.algorithms.ListCell; + /** + * Returns an array representation of this list. + * @returns {Array.} + */ + toArray():Object[]; + /** + * Gets the number of elements in this list. + * @type {number} + */ + size:number; + /** + * Gets the first element of this list. + * @type {Object} + */ + firstObject:Object; + /** + * Gets the last element of this list. + * @type {Object} + */ + lastObject:Object; + /** + * Gets the first cell of this list. + * @type {yfiles.algorithms.ListCell} + */ + firstCell:yfiles.algorithms.ListCell; + /** + * Gets the last cell of this list. + * @type {yfiles.algorithms.ListCell} + */ + lastCell:yfiles.algorithms.ListCell; + static $class:yfiles.lang.Class; + } + /** + * This class represents a line in the 2D-dimensional affine space. + *

+ * The line is defined by the equation ax + by + c = 0 + *

+ * @class yfiles.algorithms.AffineLine + */ + export interface AffineLine extends Object{} + export class AffineLine { + /** + * Creates an affine line which is defined by two points. + * @param {yfiles.algorithms.YPoint} p1 + * @param {yfiles.algorithms.YPoint} p2 + * @constructor + */ + constructor(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint); + /** + * Creates an affine line which is defined by a point and a vector. + * @param {yfiles.algorithms.YPoint} p1 + * @param {yfiles.algorithms.YVector} v + * @constructor + */ + constructor(p1:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector); + /** + * Returns the crossing of two lines. + *

+ * If the lines are parallel, null is returned. + *

+ * @param {yfiles.algorithms.AffineLine} l1 + * @param {yfiles.algorithms.AffineLine} l2 + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static getCrossing(l1:yfiles.algorithms.AffineLine,l2:yfiles.algorithms.AffineLine):yfiles.algorithms.YPoint; + /** + * Projects an point on the line in direction of the X-axis. + * @param {yfiles.algorithms.YPoint} p + * @returns {yfiles.algorithms.YPoint} + */ + getXProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Projects an point on the line in direction of the Y-axis. + * @param {yfiles.algorithms.YPoint} p + * @returns {yfiles.algorithms.YPoint} + */ + getYProjection(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Gets a from ax+by+c = 0 + * @type {number} + */ + a:number; + /** + * Gets b from ax+by+c = 0 + * @type {number} + */ + b:number; + /** + * Gets c from ax+by+c = 0 + * @type {number} + */ + c:number; + static $class:yfiles.lang.Class; + } + /** + * The handle of a segment of a borderline. + * @class yfiles.algorithms.BorderLineSegment + */ + export interface BorderLineSegment extends Object{} + export class BorderLineSegment { + /** + * 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. + * @returns {number} the segment's value at the given position. + */ + getValueAt(position:number):number; + /** + * Returns the next segment or null if there is no such segment. + * @returns {yfiles.algorithms.BorderLineSegment} + */ + next():yfiles.algorithms.BorderLineSegment; + /** + * Returns the previous segment or null if there is no such segment. + * @returns {yfiles.algorithms.BorderLineSegment} + */ + prev():yfiles.algorithms.BorderLineSegment; + /** + * Gets the end of this segment. + * @type {number} + */ + end:number; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.algorithms.BorderLine + */ + export interface BorderLine extends Object{} + export class 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 + * @constructor + */ + constructor(min:number,max:number,valueAtMin:number,valueAtMax:number); + /** + * 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 + * @constructor + */ + constructor(min:number,max:number,value:number); + /** + * Creates a new BorderLine with the given value from -Double.MAX_VALUE to Double.MAX_VALUE. + * @param {number} value the value of the segment + * @constructor + */ + constructor(value:number); + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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 + * @returns {yfiles.algorithms.BorderLine} the copy of the borderline + */ + createCopy(negateValues:boolean,negateOffsets:boolean):yfiles.algorithms.BorderLine; + /** + * 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 + * @returns {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 + * @returns {yfiles.algorithms.BorderLine} a new borderline that is the result of the merge + */ + createMin(other:yfiles.algorithms.BorderLine):yfiles.algorithms.BorderLine; + /** + * Returns the first segment or null if there is no such segment. + * @returns {yfiles.algorithms.BorderLineSegment} + */ + firstSegment():yfiles.algorithms.BorderLineSegment; + /** + * Calculates the minimal distance between this borderline and the other one. + *

+ * The other one is treated as if the values were all greater. + *

+ * @param {yfiles.algorithms.BorderLine} greater + * @returns {number} + */ + getDistanceTo(greater:yfiles.algorithms.BorderLine):number; + /** + * Returns the maximum position of the given segment. + * @param {yfiles.algorithms.BorderLineSegment} s the segment + * @returns {number} + */ + getMax(s:yfiles.algorithms.BorderLineSegment):number; + /** + * Calculates the maximum value in the interval from->to. + * @param {number} from + * @param {number} to + * @returns {number} + */ + getMaxValue(from:number,to:number):number; + /** + * Returns the minimum position of the given segment. + * @param {yfiles.algorithms.BorderLineSegment} s the segment + * @returns {number} + */ + getMin(s:yfiles.algorithms.BorderLineSegment):number; + /** + * Calculates the minimum value in the interval from->to. + * @param {number} from + * @param {number} to + * @returns {number} + */ + getMinValue(from:number,to:number):number; + /** + * Returns the segment at the given position. + * @param {number} pos the position + * @returns {yfiles.algorithms.BorderLineSegment} + */ + getSegmentAt(pos:number):yfiles.algorithms.BorderLineSegment; + /** + * Returns the slope of the given segment. + * @param {yfiles.algorithms.BorderLineSegment} s the segment + * @returns {number} + */ + getSlope(s:yfiles.algorithms.BorderLineSegment):number; + /** + * 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.BorderLineSegment} s the segment + * @returns {number} + */ + getValue(s:yfiles.algorithms.BorderLineSegment):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.BorderLineSegment} segment The segment whose value shall be returned. + * @param {number} pos the position where the value will be retrieved. + * @returns {number} the value + * @throws {Stubs.Exceptions.ArgumentError} if pos is outside the segment's range. + */ + getValueAt(segment:yfiles.algorithms.BorderLineSegment,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 + * @returns {number} the value + * @throws {Stubs.Exceptions.ArgumentError} if pos is outside the segment's range that is stored in cell. + */ + getValueAt(cell:yfiles.algorithms.ListCell,pos:number):number; + /** + * Returns the value that is set on this borderline at the specified position. + * @param {number} pos the position + * @returns {number} the value + * @throws {Stubs.Exceptions.IndexOutOfRangeError} if the position is outside of the borderline. + */ + getValueAt(pos:number):number; + /** + * Grows this BorderLine horizontally, so that the {@link yfiles.algorithms.BorderLine#getValueAt 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; + /** + * Returns the last segment or null if there is no such segment. + * @returns {yfiles.algorithms.BorderLineSegment} + */ + lastSegment():yfiles.algorithms.BorderLineSegment; + /** + * 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 next segment or null if there is no such segment. + * @param {yfiles.algorithms.BorderLineSegment} s + * @returns {yfiles.algorithms.BorderLineSegment} + */ + next(s:yfiles.algorithms.BorderLineSegment):yfiles.algorithms.BorderLineSegment; + /** + * Returns the previous segment or null if there is no such segment. + * @param {yfiles.algorithms.BorderLineSegment} s + * @returns {yfiles.algorithms.BorderLineSegment} + */ + prev(s:yfiles.algorithms.BorderLineSegment):yfiles.algorithms.BorderLineSegment; + /** + * 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; + /** + * 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; + /** + * 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 {Stubs.Exceptions.ArgumentError} if min is greater than max. + */ + setSloped(min:number,max:number,value:number,slope:number):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; + /** + * Gets the smallest position of this borderline + * @type {number} + */ + min:number; + /** + * Gets the greatest position of this borderline + * @type {number} + */ + max:number; + /** + * Gets the minimum value that is set on this borderline + * @type {number} + */ + minValue:number; + /** + * Gets the maximum value that is set on this borderline + * @type {number} + */ + maxValue:number; + static $class:yfiles.lang.Class; + } + /** + * This class provides useful geometric primitives and advanced geometric algorithms. + * @class yfiles.algorithms.Geom + * @static + */ + export interface Geom extends Object{} + export class Geom { + /** + * Calculates the convex hull for a set of points. + * @param {yfiles.algorithms.YList} points a list of {@link yfiles.algorithms.YPoint} objects + * @returns {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. + * @static + */ + static calcConvexHull(points:yfiles.algorithms.YList):yfiles.algorithms.YList; + /** + * 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. + * @returns {yfiles.algorithms.YPoint} the intersection point of the specified lines or null if there is no intersection. + * @static + */ + static calcIntersection(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 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. + * @returns {yfiles.algorithms.YPoint} the intersection point of the specified lines or null if there is no intersection. + * @static + */ + static calcIntersection(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 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. + * @returns {yfiles.algorithms.YPoint} the intersection point of the specified lines or null if there is no intersection. + * @static + */ + static calcIntersection(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):yfiles.algorithms.YPoint; + /** + * 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 + * @returns {yfiles.algorithms.Rectangle2D} + * @static + */ + static calcIntersection(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * 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 + * @returns {yfiles.algorithms.Rectangle2D} + * @static + */ + static calcUnion(r1:yfiles.algorithms.Rectangle2D,r2:yfiles.algorithms.Rectangle2D,dest:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * 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} + *

+ * @param {yfiles.algorithms.YPoint} p + * @param {yfiles.algorithms.YPoint} q + * @param {yfiles.algorithms.YPoint} r + * @returns {boolean} + * @static + */ + static collinear(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; + /** + * 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 + * @returns {number} + * @static + */ + static distanceToLineSegment(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):number; + /** + * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) > 0} + * @param {yfiles.algorithms.YPoint} p + * @param {yfiles.algorithms.YPoint} q + * @param {yfiles.algorithms.YPoint} r + * @returns {boolean} + * @static + */ + static leftTurn(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):boolean; + /** + * Returns whether the two lines defined by the given coordinates intersect or not. + * @param {number} x1 + * @param {number} y1 + * @param {number} x2 + * @param {number} y2 + * @param {number} x3 + * @param {number} y3 + * @param {number} x4 + * @param {number} y4 + * @returns {boolean} + * @static + */ + static linesIntersect(x1:number,y1:number,x2:number,y2:number,x3:number,y3:number,x4:number,y4:number):boolean; + /** + * Same as {@link yfiles.algorithms.Geom#orientation} with double values as arguments. + * @param {number} px + * @param {number} py + * @param {number} qx + * @param {number} qy + * @param {number} rx + * @param {number} ry + * @returns {number} + * @static + */ + static orientation(px:number,py:number,qx:number,qy:number,rx:number,ry:number):number; + /** + * 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. + *

+ * @param {yfiles.algorithms.YPoint} p + * @param {yfiles.algorithms.YPoint} q + * @param {yfiles.algorithms.YPoint} r + * @returns {number} +1 in the case of positive orientation, -1 in the case of negative orientation and 0 in the case of zero orientation. + * @static + */ + static orientation(p:yfiles.algorithms.YPoint,q:yfiles.algorithms.YPoint,r:yfiles.algorithms.YPoint):number; + /** + * 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 + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static projection(pointX:number,pointY:number,lineX1:number,lineY1:number,lineX2:number,lineY2:number):yfiles.algorithms.YPoint; + /** + * Same as {@link yfiles.algorithms.Geom#orientation orientation(p,q,r) < 0} + * @param {yfiles.algorithms.YPoint} p + * @param {yfiles.algorithms.YPoint} q + * @param {yfiles.algorithms.YPoint} r + * @returns {boolean} + * @static + */ + static rightTurn(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. + * @param {yfiles.algorithms.YPoint} a + * @param {yfiles.algorithms.YPoint} b + * @param {yfiles.algorithms.YPoint} c + * @param {yfiles.algorithms.YPoint} d + * @returns {number} + * @static + */ + static sideOfCircle(a:yfiles.algorithms.YPoint,b:yfiles.algorithms.YPoint,c:yfiles.algorithms.YPoint,d:yfiles.algorithms.YPoint):number; + /** + * Converts the given degree value from radian to angular + * @param {number} angrad + * @returns {number} + * @static + */ + static toDegrees(angrad:number):number; + /** + * Converts the given degree value from angular to radian. + * @param {number} angdeg + * @returns {number} + * @static + */ + static toRadians(angdeg:number):number; + static $class:yfiles.lang.Class; + } + /** + * This is an interface for a sequence of instances of LineSegment. + * @interface + * @implements {yfiles.algorithms.ICursor} + */ + export interface ILineSegmentCursor extends Object,yfiles.algorithms.ICursor{ + /** + * Gets the instance of LineSegment the cursor is currently pointing on. + * @abstract + * @type {yfiles.algorithms.LineSegment} + */ + lineSegment:yfiles.algorithms.LineSegment; + } + var ILineSegmentCursor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Double-precision immutable insets representation. + * @class yfiles.algorithms.Insets + * @implements {yfiles.lang.ICloneable} + */ + export interface Insets extends Object,yfiles.lang.ICloneable{} + export class Insets { + /** + * 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 + * @constructor + */ + constructor(top:number,left:number,bottom:number,right:number); + /** + * + * @returns {Object} + */ + clone():Object; + /** + * Creates a {@link yfiles.geometry.Insets} from a given {@link yfiles.algorithms.Insets}. + * @returns {yfiles.geometry.Insets} The {@link yfiles.geometry.Insets}. + */ + toInsets():yfiles.geometry.Insets; + /** + * The inset from the top. + * @const + * @type {number} + */ + top:number; + /** + * The inset from the left. + * @const + * @type {number} + */ + left:number; + /** + * The inset from the bottom. + * @const + * @type {number} + */ + bottom:number; + /** + * The inset from the right. + * @const + * @type {number} + */ + right:number; + static $class:yfiles.lang.Class; + } + /** + * An instance of this interface handles intersections found by the IntersectionAlgorithm, + * @interface + */ + export interface IIntersectionHandler extends Object{ + /** + * This method is called at every intersection. + * @param {Object} a + * @param {Object} b + * @abstract + */ + checkIntersection(a:Object,b:Object):void; + } + var IIntersectionHandler:{ + $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. + *

+ * @class yfiles.algorithms.IntersectionAlgorithm + * @static + */ + export interface IntersectionAlgorithm extends Object{} + export class IntersectionAlgorithm { + /** + * 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.IIntersectionHandler} iHandler intersections are reported to this class. + * @static + */ + static intersect(objects:yfiles.algorithms.YList,iHandler:yfiles.algorithms.IIntersectionHandler):void; + static $class:yfiles.lang.Class; + } + /** + * This interface describes a 2-dimensional object which has a finite bounding box. + * @interface + */ + export interface IPlaneObject extends Object{ + /** + * Gets the smallest Rectangle which contains the object. + * @abstract + * @type {yfiles.algorithms.YRectangle} + */ + 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. + * @interface + * @implements {yfiles.algorithms.ICursor} + */ + export interface IPointCursor extends Object,yfiles.algorithms.ICursor{ + /** + * Gets the instance of YPoint the cursor is currently pointing on. + * @abstract + * @type {yfiles.algorithms.YPoint} + */ + 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. + *

+ * @class yfiles.algorithms.LineSegment + * @implements {yfiles.algorithms.IPlaneObject} + */ + export interface LineSegment extends Object,yfiles.algorithms.IPlaneObject{} + export class LineSegment { + /** + * 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. + * @constructor + */ + constructor(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint); + /** + * Checks whether a line segment intersects a paraxial box. + *

+ * Implemented using the Cohen-Sutherland algorithm. + *

+ * @param {number} boxX1 x-coordinate of the upper left corner of the box + * @param {number} boxY1 y-coordinate of the upper left corner of the box + * @param {number} boxX2 x-coordinate of the lower right corner of the box + * @param {number} boxY2 y-coordinate of the lower right corner of the box + * @param {number} sX1 x-coordinate of the first end point of the line segment + * @param {number} sY1 y-coordinate of the first end point of the line segment + * @param {number} sX2 x-coordinate of the second end point of the line segment + * @param {number} sY2 y-coordinate of the second end point of the line segment + * @returns {boolean} true if the line segment intersects the box, false otherwise. + * @static + */ + static boxIntersectsSegment(boxX1:number,boxY1:number,boxX2:number,boxY2:number,sX1:number,sY1:number,sX2:number,sY2:number):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 the first end point of the line segment + * @param {number} y1 y-coordinate of the first end point of the line segment + * @param {number} x2 x-coordinate of the second end point of the line segment + * @param {number} y2 y-coordinate of the second end point of the line segment + * @returns {boolean} true if the line segment intersects the box, false otherwise. + * @static + */ + static boxIntersectsSegment(box:yfiles.algorithms.YRectangle,x1:number,y1:number,x2:number,y2:number):boolean; + /** + * 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. + * @returns {boolean} true if the line segments intersects the box, false otherwise. + * @static + */ + static boxIntersectsSegment(box:yfiles.algorithms.YRectangle,s:yfiles.algorithms.YPoint,t:yfiles.algorithms.YPoint):boolean; + /** + * Checks whether a given point lies on this line segment. + * @param {yfiles.algorithms.YPoint} point an arbitrary point. + * @returns {boolean} true if the line segments intersects the box, false otherwise. + */ + contains(point:yfiles.algorithms.YPoint):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 + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static getIntersection(s1:yfiles.algorithms.LineSegment,s2:yfiles.algorithms.LineSegment):yfiles.algorithms.YPoint; + /** + * Checks whether the line segment intersects a point. + * @param {yfiles.algorithms.YPoint} p a point + * @returns {boolean} true if the line segments intersects the given point, false otherwise. + */ + intersects(p:yfiles.algorithms.YPoint):boolean; + /** + * Checks whether the line segment intersects a box. + * @param {yfiles.algorithms.YRectangle} box A rectangle. + * @returns {boolean} true if the line segments intersects the box, false otherwise. + */ + intersects(box:yfiles.algorithms.YRectangle):boolean; + /** + * Determines if the given points define a horizontal line segment. + *

+ * This methods allows for y-coordinate differences of up to 1e-8. + *

+ * @param {yfiles.algorithms.YPoint} p1 + * @param {yfiles.algorithms.YPoint} p2 + * @returns {boolean} true if the given points define a horizontal line segment; false otherwise. + * @static + */ + static isHorizontalSegment(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):boolean; + /** + * Returns if the projection on the X axis of the line segment covers a certain point on the X Axis. + * @param {number} x + * @returns {boolean} + */ + isInXIntervall(x:number):boolean; + /** + * Returns if the projection on the Y axis of the line segment covers a certain point on the Y Axis. + * @param {number} y + * @returns {boolean} + */ + isInYIntervall(y:number):boolean; + /** + * Determines if the given points define a vertical line segment. + *

+ * This methods allows for x-coordinate differences of up to 1e-8. + *

+ * @param {yfiles.algorithms.YPoint} p1 + * @param {yfiles.algorithms.YPoint} p2 + * @returns {boolean} true if the given points define a vertical line segment; false otherwise. + * @static + */ + static isVerticalSegment(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):boolean; + /** + * Returns the length of the line segment, this is the value of the Euclidean norm. + * @returns {number} an value > 0. + */ + length():number; + /** + * Returns the affine line defined by the end points of the line segment. + * @returns {yfiles.algorithms.AffineLine} + */ + toAffineLine():yfiles.algorithms.AffineLine; + /** + * Returns the vector pointing from the first end point to the second end point of the line segment. + * @returns {yfiles.algorithms.YVector} + */ + toYVector():yfiles.algorithms.YVector; + /** + * Gets if this segment is considered vertical, i.e. + *

+ * the x values of the end point differ less then 0.00000001 + *

+ * @type {boolean} + */ + isVertical:boolean; + /** + * Gets if the interval is horizontal. + * @type {boolean} + */ + isHorizontal:boolean; + /** + * Gets the first end point of the line segment. + * @type {yfiles.algorithms.YPoint} + */ + firstEndPoint:yfiles.algorithms.YPoint; + /** + * Gets the second end point of the line segment. + * @type {yfiles.algorithms.YPoint} + */ + secondEndPoint:yfiles.algorithms.YPoint; + /** + * Gets the y value of the line on x coordinate 0. + * @type {number} + */ + xOffset:number; + /** + * Gets the slope of the line segment. + * @type {number} + */ + slope:number; + /** + * Gets the smallest Rectangle which contains the object. + * @type {yfiles.algorithms.YRectangle} + */ + boundingBox:yfiles.algorithms.YRectangle; + /** + * Gets the distance from start to end point in x-coordinates. + * @type {number} + */ + deltaX:number; + /** + * Gets the distance from start to end point in y-coordinates. + * @type {number} + */ + deltaY:number; + static $class:yfiles.lang.Class; + } + /** + * Represents a two-dimensional point located at (x, y). + * @class yfiles.algorithms.Point2D + * @implements {yfiles.lang.ICloneable} + */ + export interface Point2D extends Object,yfiles.lang.ICloneable{} + export class Point2D { + /** + * 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 + * @constructor + */ + constructor(x:number,y:number); + /** + * Creates a new instance that is located at (0, 0) + * @constructor + */ + constructor(); + /** + * Creates a new instance of this class that has the same values as this objects. + * @returns {Object} a new instance of this class that has the same values as this objects. + */ + clone():Object; + /** + * 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. + * @returns {number} the distance between this points and another one, given as its coordinates. + */ + distance(px:number,py:number):number; + /** + * Calculates the distance between this points and another one. + * @param {yfiles.algorithms.Point2D} p The second point. + * @returns {number} the distance between this points and another one. + */ + distance(p:yfiles.algorithms.Point2D):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. + * @returns {number} the distance between two points, given as their coordinates. + * @static + */ + static distance(x1:number,y1:number,x2:number,y2:number):number; + /** + * 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. + * @returns {number} the squared distance between this points and another one, given as its coordinates. + */ + distanceSq(px:number,py:number):number; + /** + * Calculates the squared distance between this points and another one. + * @param {yfiles.algorithms.Point2D} p The second point. + * @returns {number} the squared distance between this points and another one. + */ + distanceSq(p:yfiles.algorithms.Point2D):number; + /** + * 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. + * @returns {number} the squared distance between two points, given as their coordinates. + * @static + */ + static distanceSq(x1:number,y1:number,x2:number,y2:number):number; + /** + * 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; + /** + * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.Point2D}. + * @returns {yfiles.geometry.Point} The {@link yfiles.geometry.Point}. + */ + toPoint():yfiles.geometry.Point; + /** + * Sets the location of this point to the same values as for the given point. + * @type {yfiles.algorithms.Point2D} + */ + location:yfiles.algorithms.Point2D; + /** + * Gets the x coordinate of this point. + * @type {number} + */ + x:number; + /** + * Gets the y coordinate of this point. + * @type {number} + */ + y:number; + static $class:yfiles.lang.Class; + } + /** + * Represents a two-dimensional rectangle of size (width x height), located at the point (x, y). + * @class yfiles.algorithms.Rectangle2D + * @implements {yfiles.lang.ICloneable} + */ + export interface Rectangle2D extends Object,yfiles.lang.ICloneable{} + export class Rectangle2D { + /** + * 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. + * @constructor + */ + constructor(x:number,y:number,width:number,height:number); + /** + * Creates a new rectangle of size (0 x 0) at the location (0, 0). + * @constructor + */ + constructor(); + /** + * 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#contains} 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 + */ + add(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; + /** + * Creates a new instance of this class that has the same values as this objects. + * @returns {Object} a new instance of this class that has the same values as this objects. + */ + clone():Object; + /** + * 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. + * @returns {boolean} true if this rectangle contains the second one + */ + contains(x:number,y:number,width:number,height: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. + * @returns {boolean} true if the specified point is contained in this rectangle; false otherwise. + */ + contains(x:number,y:number):boolean; + /** + * Checks whether this rectangle completely contains the second specified rectangle. + * @param {yfiles.algorithms.Rectangle2D} rect the rectangle to check for containment + * @returns {boolean} true if this rectangle contains the second one + */ + contains(rect:yfiles.algorithms.Rectangle2D):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. + * @returns {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. + * @returns {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated union. + */ + createUnion(r:yfiles.algorithms.Rectangle2D):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. + * @static + */ + static intersect(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; + /** + * 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. + * @returns {boolean} true if both rectangles intersect + */ + intersects(x:number,y:number,width:number,height:number):boolean; + /** + * Checks whether this rectangle and the second specified rectangle intersect. + * @param {yfiles.algorithms.Rectangle2D} rect the rectangle to check for intersection + * @returns {boolean} true if both rectangles intersect + */ + intersects(rect:yfiles.algorithms.Rectangle2D):boolean; + /** + * 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. + * @returns {boolean} true if the specified line intersects this rectangle; false otherwise. + */ + intersectsLine(x1:number,y1:number,x2:number,y2:number):boolean; + /** + * 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; + /** + * 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. + */ + setFrameFromCenter(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 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. + */ + setFrameFromDiagonal(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 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; + /** + * Creates a {@link yfiles.geometry.Rect} from a given {@link yfiles.algorithms.Rectangle2D}. + * @returns {yfiles.geometry.Rect} The {@link yfiles.geometry.Rect}. + */ + toRect():yfiles.geometry.Rect; + /** + * 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. + * @static + */ + static union(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; + /** + * Gets or sets the outer bounds of this rectangle in double coordinates. + * @type {yfiles.algorithms.Rectangle2D} + */ + frame:yfiles.algorithms.Rectangle2D; + /** + * Sets the location and size of this rectangle to be similar to the specified rectangle. + * @type {yfiles.algorithms.Rectangle2D} + */ + rect:yfiles.algorithms.Rectangle2D; + /** + * Gets the x coordinate of the upper left corner. + * @type {number} + */ + x:number; + /** + * Gets the y coordinate of the upper left corner. + * @type {number} + */ + y:number; + /** + * Gets the width of this rectangle. + * @type {number} + */ + width:number; + /** + * Gets the height of this rectangle. + * @type {number} + */ + height:number; + /** + * Gets whether this instance is empty, i.e. + *

+ * covers no area. + *

+ * @type {boolean} + */ + empty:boolean; + /** + * Gets the smallest x coordinate of this rectangle. + * @type {number} + */ + minX:number; + /** + * Gets the smallest y coordinate of this rectangle. + * @type {number} + */ + minY:number; + /** + * Gets the largest x coordinate of this rectangle. + * @type {number} + */ + maxX:number; + /** + * Gets the largest y coordinate of this rectangle. + * @type {number} + */ + maxY:number; + /** + * Gets the x coordinate of the center point of this rectangle. + * @type {number} + */ + centerX:number; + /** + * Gets the y coordinate of the center point of this rectangle. + * @type {number} + */ + centerY:number; + /** + * Gets the bounds of this instance in double precision. + * @type {yfiles.algorithms.Rectangle2D} + */ + bounds2D:yfiles.algorithms.Rectangle2D; + static $class:yfiles.lang.Class; + } + /** + * This class provides algorithms for the triangulation of point sets in the plane. + * @class yfiles.algorithms.Triangulator + * @static + */ + export interface Triangulator extends Object{} + export class Triangulator { + /** + * 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. + * @returns {yfiles.algorithms.Edge} an edge on the outer face of the result graph. + * @static + */ + static calcDelauneyTriangulation(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,revMap: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. + * @returns {yfiles.algorithms.Edge} an edge on the outer face of the result graph. + * @static + */ + static triangulatePoints(points:yfiles.algorithms.YList,result:yfiles.algorithms.Graph,resultMap:yfiles.algorithms.INodeMap,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.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. + * @returns {yfiles.algorithms.Edge} an edge on the outer face of the result graph. + * @static + */ + static triangulatePoints(result:yfiles.algorithms.Graph,pointData:yfiles.algorithms.IDataProvider,reverseEdgeMap:yfiles.algorithms.IEdgeMap):yfiles.algorithms.Edge; + static $class:yfiles.lang.Class; + } + /** + * This class represents the size of an object. + *

+ * An instance of this class implements the immutable design pattern. + *

+ * @class yfiles.algorithms.YDimension + * @implements {yfiles.lang.IComparable} + */ + export interface YDimension extends Object,yfiles.lang.IComparable{} + export class YDimension { + /** + * Creates a new YDimension2D object for given size. + * @param {number} width + * @param {number} height + * @constructor + */ + constructor(width:number,height:number); + /** + * + * @param {Object} o + * @returns {number} + */ + compareTo(o:Object):number; + /** + * Creates a {@link yfiles.geometry.Size} from a given {@link yfiles.algorithms.YDimension}. + * @returns {yfiles.geometry.Size} The {@link yfiles.geometry.Size}. + */ + toSize():yfiles.geometry.Size; + /** + * Gets the width of the dimension object. + * @type {number} + */ + width:number; + /** + * Gets the height of the dimension object. + * @type {number} + */ + height:number; + static $class:yfiles.lang.Class; + } + /** + * 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). + *

+ * @class yfiles.algorithms.YOrientedRectangle + * @implements {yfiles.algorithms.IPlaneObject} + */ + export interface YOrientedRectangle extends Object,yfiles.algorithms.IPlaneObject{} + export class 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. + * @constructor + */ + constructor(rect:yfiles.algorithms.YOrientedRectangle); + /** + * 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. + * @constructor + */ + constructor(rect:yfiles.algorithms.YRectangle); + /** + * 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. + * @constructor + */ + constructor(anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number); + /** + * 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. + * @constructor + */ + constructor(anchorX:number,anchorY:number,width:number,height:number); + /** + * 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. + * @constructor + */ + constructor(position:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,upVector:yfiles.algorithms.YVector); + /** + * 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. + * @constructor + */ + constructor(anchor:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension); + /** + * 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; + /** + * Determines the four corner points of an oriented rectangle. + * @param {yfiles.algorithms.YOrientedRectangle} rect The rectangle to determine the bounds. + * @returns {Array.} the array of corner points. + * @static + */ + static calcPoints(rect:yfiles.algorithms.YOrientedRectangle):yfiles.algorithms.YPoint[]; + /** + * Determines the coordinates of the four corners of an oriented rectangle. + * @param {yfiles.algorithms.YOrientedRectangle} rect The rectangle to determine the bounds. + * @returns {Array.} the array of coordinates of the corner points in which each even index has the x-coordinate and each odd index the + * y-coordinate + * @static + */ + static calcPointsInDouble(rect:yfiles.algorithms.YOrientedRectangle):number[]; + /** + * 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=false] if true, all points on the border of the rectangle are considered to be contained. + * @returns {boolean} true iff the specified point lies inside; false otherwise. + */ + contains(x:number,y:number,closed?:boolean):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. + * @returns {boolean} true iff the r1 contains r2. + * @static + */ + static contains(r1:yfiles.algorithms.YOrientedRectangle,r2:yfiles.algorithms.YOrientedRectangle,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. + * @returns {boolean} true if the point lies inside the rectangle; false otherwise. + * @static + */ + static contains(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. + * @returns {boolean} true if the point lies inside the rectangle; false otherwise. + * @static + */ + static contains(rect:yfiles.algorithms.YOrientedRectangle,x:number,y:number,eps:number):boolean; + /** + * 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. + * @returns {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. + * @returns {yfiles.algorithms.YOrientedRectangle} a new OrientedRectangle instance that has the specified width and height. + */ + getResizedInstance(width:number,height:number):yfiles.algorithms.YOrientedRectangle; + /** + * 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. + *

+ * @param {yfiles.algorithms.YOrientedRectangle} rect + * @param {yfiles.algorithms.LineSegment} line + * @param {number} eps + * @returns {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. + * @static + */ + static intersectionPoint(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):yfiles.algorithms.YPoint; + /** + * Determines whether or not the specified oriented rectangle and the specified line segment intersect. + * @param {yfiles.algorithms.YOrientedRectangle} rect + * @param {yfiles.algorithms.LineSegment} line + * @param {number} eps + * @returns {boolean} true if the rectangle and the segment intersect and false otherwise. + * @static + */ + static intersects(rect:yfiles.algorithms.YOrientedRectangle,line:yfiles.algorithms.LineSegment,eps:number):boolean; + /** + * 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. + * @returns {boolean} Whether they have a non-empty intersection. + * @static + */ + static intersects(orientedRectangle:yfiles.algorithms.YOrientedRectangle,rectangle:yfiles.algorithms.YRectangle,eps:number):boolean; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * Sets the size of this rectangle. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setSize(width:number,height:number):void; + /** + * 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; + /** + * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} from a given {@link yfiles.algorithms.YOrientedRectangle}. + * @returns {yfiles.geometry.IOrientedRectangle} The {@link yfiles.geometry.IOrientedRectangle}. + */ + toImmutableOrientedRectangle():yfiles.geometry.IOrientedRectangle; + /** + * Gets whether this instance has negative width or height. + * @type {boolean} + */ + empty:boolean; + /** + * Gets or sets the anchor of this oriented rectangle. + * @type {yfiles.algorithms.YPoint} + */ + anchor:yfiles.algorithms.YPoint; + /** + * Gets the x-coordinate of this rectangle's anchor point. + * @type {number} + */ + anchorX:number; + /** + * Gets the y-coordinate of this rectangle's anchor point. + * @type {number} + */ + anchorY:number; + /** + * Gets or sets the size of this rectangle. + * @type {yfiles.algorithms.YDimension} + */ + size:yfiles.algorithms.YDimension; + /** + * Gets the width of this rectangle. + * @type {number} + */ + width:number; + /** + * Gets the height of this rectangle. + * @type {number} + */ + height:number; + /** + * Gets the x-component of this rectangle's up vector. + * @type {number} + */ + upX:number; + /** + * Gets the y-component of this rectangle's up vector. + * @type {number} + */ + upY:number; + /** + * Gets or sets 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). + *

+ * @type {number} + */ + angle:number; + /** + * Gets or sets the current center of the oriented rectangle. + * @type {yfiles.algorithms.YPoint} + */ + center:yfiles.algorithms.YPoint; + /** + * Calculates the paraxial bounding box of this oriented rectangle. + * @type {yfiles.algorithms.YRectangle} + */ + boundingBox:yfiles.algorithms.YRectangle; + static $class:yfiles.lang.Class; + } + /** + * This class represents a point in the plane with double coordinates. + *

+ * This class implements the immutable design pattern. + *

+ * @class yfiles.algorithms.YPoint + * @implements {yfiles.lang.IComparable} + * @final + */ + export interface YPoint extends Object,yfiles.lang.IComparable{} + export class 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. + * @constructor + */ + constructor(x:number,y:number); + /** + * Creates a new YPoint at location (0,0) + * @constructor + */ + constructor(); + /** + * 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. + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static add(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * 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. + *

+ * @param {Object} o + * @returns {number} + */ + compareTo(o:Object):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 + * @returns {number} the euclidean distance between first and second point + * @static + */ + static distance(x1:number,y1:number,x2:number,y2:number):number; + /** + * Returns the euclidean distance between two points. + * @param {yfiles.algorithms.YPoint} p1 an arbitrary point + * @param {yfiles.algorithms.YPoint} p2 an arbitrary point + * @returns {number} the Euclidean distance between p1 and p2. + * @static + */ + static distance(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):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 + * @returns {number} the Euclidean distance between this point and the point (x,y). + */ + distanceTo(x:number,y:number):number; + /** + * Returns the euclidean distance between this point and a given point. + * @param {yfiles.algorithms.YPoint} p an arbitrary point + * @returns {number} the Euclidean distance between this point and p. + */ + distanceTo(p:yfiles.algorithms.YPoint):number; + /** + * 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. + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static midPoint(p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * 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. + * @returns {yfiles.algorithms.YPoint} a new instance of YPoint which is the result of the moving operation. + */ + moveBy(x:number,y:number):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. + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static subtract(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. + * @returns {yfiles.algorithms.YPoint} + * @static + */ + static swap(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.YPoint}. + * @returns {yfiles.geometry.Point} The {@link yfiles.geometry.Point}. + */ + toPoint():yfiles.geometry.Point; + /** + * A YPoint constant with coordinates (0,0). + * @const + * @static + * @type {yfiles.algorithms.YPoint} + */ + static ORIGIN:yfiles.algorithms.YPoint; + /** + * Gets the x-coordinate of the point object. + * @type {number} + */ + x:number; + /** + * Gets the y-coordinate of the point object. + * @type {number} + */ + y:number; + static $class:yfiles.lang.Class; + } + /** + * This class represents an ordered list of points in the plane. + * @class yfiles.algorithms.YPointPath + * @final + */ + export interface YPointPath extends Object{} + export class YPointPath { + /** + * Creates a new path from an array of points. + * @param {Array.} path + * @constructor + */ + constructor(path:yfiles.algorithms.YPoint[]); + /** + * Creates a new path from a list of points. + * @param {yfiles.collections.IList.} l a list of {@link yfiles.algorithms.YPoint} instances. + * @constructor + */ + constructor(l:yfiles.collections.IList); + /** + * Creates a new empty path. + * @constructor + */ + constructor(); + /** + * 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. + *

+ * @returns {number} the (geometric) length of the path + */ + calculateLength():number; + /** + * Create a point path with reverse ordering of the points. + * @returns {yfiles.algorithms.YPointPath} + */ + createReverse():yfiles.algorithms.YPointPath; + /** + * Get the points in the path. + * @returns {yfiles.algorithms.ICursor} + */ + cursor():yfiles.algorithms.ICursor; + /** + * Returns a line segment in the path. + * @param {number} i + * @returns {yfiles.algorithms.LineSegment} + */ + getLineSegment(i:number):yfiles.algorithms.LineSegment; + /** + * Get the number of points in the path. + * @returns {number} + */ + length():number; + /** + * Get the points in the path. + * @returns {yfiles.algorithms.ILineSegmentCursor} + */ + lineSegments():yfiles.algorithms.ILineSegmentCursor; + /** + * Get the points in the path. + * @returns {yfiles.algorithms.IPointCursor} + */ + points():yfiles.algorithms.IPointCursor; + /** + * Get the points in the list as array. + * @returns {Array.} + */ + toArray():yfiles.algorithms.YPoint[]; + /** + * Get the points in the path as list. + * @returns {yfiles.collections.IList.} a list of {@link yfiles.algorithms.YPoint} instances. + */ + toList():yfiles.collections.IList; + /** + * Defines a path with no points. + * @const + * @static + * @type {yfiles.algorithms.YPointPath} + */ + static EMPTY_PATH:yfiles.algorithms.YPointPath; + /** + * Gets the first point in the path. + * @type {yfiles.algorithms.YPoint} + */ + first:yfiles.algorithms.YPoint; + /** + * Gets the last point in the path. + * @type {yfiles.algorithms.YPoint} + */ + last:yfiles.algorithms.YPoint; + /** + * Gets the number of line segments in the path. + * @type {number} + */ + lineSegmentCount:number; + static $class:yfiles.lang.Class; + } + /** + * This class defines a rectangle and provides utility methods for it. + * @class yfiles.algorithms.YRectangle + * @extends {yfiles.algorithms.YDimension} + * @implements {yfiles.algorithms.IPlaneObject} + */ + export interface YRectangle extends yfiles.algorithms.YDimension,yfiles.algorithms.IPlaneObject{} + export class 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. + * @constructor + */ + constructor(x:number,y:number,width:number,height:number); + /** + * 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. + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension); + /** + * Creates a new rectangle with upper left corner (0,0) and size (0,0). + * @constructor + */ + constructor(); + /** + * Checks whether or not this YRectangle contains the given rectangle. + * @param {yfiles.algorithms.YRectangle} p + * @returns {boolean} + */ + contains(p:yfiles.algorithms.YRectangle):boolean; + /** + * Checks whether or not this YRectangle contains the given point. + * @param {yfiles.algorithms.YPoint} p + * @returns {boolean} + */ + contains(p:yfiles.algorithms.YPoint):boolean; + /** + * Checks whether or not this YRectangle contains the rectangle defined by the given frame. + * @param {number} x + * @param {number} y + * @param {number} width + * @param {number} height + * @returns {boolean} + */ + contains(x:number,y:number,width:number,height:number):boolean; + /** + * 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. + * @returns {boolean} true if the point lies inside the rectangle; false otherwise. + */ + contains(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=false] if true, all points on the border of the rectangle are considered to be contained. + * @returns {boolean} true if the point lies inside the rectangle; false otherwise. + * @static + */ + static contains(rx:number,ry:number,rw:number,rh:number,x:number,y:number,closed?:boolean):boolean; + /** + * Returns the Euclidean distance to the passed rectangle. + *

+ * If they overlap, the distance is 0. + *

+ * @param {yfiles.algorithms.YRectangle} other the second rectangle. + * @returns {number} the distance to the given rectangle. + */ + getEuclideanDistance(other:yfiles.algorithms.YRectangle):number; + /** + * Returns the Manhattan distance to the passed rectangle. + *

+ * If they overlap the distance is 0. + *

+ * @param {yfiles.algorithms.YRectangle} other the second rectangle. + * @returns {number} the distance to the given rectangle. + */ + getManhattanDistance(other:yfiles.algorithms.YRectangle):number; + /** + * Returns whether or not the given rectangles intersect. + * @param {yfiles.algorithms.YRectangle} r1 + * @param {yfiles.algorithms.YRectangle} r2 + * @returns {boolean} + * @static + */ + static intersects(r1:yfiles.algorithms.YRectangle,r2:yfiles.algorithms.YRectangle):boolean; + /** + * Creates a {@link yfiles.geometry.Rect} from a given {@link yfiles.algorithms.YRectangle}. + * @returns {yfiles.geometry.Rect} The {@link yfiles.geometry.Rect}. + */ + toRect():yfiles.geometry.Rect; + /** + * Gets x-coordinate of upper left corner. + * @type {number} + */ + x:number; + /** + * Gets y-coordinate of upper left corner. + * @type {number} + */ + y:number; + /** + * Gets coordinates of upper left corner. + * @type {yfiles.algorithms.YPoint} + */ + location:yfiles.algorithms.YPoint; + /** + * Gets this object. + * @type {yfiles.algorithms.YRectangle} + */ + boundingBox:yfiles.algorithms.YRectangle; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.algorithms.YVector + */ + export interface YVector extends Object{} + export class 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=null] The second point. If no point is spcified, (0,0) is used instead. + * @constructor + */ + constructor(p1:yfiles.algorithms.YPoint,p2?:yfiles.algorithms.YPoint); + /** + * Creates a new vector which is a copy of another vector. + * @param {yfiles.algorithms.YVector} v the vector, whose values are copied. + * @constructor + */ + constructor(v: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. + * @constructor + */ + constructor(x1:number,y1:number,x2:number,y2:number); + /** + * Creates a new vector with given direction. + * @param {number} dx the first coordinate + * @param {number} dy the second coordinate + * @constructor + */ + constructor(dx:number,dy:number); + /** + * Adds a vector to this vector. + * @param {yfiles.algorithms.YVector} v the vector to add. + */ + add(v:yfiles.algorithms.YVector):void; + /** + * 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. + * @returns {yfiles.algorithms.YPoint} p+v + * @static + */ + static add(p:yfiles.algorithms.YPoint,v:yfiles.algorithms.YVector):yfiles.algorithms.YPoint; + /** + * 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. + * @returns {yfiles.algorithms.YVector} v+w + * @static + */ + static add(v:yfiles.algorithms.YVector,w:yfiles.algorithms.YVector):yfiles.algorithms.YVector; + /** + * Returns the result of the addition of two angles between 0 and 2*Pi. + *

+ * The result is calculated modulo 2*Pi. + *

+ * @param {number} a1 a value in [0,2Pi). + * @param {number} a2 a value in [0,2Pi). + * @returns {number} The sum of a1 and a2 modulo 2*Pi. + * @static + */ + static addAngle(a1:number,a2:number):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. + *

+ * @param {yfiles.algorithms.YVector} v1 + * @param {yfiles.algorithms.YVector} v2 + * @returns {number} + * @static + */ + static angle(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number; + /** + * Returns this vector with unit length. + * @param {yfiles.algorithms.YVector} v + * @returns {yfiles.algorithms.YVector} + * @static + */ + static getNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector; + /** + * Returns the length of the vector, this is the value of the euclidean norm. + * @returns {number} a value > 0. + */ + length():number; + /** + * Assigns unit length to the vector. + *
+ */ + norm():void; + /** + * Returns the vector which is orthogonal to the given one and has unit length. + * @param {yfiles.algorithms.YVector} v a vector. + * @returns {yfiles.algorithms.YVector} a vector which is orthogonal to v with unit length. + * @static + */ + static orthoNormal(v:yfiles.algorithms.YVector):yfiles.algorithms.YVector; + /** + * Returns true if vector v1 is on the right side of v2. + * @param {yfiles.algorithms.YVector} v1 + * @param {yfiles.algorithms.YVector} v2 + * @returns {boolean} + * @static + */ + static rightOf(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):boolean; + /** + * 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. + * @returns {yfiles.algorithms.YVector} the rotated vector. + */ + rotate(angle:number):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. + * @returns {number} v1.x * v2.x + v1.y * v2.y + * @static + */ + static scalarProduct(v1:yfiles.algorithms.YVector,v2:yfiles.algorithms.YVector):number; + /** + * Scales the vector by an factor. + * @param {number} factor the scale factor, with which the length is multiplied. + */ + scale(factor:number):void; + /** + * Creates a {@link yfiles.geometry.Point} from a given {@link yfiles.algorithms.YVector}. + * @returns {yfiles.geometry.Point} The {@link yfiles.geometry.Point}. + */ + toPoint():yfiles.geometry.Point; + /** + * Gets the first coordinate of the vector. + * @type {number} + */ + x:number; + /** + * Gets the second coordinate of the vector. + * @type {number} + */ + y:number; + static $class:yfiles.lang.Class; + } + /** + * This class provides access to some Comparator instances that are commonly used in yFiles. + * @class yfiles.algorithms.Comparers + * @static + */ + export interface Comparers extends Object{} + export class Comparers { + /** + * 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.lang.Object_Interface#compare} instead. + *

+ * @param {number} d1 the first number to compare. + * @param {number} d2 the second number to compare. + * @returns {number} a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the + * second. + * @see yfiles.collections.IComparer.#compare + * @static + */ + static compare(d1:number,d2:number):number; + /** + * Returns a {@link yfiles.collections.IComparer.} that compares to Objects of type Comparable. + * @returns {yfiles.collections.IComparer.} + * @static + */ + static createComparableComparer():yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} that compares objects of arbitrary type. + *

+ * Two objects are compared by comparing the {@link yfiles.lang.IComparable} instances the given data provider returns for each of + * these objects. + *

+ * @param {yfiles.algorithms.IDataProvider} dp a data provider that must return a {@link yfiles.lang.IComparable} for each object that is being compared by this comparator. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares arbitrary objects. + * @static + */ + static createComparableDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} 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. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares arbitrary objects. + * @static + */ + static createIntDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} 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. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares edges. + * @static + */ + static createIntDataSourceComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} 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. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares edges. + * @static + */ + static createIntDataTargetComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} 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. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares arbitrary objects. + * @static + */ + static createNumberDataComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} 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. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares edges. + * @static + */ + static createNumberDataSourceComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + /** + * Returns a {@link yfiles.collections.IComparer.} 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. + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares edges. + * @static + */ + static createNumberDataTargetComparer(dp:yfiles.algorithms.IDataProvider):yfiles.collections.IComparer; + static $class:yfiles.lang.Class; + } + /** + * Provides utility methods for working with {@link yfiles.algorithms.ICursor cursors}. + * @class yfiles.algorithms.Cursors + * @static + */ + export interface Cursors extends Object{} + export class Cursors { + /** + * 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 + * @returns {yfiles.algorithms.ICursor} + * @static + */ + static concatenate(c1:yfiles.algorithms.ICursor,c2:yfiles.algorithms.ICursor):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. + *

+ * Type parameter T. + * @param {yfiles.collections.ICollection.} c The collection. + * @returns {yfiles.algorithms.ICursor} The cursor view of the given collection. + * @template T + * @static + */ + static 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}. + *

+ * Type parameter T. + * @param {yfiles.collections.ICollection.} c The collection. + * @returns {yfiles.algorithms.IEdgeCursor} an {@link yfiles.algorithms.IEdgeCursor} view of the given collection. + * @template T + * @static + */ + static createEdgeCursor(c:yfiles.collections.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}. + *

+ * Type parameter T. + * @param {yfiles.collections.ICollection.} c The collection. + * @returns {yfiles.algorithms.INodeCursor} an {@link yfiles.algorithms.INodeCursor} view of the given collection. + * @template T + * @static + */ + static createNodeCursor(c:yfiles.collections.ICollection):yfiles.algorithms.INodeCursor; + /** + * Creates or fills an array with the values provided by the cursor + * @param {yfiles.algorithms.ICursor} cursor the cursor + * @param {Array.} dest the array to fill with the values or null if the method should create the array itself + * @returns {Array.} dest or a newly created array filled with the values from cursor + * @static + */ + static toArray(cursor:yfiles.algorithms.ICursor,dest:Object[]):Object[]; + static $class:yfiles.lang.Class; + } + /** + * An abstract adapter class for providing data. + *

+ * The data provision methods in this class throw a {@link Stubs.Exceptions.NotSupportedError} 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. + *

+ * @class yfiles.algorithms.DataProviderAdapter + * @implements {yfiles.algorithms.IDataProvider} + */ + export interface DataProviderAdapter extends Object,yfiles.algorithms.IDataProvider{} + export class DataProviderAdapter { + /** + * 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. + *

+ * @param {Object} dataHolder + * @returns {boolean} false. + */ + defined(dataHolder:Object):boolean; + /** + * Subclasses may override this method to provide access to object values. + * @param {Object} dataHolder + * @returns {Object} + * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. + */ + get(dataHolder:Object):Object; + /** + * Subclasses may override this method to provide access to boolean values. + * @param {Object} dataHolder + * @returns {boolean} + * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. + */ + getBoolean(dataHolder:Object):boolean; + /** + * Subclasses may override this method to provide access to integer values. + * @param {Object} dataHolder + * @returns {number} + * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. + */ + getInt(dataHolder:Object):number; + /** + * Subclasses may override this method to provide access to double values. + * @param {Object} dataHolder + * @returns {number} + * @throws {Stubs.Exceptions.NotSupportedError} unless overwritten. + */ + getNumber(dataHolder:Object):number; + static $class:yfiles.lang.Class; + } + /** + * This class provides convenience and transformation services for DataProviders. + * @class yfiles.algorithms.DataProviders + * @static + */ + export interface DataProviders extends Object{} + export class DataProviders { + /** + * Returns a DataProvider that returns the given value for each key. + * @param {Object} data constant Object data returned by the created data provider. + * @returns {yfiles.algorithms.IDataProvider} a data provider view of a single value. + * @static + */ + static createConstantDataProvider(data:Object):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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static 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 {Array.} doubleData double data for each edge of a static graph + * @param {Array.} intData int data for each edge of a static graph + * @param {Array.} boolData boolean data for each edge of a static graph + * @param {Array.} objectData Object data for each edge of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given arrays + * @static + */ + static createEdgeDataProviderForArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createEdgeDataProviderForBoolean(data:boolean[]):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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createEdgeDataProviderForInt(data:number[]):yfiles.algorithms.IDataProvider; + /** + * 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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createEdgeDataProviderForNumber(data:number[]):yfiles.algorithms.IDataProvider; + /** + * Returns a DataProvider that returns the negated boolean values provided by another data provider. + * @param {yfiles.algorithms.IDataProvider} data + * @returns {yfiles.algorithms.IDataProvider} + * @static + */ + static createNegatedDataProvider(data:yfiles.algorithms.IDataProvider):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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createNodeDataProvider(data:Object[]):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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createNodeDataProviderForBoolean(data:boolean[]):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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createNodeDataProviderForInt(data:number[]):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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given array + * @static + */ + static createNodeDataProviderForNumber(data:number[]):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 {Array.} doubleData double data for each node of a static graph + * @param {Array.} intData int data for each node of a static graph + * @param {Array.} boolData boolean data for each node of a static graph + * @param {Array.} objectData Object data for each node of a static graph + * @returns {yfiles.algorithms.IDataProvider} a data provider view of the given arrays + * @static + */ + static createNodeDataProviderWithArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):yfiles.algorithms.IDataProvider; + /** + * Returns a DataProvider for edges that return the data provider values bound to their source nodes. + * @param {yfiles.algorithms.IDataProvider} nodeData + * @returns {yfiles.algorithms.IDataProvider} + * @static + */ + static createSourceDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; + /** + * Returns a DataProvider for edges that return the data provider values bound to their target nodes. + * @param {yfiles.algorithms.IDataProvider} nodeData + * @returns {yfiles.algorithms.IDataProvider} + * @static + */ + static createTargetDataProvider(nodeData:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.algorithms.GraphPartitionManager + */ + export interface GraphPartitionManager extends Object{} + export class GraphPartitionManager { + /** + * Instantiates a new GraphPartitionManager for the given graph. + *

+ * All non-static hiding and unhiding methods will refer to the given graph. + *

+ * @param {yfiles.algorithms.Graph} graph + * @param {yfiles.algorithms.IDataProvider} partitionId + * @constructor + */ + constructor(graph:yfiles.algorithms.Graph,partitionId:yfiles.algorithms.IDataProvider); + /** + * 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; + /** + * 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. + *

+ * @param {yfiles.algorithms.NodeList} nl + */ + hide(nl:yfiles.algorithms.NodeList):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. + *

+ * @param {yfiles.algorithms.EdgeList} el + */ + hide(el:yfiles.algorithms.EdgeList):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. + *

+ * @param {yfiles.algorithms.Edge} e + */ + hide(e:yfiles.algorithms.Edge):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. + *

+ * @param {yfiles.algorithms.Node} v + */ + hide(v:yfiles.algorithms.Node):void; + /** + * 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 the given edges from the graph. + *

+ * The hidden edges will be stored so that they can be unhidden again at a later time. + *

+ * @param {yfiles.algorithms.IEdgeCursor} ec + */ + hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):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 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. + *

+ * @param {yfiles.algorithms.ICursor} cursor + */ + hideItemCursor(cursor:yfiles.algorithms.ICursor):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; + /** + * 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. + *

+ * @param {yfiles.algorithms.INodeCursor} nc + */ + hideNodeCursor(nc:yfiles.algorithms.INodeCursor):void; + /** + * Hides nodes and adjacent edges that have the given partitionId associated. + * @param {Object} partitionId the id + */ + hidePartition(partitionId:Object):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; + /** + * 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 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; + /** + * This method will be called whenever the partition manager is requested to unhide the given node from the graph. + * @param {yfiles.algorithms.Node} v + * @protected + */ + unhide(v:yfiles.algorithms.Node):void; + /** + * This method will be called whenever the partition manager is requested to unhide the given edge from the graph. + * @param {yfiles.algorithms.Edge} e + * @protected + */ + unhide(e:yfiles.algorithms.Edge):void; + /** + * Unhides all formerly hidden elements in the graph. + */ + unhideAll():void; + /** + * Unhides all formerly hidden edges in the graph. + */ + unhideEdges():void; + /** + * Unhides all formerly hidden nodes in the graph. + *

+ * Note that this method does not unhide hidden edges. + *

+ */ + unhideNodes():void; + /** + * Unhides nodes that have the given partitionId associated. + * @param {Object} partitionId the id + */ + unhidePartition(partitionId:Object):void; + /** + * Gets or sets whether or not this partition manager should fire graph events. + *

+ * By default the partition manager does not fire graph events. + *

+ * @type {boolean} + */ + fireGraphEventsEnabled:boolean; + /** + * Gets the Graph for which this partition manager was created. + * @type {yfiles.algorithms.Graph} + */ + graph:yfiles.algorithms.Graph; + static $class:yfiles.lang.Class; + } + /** + * 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. + *

+ * @class yfiles.algorithms.LayoutGraphHider + */ + export interface LayoutGraphHider extends Object{} + export class LayoutGraphHider { + /** + * Instantiates a new GraphHider for the given graph. + *

+ * All non-static hiding and unhiding methods will refer to the given graph. + *

+ * @param {yfiles.algorithms.Graph} g + * @constructor + */ + constructor(g:yfiles.algorithms.Graph); + /** + * The edges that are currently hidden + * @returns {yfiles.algorithms.IEdgeCursor} a cursor of the currently hidden edges + */ + getHiddenEdgeCursor():yfiles.algorithms.IEdgeCursor; + /** + * The nodes that are currently hidden + * @returns {yfiles.algorithms.INodeCursor} a cursor of the currently hidden nodes + */ + getHiddenNodeCursor():yfiles.algorithms.INodeCursor; + /** + * 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. + *

+ * @param {yfiles.algorithms.NodeList} nl + */ + hide(nl:yfiles.algorithms.NodeList):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. + *

+ * @param {yfiles.algorithms.EdgeList} el + */ + hide(el:yfiles.algorithms.EdgeList):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. + *

+ * @param {yfiles.algorithms.Edge} e + */ + hide(e:yfiles.algorithms.Edge):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. + *

+ * @param {yfiles.algorithms.Node} v + */ + hide(v:yfiles.algorithms.Node):void; + /** + * 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 the given edges from the graph. + *

+ * The hidden edges will be stored so that they can be unhidden again at a later time. + *

+ * @param {yfiles.algorithms.IEdgeCursor} ec + */ + hideEdgeCursor(ec:yfiles.algorithms.IEdgeCursor):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 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. + *

+ * @param {yfiles.algorithms.ICursor} cursor + */ + hideItemCursor(cursor:yfiles.algorithms.ICursor):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; + /** + * 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. + *

+ * @param {yfiles.algorithms.INodeCursor} nc + */ + hideNodeCursor(nc:yfiles.algorithms.INodeCursor):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 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. + *

+ * @param {yfiles.algorithms.Graph} graph + * @param {yfiles.algorithms.IEdgeCursor} ec + * @static + */ + static hideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):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; + /** + * This method will be called whenever the hider is requested to unhide the given node from the graph. + * @param {yfiles.algorithms.Node} v + * @protected + */ + unhide(v:yfiles.algorithms.Node):void; + /** + * This method will be called whenever the hider is requested to unhide the given edge from the graph. + * @param {yfiles.algorithms.Edge} e + * @protected + */ + unhide(e:yfiles.algorithms.Edge):void; + /** + * Unhides all formerly hidden elements in the graph. + */ + unhideAll():void; + /** + * Unhides the given edge. + *

+ * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. + *

+ *

+ * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes + * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. + *

+ * @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.LayoutGraphHider#hiddenEdges}. + *

+ *

+ * Note that unhiding an edge whose source/target is not in the graph (e.g., because it's currently hidden/removed) causes + * an exception. Hence, in such cases, you first have to unhide/reinsert the corresponding endpoints. + *

+ * @param {yfiles.algorithms.EdgeList} edges the edges that will be unhidden + */ + unhideEdges(edges:yfiles.algorithms.EdgeList):void; + /** + * Unhides all formerly hidden edges in the graph. + */ + unhideEdges():void; + /** + * Unhides the given node and if requested its adjacent edges. + *

+ * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenNodes} and {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. + *

+ * @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; + /** + * Unhides the given nodes and if requested its adjacent edges. + *

+ * Also updates {@link yfiles.algorithms.LayoutGraphHider#hiddenNodes} and {@link yfiles.algorithms.LayoutGraphHider#hiddenEdges}. + *

+ * @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. + */ + unhideNodes(nodes:yfiles.algorithms.NodeList,unhideAdjacentEdges:boolean):void; + /** + * Unhides all formerly hidden nodes in the graph. + *

+ * Note that this method does not unhide hidden edges. + *

+ */ + unhideNodes():void; + /** + * 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. + *

+ * @param {yfiles.algorithms.Graph} graph + * @param {yfiles.algorithms.IEdgeCursor} ec + * @static + */ + static unhideSubgraph(graph:yfiles.algorithms.Graph,ec:yfiles.algorithms.IEdgeCursor):void; + /** + * holds the list of the hidden edges in stack order + * @protected + * @type {yfiles.algorithms.EdgeList} + */ + hiddenEdges:yfiles.algorithms.EdgeList; + /** + * holds the list of the hidden nodes in stack order + * @protected + * @type {yfiles.algorithms.NodeList} + */ + hiddenNodes:yfiles.algorithms.NodeList; + /** + * Gets or sets whether or not this hider should fire graph events. + *

+ * By default the hider does not fire graph events. + *

+ * @type {boolean} + */ + fireGraphEvents:boolean; + /** + * Gets the Graph for which this GraphHider was created. + * @type {yfiles.algorithms.Graph} + */ + graph:yfiles.algorithms.Graph; + static $class:yfiles.lang.Class; + } + /** + * This class provides convenience and transformation services for Node- and EdgeMaps and other layout-related collection + * types. + * @class yfiles.algorithms.Maps + * @static + */ + export interface Maps extends Object{} + export class Maps { + /** + * 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. + *

+ * @param {yfiles.collections.IMap.} map + * @returns {yfiles.algorithms.IDataMap} + * @static + */ + static createDataMap(map:yfiles.collections.IMap):yfiles.algorithms.IDataMap; + /** + * 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. + *

+ * @param {yfiles.collections.IMap.} map + * @returns {yfiles.algorithms.IEdgeMap} + * @static + */ + static createEdgeMap(map:yfiles.collections.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. + *

+ * @returns {yfiles.algorithms.IDataMap} + * @static + */ + static createHashedDataMap():yfiles.algorithms.IDataMap; + /** + * Creates an EdgeMap that is based on hashing. + *

+ * The preconditions specified in java.util.HashMap apply for the keys and values of this map. + *

+ * @returns {yfiles.algorithms.IEdgeMap} + * @static + */ + static createHashedEdgeMap():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. + *

+ * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHashedNodeMap():yfiles.algorithms.INodeMap; + /** + * Factory method that creates a {@link yfiles.collections.IMap.} that is a special hash map implementation mainly used by the layout algorithms. + * Type parameter K. + * Type parameter V. + * @param {yfiles.collections.ICollection.>} [entries=null] The items to optionally populate the set with initially. + * @returns {yfiles.collections.IMap.} A new instance. + * @template K,V + * @static + */ + static createHashMap(entries?:yfiles.collections.ICollection>):yfiles.collections.IMap; + /** + * Factory method that creates an {@link yfiles.collections.ICollection.} implementation with set semantics that is a special hash map based implementation mainly + * used by the layout algorithms. + * Type parameter T. + * @param {yfiles.collections.IEnumerable.} [items=null] The items to optionally populate the set with initially. + * @returns {yfiles.collections.ICollection.} A new instance. + * @template T + * @static + */ + static createHashSet(items?:yfiles.collections.IEnumerable):yfiles.collections.ICollection; + /** + * Creates a resettable high performance map for values of 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. + *

+ * @param {yfiles.algorithms.IDataProvider} backingProvider + * @param {yfiles.algorithms.IDataAcceptor} backingAcceptor + * @param {number} defaultValue + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHighPerformanceDoubleMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.INodeMap; + /** + * Creates a resettable high performance map for values of 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. + *

+ * @param {yfiles.algorithms.IDataMap} backingMap + * @param {number} defaultValue + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHighPerformanceDoubleMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.INodeMap; + /** + * Creates a resettable high performance map for values of 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. + *

+ * @param {yfiles.algorithms.IDataProvider} backingProvider + * @param {yfiles.algorithms.IDataAcceptor} backingAcceptor + * @param {number} defaultValue + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHighPerformanceIntMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.INodeMap; + /** + * Creates a resettable high performance map for values of 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. + *

+ * @param {yfiles.algorithms.IDataMap} backingMap + * @param {number} defaultValue + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHighPerformanceIntMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.INodeMap; + /** + * Creates 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. + *

+ * @param {yfiles.algorithms.IDataProvider} backingProvider + * @param {yfiles.algorithms.IDataAcceptor} backingAcceptor + * @param {Object} defaultValue + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHighPerformanceMap(backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:Object):yfiles.algorithms.INodeMap; + /** + * Creates 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. + *

+ * @param {yfiles.algorithms.IDataMap} backingMap + * @param {Object} defaultValue + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createHighPerformanceMap(backingMap:yfiles.algorithms.IDataMap,defaultValue:Object):yfiles.algorithms.INodeMap; + /** + * 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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + * @static + */ + static createIndexEdgeMap(data:Object[]):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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + * @static + */ + static createIndexEdgeMapForBoolean(data:boolean[]):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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + * @static + */ + static createIndexEdgeMapForInt(data:number[]):yfiles.algorithms.IEdgeMap; + /** + * 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 {Array.} data array data for each edge of a static graph + * @returns {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + * @static + */ + static createIndexEdgeMapForNumber(data:number[]):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 {Array.} doubleData double data for each edge of a static graph + * @param {Array.} intData int data for each edge of a static graph + * @param {Array.} boolData boolean data for each edge of a static graph + * @param {Array.} objectData Object data for each edge of a static graph + * @returns {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given arrays + * @static + */ + static createIndexEdgeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):yfiles.algorithms.IEdgeMap; + /** + * 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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.INodeMap} a NodeMap view of the given array + * @static + */ + static createIndexNodeMap(data:Object[]):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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.INodeMap} a NodeMap view of the given array + * @static + */ + static createIndexNodeMapForBoolean(data:boolean[]):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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.INodeMap} a NodeMap view of the given array + * @static + */ + static createIndexNodeMapForInt(data:number[]):yfiles.algorithms.INodeMap; + /** + * 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 {Array.} data array data for each node of a static graph + * @returns {yfiles.algorithms.INodeMap} a NodeMap view of the given array + * @static + */ + static createIndexNodeMapForNumber(data:number[]):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 {Array.} doubleData double data for each node of a static graph + * @param {Array.} intData int data for each node of a static graph + * @param {Array.} boolData boolean data for each node of a static graph + * @param {Array.} objectData Object data for each node of a static graph + * @returns {yfiles.algorithms.INodeMap} a NodeMap view of the given arrays + * @static + */ + static createIndexNodeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):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. + *

+ * @param {yfiles.collections.IMap.} map + * @returns {yfiles.algorithms.INodeMap} + * @static + */ + static createNodeMap(map:yfiles.collections.IMap):yfiles.algorithms.INodeMap; + static $class:yfiles.lang.Class; + } + }export namespace layout{ + /** + * This class represents a column of a {@link yfiles.layout.PartitionGrid partition grid} structure. + *

+ * The results of the calculation of the geometry of the column will be placed into the instances of this class after the + * layout. + *

+ * @see yfiles.layout.PartitionGrid + * @class yfiles.layout.ColumnDescriptor + * @implements {yfiles.lang.IComparable} + */ + export interface ColumnDescriptor extends Object,yfiles.lang.IComparable{} + export class ColumnDescriptor { + /** + * Compares this {@link yfiles.layout.ColumnDescriptor} instance with a given other {@link yfiles.layout.ColumnDescriptor} instance based + * on the indices of the two instances. + * @param {Object} o the {@link yfiles.layout.ColumnDescriptor} to compare to + * @returns {number} -1, 0 or 1 if this {@link yfiles.layout.ColumnDescriptor} is less than, equal to, or greater than the given other + * {@link yfiles.layout.ColumnDescriptor} + */ + compareTo(o:Object):number; + /** + * Gets the index of the column within the {@link yfiles.layout.PartitionGrid partition grid}. + * @type {number} + */ + index:number; + /** + * Gets or sets the minimum width of the column. + *

+ * The minimum width is defined to be at least 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum width is negative + * @type {number} + */ + minimumWidth:number; + /** + * Gets or sets the left column inset in which no element will lie in the resulting layout. + *

+ * The column inset must be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the left inset is negative + * @type {number} + */ + leftInset:number; + /** + * Gets or sets the right column inset in which no element will lie in the resulting layout. + *

+ * The column inset must be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the right inset is negative + * @type {number} + */ + rightInset:number; + /** + * Gets or sets the computed width of the column after the layout has been calculated. + *

+ * The computed width needs to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the computed width is negative + * @type {number} + */ + computedWidth:number; + /** + * Gets or sets the original width of the column. + *

+ * The original width should be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the original width is negative + * @type {number} + */ + originalWidth:number; + /** + * Gets or sets the original position (smallest x-coordinate) of the column. + * @type {number} + */ + originalPosition:number; + /** + * Gets or sets the computed position (smallest x-coordinate) of the column after the layout has been calculated. + * @type {number} + */ + computedPosition:number; + /** + * Gets or sets the tightness factor of this column. + *

+ * This value must lie within the interval [0,1]. + *

+ *

+ * The larger the value, the more the column will be forced to obtain its minimum width: + *

+ *
    + *
  • a value of 0.0d will disable the compression of the column.
  • + *
  • a value of 1.0d will try to force the column to obtain its specified {@link yfiles.layout.ColumnDescriptor#minimumWidth minimum width}.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside the interval [0,1] + * @type {number} + */ + tightness:number; + /** + * Gets or sets whether the index of the column is fixed or it should be chosen automatically in order to minimize edge + * lengths. + *

+ * For all columns where this property is enabled, the relative ordering given by the indices is preserved. The remaining + * columns may be sorted again so that the overall edge lengths are minimized. + *

+ * @type {boolean} + */ + indexFixed:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class represents a single partition cell, i.e., a pair consisting of a row and a column. + * @class yfiles.layout.PartitionCellIdEntry + * @implements {yfiles.lang.IComparable} + * @final + */ + export interface PartitionCellIdEntry extends Object,yfiles.lang.IComparable{} + export class PartitionCellIdEntry { + /** + * Compares this {@link yfiles.layout.PartitionCellIdEntry} instance with a given other {@link yfiles.layout.PartitionCellIdEntry} + * instance. + *

+ * The comparison is based on the indices of the {@link yfiles.layout.PartitionCellIdEntry#row rows} and {@link yfiles.layout.PartitionCellIdEntry#column columns} of the two pairs. A {@link yfiles.layout.PartitionCellIdEntry} is + * considered to be smaller than another pair if its {@link yfiles.layout.RowDescriptor#index row index} is smaller than the row index of the other pair. If the row + * indices are equal, the {@link yfiles.layout.PartitionCellIdEntry} with the smaller {@link yfiles.layout.ColumnDescriptor#index column index} is said to be smaller. Hence, + * two {@link yfiles.layout.PartitionCellIdEntry} instances are equal, if the row and column indices are equal. + *

+ * @param {Object} o the {@link yfiles.layout.PartitionCellIdEntry} to be compared + * @returns {number} -1, 0 or 1 if this {@link yfiles.layout.PartitionCellIdEntry} is smaller than, equal to, or greater than the given other {@link yfiles.layout.PartitionCellIdEntry} + * instance + */ + compareTo(o:Object):number; + /** + * Gets the {@link yfiles.layout.RowDescriptor} associated with this {@link yfiles.layout.PartitionCellId partition cell}. + * @type {yfiles.layout.RowDescriptor} + */ + row:yfiles.layout.RowDescriptor; + /** + * Gets the {@link yfiles.layout.ColumnDescriptor} associated with this {@link yfiles.layout.PartitionCellId partition cell}. + * @type {yfiles.layout.ColumnDescriptor} + */ + column:yfiles.layout.ColumnDescriptor; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.PartitionCellId} represents an identifier for partition cells of a {@link yfiles.layout.PartitionGrid partition grid} structure. + * @see yfiles.layout.PartitionGrid + * @class yfiles.layout.PartitionCellId + */ + export interface PartitionCellId extends Object{} + export class PartitionCellId { + /** + * Gets a {@link yfiles.collections.ICollection. collection} of elements of type {@link yfiles.layout.PartitionCellIdEntry}. + *

+ * Each pair consists of a {@link yfiles.layout.ColumnDescriptor column} and a {@link yfiles.layout.RowDescriptor row} defining a single {@link yfiles.layout.PartitionCellId partition cell}. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + cells:yfiles.collections.IEnumerable; + /** + * Gets whether or not this {@link yfiles.layout.PartitionCellId} represents a multi-cell, i.e., a cell spanning multiple + * rows/columns. + *

+ * This means that it was created using {@link yfiles.layout.PartitionGrid#createCellSpanId}, + * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createColumnSpanId} + * or {@link yfiles.layout.PartitionGrid#createRowSpanId}. + *

+ * @type {boolean} + */ + isSpanning:boolean; + /** + * Gets the first {@link yfiles.layout.RowDescriptor row} associated with this {@link yfiles.layout.PartitionCellId partition cell} identifier. + * @type {yfiles.layout.RowDescriptor} + */ + row:yfiles.layout.RowDescriptor; + /** + * Gets the first {@link yfiles.layout.ColumnDescriptor column} associated with this {@link yfiles.layout.PartitionCellId partition cell} identifier. + * @type {yfiles.layout.ColumnDescriptor} + */ + column:yfiles.layout.ColumnDescriptor; + static $class:yfiles.lang.Class; + } + /** + * This class represents a partition grid that partitions the drawing area into rectangular partition cells. + *

+ * Such a structure allows, for example, to model vertical/horizontal swimlanes which are often used in flow diagrams to + * separate logical units. + *

+ *

+ * The grid consists of rows and columns that are created using the corresponding constructors of this class or methods {@link yfiles.layout.PartitionGrid#addRow} + * and {@link yfiles.layout.PartitionGrid#addColumn}. The {@link yfiles.layout.PartitionGrid} object has to be registered with the graph + * using the {@link yfiles.algorithms.IDataProvider} 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 with the graph using {@link yfiles.algorithms.IDataProvider} key + * {@link yfiles.layout.PartitionGrid#PARTITION_CELL_ID_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#createCellId} 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#createCellSpanId}, + * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanId}, + * {@link yfiles.layout.PartitionGrid#createColumnSpanId}, and {@link yfiles.layout.PartitionGrid#createRowSpanId}. + *

+ *

+ * {@graph {"ann":{"s":[60,30],"d":1, "lblB" : 1, "lblFont" : "16px sans-serif"},"n":[[265,290,230,142,2,[[265,313.6,230,23.6,5,"Column 0"]]],[311.5,386.5,[[336.16,410.85,10.67,18.7]]],[411.5,346.5,[[436.16,370.85,10.67,18.7]]],[505,289,299,144,2,[[505,312.6,299,23.6,5,"Column 1"]]],[631.5,366.5,[[656.16,390.85,10.67,18.7]]],[731.5,326.5,[[756.16,350.85,10.67,18.7]]],[531.5,326.5,[[556.16,350.85,10.67,18.7]]],[819,290,250,140,2,[[819,313.6,250,23.6,5,"Column 2"]]],[831.5,326.5,[[856.16,350.85,10.67,18.7]]],[265,449,230,123,2],[411.5,466.5,[[436.16,490.85,10.67,18.7]]],[411.5,526.5,[[436.16,550.85,10.67,18.7]]],[505,449,299,123,2],[819,449,250,123,2],[931.5,466.5,[[956.16,490.85,10.67,18.7]]],[505,589,299,104,2],[819,589,250,104,2],[531.5,606.5,[[552.83,630.85,17.35,18.7]]],[265,589,230,104,2],[411.5,606.5,[[432.83,630.85,17.35,18.7]]],[831.5,606.5,[[852.83,630.85,17.35,18.7]]],[105,348.2,150,23.6,2,[[105,371.8,150,23.6,5,"Row 0"]]],[105,488.2,150,23.6,2,[[105,511.8,150,23.6,5,"Row 1"]]],[105,628.2,150,23.6,2,[[105,651.8,150,23.6,5,"Row 2"]]]],"e":[[1,2,30,-10,-30,-0,[381.5,391.5,381.5,361.5]],[1,4,30,-0,-30,10,[581.5,401.5,581.5,391.5]],[2,4,30,7.5,-30,-0,[481.5,369,481.5,381.5]],[4,5,30,-0,-30,7.5,[701.5,381.5,701.5,349]],[2,6,30,-7.5,-30,-0,[481.5,354,481.5,341.5]],[6,4,30,7.5,-30,-10,[601.5,349,601.5,371.5]],[6,5,30,-7.5,-30,-7.5,[621.5,334,621.5,341.5,681.5,341.5,681.5,334]],[5,8,30,-0,-30,-0],[8,14,30,-0,-30,-7.5,[901.5,341.5,901.5,474]],[10,14,30,-0,-30,7.5,[881.5,481.5,881.5,489]],[1,17,30,10,-30,10,[381.5,411.5,381.5,661.5,481.5,661.5,481.5,631.5]],[11,17,30,-0,-30,-10,[481.5,541.5,481.5,611.5]],[19,17,30,-0,-30,-0],[17,20,30,-0,-30,-0]],"vp":[105.0,289.0,964.0,404.0]}} Sample output of a layout algorithm with a partition grid + *

+ * @class yfiles.layout.PartitionGrid + */ + export interface PartitionGrid extends Object{} + export class PartitionGrid { + /** + * Creates an instance of {@link yfiles.layout.PartitionGrid} with the given number of rows and columns as well as with given + * insets and minimum 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 + * @constructor + */ + constructor(rowCount:number,columnCount:number,rowInsets:number,columnInsets:number,minRowSize:number,minColumnSize:number); + /** + * Creates an instance of {@link yfiles.layout.PartitionGrid} with the given number of rows and columns. + * @param {number} rowCount the number of rows + * @param {number} columnCount the number of columns + * @constructor + */ + constructor(rowCount:number,columnCount:number); + /** + * Creates a new empty instance of {@link yfiles.layout.PartitionGrid}. + * @constructor + */ + constructor(); + /** + * Adds a new {@link yfiles.layout.ColumnDescriptor column} to the {@link yfiles.layout.PartitionGrid} instance. + *

+ * The index of the column (as returned by {@link yfiles.layout.ColumnDescriptor#index}) is equal to the size of the list returned by {@link yfiles.layout.PartitionGrid#columns}. + *

+ * @returns {yfiles.layout.ColumnDescriptor} a new {@link yfiles.layout.ColumnDescriptor} instance + */ + addColumn():yfiles.layout.ColumnDescriptor; + /** + * Adds a new {@link yfiles.layout.RowDescriptor row} to the {@link yfiles.layout.PartitionGrid} instance. + *

+ * The index of the row (as returned by {@link yfiles.layout.RowDescriptor#index}) is equal to the size of the list returned by {@link yfiles.layout.PartitionGrid#rows}. + *

+ * @returns {yfiles.layout.RowDescriptor} a new {@link yfiles.layout.RowDescriptor} instance + */ + addRow():yfiles.layout.RowDescriptor; + /** + * Creates a {@link yfiles.layout.PartitionCellId 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 + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + * @throws {Stubs.Exceptions.ArgumentError} if the given column/row index is not valid + */ + createCellId(rowIndex:number,columnIndex:number):yfiles.layout.PartitionCellId; + /** + * Creates a {@link yfiles.layout.PartitionCellId partition cell} identifier that represents the cell defined by the given {@link yfiles.layout.ColumnDescriptor column} and {@link yfiles.layout.RowDescriptor row}. + * @param {yfiles.layout.RowDescriptor} rd the row defining the cell + * @param {yfiles.layout.ColumnDescriptor} cd the column defining the cell + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + * @throws {Stubs.Exceptions.ArgumentError} if the given column/row is null + */ + createCellId(rd:yfiles.layout.RowDescriptor,cd:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; + /** + * Creates a {@link yfiles.layout.PartitionCellId 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 fromRow 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 + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + */ + createCellSpanId(fromRow:yfiles.layout.RowDescriptor,fromCol:yfiles.layout.ColumnDescriptor,toRow:yfiles.layout.RowDescriptor,toCol:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; + /** + * Creates a {@link yfiles.layout.PartitionCellId 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 fromRowIndex and toRowIndex (both + * including) and a column with index between fromColIndex and toColIndex (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 + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + */ + createCellSpanId(fromRowIndex:number,fromColIndex:number,toRowIndex:number,toColIndex:number):yfiles.layout.PartitionCellId; + /** + * Creates a {@link yfiles.layout.PartitionCellId 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.collections.ICollection.} rowList the {@link yfiles.layout.RowDescriptor rows} defining the cell + * @param {yfiles.collections.ICollection.} columnList the {@link yfiles.layout.ColumnDescriptor columns} defining the cell + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + */ + createCellSpanId(rowList:yfiles.collections.ICollection,columnList:yfiles.collections.ICollection):yfiles.layout.PartitionCellId; + /** + * Creates a {@link yfiles.layout.PartitionCellId 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 + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + */ + createColumnSpanId(columnIndex:number):yfiles.layout.PartitionCellId; + /** + * Creates a {@link yfiles.layout.PartitionCellId 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 + * @returns {yfiles.layout.PartitionCellId} a {@link yfiles.layout.PartitionCellId} instance + */ + createRowSpanId(rowIndex:number):yfiles.layout.PartitionCellId; + /** + * Finalizes the orientation changes and is called at the end of the {@link yfiles.layout.OrientationLayout} stage. + *

+ * Points are transferred to their final positions through {@link yfiles.layout.OrientationLayout#completeTransform}. + *

+ * @param {yfiles.layout.OrientationLayout} orientationLayouter an {@link yfiles.layout.OrientationLayout} instance + * @see yfiles.layout.OrientationLayout + */ + finalizeOrientationChange(orientationLayouter:yfiles.layout.OrientationLayout):void; + /** + * Returns the {@link yfiles.layout.ColumnDescriptor column} with the given index. + * @param {number} index the index of the column to be returned + * @returns {yfiles.layout.ColumnDescriptor} the {@link yfiles.layout.ColumnDescriptor column} with the given index or null if no such column exists + */ + getColumn(index:number):yfiles.layout.ColumnDescriptor; + /** + * Returns the {@link yfiles.layout.PartitionGrid} instance associated with the given graph. + * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {yfiles.layout.PartitionGrid} the {@link yfiles.layout.PartitionGrid} of the graph or null if the graph has no associated partition grid + * @static + */ + static getPartitionGrid(graph:yfiles.algorithms.Graph):yfiles.layout.PartitionGrid; + /** + * Returns the {@link yfiles.layout.RowDescriptor row} with the given index. + * @param {number} index the index of the row to be returned + * @returns {yfiles.layout.RowDescriptor} the {@link yfiles.layout.RowDescriptor row} with the given index or null if no such row exists + */ + getRow(index:number):yfiles.layout.RowDescriptor; + static hasAtLeastTwoNonEmptyRows(graph:yfiles.algorithms.Graph):boolean; + /** + * Prepares for the orientation changes and is called at the beginning of the {@link yfiles.layout.OrientationLayout} stage. + *

+ * Original points are transferred to their temporary positions through {@link yfiles.layout.OrientationLayout#prepareTransform}. + *

+ * @param {yfiles.layout.OrientationLayout} orientationLayouter an {@link yfiles.layout.OrientationLayout} instance + * @see yfiles.layout.OrientationLayout + */ + prepareOrientationChange(orientationLayouter:yfiles.layout.OrientationLayout):void; + /** + * Data provider key for storing the partition grid structure + *

+ * If the {@link yfiles.algorithms.IDataProvider} contains a partition grid structure, this structure will be considered during + * layout (provided that the layout algorithm supports such constraints). + *

+ * @const + * @static + * @type {yfiles.algorithms.GraphDpKey.} + */ + static PARTITION_GRID_DP_KEY:yfiles.algorithms.GraphDpKey; + /** + * Data provider key for storing a set of partition cells for each node + *

+ * Each node is placed inside the columns/rows defined by the corresponding {@link yfiles.layout.PartitionCellId} identifier. + * Instances can be shared among multiple nodes, but don't have to be shared. + *

+ * @see yfiles.layout.PartitionCellId + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static PARTITION_CELL_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets whether or not the order of the columns should be chosen automatically to minimize edge lengths. + *

+ * 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 sorted again so that the + * overall edge lengths are minimized. + *

+ * @type {boolean} + */ + optimizeColumnOrder:boolean; + /** + * Gets or sets whether or not the order of the rows should be chosen automatically to minimize edge lengths. + *

+ * 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 sorted again so that the + * overall edge lengths are minimized. + *

+ * @type {boolean} + */ + optimizeRowOrder:boolean; + /** + * Gets the list of rows of the {@link yfiles.layout.PartitionGrid partition grid}. + * @type {yfiles.algorithms.YList} + */ + rows:yfiles.algorithms.YList; + /** + * Gets the columns of the {@link yfiles.layout.PartitionGrid partition grid}. + * @type {yfiles.algorithms.YList} + */ + columns:yfiles.algorithms.YList; + static $class:yfiles.lang.Class; + } + /** + * This class represents a row of a {@link yfiles.layout.PartitionGrid partition grid} structure. + *

+ * The results of the calculation of the geometry of the row will be placed into the instances of this class after the + * layout. + *

+ * @see yfiles.layout.PartitionGrid + * @class yfiles.layout.RowDescriptor + * @implements {yfiles.lang.IComparable} + */ + export interface RowDescriptor extends Object,yfiles.lang.IComparable{} + export class RowDescriptor { + /** + * Compares this {@link yfiles.layout.RowDescriptor} instance with a given other {@link yfiles.layout.RowDescriptor} instance based on the + * indices of the two instances. + * @param {Object} o the {@link yfiles.layout.RowDescriptor} to compare to + * @returns {number} -1, 0 or 1 if this {@link yfiles.layout.RowDescriptor} is less than, equal to, or greater than the given other + * {@link yfiles.layout.RowDescriptor} + */ + compareTo(o:Object):number; + /** + * Gets the index of the row within the {@link yfiles.layout.PartitionGrid partition grid}. + * @type {number} + */ + index:number; + /** + * Gets or sets the minimum height of the row. + *

+ * The minimum height is defined to be at least 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum height is negative + * @type {number} + */ + minimumHeight:number; + /** + * Gets or sets the top inset in which no element will lie in the resulting layout. + *

+ * The inset value needs to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given top inset is negative + * @type {number} + */ + topInset:number; + /** + * Gets or sets the bottom inset in which no element will lie in the resulting layout. + *

+ * The inset value needs to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given bottom inset is negative + * @type {number} + */ + bottomInset:number; + /** + * Gets or sets the computed height of the row after the layout has been calculated. + *

+ * The computed height needs to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the computed height is negative + * @type {number} + */ + computedHeight:number; + /** + * Gets or sets the original position (smallest y-coordinate) of the row. + * @type {number} + */ + originalPosition:number; + /** + * Gets or sets the original height of the row. + *

+ * The original height needs to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the original height is negative + * @type {number} + */ + originalHeight:number; + /** + * Gets or sets the computed position (smallest y-coordinate) of the row after the layout has been calculated. + * @type {number} + */ + computedPosition:number; + /** + * Gets or sets the tightness factor of this row. + *

+ * This value must lie within the interval [0,1]. + *

+ *

+ * The larger the value, the more the row will be forced to obtain its minimum height: + *

+ *
    + *
  • a value of 0.0d will disable the compression of the row.
  • + *
  • a value of 1.0d will try to force the row to obtain its specified {@link yfiles.layout.RowDescriptor#minimumHeight minimum height}.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside the interval [0,1] + * @type {number} + */ + tightness:number; + /** + * Gets or sets whether the index of the row is fixed or it should be chosen automatically in order to minimize edge + * lengths. + *

+ * For all rows where this property is enabled, the relative ordering given by the indices is preserved. The remaining rows + * may be sorted again so that the overall edge lengths are minimized. + *

+ * @type {boolean} + */ + indexFixed:boolean; + static $class:yfiles.lang.Class; + } + export enum InterEdgeRoutingStyle{ + /** + * An inter-edge routing style based on which the edge layout of inter-edges will be adopted from the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle + */ + ADOPT, + /** + * An inter-edge routing style based on which inter-edges are routed in an orthogonal style. + * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle + * @see yfiles.layout.FixGroupLayoutStage#interEdgeRouter + */ + ORTHOGONAL, + /** + * An inter-edge routing style based on which inter-edges are routed as straight lines. + * @see yfiles.layout.FixGroupLayoutStage#interEdgeRoutingStyle + * @see yfiles.layout.FixGroupLayoutStage#interEdgeRouter + */ + STRAIGHTLINE + } + /** + * This interface defines {@link yfiles.algorithms.IDataProvider} keys for those layout algorithms that can handle hierarchically + * grouped graphs. + *

+ * There are two groups of {@link yfiles.algorithms.IDataProvider} keys. {@link yfiles.algorithms.IDataProvider}s registered with + * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY} and {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} + * define the relationship of nodes within the hierarchy. A parent node is defined for each node in the graph. This parent + * is the containing group node. For top-level nodes, this parent is null. + *

+ *

+ * {@link yfiles.layout.GroupingKeys#GROUP_NODE_INSETS_DP_KEY} and {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY} are used for + * registering + * {@link yfiles.algorithms.IDataProvider}s that add layout information to group nodes such as the insets and the minimum size + * respectively. + *

+ * @see yfiles.layout.GroupingSupport + * @class yfiles.layout.GroupingKeys + * @static + */ + export interface GroupingKeys extends Object{} + export class GroupingKeys { + /** + * Data provider key for assigning a unique ID for each node. + *

+ * The IDs of the nodes need to differ based on {@link Object#hashCode} and {@link Object#equals}. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for describing the hierarchy of nodes in the graph. + * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static PARENT_NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for distinguishing normal nodes from group nodes. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static GROUP_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for assigning insets for group nodes. + *

+ * Insets reserve space around the contents of a group node. Labels and other visual decorations may be placed inside this + * space. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static GROUP_NODE_INSETS_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for assigning minimum sizes for group nodes. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static MINIMUM_NODE_SIZE_DP_KEY:yfiles.algorithms.NodeDpKey; + static $class:yfiles.lang.Class; + } + /** + * This class provides convenient and efficient access to the hierarchic graph structure. + *

+ * The grouping information is provided through {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys + * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} and + * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}. It describes the hierarchy as a tree where a group node is the parent of the + * nodes that it contains. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[444,-37.38,62,82.38,2,[[444,-15,62,22.38,"9"]]],[460,0,[[469.66,24.35,10.67,18.7,"5"]]],[536,0,[[545.66,24.35,10.67,18.7,"6"]]],[384,0,[[393.66,24.35,10.67,18.7,"4"]]],[596,-10,50,50,2,[[596,12.38,50,22.38,"7"]]],[140,-74.75,214,134.75,2,[[140,-52.38,214,22.38,"10"]]],[156,0,[[165.66,24.35,10.67,18.7,"1"]]],[216,-37.38,122,82.38,2,[[216,-15,122,22.38,"8"]]],[232,0,[[241.66,24.35,10.67,18.7,"2"]]],[292,0,[[301.66,24.35,10.67,18.7,"3"]]]],"e":[],"vp":[140.0,-75.0,506.0,135.0]}} This is an example graph that contains group nodes. {@graph {"ann":{"s":[30,30],"d":1},"n":[[34.5,70,42,52.38,2,[[34.5,92.38,42,22.38,"10"]]],[200,162.38,42,52.38,2,[[200,184.75,42,22.38,"9"]]],[150,277.13,[[159.66,301.48,10.67,18.7,"4"]]],[179.25,0,[[160.9,22.7,66.7,18.7,"Virtual Root"]]],[0,277.13,[[9.66,301.48,10.67,18.7,"1"]]],[206,277.13,[[215.66,301.48,10.67,18.7,"5"]]],[69,162.38,42,52.38,2,[[69,184.75,42,22.38,"8"]]],[50,277.13,[[59.66,301.48,10.67,18.7,"2"]]],[100,277.13,[[109.66,301.48,10.67,18.7,"3"]]],[312,254.75,42,52.38,2,[[312,277.13,42,22.38,"7"]]],[262,277.13,[[271.66,301.48,10.67,18.7,"6"]]]],"e":[[3,0,[194.25,50,55.5,50]],[3,2,[194.25,50,165,50]],[3,1,[194.25,50,221,50]],[0,4,[55.5,142.38,15,142.38]],[1,5],[0,6,[55.5,142.38,90,142.38]],[6,7,[90,234.75,65,234.75]],[6,8,[90,234.75,115,234.75]],[3,9,[194.25,50,333,50]],[3,10,[194.25,50,277,50]]],"vp":[0.0,0.0,354.0,308.0]}} The hierarchy tree of the grouped graph reveals the relationship + * among the nodes. The corresponding nodes have the same labels as in the grouped graph. Group nodes are considered as the + * parents of their content which can consist of group nodes and/or normal nodes. Top-level nodes are children of a + * {@link yfiles.layout.GroupingSupport#root virtual root}. Leaf nodes can either be normal nodes or empty groups. + *

+ * @class yfiles.layout.GroupingSupport + */ + export interface GroupingSupport extends Object{} + export class GroupingSupport { + /** + * Creates a new {@link yfiles.layout.GroupingSupport} instance that represents the hierarchy of the graph. + *

+ * The hierarchy information is cached during the constructor call. Later modifications to the graph are not considered and + * may lead to errors when using this {@link yfiles.layout.GroupingSupport} instance. + *

+ * @param {yfiles.algorithms.Graph} graph the graph instance from which the hierarchy information is obtained + * @constructor + */ + constructor(graph:yfiles.algorithms.Graph); + /** + * Creates a {@link yfiles.algorithms.INodeMap} to store hierarchy information for each node. + *

+ * This method is called in {@link yfiles.layout.GroupingSupport#init} and may be overridden to customize how the {@link yfiles.algorithms.INodeMap} + * is created. + *

+ * @param {yfiles.algorithms.Graph} graph the current graph + * @returns {yfiles.algorithms.INodeMap} the new instance of {@link yfiles.algorithms.INodeMap} + * @see yfiles.layout.GroupingSupport#init + * @see yfiles.layout.GroupingSupport#disposeInfoMap + * @protected + */ + createInfoMap(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeMap; + /** + * Disposes of all internal data structures held by this {@link yfiles.layout.GroupingSupport instance}. + *

+ * {@link yfiles.layout.GroupingSupport} should be disposed of when it is not needed anymore, or if the state of the graph changes + * (e.g. new nodes are added). + *

+ */ + dispose():void; + /** + * Disposes of the {@link yfiles.algorithms.INodeMap} created to store hierarchy information for each node. + *

+ * This method is called in {@link yfiles.layout.GroupingSupport#dispose} and may be overridden to revert changes from + * {@link yfiles.layout.GroupingSupport#createInfoMap}. + *

+ * @param {yfiles.algorithms.Graph} graph the current graph + * @param {yfiles.algorithms.INodeMap} infoMap the {@link yfiles.algorithms.INodeMap} which contains the hierarchy information for each node + * @see yfiles.layout.GroupingSupport#dispose + * @see yfiles.layout.GroupingSupport#createInfoMap + * @protected + */ + disposeInfoMap(graph:yfiles.algorithms.Graph,infoMap:yfiles.algorithms.INodeMap):void; + /** + * Returns the direct children of the given group node. + *

+ * If the {@link yfiles.layout.GroupingSupport#root virtual root of the hierarchy tree} is passed, all top-level nodes are returned. + *

+ * @param {yfiles.algorithms.Node} parent the group node + * @returns {yfiles.algorithms.NodeList} a set of child nodes of the given parent node + * @see yfiles.layout.GroupingSupport#root + * @see yfiles.layout.GroupingSupport#getParent + * @see yfiles.layout.GroupingSupport#getDescendants + */ + getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns all descendants of the given group node. + *

+ * All nodes in the subtree rooted at this group node are collected recursively. + *

+ *

+ * If the {@link yfiles.layout.GroupingSupport#root virtual root of the hierarchy tree} is passed, all nodes in the graph are returned. + *

+ * @param {yfiles.algorithms.Node} parent the group node + * @returns {yfiles.algorithms.NodeList} a set of nodes that belong to a subtree of the hierarchy tree rooted at the given parent + * @see yfiles.layout.GroupingSupport#root + * @see yfiles.layout.GroupingSupport#getParent + * @see yfiles.layout.GroupingSupport#getChildren + */ + getDescendants(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns all edges crossing the bounds of the given group node such that their targets are inside the group node while + * their sources lie outside the group node. + * @param {yfiles.algorithms.Node} group the group node whose bounds are crossed + * @returns {yfiles.algorithms.EdgeList} a set of edges that cross the bounds of the group node starting outside the group node + * @see yfiles.layout.GroupingSupport#getEdgesGoingOut + * @see yfiles.layout.GroupingSupport#isNormalEdge + */ + getEdgesGoingIn(group:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; + /** + * Returns all edges crossing the bounds of the given group node such that their sources are inside the group node while + * their targets lie outside the group node. + * @param {yfiles.algorithms.Node} group the group node whose bounds are crossed + * @returns {yfiles.algorithms.EdgeList} a set of edges that cross the bounds of the group node starting inside the group node + * @see yfiles.layout.GroupingSupport#getEdgesGoingIn + * @see yfiles.layout.GroupingSupport#isNormalEdge + */ + getEdgesGoingOut(group:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; + /** + * Returns the nearest common ancestor of the given nodes in the hierarchy structure. + *

+ * The nearest common ancestor is the local root of the smallest subtree in the hierarchy tree that contains both nodes. + * This group is the first node that contains these two nodes. If no such node exists, the {@link yfiles.layout.GroupingSupport#root virtual root} is returned. + *

+ *

+ * Common ancestors in special cases: + *

+ *
    + *
  • node1 == node2: the parent of node1/node2
  • + *
  • node1 is parent of node2: the parent of node1
  • + *
  • node2 is parent of node1: the parent of node2
  • + *
+ * @param {yfiles.algorithms.Node} node1 one of the two nodes whose common ancestor is determined + * @param {yfiles.algorithms.Node} node2 one of the two nodes whose common ancestor is determined + * @returns {yfiles.algorithms.Node} the nearest common ancestor node or {@link yfiles.layout.GroupingSupport#root} + */ + getNearestCommonAncestor(node1:yfiles.algorithms.Node,node2:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Returns the parent for the given node. + *

+ * The parent is the containing group node. + *

+ * @param {yfiles.algorithms.Node} node the node for which the parent is determined + * @returns {yfiles.algorithms.Node} the parent of the given node or null for a top-level node + * @throws {Stubs.Exceptions.ArgumentError} if the given node is null + * @see yfiles.layout.GroupingSupport#getChildren + * @see yfiles.layout.GroupingSupport#getDescendants + * @see yfiles.layout.GroupingSupport#getNearestCommonAncestor + */ + getParent(node:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Returns an immediate child of the group node that represents the given node. + *

+ * If this node is already a child of the group node, the group node will be its representative. In case the node is + * located further down in the hierarchy, the child of the group node, which is also an ancestor of the node, is used. + * There is no representative if the node is not a descendant of the group. + *

+ * @param {yfiles.algorithms.Node} node the node for which a representative is searched + * @param {yfiles.algorithms.Node} group the group node to which the representative should belong + * @returns {yfiles.algorithms.Node} the representative or null if the node is not a descendant of the group + * @throws {Stubs.Exceptions.ArgumentError} if the given node is null + */ + getRepresentative(node:yfiles.algorithms.Node,group:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Determines whether or not the given node is a group node with children. + *

+ * Normal nodes never have children. + *

+ * @param {yfiles.algorithms.Node} node the potential parent + * @returns {boolean} true if the given node has children, false otherwise + * @see yfiles.layout.GroupingSupport#getChildren + * @see yfiles.layout.GroupingSupport#isGroupNode + */ + hasChildren(node:yfiles.algorithms.Node):boolean; + /** + * Initializes internal data structures. + *

+ * This method is called from {@link yfiles.layout.GroupingSupport} and retrieves the state of the hierarchic graph at the moment + * of invocation. It may be overridden to append additional information used for group handling. + *

+ * @see yfiles.layout.GroupingSupport#dispose + * @protected + */ + init():void; + /** + * Returns whether or not the given graph is flat. + *

+ * A graph is considered to be flat if there exist no group nodes or there exist group nodes but none of them has children. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {boolean} true if there are no groups or only empty groups in the graph, false otherwise + * @see yfiles.layout.GroupingSupport#isGrouped + * @static + */ + static isFlat(graph:yfiles.algorithms.Graph):boolean; + /** + * Returns whether or not the given graph is grouped. + *

+ * A graph is considered to be grouped if there are {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys + * {@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}. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {boolean} true if the graph contains hierarchic information, false otherwise + * @see yfiles.layout.GroupingSupport#isFlat + * @static + */ + static isGrouped(graph:yfiles.algorithms.Graph):boolean; + /** + * Determines whether or not the given node is a group node. + *

+ * While group nodes may have children, normal nodes never have children. + *

+ * @param {yfiles.algorithms.Node} node the potential group node + * @returns {boolean} true if the given node is a group node, false otherwise + * @see yfiles.layout.GroupingSupport#hasChildren + */ + isGroupNode(node:yfiles.algorithms.Node):boolean; + /** + * Determines whether or not the given edge is a normal edge as opposed to an edge that crosses any group node bounds. + *

+ * Source and target of a normal edge are part of the same hierarchy level and share the same parent node. + *

+ * @param {yfiles.algorithms.Edge} edge the edge to check + * @returns {boolean} true if the given edge is normal, false otherwise + * @see yfiles.layout.GroupingSupport#getEdgesGoingIn + * @see yfiles.layout.GroupingSupport#getEdgesGoingOut + */ + isNormalEdge(edge:yfiles.algorithms.Edge):boolean; + /** + * Gets the {@link yfiles.algorithms.Graph} instance for which this {@link yfiles.layout.GroupingSupport} object provides hierarchy + * information. + * @type {yfiles.algorithms.Graph} + */ + graph:yfiles.algorithms.Graph; + /** + * Gets a {@link yfiles.algorithms.Node} instance associated with the virtual root of the hierarchy tree. + *

+ * This instance can be given to the {@link yfiles.layout.GroupingSupport#getChildren} to obtain the nodes of the top level of the + * hierarchy. + *

+ * @see yfiles.layout.GroupingSupport#getChildren + * @type {yfiles.algorithms.Node} + */ + root:yfiles.algorithms.Node; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.ILayoutStage layout stage} that hides the group nodes of hierarchically grouped graphs. + *

+ * This stage removes all group nodes and adjacent edges from the graph before passing it to the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. After the core layout algorithm has arranged the graph, the hidden elements will be reinserted. + *

+ *

+ * This stage is used by layout algorithms that cannot handle grouped graphs (e.g. {@link yfiles.circular.CircularLayout}). + *

+ * @class yfiles.layout.HideGroupsStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface HideGroupsStage extends yfiles.layout.LayoutStageBase{} + export class HideGroupsStage { + /** + * Creates an instance of {@link yfiles.layout.HideGroupsStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Hides the group nodes and their incident edges of the input graph. + *

+ * Furthermore, this method removes all grouping-related {@link yfiles.algorithms.IDataProvider}s from the input graph. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY + * @see yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY + * @see yfiles.layout.GroupingKeys#GROUP_DP_KEY + * @see yfiles.layout.HideGroupsStage#unhideGroupNodes + */ + hideGroupNodes(graph:yfiles.layout.LayoutGraph):void; + /** + * Un-hides the group nodes and their incident edges of the input graph that were previously hidden using method + * {@link yfiles.layout.HideGroupsStage#hideGroupNodes}. + *

+ * Furthermore, this method restores all previously removed grouping related + * {@link yfiles.algorithms.IDataProvider}s on the input graph. + *

+ * @param {yfiles.layout.LayoutGraph} graph the given graph + * @see yfiles.layout.GroupingKeys#NODE_ID_DP_KEY + * @see yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY + * @see yfiles.layout.GroupingKeys#GROUP_DP_KEY + * @see yfiles.layout.HideGroupsStage#hideGroupNodes + */ + unhideGroupNodes(graph:yfiles.layout.LayoutGraph):void; + /** + * Gets or sets whether or not empty group nodes, i.e., group nodes without children, will be hidden by this stage. + * @type {boolean} + */ + hidingEmptyGroupNodes:boolean; + /** + * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance for calculating the sizes of group nodes. + *

+ * For every group which is in its open state, the {@link yfiles.layout.IGroupBoundsCalculator} will be asked to calculate the + * bounds for the group's child nodes. The resulting size will be used during the ongoing layout calculation. + *

+ * @type {yfiles.layout.IGroupBoundsCalculator} + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.IGroupBoundsCalculator} is responsible for calculating the bounds of a group node during a layout + * process. + * @interface + */ + export interface IGroupBoundsCalculator extends Object{ + /** + * Calculates the bounds of the given group node that contains the given list of child nodes. + *

+ * This method is called during the layout process. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} groupNode the group node whose bounds will be calculated + * @param {yfiles.algorithms.NodeList} children a {@link yfiles.algorithms.NodeList} containing the nodes that reside inside the group node + * @returns {yfiles.algorithms.Rectangle2D} a {@link yfiles.algorithms.Rectangle2D} instance that describes the bounds of the group node + * @abstract + */ + 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; + }; + /** + * This {@link yfiles.layout.IGroupBoundsCalculator} calculates the bounds of group nodes and allows to specify custom insets for + * each group node. + *

+ * {@link yfiles.algorithms.Insets Insets} are provided by a {@link yfiles.algorithms.IDataProvider} that must have been registered with the graph using the + * specified {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} prior to the invocation of the layout algorithm. + *

+ * @class yfiles.layout.InsetsGroupBoundsCalculator + * @implements {yfiles.layout.IGroupBoundsCalculator} + */ + export interface InsetsGroupBoundsCalculator extends Object,yfiles.layout.IGroupBoundsCalculator{} + export class InsetsGroupBoundsCalculator { + /** + * Constructs an instance of {@link yfiles.layout.InsetsGroupBoundsCalculator} using the given {@link yfiles.algorithms.IDataProvider} key + * as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey group node insets key} and the given insets as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets}. + * @param {Object} [groupNodeInsetsDPKey=null] the {@link yfiles.algorithms.IDataProvider} key to use as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} + * @param {yfiles.algorithms.Insets} [defaultInsets=null] the insets to use as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets} + * @constructor + */ + constructor(groupNodeInsetsDPKey?:Object,defaultInsets?:yfiles.algorithms.Insets); + /** + * Constructs an instance of {@link yfiles.layout.InsetsGroupBoundsCalculator} using the given {@link yfiles.algorithms.IDataProvider} key + * as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey group node insets key} and the given insets as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets}. + * @param {Object} options The parameters to pass. + * @param {Object} [options.groupNodeInsetsDPKey=null] the {@link yfiles.algorithms.IDataProvider} key to use as {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} + * @param {yfiles.algorithms.Insets} [options.defaultInsets=null] the insets to use as {@link yfiles.layout.InsetsGroupBoundsCalculator#defaultInsets default insets} + * @constructor + */ + constructor(options:{groupNodeInsetsDPKey?:Object,defaultInsets?:yfiles.algorithms.Insets}); + /** + * Calculates the bounds of the given group node and enlarges the bounds by the insets associated with the group node. + *

+ * The {@link yfiles.algorithms.Insets insets} associated with the group node will be retrieved from a {@link yfiles.algorithms.IDataProvider} registered with the + * graph with the current {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} groupNode the group node whose bounds will be calculated + * @param {yfiles.algorithms.NodeList} children a {@link yfiles.algorithms.NodeList} containing the nodes that reside inside the group node + * @returns {yfiles.algorithms.Rectangle2D} a {@link yfiles.algorithms.Rectangle2D} instance that describes the bounds of the group node + */ + calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + /** + * Enlarges the given graph bounds by the insets associated with the given group node. + *

+ * The {@link yfiles.algorithms.Insets insets} associated with the group node will be retrieved from a {@link yfiles.algorithms.IDataProvider} registered with the + * graph with the current {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key}. + *

+ *

+ * This method is called while {@link yfiles.layout.InsetsGroupBoundsCalculator#calculateBounds calculating the group bounds} to realize the support for custom insets. It may be overridden + * to change the way specific insets influence the group node bounds. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} groupNode the group node whose bounds should be enlarged + * @param {yfiles.algorithms.NodeList} children the list of nodes that the given group node contains + * @param {yfiles.algorithms.Rectangle2D} bounds a {@link yfiles.algorithms.Rectangle2D} instance representing the bounds of the given group node + * @returns {yfiles.algorithms.Rectangle2D} a {@link yfiles.algorithms.Rectangle2D} instance representing the enlarged bounds of the given group node + */ + createEnlargedBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList,bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Gets or sets whether or not the labels of nodes contained in a group are considered while calculating the bounds of the + * group node. + * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets whether or not the labels of edges contained in a group are considered while calculating the bounds of the + * group node. + * @type {boolean} + */ + considerEdgeLabels:boolean; + /** + * Gets or sets whether or not the calculation of the bounds of a group node considers the {@link yfiles.layout.NodeHalo NodeHalos} associated with the + * group's child nodes. + * @type {boolean} + */ + considerNodeHalos:boolean; + /** + * Gets or sets the default insets that will be used if the {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.layout.InsetsGroupBoundsCalculator#groupNodeInsetsDpKey insets key} + * does not contain a mapping for a specific node. + * @type {yfiles.algorithms.Insets} + */ + defaultInsets:yfiles.algorithms.Insets; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used to access the insets for the group + * nodes. + *

+ * The {@link yfiles.algorithms.IDataProvider} registered with this key must provide a mapping from each group node to a {@link yfiles.algorithms.Insets} + * (or {@link yfiles.algorithms.Insets}) instance. + *

+ * @type {Object} + */ + groupNodeInsetsDpKey:Object; + static $class:yfiles.lang.Class; + } + /** + * A special {@link yfiles.layout.ComponentLayout} implementation that allows to lay out isolated subgraphs within a group as + * separate components. + *

+ * {@link yfiles.orthogonal.OrthogonalLayout OrthogonalLayout} uses this layout stage to arrange components. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0},"n":[[-5,16,210,336.38,2],[10,110,1],[10,35,1],[85,35,1],[160,35,1],[160,110,1],[10,285],[85,285],[85,210]],"e":[[1,2,0,-15,0,15],[2,3,15,0,-15,0],[3,4,15,0,-15,0],[4,5,0,15,0,-15],[5,1,-15,0,15,0],[6,8,0,-15,-15,0,[25,225]],[8,7,0,15,0,-15],[7,6,-15,0,15,0]],"vp":[-5.0,16.0,210.0,337.0]}} Example of a hierarchically grouped graph with two components that are laid out by {@link yfiles.orthogonal.OrthogonalLayout OrthogonalLayout} as separate + * components. + *

+ * @class yfiles.layout.IsolatedGroupComponentLayout + * @extends {yfiles.layout.ComponentLayout} + */ + export interface IsolatedGroupComponentLayout extends yfiles.layout.ComponentLayout{} + export class IsolatedGroupComponentLayout { + /** + * Creates an instance of {@link yfiles.layout.IsolatedGroupComponentLayout} with the given layout algorithm as + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] the core layout algorithm that will be invoked for each component of the graph + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Determines the nodes that belong to the same graph component. + *

+ * Unlike + * {@link yfiles.layout.ComponentLayout}, this implementation additionally identifies isolated subgraphs within a group as separate + * components. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.INodeMap} compNumber the {@link yfiles.algorithms.INodeMap} that will be filled by the layout algorithm, such that it contains the zero-based index + * of the component number to which each node belongs + * @returns {number} the number of separate components + * @protected + */ + findIsolatedGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; + static $class:yfiles.lang.Class; + } + /** + * This {@link yfiles.layout.IGroupBoundsCalculator} allows custom insets for group nodes and guarantees that their provided + * minimum sizes will be maintained. + *

+ * As a subclass of {@link yfiles.layout.InsetsGroupBoundsCalculator}, this class supports custom insets for each group node. + * Furthermore, it guarantees that a desired minimum size is maintained. The minimum sizes are provided by a {@link yfiles.algorithms.IDataProvider} + * registered with the graph using the specified {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum node size key}. + *

+ * @class yfiles.layout.MinimumSizeGroupBoundsCalculator + * @extends {yfiles.layout.InsetsGroupBoundsCalculator} + */ + export interface MinimumSizeGroupBoundsCalculator extends yfiles.layout.InsetsGroupBoundsCalculator{} + export class MinimumSizeGroupBoundsCalculator { + /** + * Creates a new instance of {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} with the given key as {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum node size key}. + * @param {Object} minSizeDataProviderKey the {@link yfiles.algorithms.IDataProvider} key to use as {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum size key} + * @constructor + */ + constructor(minSizeDataProviderKey:Object); + /** + * Creates a new instance of {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets how the nodes are resized horizontally if the calculated width is smaller than the preferred minimum width + * of a group node. + *

+ * The alignment is defined to be a value between 0 and 1, such that: + *

+ *
    + *
  • A value of 0 means that the nodes grow to the right while the left border remains unchanged.
  • + *
  • A value of 1 means that the nodes grow to the left while the right border remains unchanged.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if the given value does not lie within [0,1] + * @type {number} + */ + xAlignment:number; + /** + * Gets or sets how the nodes are resized vertically if the calculated height is smaller than the preferred minimum height + * of a group node. + *

+ * The alignment is defined to be a value between 0 and 1, such that: + *

+ *
    + *
  • A value of 0 means that the nodes grow downwards while the top border remains unchanged.
  • + *
  • A value of 1 means that the nodes grow upwards while the bottom border remains unchanged.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if the given value does not lie within [0,1] + * @type {number} + */ + yAlignment:number; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used to access the minimum sizes for the + * group nodes. + *

+ * The {@link yfiles.algorithms.IDataProvider} registered with this key must provide a mapping from each group node to a {@link yfiles.algorithms.YDimension} + * object defining the minimum width and height of the group node. + *

+ * @see yfiles.layout.MinimumSizeGroupBoundsCalculator#defaultMinimumNodeSize + * @type {Object} + */ + minimumNodeSizeDpKey:Object; + /** + * Gets or sets the default minimum size (width and height) for group nodes. + *

+ * The default minimum size is used if the {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey minimum size key} does not + * contain a mapping for a group node. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.algorithms.YDimension} is null + * @see yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey + * @type {yfiles.algorithms.YDimension} + */ + defaultMinimumNodeSize:yfiles.algorithms.YDimension; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm recursively traverses a hierarchically organized graph in a bottom-up fashion and applies a + * specified layout algorithm to the contents (direct children) of each group node. + *

+ * Layout Style The way a graph is arranged depends on the {@link yfiles.layout.ILayoutAlgorithm layout algorithms} which are applied to the different group nodes. {@link yfiles.layout.RecursiveGroupLayout} + * is able to produce different layout styles for the content of each group node. + *

+ *

+ * This layout algorithm can be either applied if a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} cannot handle grouped graphs by itself or if the + * content of (some) group nodes should be arranged differently. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[-17.5,755,335,340,2],[166.25,770],[247.5,840],[85,840],[172.5,910],[272.5,910],[72.5,910],[272.5,980],[222.5,910],[97.5,980],[47.5,980],[-2.5,910],[147.5,980],[122.5,1050],[172.5,1050],[197.5,980],[-2.5,980],[-2.5,1050],[929.97,593,673.03,664,2],[1028.43,230.79,493.13,238.42,2],[1451.74,249.79,54.83,54.83],[1043.43,336.11,54.83,54.83],[1376.74,346.07],[1143.26,334.82],[1223.95,267.93,37.09,37.09],[1223.95,335.02,37.09,37.09],[1223.95,402.12,37.09,37.09],[1306.05,338.57],[351.41,46.3,547.17,607.39,2],[392.91,738,464.18,374,2],[600.69,849.79,44.43,44.43],[803.73,927.82,38.37,38.37],[600.69,1024.79,44.43,44.43],[707.91,932],[707.91,1032],[507.91,757],[503.73,852.82,38.37,38.37],[407.91,857],[1329,1038,6],[1269,795,6],[1472,612,6],[1411,1025,6],[1427,744,6],[1355,779,6],[1157,888,6],[1108,838,6],[1230,723,6],[1351,946,6],[1185,810,6],[1387,847,6],[1185,956,6],[1221,1212,6],[1311,715,6],[962,988,6],[1558,700,6],[1053,639,6],[1264,993,6],[1509,1121,6],[1143,742,6],[1453,871,6],[1248,1077,6],[1430,943,6],[1093,947,6],[1173,1025,6],[1249.93,858.93,83.14,83.14,6],[406.42,266.45,6],[535.29,224.58,6],[407.4,568.81,54.23,54.23,6],[366.41,92.7,54.23,54.23,6],[464.05,443.83,6],[450.74,65.3,54.23,54.23,6],[464.05,224.58,6],[592.93,401.96,6],[714.87,571.77,41.35,41.35,6],[842.24,530.39,41.35,41.35,6],[793.59,463.42,41.35,41.35,6],[793.59,597.35,41.35,41.35,6],[614.94,334.2,6],[535.29,443.83,6],[714.87,489,41.35,41.35,6],[406.42,401.96,6],[592.93,266.45,6],[384.4,334.2,6],[595.06,86,54.23,54.23,6],[668.28,135.99,54.23,54.23,6],[720.4,207.72,54.23,54.23,6],[745.32,292.81,54.23,54.23,6]],"e":[[1,2],[1,3],[3,4],[2,5],[3,6],[5,7],[2,8],[6,9],[6,10],[3,11],[4,12],[12,13],[12,14],[4,15],[11,16],[16,17],[0,19,0,-170,0,-119.21,[150,0,1275,0]],[21,22,27.41,13.71,-15,7.5,[1108.26,377.23,1158.26,454.21,1336.05,454.21,1361.74,368.57]],[22,20,15,-0,-27.41,18.28,[1416.74,361.07,1436.74,295.48]],[21,23,27.41,-13.71,-15,-0],[23,20,15,-11.25,-27.41,-18.28,[1183.26,338.57,1208.95,252.93,1391.74,252.93,1436.74,258.93]],[23,24,15,-3.75,-18.55,-0,[1183.26,346.07,1208.95,286.48]],[24,20,18.55,-9.27,-27.41,-0],[23,25,15,3.75,-18.55,-0],[23,26,15,11.25,-18.55,-0,[1183.26,361.07,1208.95,420.66]],[25,27,18.55,-0,-15,-0],[24,27,18.55,9.27,-15,-10,[1271.05,295.75,1291.05,343.57]],[26,27,18.55,-0,-15,10,[1271.05,420.66,1291.05,363.57]],[27,22,15,-0,-15,-7.5],[29,28,0,-187,0,303.7],[31,30,0,-19.18,22.21,0,[822.91,872]],[31,32,0,19.18,0,22.21,[822.91,1097,622.91,1097]],[2,32],[32,30,0,-22.21,0,22.21],[31,33,-19.18,0,15,0],[33,32,-15,0,12.5,-22.21,[635.41,947]],[33,34,0,15,0,-15],[34,32,-15,0,22.21,0],[34,31,15,0,-12.5,19.18,[810.41,1047]],[35,30,15,0,0,-22.21,[622.91,772]],[35,36,0,15,0,-19.18],[32,36,-22.21,-12.5,0,19.18,[522.91,1034.5]],[36,30,19.18,0,-22.21,0],[36,37,-19.18,0,15,0],[32,37,-22.21,0,0,15,[422.91,1047]],[37,35,0,-15,-15,0,[422.91,772]],[42,40],[42,54],[41,57],[58,55],[60,51],[62,53],[64,38],[64,39],[64,41,[1330.6,964.06,1337.99,974.52,1346.6,984.13,1356.64,992.4]],[64,42,[1301.28,892.93,1380.34,828.69,1390.42,819.61,1400.14,810]],[64,43],[64,44],[64,45],[64,46,[1257.8,823.49,1254.58,812.63,1252.57,801.6]],[64,47],[64,48],[64,49],[64,50],[64,52,[1313.2,816.82,1315.29,805.72]],[64,56],[64,58,[1227.75,807.43,1218.48,798.12,1198.26,783.57]],[64,59,[1401.91,896.21,1413.4,895.03]],[64,60,[1249.83,992.24,1246.96,1005.02,1247.3,1018.2]],[64,61],[64,62],[64,63],[40,19],[69,67],[65,71],[66,71],[71,70],[71,69],[71,68],[72,21],[73,74],[75,74],[73,76],[74,76],[77,72],[77,71],[71,78],[78,72],[78,69],[72,79],[79,75],[79,73],[69,80],[72,80],[66,81],[81,77],[65,82],[82,81],[82,80],[82,77],[83,81],[84,81],[85,81],[86,81],[51,33]],"vp":[-18.0,0.0,1621.0,1257.0]}}Concept + *

+ *

+ * {@link yfiles.layout.RecursiveGroupLayout} uses a hierarchy tree representation of the grouped graph in which the content nodes + * are the children of their containing group node. That way, it can traverse the tree recursively while arranging only the + * direct children of each group node. The layout algorithm starts by arranging the leaves in the hierarchy tree, then + * works its way up to the root computing the layout for each group node in the tree. + *

+ *

+ * All nodes other than the direct children are temporarily hidden. The layout algorithm performs two steps for each group + * node. + *

+ *
    + *
  1. + * It arranges the direct children using either the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} or a special layout algorithm retrieved from a {@link yfiles.algorithms.IDataProvider} + * registered with + * {@link yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY}. The content of group nodes among the children is already + * arranged at this time and will be ignored. These group nodes are handled like normal nodes with a size that encloses the + * content. + *
  2. + *
  3. + * Then {@link yfiles.layout.RecursiveGroupLayout} computes the final size of the group node using an implementation of + * {@link yfiles.layout.IGroupBoundsCalculator}. Customized {@link yfiles.layout.IGroupBoundsCalculator}s can be specified using + * {@link yfiles.layout.RecursiveGroupLayout#groupBoundsCalculator}. Aside from the resulting layout, this size is used in the following iteration. + *
  4. + *
+ *

+ * After a layout is applied to all group nodes, the layout algorithm computes routes for the edges whose source node is + * located at a different hierarchy level than its target node. The edge routing algorithm for these so-called inter-edges + * can be {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter customized}. + *

+ *

+ * Note that {@link yfiles.layout.RecursiveGroupLayout} can run without a + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. In this case no layout is calculated, instead the group node bounds are merely adjusted to fit + * their respective contents. + *

+ *

+ * Features There are two alternatives for applying different layout styles to the contents of group nodes: + *

+ *
    + *
  1. + * Mapping each group node to a corresponding {@link yfiles.layout.ILayoutAlgorithm layout algorithm} by registering a {@link yfiles.algorithms.IDataProvider} with key + * {@link yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY}. The content of the hierarchy root is arranged with the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *
  2. + *
  3. Using {@link yfiles.layout.LayoutMultiplexer} as {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}.
  4. + *
+ *

+ * Since {@link yfiles.layout.RecursiveGroupLayout} delegates the actual arrangement of the graph to other layout algorithms, it + * will support the same features as the currently used layout algorithm. + *

+ *

+ * The improvement of the routing of inter-edges is based on the {@link yfiles.layout.RecursiveGroupLayout#autoAssignPortCandidates insertion} of {@link yfiles.layout.PortCandidate}s or the {@link yfiles.layout.RecursiveGroupLayout#replacePortConstraints conversion} + * of {@link yfiles.layout.PortConstraint}s into {@link yfiles.layout.PortCandidate}s. Hence, they only work well if the applied layout + * algorithm supports {@link yfiles.layout.PortCandidate}s. + *

+ *

+ * This algorithm also provides a {@link yfiles.layout.RecursiveGroupLayout#fromSketchMode From Sketch mode} that should be activated if the applied layout algorithm runs in From + * Sketch mode, too. Otherwise, the initial coordinates may not be considered correctly. + *

+ * @class yfiles.layout.RecursiveGroupLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface RecursiveGroupLayout extends yfiles.layout.LayoutStageBase{} + export class RecursiveGroupLayout { + /** + * Creates a new instance of {@link yfiles.layout.RecursiveGroupLayout} with default settings using the given {@link yfiles.layout.ILayoutAlgorithm layout algorithm} and + * {@link yfiles.layout.IGroupBoundsCalculator} implementation. + * @param {yfiles.layout.ILayoutAlgorithm} core the layout algorithm that is applied in each step of the recursion + * @param {yfiles.layout.IGroupBoundsCalculator} gbc the {@link yfiles.layout.IGroupBoundsCalculator} for calculating group sizes + * @constructor + */ + constructor(core:yfiles.layout.ILayoutAlgorithm,gbc:yfiles.layout.IGroupBoundsCalculator); + /** + * Creates a new instance of {@link yfiles.layout.RecursiveGroupLayout} with an optional core layout algorithm. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The layout algorithm that is applied in each recursion step. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Reroutes the given inter-edges using the current {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter edge routing algorithm}. + *

+ * This method is called after calculating the overall layout when the positions of all nodes and normal edges are fixed. + *

+ *

+ * If no {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter inter-edge router} is specified, this method resets the path of all inter-edges that don't connect to the proper + * location within the group. This may happen for inter-edges without + * {@link yfiles.layout.PortCandidate}s or if the applied layout algorithm doesn't support such constraints. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.EdgeList} interEdges the edges which traverse the boundary of a group node + * @see yfiles.layout.RecursiveGroupLayout#autoAssignPortCandidates + * @see yfiles.layout.RecursiveGroupLayout#replacePortConstraints + * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter + * @protected + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; + /** + * Data provider key for arranging the content of each group node with an individual layout algorithm. + *

+ * The specified layouter instance is applied to the content of the group node. To arrange the top level elements the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} + * is used. + *

+ * @see yfiles.layout.RecursiveGroupLayout#NULL_LAYOUT + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static GROUP_NODE_LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for assigning source split ids to edges connecting to group nodes. + *

+ * The edges will be aligned with edges that connect to the same group node and have the same split id at their source + * (preferably) or target. + *

+ * @see yfiles.layout.RecursiveGroupLayout#TARGET_SPLIT_ID_DP_KEY + * @see yfiles.hierarchic.HierarchicLayout + * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static SOURCE_SPLIT_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for assigning target split ids to edges connecting to group nodes. + *

+ * The edges will be aligned with edges that connect to the same group node and have the same split id at their source or + * target (preferably). + *

+ * @see yfiles.layout.RecursiveGroupLayout#SOURCE_SPLIT_ID_DP_KEY + * @see yfiles.hierarchic.HierarchicLayout + * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static TARGET_SPLIT_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * A constant that represents a {@link yfiles.layout.ILayoutAlgorithm} implementation that does nothing. + *

+ * This implementation can be assigned to group nodes to keep their content unchanged. The layout algorithm will still + * calculate the sizes of the group nodes. + *

+ * @const + * @static + * @type {yfiles.layout.ILayoutAlgorithm} + */ + static NULL_LAYOUT:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets whether or not to consider the initial coordinates of the graph elements. + *

+ * When using the initial coordinates, {@link yfiles.layout.RecursiveGroupLayout} sets the coordinates of the nodes to their + * initial position before the corresponding {@link yfiles.layout.ILayoutAlgorithm layout algorithm} is called. + *

+ * @type {boolean} + */ + fromSketchMode:boolean; + /** + * Gets or sets whether or not temporary {@link yfiles.layout.PortCandidate}s are inserted to improve the routing of inter-edges. + *

+ * If enabled, {@link yfiles.layout.RecursiveGroupLayout} will insert {@link yfiles.layout.PortCandidate}s for all inter-edges that cross a + * group node border. Those {@link yfiles.layout.PortCandidate}s are located at the relative position of the real source/target + * node. Inter-edges that connect to such {@link yfiles.layout.PortCandidate}s will be routed when the layout of the containing + * group node is calculated and will not be {@link yfiles.layout.RecursiveGroupLayout#routeInterEdges rerouted} later. This may produce more suitable edge routes but cannot prevent + * edges from crossing nodes. + *

+ *

+ * Without temporary or user specified {@link yfiles.layout.PortCandidate}s, inter-edges will always end at the border/center of + * the corresponding group node. Thus, they are rerouted afterwards using an {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter edge routing algorithm}. + *

+ * @see yfiles.layout.RecursiveGroupLayout#routeInterEdges + * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter + * @see yfiles.layout.PortCandidate + * @type {boolean} + */ + autoAssignPortCandidates:boolean; + /** + * Gets or sets whether or not {@link yfiles.layout.PortConstraint}s of inter-edges are temporarily replaced by + * {@link yfiles.layout.PortCandidate}s. + *

+ * If disabled, inter-edges will always end at the border/center of the corresponding group node, even if those edges have + * port constraints. Thus, they are {@link yfiles.layout.RecursiveGroupLayout#routeInterEdges rerouted} later without considering the constraint. Enabling this settings may produce + * more suitable edge routes but cannot prevent edges from crossing nodes. + *

+ *

+ * 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. + *

+ * @see yfiles.layout.RecursiveGroupLayout#routeInterEdges + * @see yfiles.layout.PortCandidate + * @type {boolean} + */ + replacePortConstraints:boolean; + /** + * Gets or sets whether empty group nodes are handled like group nodes with content or like normal nodes. + *

+ * If they are handled like other group nodes, {@link yfiles.layout.RecursiveGroupLayout} will resize them according to their + * (non-existing) content. This results in small empty group nodes. Handled like normal nodes, empty group nodes will keep + * their initial size. + *

+ * @type {boolean} + */ + considerEmptyGroups:boolean; + /** + * Gets or sets the current edge routing algorithm for handling 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, these edges have to be routed after restoring the original graph structure + * using this edge routing algorithm. + *

+ *

+ * It is required that a suitable {@link yfiles.layout.RecursiveGroupLayout#interEdgesDpKey selection key} is specified. The same selection key must be used for setting the sphere of + * action for the edge router. + *

+ * @see yfiles.layout.RecursiveGroupLayout#interEdgesDpKey + * @type {yfiles.layout.ILayoutAlgorithm} + */ + interEdgeRouter:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the key for marking the inter-edges to be routed. + *

+ * The key should be used by the specified {@link yfiles.layout.RecursiveGroupLayout#interEdgeRouter inter-edge routing algorithm} to obtain the edges to be routed. This layouter + * automatically marks these edges and registers the {@link yfiles.algorithms.IDataProvider} using the specified key. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @see yfiles.layout.RecursiveGroupLayout#interEdgeRouter + * @type {Object} + */ + interEdgesDpKey:Object; + /** + * Gets or sets a {@link yfiles.layout.IGroupBoundsCalculator} which computes the sizes of all group nodes. + *

+ * This {@link yfiles.layout.IGroupBoundsCalculator} is used each time after calculating the layout for a content graph. + *

+ * @type {yfiles.layout.IGroupBoundsCalculator} + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + static $class:yfiles.lang.Class; + } + export enum OperationType{ + /** + * Operation specifier defining that the graph will be mirrored at the x-axis. + * @see yfiles.layout.GraphTransformer#operation + */ + MIRROR_X_AXIS, + /** + * Operation specifier defining that the graph will be mirrored at the y-axis. + * @see yfiles.layout.GraphTransformer#operation + */ + MIRROR_Y_AXIS, + /** + * Operation specifier defining that the graph will be rotated. + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.GraphTransformer#rotationAngle + * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled + */ + ROTATE, + /** + * Operation specifier defining that the graph will be scaled. + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.GraphTransformer#scaleFactor + * @see yfiles.layout.GraphTransformer#setScaleFactors + * @see yfiles.layout.GraphTransformer#scaleNodeSize + */ + SCALE, + /** + * Operation specifier defining that the graph will be translated. + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.GraphTransformer#translateX + * @see yfiles.layout.GraphTransformer#translateY + */ + TRANSLATE + } + /** + * This layout algorithm applies geometric transformations to (sub-)graphs. + *

+ * Layout Style There are several ways to transform the graph that include mirroring, rotating, scaling and translating. {@graph {"ann":{"s":[30,30],"d":1},"n":[[-15,235],[-15,360],[-15,110],[235,485],[110,485],[360,485],[-15,485],[485,235],[485,360],[235,-15],[110,-15],[360,-15],[485,110],[-15,-15],[485,485],[485,-15],[235,235,1],[146.61,146.61,1],[146.61,323.39,1],[58.22,235,1],[323.39,323.39,1],[235,411.78,1],[323.39,146.61,1],[235,58.22,1],[411.78,235,1]],"e":[[1,0],[0,2],[4,3],[3,5],[1,6],[6,4],[7,8],[9,10],[11,9],[12,7],[2,13],[13,10],[8,14],[14,5],[11,15],[12,15],[16,17],[16,18],[19,17],[19,18],[20,16],[18,21],[21,20],[22,16],[23,22],[23,17],[20,24],[22,24],[17,0],[19,1],[23,2],[18,3],[4,19],[5,21],[20,7],[21,8],[9,22],[10,23],[24,11],[24,12]],"vp":[-15.0,-15.0,530.0,530.0]}} + *

+ *

+ * The highlighted subgraph is rotated by 45 degrees + *

+ *

+ * Features + *

+ *

+ * The layout can be {@link yfiles.layout.OperationType#SCALE scaled} with independent factors for the horizontal and vertical scaling. Optionally, the sizes of + * nodes can be scaled, too. + *

+ *

+ * The layout can be mirrored either on the {@link yfiles.layout.OperationType#MIRROR_X_AXIS x-axis} or the {@link yfiles.layout.OperationType#MIRROR_Y_AXIS y-axis}. + *

+ *

+ * A {@link yfiles.layout.OperationType#ROTATE rotation} can be specified. Instead of {@link yfiles.layout.GraphTransformer#rotationAngle defining} a rotation angle the angle can be {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled determined automatically} to fit + * specific bounds. + *

+ *

+ * The coordinates in the layout can be {@link yfiles.layout.OperationType#TRANSLATE translated} by a specific vector. + *

+ *

+ * To only apply previously mentioned transformations to a subgraph, the {@link yfiles.layout.SubgraphLayout} needs to be {@link yfiles.layout.MultiStageLayout#subgraphLayoutEnabled enabled}. + * Then the nodes in the subgraph must be marked in a {@link yfiles.algorithms.IDataProvider} registered with the according {@link yfiles.layout.SubgraphLayout#affectedNodesDpKey key}. + *

+ * @class yfiles.layout.GraphTransformer + * @extends {yfiles.layout.MultiStageLayout} + * @implements {yfiles.layout.ILayoutStage} + */ + export interface GraphTransformer extends yfiles.layout.MultiStageLayout,yfiles.layout.ILayoutStage{} + export class GraphTransformer { + /** + * Creates a new instance of {@link yfiles.layout.GraphTransformer} with default settings. + * @constructor + */ + constructor(); + /** + * Rotates the given graph so its resulting bounding box fits best to the given bounds. + * @param {yfiles.layout.LayoutGraph} graph the graph that is rotated + * @param {number} width the width of the preferred layout bounds + * @param {number} height the height of the preferred layout bounds + * @returns {number} the rotation angle + * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled + * @static + */ + static applyBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; + /** + * Returns the rotation angle for the graph that will result in a layout that fits best to the given bounds. + * @param {yfiles.layout.LayoutGraph} graph the graph that is rotated + * @param {number} width the width of the preferred layout bounds + * @param {number} height the height of the preferred layout bounds + * @returns {number} the rotation angle + * @see yfiles.layout.GraphTransformer#applyBestFitRotationAngle + * @static + */ + static findBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; + /** + * Specifies the preferred size of the layout. + *

+ * If performing a {@link yfiles.layout.OperationType#ROTATE rotation} and this rotation should be + * {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled automatically fitted}, then the given preferred size defines the aspect ratio that will be used for fitting the layout + * rotation. + *

+ *

+ * The preferred width and height need to be non-negative. + *

+ * @param {number} width the preferred width of the layout + * @param {number} height the preferred height of the layout + * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is negative + * @see yfiles.layout.GraphTransformer#preferredWidth + * @see yfiles.layout.GraphTransformer#preferredHeight + * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#ROTATE + */ + preferredLayoutSize(width:number,height:number):void; + /** + * Fits the given graph into the specified rectangular bounds. + *

+ * If the bounding box fits in the given bounds, nothing is done. Otherwise, the graph is scaled and optionally moved to + * fit. + *

+ * @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 + * @static + */ + static setMaximalBounds(graph:yfiles.layout.LayoutGraph,x:number,y:number,w:number,h:number):void; + /** + * Specifies the horizontal and vertical scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. + *

+ * Only positive scaling factors are allowed. + *

+ * @param {number} xFactor the horizontal scaling factor + * @param {number} yFactor the vertical scaling factor + * @throws {Stubs.Exceptions.ArgumentError} if one the specified scaling factors is negative or 0 + * @see yfiles.layout.GraphTransformer#scaleFactorX + * @see yfiles.layout.GraphTransformer#scaleFactorY + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#SCALE + */ + setScaleFactors(xFactor:number,yFactor:number):void; + /** + * Translates the layout coordinates by the given vector. + * @param {yfiles.layout.LayoutGraph} graph the graph that is translated + * @param {number} dx the horizontal distance the given graph is moved + * @param {number} dy the vertical distance the given graph is moved + * @see yfiles.layout.OperationType#TRANSLATE + * @see yfiles.layout.GraphTransformer#operation + * @static + */ + static translate(graph:yfiles.layout.LayoutGraph,dx:number,dy:number):void; + /** + * + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the transformation operation. + * @throws {Stubs.Exceptions.ArgumentError} if the specified operation is unknown + * @type {yfiles.layout.OperationType} + */ + operation:yfiles.layout.OperationType; + /** + * Gets or sets the angle of rotation. + *

+ * The angle must be given in degrees. + *

+ * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#ROTATE + * @type {number} + */ + rotationAngle:number; + /** + * Gets or sets whether or not to automatically choose the best fitting rotation angle. + *

+ * The angle will be chosen such that the bounding box after the rotation fits best to the {@link yfiles.layout.GraphTransformer#preferredLayoutSize preferred aspect ratio}. + *

+ * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#ROTATE + * @type {boolean} + */ + bestFitRotationEnabled:boolean; + /** + * Gets or sets the preferred height of the layout. + *

+ * This value will be used for {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled fitting the rotation} to preferred bounds. + *

+ *

+ * The preferred height needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified height is negative + * @see yfiles.layout.GraphTransformer#preferredWidth + * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#ROTATE + * @type {number} + */ + preferredHeight:number; + /** + * Gets or sets the preferred width of the layout. + *

+ * This value will be used for {@link yfiles.layout.GraphTransformer#bestFitRotationEnabled fitting the rotation} to preferred bounds. + *

+ *

+ * The preferred width needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified width is negative + * @see yfiles.layout.GraphTransformer#preferredHeight + * @see yfiles.layout.GraphTransformer#bestFitRotationEnabled + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#ROTATE + * @type {number} + */ + preferredWidth:number; + /** + * Gets or sets whether or not to also scale node sizes when performing the {@link yfiles.layout.OperationType#SCALE scale operation}. + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#SCALE + * @type {boolean} + */ + scaleNodeSize:boolean; + /** + * Sets the uniform scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. + *

+ * This factor applies vertical and horizontal. + *

+ *

+ * Only positive scaling factors are allowed. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 + * @see yfiles.layout.GraphTransformer#scaleFactorX + * @see yfiles.layout.GraphTransformer#scaleFactorY + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#SCALE + * @type {number} + */ + scaleFactor:number; + /** + * Gets or sets the vertical scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. + *

+ * Only positive scaling factors are allowed. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 + * @see yfiles.layout.GraphTransformer#scaleFactorX + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#SCALE + * @type {number} + */ + scaleFactorY:number; + /** + * Gets or sets the horizontal scaling factor used for the {@link yfiles.layout.OperationType#SCALE scale operation}. + *

+ * Only positive scaling factors are allowed. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified scaling factor is negative or 0 + * @see yfiles.layout.GraphTransformer#scaleFactorY + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#SCALE + * @type {number} + */ + scaleFactorX:number; + /** + * Gets or sets the horizontal translation distance. + *

+ * A positive value means the graph is moved to the right while, a negative value means the graph is moved to the left. + *

+ * @see yfiles.layout.GraphTransformer#translateY + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#TRANSLATE + * @type {number} + */ + translateX:number; + /** + * Gets or sets the vertical translation distance. + *

+ * A positive value means the graph is moved downwards, while a negative value means the graph is moved upwards. + *

+ * @see yfiles.layout.GraphTransformer#translateX + * @see yfiles.layout.GraphTransformer#operation + * @see yfiles.layout.OperationType#TRANSLATE + * @type {number} + */ + translateY:number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.BendConverter} replaces edge bends with dummy nodes for the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. + *

+ * Concept Replacing the bends works in three steps: + *

+ *
    + *
  1. Replacing the bends and the edge segments between them with dummy nodes and edges
  2. + *
  3. Invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} on the altered graph
  4. + *
  5. Recreating the bends and removing all dummy elements
  6. + *
+ *

+ * When the dummy elements have been inserted, edge information about {@link yfiles.layout.BendConverter#adoptPortConstraints port constraints}, {@link yfiles.layout.BendConverter#adoptEdgeGroups edge groups} and {@link yfiles.layout.BendConverter#adoptAffectedEdges selection state} can + * be adopted from the original edges. That way, the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} can access the mentioned information. + *

+ * @class yfiles.layout.BendConverter + * @implements {yfiles.layout.ILayoutStage} + */ + export interface BendConverter extends Object,yfiles.layout.ILayoutStage{} + export class BendConverter { + /** + * Creates a new {@link yfiles.layout.BendConverter} instance with the given size as the width and height for the dummy nodes. + * @param {number} size the size for the dummy nodes + * @throws {Stubs.Exceptions.ArgumentError} if the given size is negative + * @constructor + */ + constructor(size:number); + /** + * Creates a new instance of {@link yfiles.layout.BendConverter} with the given {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} core the core layout algorithm + * @constructor + */ + constructor(core:yfiles.layout.ILayoutAlgorithm); + /** + * Creates a new {@link yfiles.layout.BendConverter} instance with default settings. + * @constructor + */ + constructor(); + /** + * Adds information to newly created dummy nodes. + *

+ * This is a callback method that will be invoked after new elements for the given edge have been added to the given graph + * by {@link yfiles.layout.BendConverter#prepare}. At this point, the original edge is still in the graph. + *

+ *

+ * The current implementation does nothing. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the edge whose bends were replaced by the given dummy nodes + * @param {yfiles.algorithms.NodeList} dummyNodes the dummy nodes representing the bends of the edge + * @protected + */ + addedPathForEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dummyNodes:yfiles.algorithms.NodeList):void; + /** + * Replaces all bends in the current {@link yfiles.layout.BendConverter#DEFAULT_AFFECTED_EDGES_DP_KEY scope} with dummy nodes before invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. + *

+ * After the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} has finished, the edges between the dummy nodes are reconnected and the dummy nodes are + * replaced by bends again. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Prepares the graph before calling the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. + *

+ * The bends of the edges belonging to the current scope are replaced by dummy nodes and the segments between those dummy + * nodes are replaced by dummy edges. + *

+ *

+ * Edge-specific information like {@link yfiles.layout.PortConstraint}s, edge groups or selection state can be applied to the dummy + * edges to keep this information for the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. + *

+ *

+ * This method is called by {@link yfiles.layout.BendConverter#applyLayout} before invoking the + * {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. It may be overridden to extend the edge-specific information that should be adopted by the dummy + * edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @see yfiles.layout.BendConverter#restore + * @see yfiles.layout.BendConverter#adoptAffectedEdges + * @see yfiles.layout.BendConverter#adoptPortConstraints + * @see yfiles.layout.BendConverter#adoptEdgeGroups + * @protected + */ + prepare(graph:yfiles.layout.LayoutGraph):void; + /** + * Restores the structure of the graph after the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} has finished. + *

+ * This method is called by {@link yfiles.layout.BendConverter#applyLayout} after invoking the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm}. It may be + * overridden to clean up all additional information added in {@link yfiles.layout.BendConverter#prepare}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph arranged by the {@link yfiles.layout.BendConverter#coreLayout core layout algorithm} + * @see yfiles.layout.BendConverter#prepare + * @see yfiles.layout.BendConverter#adoptAffectedEdges + * @see yfiles.layout.BendConverter#adoptPortConstraints + * @see yfiles.layout.BendConverter#adoptEdgeGroups + * @protected + */ + restore(graph:yfiles.layout.LayoutGraph):void; + /** + * Data provider key for specifying the set of edges for which this stage will replace bends + *

+ * Only the bends of the marked edges will be replaced with dummy nodes. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the core layout algorithm that is wrapped by this {@link yfiles.layout.ILayoutStage}. + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets whether or not edge grouping information of the original edge should be adopted by its replacement edges. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {boolean} + */ + adoptEdgeGroups:boolean; + /** + * Gets or sets whether or not the associated + * {@link yfiles.layout.PortConstraint}s of the original edge should be adopted by its replacement edges. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {boolean} + */ + adoptPortConstraints:boolean; + /** + * Gets or sets whether or not the selection state of the original edge should be adopted by its replacement edges. + *

+ * The selection state is looked up in a {@link yfiles.algorithms.IDataProvider} registered with the key returned by {@link yfiles.layout.BendConverter#affectedEdgesDpKey}. + *

+ * @see yfiles.layout.BendConverter#affectedEdgesDpKey + * @type {boolean} + */ + adoptAffectedEdges:boolean; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which identifies edges as selected. + *

+ * If {@link yfiles.layout.BendConverter#adoptAffectedEdges the selection is conserved}, the selection state described by the {@link yfiles.algorithms.IDataProvider} registered with this + * key is applied to the according dummy edges. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @see yfiles.layout.BendConverter#adoptAffectedEdges + * @type {Object} + */ + affectedEdgesDpKey:Object; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.BufferedLayout} is a hull algorithm that invokes its {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} on a copy of the input graph. + *

+ * After the layout process has finished, the calculated layout will be written back to the original 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 only provides a graph interface + * adapter to the yFiles graph layout machinery. + *

+ * @class yfiles.layout.BufferedLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface BufferedLayout extends yfiles.layout.LayoutStageBase{} + export class BufferedLayout { + /** + * Creates a new {@link yfiles.layout.BufferedLayout} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] the core layout routine + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.ComponentLayout} arranges the connected components of a graph. + *

+ * Layout Style The components can be arranged using different {@link yfiles.layout.ComponentLayout#style styles}. All styles except {@link yfiles.layout.ComponentArrangementStyles#NONE} + * place the components without overlaps. {@graph {"ann":{"s":[30,30],"d":1},"n":[[552,150],[477,75],[75,150],[150,375],[150,225],[150,300],[351,150],[150,75],[0,150],[552,75],[477,0],[426,75],[351,225],[552,225],[150,150],[351,0],[276,75],[351,75],[75,300],[426,150],[225,150],[75,75],[225,300],[150,0],[477,351],[477,276],[553,351],[553,276],[150,450],[327,402],[276,402],[378,402],[429,402]],"e":[[0,1,-15,0,0,15,[492,165]],[3,5,0,-15,0,15],[5,4,0,-15,0,15],[8,2,15,0,-15,0],[0,9,0,-15,0,15],[9,1,-15,0,15,0],[1,10,0,-15,0,15],[12,6,0,-15,0,15],[0,13,0,15,0,-15],[4,14,0,-15,0,15],[14,2,-15,0,15,0],[14,7,0,-15,0,15],[16,15,0,-15,-15,0,[291,15]],[15,17,0,15,0,-15],[17,11,15,0,-15,0],[17,6,0,15,0,-15],[17,16,-15,0,15,0],[18,5,15,0,-15,0],[6,19,15,0,-15,0],[19,11,0,-15,0,15],[20,14,-15,0,15,0],[2,21,0,-15,0,15],[22,5,-15,0,15,0],[22,20,0,-15,0,15],[23,7,0,15,0,-15],[24,25,0,-15,0,15],[24,26],[26,27,0,-15,0,15],[25,27],[3,28,0,15,0,-15],[30,29],[31,32]],"vp":[0.0,0.0,583.0,480.0]}} + *

+ *

+ * Layout with orthogonal components using {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_COMPACT} + *

+ *

+ * Concept + *

+ *

+ * {@link yfiles.layout.ComponentLayout} is a {@link yfiles.layout.ILayoutStage} that can wrap another {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. That way, it + * allows handling disconnected graphs for the wrapped {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ *

+ * The following steps outline the concept of {@link yfiles.layout.ComponentLayout}: + *

+ *
    + *
  1. Determine the connected components of the graph
  2. + *
  3. Hide all graph components
  4. + *
  5. Apply the following steps to each component separately
  6. + *
  7. Unhide all graph components
  8. + *
  9. {@link yfiles.layout.ComponentLayout#componentArrangement Optionally arrange} the components
  10. + *
+ *

+ * Features + *

+ *

+ * To arrange the subgraphs of the components, {@link yfiles.layout.ComponentLayout} uses the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. If + * there is no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} specified, it will keep the locations in the subgraph and arrange the components as + * they are. + *

+ *

+ * Hierarchically grouped graphs are handled in a special way. The contents of a group node will always belong to the same + * component as the group node itself. To change that behavior {@link yfiles.layout.ComponentLayout#considerGrouping grouping} can be disabled. + *

+ *

+ * By default, the components consist of the connected nodes in a graph. To choose custom subgraphs to form components, + * register a {@link yfiles.algorithms.IDataProvider} with {@link yfiles.layout.ComponentLayout#COMPONENT_ID_DP_KEY} and assign component + * IDs to the nodes. + *

+ * @see yfiles.layout.MultiStageLayout + * @class yfiles.layout.ComponentLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface ComponentLayout extends yfiles.layout.LayoutStageBase{} + export class ComponentLayout { + /** + * Creates a new {@link yfiles.layout.ComponentLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algortihm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Produces a component graph layout. + *

+ * This method is called by {@link yfiles.layout.ComponentLayout#applyLayout} in case {@link yfiles.layout.ComponentLayout#componentArrangement component arrangement} is enabled. It moves + * the graph's components such that their bounding boxes do not overlap. Subclasses may want to override this method to + * introduce custom component arrangement styles. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {Array.} nodes the nodes of the components; the i-th list contains the nodes of the i-th component + * @param {Array.} edges the edges of the components; the i-th list contains the edges of the i-th component + * @param {Array.} bbox the bounds of the components; the i-th rectangle describes the bounding box of the i-th component + * @param {Array.} boxes the extended bounds of the components; the i-th rectangle describes the bounding box of the i-th component extended by + * the spacing between components. 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 + * @see yfiles.layout.ComponentLayout#arrangeFields + * @protected + */ + arrangeComponents(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[]):void; + /** + * Arranges the bounding boxes of the components. + *

+ * This method is called by {@link yfiles.layout.ComponentLayout#arrangeComponents} if the {@link yfiles.layout.ComponentLayout#style style} is set to + * {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, + * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE} + * or + * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. It may be overridden to adjust the component arrangement + * strategy of the mentioned styles. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {Array.} nodes the nodes of the components; the i-th list contains the nodes of the i-th component + * @param {Array.} edges the edges of the components; the i-th list contains the edges of the i-th component + * @param {Array.} bbox the bounds of the components; the i-th rectangle describes the bounding box of the i-th component + * @param {Array.} boxes the extended bounds of the components; the i-th rectangle describes the bounding box of the i-th component + * @param {boolean} circular true if the arrangement should be circular, false if it should be rectangular + * @param {boolean} fill true if it is allowed to place components in empty spaces inside other + * components, false otherwise + * @param {boolean} fromSketch true if the initial coordinates should be considered, false otherwise + * @protected + */ + 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; + /** + * Calculates the bounding box of a graph component including {@link yfiles.layout.NodeHalo}s. + *

+ * This method will be invoked for each component of the graph. Depending on the state of property + * {@link yfiles.layout.ComponentLayout#considerLabels}, the returned bounding box will also include node and edge labels. It may be overridden to extend the bounds to reserve + * space for other elements. + *

+ * @param {yfiles.layout.LayoutGraph} graph the subgraph containing the nodes and edges of a component + * @returns {yfiles.algorithms.Rectangle2D} the bounding box of the component + * @see yfiles.layout.ComponentLayout#considerLabels + * @protected + */ + calculateBounds(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.Rectangle2D; + /** + * Determines which nodes belong to the same graph component. + *

+ * This implementation uses the graph connectivity to sort the nodes into different components. Nodes that are not + * connected by a path will be in separate components. + *

+ *

+ * This method is called by {@link yfiles.layout.ComponentLayout#applyLayout}. It may be overridden to choose another approach to + * find components that will be passed to the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. However, most of the layout algorithms cannot handle disconnected graphs. Also, edges between + * custom components will be ignored. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.INodeMap} compNumber a map that will be filled with the zero-based index of the component to which the node belongs + * @returns {number} the number of connected components of this graph + * @see yfiles.algorithms.GraphConnectivity#connectedComponents + * @protected + */ + findGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; + /** + * Moves the subgraph containing the given nodes and edges to the specified origin. + *

+ * This method is called by {@link yfiles.layout.ComponentLayout#arrangeComponents} and {@link yfiles.layout.ComponentLayout#arrangeFields} + * to move the components to overlap-free positions. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.NodeList} nodes the nodes in the moving subgraph + * @param {yfiles.algorithms.EdgeList} edges the edges in the moving subgraph + * @param {yfiles.algorithms.YPoint} origin the new origin of the graph + * @param {yfiles.algorithms.YRectangle} rectangle the current bounds of the subgraph + * @protected + */ + setOrigin(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,edges:yfiles.algorithms.EdgeList,origin:yfiles.algorithms.YPoint,rectangle:yfiles.algorithms.YRectangle):void; + /** + * Data provider key for specifying which nodes should be arranged + *

+ * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all components will be laid out by the core layout + * algorithm. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static AFFECTED_COMPONENTS_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for specifying custom graph components + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static COMPONENT_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the preferred size of the layout. + *

+ * The layout size also defines the desired aspect ratio (width/height). + *

+ *

+ * The width and height need to be greater than zero. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is negative or zero. + * @type {yfiles.algorithms.YDimension} + */ + preferredSize:yfiles.algorithms.YDimension; + /** + * Gets or sets whether or not to take node and edge labels into account when calculating the bounding box of the graph + * components. + * @see yfiles.layout.ComponentLayout#calculateBounds + * @type {boolean} + */ + considerLabels:boolean; + /** + * Gets or sets whether or not the separately arranged components of the input graph should be arranged relative to each + * other. + *

+ * If enabled, the components are arranged using a specific {@link yfiles.layout.ComponentLayout#style style} without producing overlaps between components (except for + * {@link yfiles.layout.ComponentArrangementStyles#NONE}). Otherwise, the layout algorithm will keep the components at their + * location. Then, the components may overlap. + *

+ * @type {boolean} + */ + componentArrangement:boolean; + /** + * Gets or sets 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. + *

+ *

+ * The spacing needs to be a non-negative value. If the grid spacing is set to 0, the grid won't be considered at all. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative + * @type {number} + */ + gridSpacing:number; + /** + * Gets or sets the distance between the bounding boxes of the components. + *

+ * The spacing needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative + * @type {number} + */ + componentSpacing:number; + /** + * Gets or sets whether or not grouping information bound to the graph should be considered when determining the graph + * components. + * @type {boolean} + */ + considerGrouping:boolean; + /** + * Gets or sets how the components are arranged. + * @throws {Stubs.Exceptions.ArgumentError} if the specified style is unknown + * @type {yfiles.layout.ComponentArrangementStyles} + */ + style:yfiles.layout.ComponentArrangementStyles; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.CompositeLayoutStage} allows for combining multiple {@link yfiles.layout.ILayoutStage}s. + *

+ * The {@link yfiles.layout.ILayoutStage}s are organized in a pipeline where additional {@link yfiles.layout.ILayoutStage}s can be {@link yfiles.layout.CompositeLayoutStage#prependStage prepended} + * or {@link yfiles.layout.CompositeLayoutStage#appendStage appended}. + *

+ *

+ * Each {@link yfiles.layout.ILayoutStage} in the pipeline executes its pre-processing code before calling its successor + * {@link yfiles.layout.ILayoutStage}. Then, after all subsequent + * {@link yfiles.layout.ILayoutStage}s have finished, it will execute its post-processing code. + *

+ *

+ * Note that the pipeline only works when all {@link yfiles.layout.ILayoutStage}s call their core layout algorithm which is the + * next {@link yfiles.layout.ILayoutStage} in the pipeline. + *

+ * @class yfiles.layout.CompositeLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface CompositeLayoutStage extends yfiles.layout.LayoutStageBase{} + export class CompositeLayoutStage { + /** + * Creates a new {@link yfiles.layout.CompositeLayoutStage} instance with two {@link yfiles.layout.ILayoutStage}s in the pipeline. + *

+ * The inner {@link yfiles.layout.ILayoutStage} will be wrapped by the outer {@link yfiles.layout.ILayoutStage}. + *

+ * @param {yfiles.layout.ILayoutStage} outerStage the wrapping {@link yfiles.layout.ILayoutStage} + * @param {yfiles.layout.ILayoutStage} innerStage the wrapped {@link yfiles.layout.ILayoutStage} + * @constructor + */ + constructor(outerStage:yfiles.layout.ILayoutStage,innerStage:yfiles.layout.ILayoutStage); + /** + * Creates a new {@link yfiles.layout.CompositeLayoutStage} instance with an empty pipeline. + * @constructor + */ + constructor(); + /** + * Appends a {@link yfiles.layout.ILayoutStage} to the previously added {@link yfiles.layout.ILayoutStage}s. + *

+ * The added {@link yfiles.layout.ILayoutStage} will be invoked just before the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} will be invoked. Its + * pre-processing code will be executed after the already added {@link yfiles.layout.ILayoutStage}s' pre-processing code, while its + * post-processing code will be executed before the post-processing code of all the other {@link yfiles.layout.ILayoutStage}s. + *

+ * @param {yfiles.layout.ILayoutStage} stage the stage to append + */ + appendStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Prepends a {@link yfiles.layout.ILayoutStage} to the previously added {@link yfiles.layout.ILayoutStage}s. + *

+ * The added {@link yfiles.layout.ILayoutStage} will be invoked before any other {@link yfiles.layout.ILayoutStage}. Its pre-processing + * code will be executed before the already added {@link yfiles.layout.ILayoutStage}s' pre-processing code, while its + * post-processing code will be executed after the post-processing code of all the other {@link yfiles.layout.ILayoutStage}s. + *

+ * @param {yfiles.layout.ILayoutStage} stage the stage to prepend + */ + prependStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Gets the complete pipeline of {@link yfiles.layout.ILayoutStage}s that were added to this {@link yfiles.layout.CompositeLayoutStage}. + * @type {yfiles.collections.IList.} + */ + layoutStages:yfiles.collections.IList; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.CopiedLayoutGraph} is a {@link yfiles.layout.LayoutGraph} that serves as a copy of another graph with layout information. + *

+ * A {@link yfiles.layout.CopiedLayoutGraph} comes to use if a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} should not run directly on the original graph. + * Using a copy, the calculated layout will not be applied to the original graph before the layout algorithm finished + * successfully. This can prevent inconsistencies in case something goes wrong during layout calculations. + *

+ *

+ * Concept {@link yfiles.layout.CopiedLayoutGraph} contains corresponding nodes and edges for each node and edge in the original graph and + * copies the labels of the original nodes and edges. It also delegates all + * {@link yfiles.algorithms.IDataProvider}s registered with the original graph. + *

+ *

+ * To preserve the relations between the original elements and the copied elements in this graph, {@link yfiles.layout.CopiedLayoutGraph} + * updates mappings between those elements. + *

+ *

+ * If there are structural changes to the original graph, they can be transferred to this copied graph using + * {@link yfiles.layout.CopiedLayoutGraph#syncStructure}. Then the copied graph will be altered, adding and removing elements, + * until it corresponds to the original again. + *

+ *

+ * Method {@link yfiles.layout.CopiedLayoutGraph#commitLayoutToOriginalGraph} will transfer updated layout information to the + * original graph. The original graph will stay unchanged until this method is called. + *

+ * @see yfiles.layout.BufferedLayout + * @class yfiles.layout.CopiedLayoutGraph + * @extends {yfiles.layout.LayoutGraph} + */ + export interface CopiedLayoutGraph extends yfiles.layout.LayoutGraph{} + export class CopiedLayoutGraph { + /** + * Creates a new {@link yfiles.layout.CopiedLayoutGraph} instance which is a copy of the given graph. + * @param {yfiles.layout.LayoutGraph} graph the original graph + * @constructor + */ + constructor(graph:yfiles.layout.LayoutGraph); + /** + * Writes the current layout information of all elements of this copied graph to the original graph. + */ + commitLayoutToOriginalGraph():void; + /** + * Creates an edge in the copied graph that corresponds to the given original edge. + *

+ * The edge will connect to the copies of the source and target of the original edge. All labels of the original edge will + * be also copied and assigned to this edge. + *

+ *

+ * The mappings are updated. Hence, it is possible to look up the newly created edge by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedEdge} + * or the original edge by using {@link yfiles.layout.CopiedLayoutGraph#getOriginalEdge}. + *

+ *

+ * This method can be used for keeping the {@link yfiles.layout.CopiedLayoutGraph} in sync with the original graph. + *

+ * @param {Object} originalEdge the original edge + * @returns {yfiles.algorithms.Edge} the copy of the original edge + */ + createCopiedEdge(originalEdge:Object):yfiles.algorithms.Edge; + /** + * Creates a node in the copied graph that corresponds to the given original node. + *

+ * All labels of the original node will be copied and assigned to this node. + *

+ *

+ * The mappings are updated. Hence, it is possible to look up the newly created node by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedNode} + * or the original node by using {@link yfiles.layout.CopiedLayoutGraph#getOriginalNode}. + *

+ *

+ * This method can be used for keeping the {@link yfiles.layout.CopiedLayoutGraph} in sync with the original graph. + *

+ * @param {Object} originalNode the original node + * @returns {yfiles.algorithms.Node} the copy of the original node + */ + createCopiedNode(originalNode:Object):yfiles.algorithms.Node; + /** + * Returns the copied edge that corresponds to the given original edge. + * @param {Object} originalEdge an edge of the original graph whose copy resides in this graph + * @returns {yfiles.algorithms.Edge} an edge in this graph that is the copy of the given original edge + */ + getCopiedEdge(originalEdge:Object):yfiles.algorithms.Edge; + /** + * Returns the copied node that corresponds to the given original node. + * @param {Object} originalNode a node of the original graph whose copy resides in this graph + * @returns {yfiles.algorithms.Node} a node in this graph that is the copy of the given original node + */ + getCopiedNode(originalNode:Object):yfiles.algorithms.Node; + /** + * Returns the original edge that corresponds to the given copied edge. + * @param {yfiles.algorithms.Edge} copiedEdge the edge in this graph that is a copy of the returned edge + * @returns {Object} the edge in the original graph whose copy is the given edge + */ + getOriginalEdge(copiedEdge:yfiles.algorithms.Edge):Object; + /** + * Returns the original node that corresponds to the given copied node. + * @param {yfiles.algorithms.Node} copiedNode the node in this graph that is a copy of the returned node + * @returns {Object} the node in the original graph whose copy is the given node + */ + getOriginalNode(copiedNode:yfiles.algorithms.Node):Object; + /** + * Synchronizes the structure of the {@link yfiles.layout.CopiedLayoutGraph} with the actual structure of the underlying original + * graph. + */ + syncStructure():void; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.CurveFittingLayoutStage} fits a piecewise cubic bezier curve to given arbitrary edge paths. + *

+ * Concept + *

+ *

+ * The {@link yfiles.layout.LayoutGraph#getPath path} of an edge, i.e., its start and end point as well as the intermediate control points, are interpreted as the + * set of input points. A cubic bezier curve is then fitted to these points. + *

+ *

+ * After the fitting, the points of the processed edges can be interpreted as cubic bezier control points. Each four + * consecutive points form a bezier curve, where the first and last of the four points represent the start and end of the + * curve and the second and third point are the control points defining how the curve looks. The second and third point do + * not necessarily lie on the actual curve. + *

+ *

+ * There are two exceptions to the stated rules: + *

+ *
    + *
  • If an input edge only consists of a source and a target point, it will be ignored by this stage.
  • + *
  • + * Self-loop edges with only one intermediate control point are also ignored. Note that self-loops with more control points + * are, however, handled by this stage. + *
  • + *
+ *

+ * Features + *

+ *

+ * The {@link yfiles.layout.CurveFittingLayoutStage#maximumError maximum allowed error} for the fitting process can be selected to control how high the precision should be. A high + * allowed error means that the approximation process has a lot of freedom. Curves are only loosely bound to the original + * edge path. If this is not desired, e.g., because no new intersection with other graph elements should be introduced, + * then a rather low error value should be specified. The lower the error value, the larger the number of bend points of an + * approximated edge will be. + *

+ *

+ * It is possible to define the set of edges that should be processed by this layout stage. Therefore, only paths of a + * sub-set of edges can be changed. Use a {@link yfiles.algorithms.IDataProvider} registered with the specified {@link yfiles.layout.CurveFittingLayoutStage#affectedEdgesDpKey selection key} to + * mark edges which should be part of the considered sub-set. + *

+ * @class yfiles.layout.CurveFittingLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface CurveFittingLayoutStage extends yfiles.layout.LayoutStageBase{} + export class CurveFittingLayoutStage { + /** + * Creates a new {@link yfiles.layout.CurveFittingLayoutStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The core layout algorithm. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Data provider key for selecting edges for curve fitting + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the maximum allowed error for the fitting process. + *

+ * The error is defined as the minimum distance between an original input control point (i.e. bend) of and edge and the + * fitted bezier curve. + *

+ *

+ * The maximum error must be greater than or equal to zero. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified maximum error is negative + * @type {number} + */ + maximumError:number; + /** + * Gets or sets the ratio that defines the distance between the intermediate control points and the end points of a cubic + * segment which actually represents a straight line, i.e., in case the four points are collinear. + *
    + *
  • 0.33 - the second and third control point are equally distributed between te first and fourth point.
  • + *
  • 0.0 - the first and second control point as well as the third and fourth point are equal.
  • + *
  • 0.5 - the second and third control point are equal and exactly the mid-point between the first and fourth point.
  • + *
+ *

+ * The control point ratio is defined to be within the interval [0.0, 0.5]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0.0, 0.5] + * @type {number} + */ + straightControlPointRatio:number; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the edges that defines whether or + * not an edge's path should be approximated by a bezier curve. + *

+ * If there is a {@link yfiles.algorithms.IDataProvider} registered with the input graph with this key, then only marked edges are + * processed by this layout stage. Otherwise, all edges are processed. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null + * @type {Object} + */ + affectedEdgesDpKey:Object; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.DefaultLayoutGraph} is a default implementation of {@link yfiles.layout.LayoutGraph} which holds the complete + * layout information about the graph and its elements. + * @class yfiles.layout.DefaultLayoutGraph + * @extends {yfiles.layout.LayoutGraph} + */ + export interface DefaultLayoutGraph extends yfiles.layout.LayoutGraph{} + export class DefaultLayoutGraph { + /** + * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance which is a copy of the given subgraph. + * @param {yfiles.layout.LayoutGraph} graph the original graph + * @param {yfiles.algorithms.ICursor} nodeSubset the nodes that induce a subgraph of the original graph + * @constructor + */ + constructor(graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor); + /** + * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance which is a copy of the given graph. + * @param {yfiles.layout.LayoutGraph} argGraph the original graph + * @constructor + */ + constructor(argGraph:yfiles.layout.LayoutGraph); + /** + * Creates a new {@link yfiles.layout.DefaultLayoutGraph} instance with default settings. + * @constructor + */ + constructor(); + /** + * Creates a new implementation of {@link yfiles.layout.IEdgeLayout}. + *

+ * This method is called by {@link yfiles.layout.DefaultLayoutGraph#getLayout} if there is no layout information assigned to an + * edge, yet. It may be overridden to create custom {@link yfiles.layout.IEdgeLayout}s. + *

+ * @returns {yfiles.layout.IEdgeLayout} the layout of an edge + * @protected + */ + createEdgeLayout():yfiles.layout.IEdgeLayout; + /** + * Creates a new implementation of {@link yfiles.layout.INodeLayout}. + *

+ * This method is called by {@link yfiles.layout.DefaultLayoutGraph#getLayout} if there is no layout information assigned to a + * node, yet. It may be overridden to create custom {@link yfiles.layout.INodeLayout}s. + *

+ * @returns {yfiles.layout.INodeLayout} the layout of a node + * @protected + */ + createNodeLayout():yfiles.layout.INodeLayout; + /** + * Specifies the layout information for all associated labels of the given edge. + *

+ * The layout information consists of the location, size and orientation of the label. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @param {Array.} layout the layout information for the labels of the edge + */ + setLabelLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLabelLayout[]):void; + /** + * Specifies the layout information for all associated labels of the given node. + *

+ * The layout information consists of the location, size and orientation of the label. + *

+ * @param {yfiles.algorithms.Node} node the node + * @param {Array.} layout the layout information for the labels of the node + */ + setLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout[]):void; + /** + * Specifies the layout information for all associated labels of the given node in case there is only one label. + *

+ * The layout information consists of the location, size and orientation of the label. + *

+ * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.layout.INodeLabelLayout} layout the layout information for the label of the node + */ + setLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout):void; + /** + * Specifies the layout information for the given edge. + *

+ * The layout information consists of the locations of the control and end points of the edge. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.layout.IEdgeLayout} layout the layout information for the edge + */ + setLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLayout):void; + /** + * Specifies the layout information for the given node. + *

+ * The layout information consists of the location and size of the node. + *

+ * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.layout.INodeLayout} layout the layout information for the node + */ + setLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLayout):void; + /** + * A {@link yfiles.algorithms.INodeMap} associating {@link yfiles.layout.INodeLabelLayout}s with the nodes of this graph. + * @see yfiles.layout.DefaultLayoutGraph#setLabelLayout + * @type {yfiles.algorithms.INodeMap} + */ + nodeLabelMap:yfiles.algorithms.INodeMap; + /** + * An {@link yfiles.algorithms.IEdgeMap} associating {@link yfiles.layout.IEdgeLabelLayout}s with the edges of this graph. + * @see yfiles.layout.DefaultLayoutGraph#setLabelLayout + * @type {yfiles.algorithms.IEdgeMap} + */ + edgeLabelMap:yfiles.algorithms.IEdgeMap; + /** + * A {@link yfiles.collections.IMap.} associating the owner of a node label with the node label itself. + * @type {yfiles.collections.IMap.} + */ + nodeLabelFeatureMap:yfiles.collections.IMap; + /** + * A {@link yfiles.collections.IMap.} associating the owner of an edge label with the edge label itself. + * @type {yfiles.collections.IMap.} + */ + edgeLabelFeatureMap:yfiles.collections.IMap; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.Direction} provides four main directions and some methods to work with them. + * @class yfiles.layout.Direction + * @final + */ + export interface Direction extends Object{} + export class Direction { + /** + * Returns the direction encoded as an integer value. + * @returns {number} 0 for direction {@link yfiles.layout.Direction#UP}, 1 for {@link yfiles.layout.Direction#RIGHT}, 2 for {@link yfiles.layout.Direction#DOWN}, and + * 3 for {@link yfiles.layout.Direction#LEFT} + */ + getDirection():number; + /** + * Decodes the up direction. + * @const + * @static + * @type {yfiles.layout.Direction} + */ + static UP:yfiles.layout.Direction; + /** + * Decodes the right direction. + * @const + * @static + * @type {yfiles.layout.Direction} + */ + static RIGHT:yfiles.layout.Direction; + /** + * Decodes the down direction. + * @const + * @static + * @type {yfiles.layout.Direction} + */ + static DOWN:yfiles.layout.Direction; + /** + * Decodes the left direction. + * @const + * @static + * @type {yfiles.layout.Direction} + */ + static LEFT:yfiles.layout.Direction; + /** + * Gets the direction that follows this direction in clockwise order. + *

+ * The new direction is turned 90 degrees in clockwise direction compared to this instance. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid + * @type {yfiles.layout.Direction} + */ + turnCW:yfiles.layout.Direction; + /** + * Gets the direction that follows this direction in counterclockwise order. + *

+ * The new direction is turned 90 degrees in counterclockwise direction compared to this instance. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid + * @type {yfiles.layout.Direction} + */ + turnCCW:yfiles.layout.Direction; + /** + * Gets the mirror direction. + *

+ * The new direction is turned 180 degrees compared to this instance. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the current direction value is invalid + * @type {yfiles.layout.Direction} + */ + mirror:yfiles.layout.Direction; + /** + * Gets whether or not this direction is horizontal ({@link yfiles.layout.Direction#RIGHT} or {@link yfiles.layout.Direction#LEFT}). + * @type {boolean} + */ + horizontal:boolean; + /** + * Gets whether or not this direction is vertical ({@link yfiles.layout.Direction#UP} or {@link yfiles.layout.Direction#DOWN}). + * @type {boolean} + */ + vertical:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} describes the placement of rotated labels at some predefined positions along + * the edge. + *

+ * {@graph {"ann":{"s":[30,30],"d":1,"lblB":1},"n":[[0,0],[200,0]],"e":[[0,1,[],[[35,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,-13.59,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[35,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,33.22,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[35,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[96.59,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"],[158.19,9.82,33.36,18.7,0.7071067811865475,-0.7071067811865476,"Label"]]]],"vp":[0.0,-27.0,230.0,84.0]}} + *

+ *

+ * The predefined positions in this model + *

+ *

+ * 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 combining several label positions with a logical or-operation to a user-defined mask. + *

+ * @class yfiles.layout.DiscreteEdgeLabelLayoutModel + * @implements {yfiles.layout.IEdgeLabelLayoutModel} + */ + export interface DiscreteEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelLayoutModel{} + export class DiscreteEdgeLabelLayoutModel { + /** + * Creates a new instance of {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} using the given candidate mask. + *

+ * The candidates mask can either describe multiple or single valid positions. + *

+ * @param {yfiles.layout.DiscreteEdgeLabelPositions} candidateMask the position mask that defines the allowed positions for an edge label + * @constructor + */ + constructor(candidateMask:yfiles.layout.DiscreteEdgeLabelPositions); + /** + * Creates a new instance of {@link yfiles.layout.DiscreteEdgeLabelLayoutModel} with default settings. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds + * @param {yfiles.layout.IEdgeLayout} edgeLayout + * @param {yfiles.layout.INodeLayout} sourceNode + * @param {yfiles.layout.INodeLayout} targetNode + * @returns {Object} + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + /** + * Returns a model parameter that encodes the specified position. + *

+ * This model parameter can be passed to {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelPlacement} to determine the + * label's position. + *

+ * @param {number} position one of the valid positions + * @returns {Object} a model parameter that encodes the specified position + * @throws {Stubs.Exceptions.ArgumentError} if the specified position is unknown + * @static + */ + static createPositionParameter(position:number):Object; + /** + * + * @param {yfiles.layout.IEdgeLabelLayout} label + * @param {yfiles.layout.IEdgeLayout} edgeLayout + * @param {yfiles.layout.INodeLayout} sourceNode + * @param {yfiles.layout.INodeLayout} targetNode + * @returns {yfiles.algorithms.YList} + */ + getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * + * @param {yfiles.algorithms.YDimension} labelSize + * @param {yfiles.layout.IEdgeLayout} edgeLayout + * @param {yfiles.layout.INodeLayout} sourceNode + * @param {yfiles.layout.INodeLayout} targetNode + * @param {Object} param + * @returns {yfiles.algorithms.YOrientedRectangle} + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns the oriented box of the label for the given label position. + *

+ * This method is called by {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelPlacement} and {@link yfiles.layout.DiscreteEdgeLabelLayoutModel#getLabelCandidates} + * to retrieve a valid 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} 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 {yfiles.layout.DiscreteEdgeLabelPositions} position the label position that is valid in this model + * @returns {yfiles.algorithms.YOrientedRectangle} the oriented box of the label + * @protected + */ + getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,position:yfiles.layout.DiscreteEdgeLabelPositions):yfiles.algorithms.YOrientedRectangle; + /** + * Returns the position specifier that is encoded by the given model parameter. + * @param {Object} parameter the model parameter + * @returns {number} the position specifier + * @throws {Stubs.Exceptions.ArgumentError} if the specified model parameter is not valid for this model + * @static + */ + static getPosition(parameter:Object):number; + /** + * Checks whether or not the given model parameter encodes a valid edge label position for this model. + *

+ * If the model parameter describes a position that is accepted by the candidate mask, this is a valid parameter. + *

+ * @param {Object} parameter the model parameter + * @returns {boolean} true if the label position described by the given model parameter is allowed, false otherwise + */ + isParameterValid(parameter:Object):boolean; + /** + * Gets the candidate mask which specifies the valid positions for edge labels. + * @type {yfiles.layout.DiscreteEdgeLabelPositions} + */ + candidateMask:yfiles.layout.DiscreteEdgeLabelPositions; + /** + * Gets or sets whether or not the label position mask should be interpreted relative to the edge segment. + *

+ * If this option is disabled, the position mask is interpreted in a geometric sense. + *

+ * @type {boolean} + */ + positionRelativeToSegment:boolean; + /** + * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference + * edge segment. + * @type {boolean} + */ + autoRotationEnabled:boolean; + /** + * Gets or sets whether or not edge labels get flipped if they would be upside down in their current position. + * @type {boolean} + */ + autoFlipping:boolean; + /** + * Gets or sets the angle (measured in radians) of the label model. + *

+ * The angle is applied in clockwise direction. + *

+ * @type {number} + */ + angle:number; + /** + * Gets or sets the distance between the label's bounding box and the edge path. + *

+ * The distance must be a non-negative value. + *

+ * @type {number} + */ + distance:number; + /** + * Gets 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.DiscreteEdgeLabelPositions#CENTER}
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_CENTER}
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#TAIL}
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_TAIL}
  • + *
+ *

+ * 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. + *

+ * @type {Object} + */ + defaultParameter:Object; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.DiscreteNodeLabelLayoutModel} allows placing labels at eight positions around a node and at nine positions + * inside the node. + *

+ * {@graph {"ann":{"s":[120,80],"d":1,"lblB":1},"n":[[-11.9,13.17,[[31.42,9.17,33.36,18.7,"Label"],[112.1,111.88,33.36,18.7,"Label"],[112.1,62.53,33.36,18.7,"Label"],[31.42,115.88,33.36,18.7,"Label"],[-49.27,111.88,33.36,18.7,"Label"],[-49.27,62.53,33.36,18.7,"Label"],[112.1,13.17,33.36,18.7,"Label"],[-49.27,13.17,33.36,18.7,"Label"],[31.42,62.53,33.36,18.7,"Label"],[-7.9,62.53,33.36,18.7,"Label"],[-7.9,89.17,33.36,18.7,"Label"],[31.42,89.17,33.36,18.7,"Label"],[70.73,89.17,33.36,18.7,"Label"],[-7.9,35.88,33.36,18.7,"Label"],[70.73,62.53,33.36,18.7,"Label"],[70.73,35.88,33.36,18.7,"Label"],[31.42,35.88,33.36,18.7,"Label"]]]],"e":[],"vp":[-50.0,-10.0,196.0,126.0]}} + *

+ *

+ * The predefined positions in this model + *

+ *

+ * 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 a combination of valid positions of this model using a logical or-operation. + *

+ * @class yfiles.layout.DiscreteNodeLabelLayoutModel + * @implements {yfiles.layout.INodeLabelLayoutModel} + */ + export interface DiscreteNodeLabelLayoutModel extends Object,yfiles.layout.INodeLabelLayoutModel{} + export class DiscreteNodeLabelLayoutModel { + /** + * Creates a new instance of {@link yfiles.layout.DiscreteNodeLabelLayoutModel} using the given candidate mask and insets. + *

+ * The specified mask can also describe a single position. + *

+ * @param {yfiles.layout.DiscreteNodeLabelPositions} candidateMask the position mask that defines the allowed positions for a node label + * @param {number} [inset=4.0] the inset value that defines the internal label distance to the node's border + * @constructor + */ + constructor(candidateMask:yfiles.layout.DiscreteNodeLabelPositions,inset?:number); + /** + * Creates a new instance of {@link yfiles.layout.DiscreteNodeLabelLayoutModel} with default settings. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds + * @param {yfiles.layout.INodeLayout} nodeLayout + * @returns {Object} + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + /** + * + * @param {yfiles.layout.INodeLabelLayout} labelLayout + * @param {yfiles.layout.INodeLayout} nodeLayout + * @returns {yfiles.algorithms.YList} + */ + getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * + * @param {yfiles.algorithms.YDimension} labelSize + * @param {yfiles.layout.INodeLayout} nodeLayout + * @param {Object} parameter + * @returns {yfiles.algorithms.YOrientedRectangle} + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,parameter:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns the oriented box of the label for the given label position. + *

+ * This method is called by {@link yfiles.layout.DiscreteNodeLabelLayoutModel#getLabelPlacement} and {@link yfiles.layout.DiscreteNodeLabelLayoutModel#getLabelCandidates} + * to retrieve a valid position. + *

+ * @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 {yfiles.layout.DiscreteNodeLabelPositions} position the label position that is valid in this model + * @returns {yfiles.algorithms.YOrientedRectangle} the oriented box of the label + * @protected + */ + getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,position:yfiles.layout.DiscreteNodeLabelPositions):yfiles.algorithms.YOrientedRectangle; + /** + * Checks whether or not the given model parameter encodes a valid node label position for this model. + *

+ * If the model parameter describes a position that is accepted by the candidate mask, this is a valid parameter. + *

+ * @param {Object} parameter the model parameter + * @returns {boolean} true if the label position described by the given model parameter is allowed, false otherwise + */ + isParameterValid(parameter:Object):boolean; + /** + * Gets the candidate mask which specifies the valid positions for node labels. + * @type {yfiles.layout.DiscreteNodeLabelPositions} + */ + candidateMask:yfiles.layout.DiscreteNodeLabelPositions; + /** + * Gets or sets the distance between the label's bounding box and the node. + *

+ * The distance must be a non-negative value. + *

+ * @type {number} + */ + distance:number; + /** + * Gets 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.DiscreteNodeLabelPositions#CENTER}
  • + *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST}
  • + *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH}
  • + *
  • {@link yfiles.layout.DiscreteNodeLabelPositions#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. + *

+ * @type {Object} + */ + defaultParameter:Object; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.layout.EdgeBundleDescriptor} defines the {@link yfiles.layout.EdgeBundling bundling} settings of an edge. + *

+ * The defined settings will be considered by {@link yfiles.layout.ILayoutAlgorithm layout algorithms} which support edge bundling. + *

+ *

+ * Each {@link yfiles.layout.EdgeBundleDescriptor} can either be specified for a single edge or shared by several edges. It is + * assigned to an edge by registering a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY} + * to the input graph. + *

+ * @see yfiles.layout.EdgeBundling + * @see yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY + * @class yfiles.layout.EdgeBundleDescriptor + */ + export interface EdgeBundleDescriptor extends Object{} + export class EdgeBundleDescriptor { + /** + * Creates a new {@link yfiles.layout.EdgeBundleDescriptor} representing a copy of the given other descriptor instance. + * @param {yfiles.layout.EdgeBundleDescriptor} descriptor the descriptor to copy + * @constructor + */ + constructor(descriptor:yfiles.layout.EdgeBundleDescriptor); + /** + * Creates a new {@link yfiles.layout.EdgeBundleDescriptor} with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets whether or not the direction of the edge associated to this descriptor should be considered. + *

+ * During the bundling procedure, the edges are bundled based on their direction such that the incoming edges of a node are + * bundled separately from its outgoing edges. If the direction of edges adjacent to a node is not considered, then they + * are not bundled separately. + *

+ *

+ * If the direction of some edges is taken into consideration while the direction of some others (adjacent to the same + * node) is ignored, the undirected edges are also bundled separately. This is done to distinguished them from the incoming + * and outgoing edges of the particular node. + *

+ * @type {boolean} + */ + considerDirection:boolean; + /** + * Gets or sets whether or not an edge associated to this descriptor should be bundled. + * @type {boolean} + */ + bundled:boolean; + /** + * Gets or sets whether or not a bezier curve should be fit to an edge associated to this descriptor. + *

+ * If disabled, the edges resemble B-splines where points of the path are actually curve points. Therefore, this + * representation requires a high number of bends to model curves. + *

+ *

+ * If this feature is enabled, a bezier curve is fitted to the start and end point as well as the intermediate control + * points of the edge. After the fitting, the points of the edge can be interpreted as cubic bezier control points. Each + * four consecutive points form a bezier curve, where the first and last of the four points represent the start and end of + * the curve and the second and third point are the control points defining how the curve looks. The second and third point + * do not necessarily lie on the actual curve. + *

+ * @type {boolean} + */ + bezierFitting:boolean; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.layout.EdgeBundling} instance defines if and how the edges of a graph should be bundled by a + * {@link yfiles.layout.ILayoutAlgorithm layout algorithm}, given that the algorithm supports edge bundling. + *

+ * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the + * source and target point, the edges are again clearly split. Edge bundling is useful to increase the readability of graph + * drawings with a high number of edges that connect a comparably small number of nodes. Without bundling, such drawings + * can often contain visual clutter and feature bad readability. + *

+ *

+ * The bundling {@link yfiles.layout.EdgeBundling#bundlingStrength strength} and {@link yfiles.layout.EdgeBundling#bundlingQuality quality} are global settings for the bundling process. On the other hand, each edge can get + * specific settings by assigning a {@link yfiles.layout.EdgeBundleDescriptor} to it. A {@link yfiles.algorithms.IDataProvider} can be + * registered with the input graph with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY} to assign descriptors + * to edges. This allows, for example, to define which edges should actually be bundled. + *

+ * @see yfiles.layout.EdgeBundleDescriptor + * @see yfiles.circular.CircularLayout#edgeBundling + * @class yfiles.layout.EdgeBundling + */ + export interface EdgeBundling extends Object{} + export class EdgeBundling { + /** + * Creates a new {@link yfiles.layout.EdgeBundling} instance with the given {@link yfiles.layout.EdgeBundling#bundlingStrength bundling strength} and {@link yfiles.layout.EdgeBundling#bundlingQuality bundling quality}. + * @param {number} bundlingStrength the bundling strength from the interval [0,1] + * @param {number} bundlingQuality the bundling quality from the interval [0,1] + * @throws {Stubs.Exceptions.ArgumentError} if the given bundling strength or quality is not within [0,1] + * @constructor + */ + constructor(bundlingStrength:number,bundlingQuality:number); + /** + * Creates a new {@link yfiles.layout.EdgeBundling} instance with default settings. + * @constructor + */ + constructor(); + /** + * Data provider key for specifying individual bundling settings for edges + *

+ * If no {@link yfiles.layout.EdgeBundleDescriptor} is mapped to an edge, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used by the layout algorithm to + * obtain the bundling setup of that edge. + *

+ * @see yfiles.layout.EdgeBundling#defaultBundleDescriptor + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_BUNDLE_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the desired quality of the calculated edge bundling. + *

+ * Higher quality indicates that the bundling procedure uses more sophisticated methods to compute the actual bundles and + * the routing of the edges. This may lead to a significantly higher running time, especially for large graphs. On the + * other hand, a low quality indicates that run-time is more important than highly optimized bundling results, leading to, + * for example, more crossings between different bundles. + *

+ *

+ * The quality is defined to lie within [0,1], where higher values stand for higher quality. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given quality value is not within [0,1] + * @type {number} + */ + bundlingQuality:number; + /** + * Gets or sets the strength of the edge bundling. + *

+ * The strength controls how tightly the edges are bundled and influences the shape of the curves of bundled edges. Low + * values lead to only slightly bundled edges; results will mostly show individual node-to-node connectivity information. + * High values show the connectivity on a higher level, strongly bundling edges together and generating highly curved edge + * paths. + *

+ *

+ * The bundling strength is defined as a value from the interval [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given strength is less than 0 or greater than 1 + * @type {number} + */ + bundlingStrength:number; + /** + * Gets or sets the default {@link yfiles.layout.EdgeBundleDescriptor} used for all edges which do not have a specific descriptor + * assigned via a {@link yfiles.algorithms.IDataProvider} registered with key + * {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. + * @throws {Stubs.Exceptions.ArgumentError} if the given descriptor is null + * @see yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.EdgeBundleDescriptor} + */ + defaultBundleDescriptor:yfiles.layout.EdgeBundleDescriptor; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.layout.EdgeLabelCandidate} describes one valid placement for an edge label considering the label model. + * @class yfiles.layout.EdgeLabelCandidate + * @extends {yfiles.layout.LabelCandidate} + */ + export interface EdgeLabelCandidate extends yfiles.layout.LabelCandidate{} + export class EdgeLabelCandidate { + /** + * Creates a new instance of {@link yfiles.layout.EdgeLabelCandidate} described by location, size, model parameter and internal + * flag. + * @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 label model associated with this candidate + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated with the candidate + * @param {boolean} [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal?:boolean); + /** + * Creates a new instance of {@link yfiles.layout.EdgeLabelCandidate} described by its box, model parameter and internal flag. + * @param {yfiles.algorithms.YOrientedRectangle} labelBox the box that specifies the candidate's size and position + * @param {Object} param the parameters of the label model associated with this candidate + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated with the candidate + * @param {boolean} [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise + * @constructor + */ + constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal?:boolean); + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.EdgeLabelOrientationSupport} provides orientation and mirroring support for {@link yfiles.layout.ILayoutAlgorithm layout algorithms} with + * integrated edge labeling. + *

+ * To calculate the position and orientation of edge labels whose placements are defined with the + * {@link yfiles.layout.PreferredPlacementDescriptor}, the {@link yfiles.layout.OrientationLayout} would need the direction of the + * associated edge. Since this direction is not available to the {@link yfiles.layout.OrientationLayout}, because it is a wrapper, + * the calculation must be done in the core layout algorithm itself with the help of the + * {@link yfiles.layout.EdgeLabelOrientationSupport}. + *

+ *

+ * Important: Since layout algorithms with integrated edge labeling cannot 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. + *

+ * @class yfiles.layout.EdgeLabelOrientationSupport + */ + export interface EdgeLabelOrientationSupport extends Object{} + export class EdgeLabelOrientationSupport { + /** + * Creates a new {@link yfiles.layout.EdgeLabelOrientationSupport} instance. + * @see yfiles.layout.OrientationLayout#considerEdgeLabels + * @constructor + */ + constructor(); + /** + * Creates and returns a non-ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} of the given potentially ambiguous one. + *

+ * The created descriptor will be one without any combinations of settings, e.g., source or target for the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge}. + *

+ * @param {yfiles.layout.PreferredPlacementDescriptor} ambiguous an ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} + * @returns {yfiles.layout.PreferredPlacementDescriptor} a non-ambiguous version of the given ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} + * @protected + */ + createNonAmbiguous(ambiguous:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.PreferredPlacementDescriptor; + /** + * 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 + * @returns {yfiles.algorithms.YVector} the 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 + * @static + */ + static 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 angle. + *

+ * The up vector starts in the lower-left corner of the label and points up. If the label is paraxial it is (0, -1). The + * right vector starts at the same point and points right. In a paraxial label it is (1, 0). + *

+ * @param {number} rightVectorAngle the angle in radians the right vector is rotated by + * @returns {yfiles.algorithms.YVector} the up vector for a label whose right vector is rotated clockwise by the given angle + * @static + */ + static getLabelUpVector(rightVectorAngle:number):yfiles.algorithms.YVector; + /** + * Transforms a direction of the layout to the oriented layout direction. + * @param {yfiles.layout.Direction} direction direction in the layout + * @param {yfiles.layout.LayoutOrientation} orientation the orientation of the layout + * @param {yfiles.layout.MirrorModes} mirrorMask the mask to determine whether or not the orientation is mirrored + * @returns {yfiles.layout.Direction} the direction in the oriented layout + * @static + */ + static getOrientedDirection(direction:yfiles.layout.Direction,orientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):yfiles.layout.Direction; + /** + * Returns whether or not the orientation is mirrored. + * @param {yfiles.layout.LayoutOrientation} orientation the orientation of the layout + * @param {yfiles.layout.MirrorModes} mirrorMask the mask to determine whether or not the orientation is mirrored + * @returns {boolean} true if the orientation is mirrored, false otherwise + * @static + */ + static isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):boolean; + /** + * Marks the given port label for a non-port placement (fallback). + *

+ * The given edge label's {@link yfiles.layout.PreferredPlacementDescriptor} will internally be changed such that its {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along edge} + * is either {@link yfiles.layout.LabelPlacements#AT_SOURCE} or {@link yfiles.layout.LabelPlacements#AT_TARGET}. + *

+ *

+ * Algorithms that are executed after this call and before {@link yfiles.layout.EdgeLabelOrientationSupport#resetAmbiguousLabelDescriptors} + * will handle port labels like normal source or target labels. + *

+ * @param {yfiles.layout.LabelLayoutData} portLabel an edge label that had a {@link yfiles.layout.LabelPlacements#AT_SOURCE_PORT} or {@link yfiles.layout.LabelPlacements#AT_TARGET_PORT} + * placement preference + * @throws {Stubs.Exceptions.InvalidOperationError} if {@link yfiles.layout.EdgeLabelOrientationSupport#replaceAmbiguousLabelDescriptors} was never called for the graph containing + * the given label. + * @see yfiles.layout.LabelPlacements#AT_SOURCE_PORT + * @see yfiles.layout.LabelPlacements#AT_TARGET_PORT + */ + markPortLabelForFallbackPlacement(portLabel:yfiles.layout.LabelLayoutData):void; + /** + * Restores the original preferred placement and updates the label rotation according to the layout orientation. + *

+ * The original {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor} that has been replaced in {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel} gets restored. Then it + * moves and rotates the {@link yfiles.layout.LabelLayoutData#bounds label box} in respect of the orientation. + *

+ *

+ * This method is called by the core layout algorithm with the integrated edge labeling for each edge label after the + * location of the label is determined. + *

+ * @param {yfiles.algorithms.Graph} graph the graph to get the orientation information from + * @param {yfiles.layout.LabelLayoutData} label the information about the edge label whose location is determined + */ + postProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData):void; + /** + * Prepares the label for the core layout algorithm. + *

+ * First, the {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor preferred placement} of the edge label is replaced by a non-ambiguous {@link yfiles.layout.PreferredPlacementDescriptor} + * that has only relative references. This descriptor is orientation independent and can be used in the core layout + * algorithm. Second, the method rotates the {@link yfiles.layout.LabelLayoutData#bounds label box} in respect of its {@link yfiles.layout.PreferredPlacementDescriptor} and the + * direction of the segment to which it belongs. After that call, the core layout algorithm can use the geometry ({@link yfiles.layout.LabelLayoutData#width} and + * {@link yfiles.layout.LabelLayoutData#height}) of the label to calculate its location. + *

+ *

+ * This method is called by the core layout algorithm with the integrated edge labeling for each edge label before the + * layout algorithm uses the geometry of labels. It should be called as soon as the direction of the segment the label + * belongs to is determined. + *

+ * @param {yfiles.algorithms.Graph} graph the graph to get the orientation information from + * @param {yfiles.layout.LabelLayoutData} label the information about the edge label whose segment direction is determined + * @param {yfiles.layout.Direction} segmentDirection the direction of the segment the edge label belongs to + */ + preProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; + /** + * Replaces the + * {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with non-ambiguous descriptors. + *

+ * The non-ambiguous descriptors are retrieved from the original descriptors. They describe only one of the possible + * placements. + *

+ *

+ * This method should be called by a layout algorithm at the beginning of the layout calculation to assure that the label's + * placement is handled consistently. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + */ + 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. + *

+ * This method should be called by a layout algorithm at the end of the layout calculation to assure that the original + * state of the graph is not corrupted. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + */ + resetAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; + /** + * 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 for setting the new up vector + * @param {yfiles.layout.Direction} segmentDirection the direction the edge segment is pointing to + * @see yfiles.layout.EdgeLabelOrientationSupport#getEdgeLabelUpVector + * @static + */ + static updateLabelOrientation(label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.FixNodeLayoutStage} fixes the initial position of either a single node or the alignment of the bounding box of + * several nodes (but not the positions of the individual nodes). + *

+ * The absolute coordinates of the {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint fix point} are the same before and after invoking the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. However, the + * relative coordinates of the nodes are altered by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * @class yfiles.layout.FixNodeLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface FixNodeLayoutStage extends yfiles.layout.LayoutStageBase{} + export class FixNodeLayoutStage { + /** + * Creates a new {@link yfiles.layout.FixNodeLayoutStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Calculates the bounding box of the specified nodes. + *

+ * The calculated bounds may contain {@link yfiles.layout.FixNodeLayoutStage#includingEdges edges} and/or {@link yfiles.layout.FixNodeLayoutStage#includingLabels labels}. + *

+ *

+ * This method is called by {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} and may be overridden to customize the size + * of the bounds. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph associated with the specified nodes + * @param {yfiles.algorithms.NodeList} fixed the list of nodes for which to determine the bounding box + * @returns {yfiles.algorithms.Rectangle2D} the bounding box of the specified nodes + * @see yfiles.layout.FixNodeLayoutStage#includingEdges + * @see yfiles.layout.FixNodeLayoutStage#includingLabels + * @see yfiles.layout.FixNodeLayoutStage#calculateFixPoint + * @protected + */ + calculateBounds(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + /** + * 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}. + *

+ *

+ * This method is called by {@link yfiles.layout.FixNodeLayoutStage#applyLayout} to determine the point that will have the same + * coordinates before and after invoking the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to introduce a custom policy for retrieving the fix point. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph associated with the specified nodes + * @param {yfiles.algorithms.NodeList} fixed the list of nodes for which a fix point has to be determined + * @returns {yfiles.algorithms.YPoint} the fix point for the specified nodes in the specified graph + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + * @see yfiles.layout.FixNodeLayoutStage#calculateBounds + * @see yfiles.layout.FixNodeLayoutStage#calculateFixPoint + * @protected + */ + calculateFixPoint(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 then null will be returned. + *

+ *

+ * This method is called by + * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint}. It may be overridden to introduce a custom policy for retrieving the + * fix point. + *

+ * @param {yfiles.algorithms.Rectangle2D} bounds the rectangle for which to determine the fix point + * @returns {yfiles.algorithms.YPoint} the fix point of the specified rectangle or null if nothing should be fixed + * @throws {Stubs.Exceptions.ArgumentError} if the current fix point policy is invalid + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + * @protected + */ + calculateFixPoint(bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.YPoint; + /** + * Data provider key for determining the nodes that should be considered fixed + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the fix point calculation policy used in {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} to determine + * which point in the corresponding rectangle should be considered fixed. + * @throws {Stubs.Exceptions.ArgumentError} if the specified policy is unknown + * @type {yfiles.layout.FixPointPolicy} + */ + fixPointPolicy:yfiles.layout.FixPointPolicy; + /** + * Gets or sets whether or not subgraph edges are taken into account when calculating the bounding box of the fixed nodes. + * @see yfiles.layout.FixNodeLayoutStage#calculateBounds + * @type {boolean} + */ + includingEdges:boolean; + /** + * Gets or sets whether or not label geometries are taken into account when calculating the bounding box of the fixed + * nodes. + * @see yfiles.layout.FixNodeLayoutStage#calculateBounds + * @type {boolean} + */ + includingLabels:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.FixPortLocationStage} ensures that layout algorithms that cannot handle port constraints keep the ports of + * edges with strong {@link yfiles.layout.PortConstraint}s. + *

+ * Without this stage, the port locations get lost. + *

+ *

+ * For each edge with strong {@link yfiles.layout.PortConstraint}s, this stage simply stores the original port and restores it + * after applying the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. Therefore, it either replaces the source/target port by the original port or + * adds the original port to the edge path calculated by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} (see method {@link yfiles.layout.FixPortLocationStage#keepCalculatedPorts}). + *

+ * @class yfiles.layout.FixPortLocationStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface FixPortLocationStage extends yfiles.layout.LayoutStageBase{} + export class FixPortLocationStage { + /** + * Creates a new {@link yfiles.layout.FixPortLocationStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Gets or sets whether or not the final edge routes should contain the ports calculated by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * If this option is disabled, this stage simply replaces the current source/target ports (calculated by the core layout + * algorithm) by the original ports (for strong ports only). Otherwise, the calculated ports are still contained in the + * edge paths. + *

+ * @type {boolean} + */ + keepCalculatedPorts:boolean; + static $class:yfiles.lang.Class; + } + /** + * This model parameter encodes a label position within {@link yfiles.layout.FreeEdgeLabelLayoutModel}. + *

+ * It represents every possible location in relation to the source point of the edge. The radius describes the distance of + * the label center from the source point. There is an angle theta which defines the location on the circle with the given + * radius. It is the angle between the first segment of the underlying edge and the imaginary line to the center of the + * label. Finally, there is a second angle that describes the rotation of the label box. + *

+ * @see yfiles.layout.FreeEdgeLabelLayoutModelParameter#setPoint + * @see yfiles.layout.FreeEdgeLabelLayoutModelParameter#angle + * @class yfiles.layout.FreeEdgeLabelLayoutModelParameter + */ + export interface FreeEdgeLabelLayoutModelParameter extends Object{} + export class FreeEdgeLabelLayoutModelParameter { + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModelParameter} with the given radius, angle and rotation + * angle. + * @param {number} radius the distance of the label from the source node of the underlying edge + * @param {number} theta the angle in radians between the first segment of the underlying edge and the imaginary line to the center of the label + * @param {number} [angle=0] the rotation angle of the label + * @constructor + */ + constructor(radius:number,theta:number,angle?:number); + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModelParameter} with radius 50 and angle 0. + * @constructor + */ + constructor(); + /** + * Specifies a point that represents the location of the label's center in relation to the source point of the edge. + *

+ * The x-coordinate corresponds to the radius which describes the distance of the label to the source point. The + * y-coordinate corresponds to the angle between the first segment of the underlying edge and the imaginary line to the + * center of the label. + *

+ * @param {number} radius the distance to the source point + * @param {number} theta the location on the radius + */ + setPoint(radius:number,theta:number):void; + /** + * Gets or sets the rotation angle of the label that is placed using this model parameter. + * @type {number} + */ + angle:number; + /** + * Gets a point that represents the location of the label's center in relation to the source point of the edge. + *

+ * The x-coordinate corresponds to the radius which describes the distance of the label to the source point. The + * y-coordinate corresponds to the angle between the first segment of the underlying edge and the imaginary line to the + * center of the label. + *

+ * @type {yfiles.algorithms.YPoint} + */ + point:yfiles.algorithms.YPoint; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.FreeEdgeLabelLayoutModel} allows placing edge labels at any location. + * @class yfiles.layout.FreeEdgeLabelLayoutModel + * @implements {yfiles.layout.IEdgeLabelLayoutModel} + */ + export interface FreeEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelLayoutModel{} + export class FreeEdgeLabelLayoutModel { + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. + * @constructor + */ + constructor(); + /** + * Creates a model parameter that represents the given edge label position within this model. + *

+ * The created model parameter represents the current location of the given label. + *

+ *

+ * This parameter can be passed to {@link yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement} to retrieve the current label + * box. + *

+ * @param {yfiles.algorithms.YOrientedRectangle} labelBounds the oriented box of the label the parameter represents + * @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 + * @returns {Object} the model parameter representing the given label location + * @throws {Stubs.Exceptions.ArgumentError} if one or more of the given bounds' values are invalid, i.e., NaN + * @see yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):Object; + /** + * Returns the {@link yfiles.layout.EdgeLabelCandidate} that describes the current label position. + * @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 + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.layout.EdgeLabelCandidate} instances + */ + getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * + * @param {yfiles.algorithms.YDimension} labelSize + * @param {yfiles.layout.IEdgeLayout} edgeLayout + * @param {yfiles.layout.INodeLayout} sourceNode + * @param {yfiles.layout.INodeLayout} targetNode + * @param {Object} param + * @returns {yfiles.algorithms.YOrientedRectangle} + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Gets the model parameter that encodes the default position of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. + *

+ * The distance of the label to the edge's source point will be 20. The angle between the line to the center of the label + * and the first segment is 20 radians. The label is not rotated. + *

+ *

+ * This parameter can be passed to {@link yfiles.layout.FreeEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding + * label box. + *

+ * @type {Object} + */ + defaultParameter:Object; + static $class:yfiles.lang.Class; + } + /** + * The model parameter that encodes a label position within {@link yfiles.layout.FreeNodeLabelLayoutModel}. + *

+ * It represents every possible location in relation to the node. The point describes the offset of the label's center to + * the upper-left corner of the node. + *

+ * @see yfiles.layout.FreeNodeLabelLayoutModelParameter#setPoint + * @class yfiles.layout.FreeNodeLabelLayoutModelParameter + */ + export interface FreeNodeLabelLayoutModelParameter extends Object{} + export class FreeNodeLabelLayoutModelParameter { + /** + * Creates a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModelParameter} with the given offset. + * @param {number} dx the horizontal offset + * @param {number} dy the vertical offset + * @constructor + */ + constructor(dx:number,dy:number); + /** + * Creates a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModelParameter}. + *

+ * It has no offset, i.e., the upper-left corners of both node label and node are at the same location. + *

+ * @constructor + */ + constructor(); + /** + * Specifies the offset of the label's center to the upper-left corner of the node. + * @param {number} dx the horizontal offset + * @param {number} dy the vertical offset + */ + setPoint(dx:number,dy:number):void; + /** + * Gets the offset of the label's center to the upper-left corner of the node. + * @type {yfiles.algorithms.YPoint} + */ + point:yfiles.algorithms.YPoint; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.FreeNodeLabelLayoutModel} allows placing node labels at any desired position. + *

+ * The location of the label does not need to satisfy any constraints. The {@link yfiles.layout.FreeNodeLabelLayoutModel#createModelParameter model parameter} describes a fixed offset between + * the upper-left corner of the node and the center of the label. + *

+ * @class yfiles.layout.FreeNodeLabelLayoutModel + * @implements {yfiles.layout.INodeLabelLayoutModel} + */ + export interface FreeNodeLabelLayoutModel extends Object,yfiles.layout.INodeLabelLayoutModel{} + export class FreeNodeLabelLayoutModel { + /** + * Returns a new instance of {@link yfiles.layout.FreeNodeLabelLayoutModel}. + * @constructor + */ + constructor(); + /** + * Creates a model parameter that represents the given node label position within this model. + *

+ * The created model parameter represents the current location of the given label. + *

+ *

+ * This parameter can be passed to {@link yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement} to retrieve the current label + * box. + *

+ * @param {yfiles.algorithms.YOrientedRectangle} labelBounds the bounds of the label the parameter represents + * @param {yfiles.layout.INodeLayout} nodeLayout the layout of the node to which the label belongs + * @returns {Object} the model parameter + * @throws {Stubs.Exceptions.ArgumentError} if one or more of the given bounds' values are invalid, i.e., NaN + * @see yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + /** + * Returns the {@link yfiles.layout.NodeLabelCandidate} that describes the current label position. + * @param {yfiles.layout.INodeLabelLayout} labelLayout the label for which candidates should be generated + * @param {yfiles.layout.INodeLayout} nodeLayout the layout of the node to which the label belongs + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.layout.NodeLabelCandidate} instances + */ + getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * + * @param {yfiles.algorithms.YDimension} labelSize + * @param {yfiles.layout.INodeLayout} nodeLayout + * @param {Object} param + * @returns {yfiles.algorithms.YOrientedRectangle} + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Gets a model parameter that encodes the default position of {@link yfiles.layout.INodeLabelLayoutModel}. + *

+ * The node label's upper-left corner is placed 20 pixels to the left and 20 pixels above the node. + *

+ *

+ * This parameter can be passed to {@link yfiles.layout.FreeNodeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding + * label box. + *

+ * @type {Object} + */ + defaultParameter:Object; + static $class:yfiles.lang.Class; + } + export enum ComponentArrangementStyles{ + /** + * Style specifier 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 yfiles.layout.ComponentLayout#style + */ + NONE, + /** + * Style specifier describing a component arrangement strategy that places components in multiple rows so that the overall + * aspect ratio of the whole graph gets as close to the aspect ratio of the preferred layout size as possible. + * @see yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + ROWS, + /** + * Style specifier describing a component arrangement strategy that places all 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 yfiles.layout.ComponentLayout#style + */ + SINGLE_ROW, + /** + * Style specifier 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 yfiles.layout.ComponentLayout#style + */ + SINGLE_COLUMN, + /** + * Style specifier describing a component arrangement strategy that places components in a rectangular cloud around the + * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may + * overlap. + *

+ * The aspect ratio of the rectangle is defined by the {@link yfiles.layout.ComponentLayout#preferredSize preferred size} of the graph. + *

+ * @see yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + PACKED_RECTANGLE, + /** + * Style specifier describing a component arrangement strategy that places components 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. + *

+ *

+ * The aspect ratio of the rectangle is defined by the {@link yfiles.layout.ComponentLayout#preferredSize preferred size} of the graph. + *

+ * @see yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + PACKED_COMPACT_RECTANGLE, + /** + * Style specifier describing a component arrangement strategy that places components in a circular cloud around the + * biggest component. Entities of different components will not overlap, however the bounding boxes of the components may + * overlap. + * @see yfiles.layout.ComponentLayout#style + */ + PACKED_CIRCLE, + /** + * Style specifier describing a component arrangement strategy that places components in a circular compact 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 yfiles.layout.ComponentLayout#style + */ + PACKED_COMPACT_CIRCLE, + /** + * Style specifier describing a component arrangement strategy that places components in multiple rows. + *

+ * 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.ComponentLayout#preferredSize}. + *

+ *

+ * In contrast to + * {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, which is especially + * useful if there are few very large components and many significantly smaller ones. + *

+ * @see yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + MULTI_ROWS, + /** + * Style specifier describing a component arrangement strategy that places components in multiple rows. + *

+ * 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.ComponentLayout#preferredSize}. But in contrast to + * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, this strategy does not always try to come as close to the preferred + * view ratio, if a ratio close to the preferred ratio only induces a lot of unused view space. This unused space will be + * minimized. + *

+ *

+ * In contrast to + * {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, which is especially + * useful if there are few very large components and many significantly smaller ones. + *

+ * @see yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + MULTI_ROWS_COMPACT, + /** + * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} + * with a restricted height. The resulting height does not exceed the preferred height ({@link yfiles.layout.ComponentLayout#preferredSize}). + *

+ * 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 yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + MULTI_ROWS_HEIGHT_CONSTRAINT, + /** + * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} + * with a restricted height and as compact as possible. The resulting height does not exceed the preferred height ({@link yfiles.layout.ComponentLayout#preferredSize}). + *

+ * 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 yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT, + /** + * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} + * with a restricted width. The resulting width does not exceed the preferred width ({@link yfiles.layout.ComponentLayout#preferredSize}). + *

+ * 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 yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + MULTI_ROWS_WIDTH_CONSTRAINT, + /** + * Style specifier describing a component arrangement strategy that places the components in {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS} + * with a restricted width and as compact as possible. The resulting width does not exceed the preferred width ({@link yfiles.layout.ComponentLayout#preferredSize}). + *

+ * 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 yfiles.layout.ComponentLayout#style + * @see yfiles.layout.ComponentLayout#preferredSize + */ + MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT, + /** + * A constant for masking actual style constants from style modifiers. + * @see yfiles.layout.ComponentLayout#style + */ + MASK, + /** + * A modifier that can be added to normal style specifiers 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 yfiles.layout.ComponentLayout#style + */ + MODIFIER_AS_IS, + /** + * A modifier that can be added to normal style specifiers to indicate that the arrangement strategy should produce a + * non-overlapping component layout. + *

+ * Combining this modifier is not supported with {@link yfiles.layout.ComponentArrangementStyles#NONE}. + *

+ * @see yfiles.layout.ComponentLayout#style + */ + MODIFIER_NO_OVERLAP + } + export enum DiscreteEdgeLabelPositions{ + /** + * Position specifier that describes a label placement near the source, left/above the edge's path. + */ + SOURCE_HEAD, + /** + * Position specifier that describes a label placement near the middle of the edge, left/above the edge's path. + */ + HEAD, + /** + * Position specifier that describes a label placement near the target, left/above the edge's path. + */ + TARGET_HEAD, + /** + * Position specifier that describes a label placement near the source, right/below the edge's path. + */ + SOURCE_TAIL, + /** + * Position specifier that describes a label placement near the middle of the edge, right/below the edge's path. + */ + TAIL, + /** + * Position specifier that describes a label placement near the target, right/below the edge's path. + */ + TARGET_TAIL, + /** + * Position specifier that describes a label placement near the source, directly on the edge's path. + */ + SOURCE_CENTER, + /** + * Position specifier that describes a label placement near the middle of the edge, directly on the edge's path. + */ + CENTER, + /** + * Position specifier that describes a label placement near the target, directly on the edge's path. + */ + TARGET_CENTER, + /** + * Position mask that constrains the allowed positions to the two locations near the middle of the edge beside the edge's + * path. + * @see yfiles.layout.DiscreteEdgeLabelPositions#HEAD + * @see yfiles.layout.DiscreteEdgeLabelPositions#TAIL + */ + TWO_POS, + /** + * Position mask that constrains the allowed positions to the {@link yfiles.layout.DiscreteEdgeLabelPositions#CENTER} of the edge's + * path. + * @see yfiles.layout.DiscreteEdgeLabelPositions#CENTER + */ + CENTERED, + /** + * Position mask that constrains the allowed positions to a set of six positions beside the edge path. + *

+ * Two of the positions are near the source and two others are near the target. The remaining positions are in the middle + * of the edge. + *

+ * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_HEAD + * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_TAIL + * @see yfiles.layout.DiscreteEdgeLabelPositions#HEAD + * @see yfiles.layout.DiscreteEdgeLabelPositions#TAIL + * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_HEAD + * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_TAIL + */ + SIX_POS, + /** + * Position mask that constrains the allowed positions to a set of three positions directly on the edge's path. + * @see yfiles.layout.DiscreteEdgeLabelPositions#SOURCE_CENTER + * @see yfiles.layout.DiscreteEdgeLabelPositions#CENTER + * @see yfiles.layout.DiscreteEdgeLabelPositions#TARGET_CENTER + */ + THREE_CENTER + } + export enum DiscreteNodeLabelPositions{ + /** + * Position specifier that describes a label placement north of the node. + */ + NORTH, + /** + * Position specifier that describes a label placement north-west of the node. + */ + NORTH_WEST, + /** + * Position specifier that describes a label placement north-east of the node. + */ + NORTH_EAST, + /** + * Position specifier that describes a label placement east of the node. + */ + EAST, + /** + * Position specifier that describes a label placement west of the node. + */ + WEST, + /** + * Position specifier that describes a label placement south of the node. + */ + SOUTH, + /** + * Position specifier that describes a label placement south-west of the node. + */ + SOUTH_WEST, + /** + * Position specifier that describes a label placement south-east of the node. + */ + SOUTH_EAST, + /** + * Position specifier that describes a label placement at the center of the node. + */ + CENTER, + /** + * Position specifier that describes a label placement at the bottom inside the node. + */ + BOTTOM, + /** + * Position specifier that describes a label placement at the top inside the node. + */ + TOP, + /** + * Position specifier that describes a label placement at the left inside the node. + */ + LEFT, + /** + * Position specifier that describes a label placement at the right inside the node. + */ + RIGHT, + /** + * Position specifier that describes a label placement at the top-left inside the node. + */ + TOP_LEFT, + /** + * Position specifier that describes a label placement at the top-right inside the node. + */ + TOP_RIGHT, + /** + * Position specifier that describes a label placement at the bottom-left inside the node. + */ + BOTTOM_LEFT, + /** + * Position specifier that describes a label placement at the bottom-right inside the node. + */ + BOTTOM_RIGHT, + /** + * Position mask that constrains the positions to {@link yfiles.layout.DiscreteNodeLabelPositions#NORTH above} and {@link yfiles.layout.DiscreteNodeLabelPositions#SOUTH below} the node. + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH + */ + SANDWICH_MASK, + /** + * Position mask that constrains the positions to the nine node-internal positions. + * @see yfiles.layout.DiscreteNodeLabelPositions#CENTER + * @see yfiles.layout.DiscreteNodeLabelPositions#TOP + * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM + * @see yfiles.layout.DiscreteNodeLabelPositions#LEFT + * @see yfiles.layout.DiscreteNodeLabelPositions#RIGHT + * @see yfiles.layout.DiscreteNodeLabelPositions#TOP_LEFT + * @see yfiles.layout.DiscreteNodeLabelPositions#TOP_RIGHT + * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM_LEFT + * @see yfiles.layout.DiscreteNodeLabelPositions#BOTTOM_RIGHT + */ + INTERNAL_MASK, + /** + * Position mask that constrains the positions to the node's four sides. + * @see yfiles.layout.DiscreteNodeLabelPositions#EAST + * @see yfiles.layout.DiscreteNodeLabelPositions#WEST + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH + */ + SIDES_MASK, + /** + * Position mask that constrains the positions to the corners outside the node. + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_WEST + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_EAST + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_WEST + */ + CORNER_MASK, + /** + * Position mask that constraints the positions to the eight node-external positions. + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH + * @see yfiles.layout.DiscreteNodeLabelPositions#EAST + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH + * @see yfiles.layout.DiscreteNodeLabelPositions#WEST + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_EAST + * @see yfiles.layout.DiscreteNodeLabelPositions#NORTH_WEST + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_EAST + * @see yfiles.layout.DiscreteNodeLabelPositions#SOUTH_WEST + */ + EIGHT_POS_MASK + } + export enum FixPointPolicy{ + /** + * Fix point calculation policy specifying that the center of a rectangle containing all fixed nodes is considered the fix + * point. + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + */ + CENTER, + /** + * Fix point calculation policy specifying that the upper left corner of a rectangle containing all fixed nodes is considered the fix + * point. + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + */ + UPPER_LEFT, + /** + * Fix point calculation policy specifying that the upper right corner of a rectangle containing all fixed nodes is considered the fix + * point. + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + */ + UPPER_RIGHT, + /** + * Fix point calculation policy specifying that the lower right corner of a rectangle containing all fixed nodes is considered the fix + * point. + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + */ + LOWER_RIGHT, + /** + * Fix point calculation policy specifying that the lower left corner of a rectangle containing all fixed nodes is considered the fix + * point. + * @see yfiles.layout.FixNodeLayoutStage#fixPointPolicy + */ + LOWER_LEFT + } + export enum LabelPlacements{ + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed near the source node of an + * edge. + */ + AT_SOURCE, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed near the target node of an + * edge. + */ + AT_TARGET, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed near the center of the + * edge path. + */ + AT_CENTER, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed directly at the source + * port of the edge. + */ + AT_SOURCE_PORT, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed directly at the target + * port of the edge. + */ + AT_TARGET_PORT, + /** + * Placement specifier mask that masks all placement specifiers that describe the placement along the edge. + */ + ALONG_EDGE_MASK, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed on the path of the edge. + */ + ON_EDGE, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed on the left hand side of + * the edge path. + *

+ * The side is interpreted relative to the direction of the edge, if no different {@link yfiles.layout.PreferredPlacementDescriptor#sideReference side reference} is defined. + *

+ */ + LEFT_OF_EDGE, + /** + * Preferred placement specifier for edge labels which expresses that the label should be placed on the right hand side of + * the edge path. + *

+ * The side is interpreted relative to the direction of the edge, if no different {@link yfiles.layout.PreferredPlacementDescriptor#sideReference side reference} is defined. + *

+ */ + RIGHT_OF_EDGE, + /** + * Placement specifier mask that masks all placement specifiers that describe the side of the edge. + */ + ON_SIDE_OF_EDGE_MASK, + /** + * Preferred placement specifier for edge labels which expresses that the label can be placed anywhere along the edge or on + * any side of the edge. + */ + ANYWHERE + } + export enum LayoutOrientation{ + /** + * Orientation specifier which defines that the main layout orientation is from top to bottom. This is the default for all + * layout algorithms. + */ + TOP_TO_BOTTOM, + /** + * Orientation specifier which defines that the main layout orientation is from left to right. The layout will be rotated + * by 90 degrees counterclockwise. + */ + LEFT_TO_RIGHT, + /** + * Orientation specifier which defines that the main layout orientation is from right to left. The layout will be rotated + * by 90 degrees clockwise. + */ + RIGHT_TO_LEFT, + /** + * Orientation specifier which defines that the main layout orientation is from bottom to top. The layout will be flipped + * along the x-axis. + */ + BOTTOM_TO_TOP + } + export enum RowAlignment{ + /** + * Row alignment specifier which defines that each row will be aligned with its left border. + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows + */ + LEADING, + /** + * Row alignment specifier which defines that each row will be aligned with its right border. + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows + */ + TRAILING, + /** + * Row alignment specifier which defines that each row will be aligned with its left border and its right border. + *

+ * Rectangles in smaller rows will be distributed over the row, so that the row aligns with both sides. + *

+ * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows + */ + JUSTIFIED, + /** + * Row alignment specifier which defines that each row will be aligned with its center. + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleRows + */ + CENTER + } + export enum MultiRowConstraint{ + /** + * Constraint specifier for a multi-row rectangle arrangement that is unconstrained. Both, height and width, are not + * limited in size. The rectangles will be arranged in a way that the view ratio defined by the preferred height and width + * will be achieved. + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows + */ + NONE, + /** + * Constraint specifier for a multi-row rectangle arrangement that constrains the height of the layout. 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 still be considered for the rest and not weakened to the height of the higher + * rectangles. Having one rectangle being higher than the constraint does always result in arrangements consisting only of + * a single top-level row. + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows + */ + HEIGHT, + /** + * Constraint specifier for a multi-row rectangle arrangement that constrains the width of the layout. 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. + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows + */ + WIDTH + } + export enum EdgeFlow{ + /** + * Edge flow specifier which defines that the flow direction of most edges is up. + * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection + */ + UP, + /** + * Edge flow specifier which defines that the flow direction of most edges is down. + * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection + */ + DOWN, + /** + * Edge flow specifier which defines that the flow direction of most edges is left. + * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection + */ + LEFT, + /** + * Edge flow specifier which defines that the flow direction of most edges is right. + * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection + */ + RIGHT, + /** + * Edge flow specifier that defines that there is no main flow direction. + * @see yfiles.layout.LayoutGraphUtilities#determineEdgeFlowDirection + */ + NONE + } + export enum NodeAlignment{ + /** + * Node alignment policy that results in top-aligned nodes for vertical alignment and left-aligned nodes for horizontal + * alignments. + * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts + */ + LEADING, + /** + * Node alignment policy that results in center-aligned nodes. + * @see yfiles.layout.LayoutGraphUtilities#alignNodeLayouts + */ + CENTERED, + /** + * Node alignment policy that results in bottom-aligned nodes for vertical alignment and right-aligned nodes for horizontal + * alignments. + * @see yfiles.layout.LayoutGraphUtilities#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 yfiles.layout.LayoutGraphUtilities#alignNodeLayouts + */ + DISTRIBUTED + } + export enum MirrorModes{ + /** + * Mirroring specifier that can be used for preventing any mirroring of layout orientations. + * @see yfiles.layout.OrientationLayout#mirrorMode + * @see yfiles.layout.OrientationLayout#orientation + */ + NONE, + /** + * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} will be + * mirrored. + *

+ * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their + * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. + *

+ * @see yfiles.layout.OrientationLayout#mirrorMode + * @see yfiles.layout.OrientationLayout#orientation + */ + TOP_TO_BOTTOM, + /** + * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT} will be + * mirrored. + *

+ * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their + * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. + *

+ * @see yfiles.layout.OrientationLayout#mirrorMode + * @see yfiles.layout.OrientationLayout#orientation + */ + RIGHT_TO_LEFT, + /** + * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} will be + * mirrored. + *

+ * This specifier can be used for creating a mirror mask that defines which layout orientations shall be mirrored at their + * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. + *

+ * @see yfiles.layout.OrientationLayout#mirrorMode + * @see yfiles.layout.OrientationLayout#orientation + */ + BOTTOM_TO_TOP, + /** + * Mirroring specifier that defines that layout orientation {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} will be + * mirrored. + *

+ * This specifier can be used to create a mirror mask that defines which layout orientations shall be mirrored at their + * corresponding axis. It can be combined with the other mirroring specifiers to mirror several orientations. + *

+ * @see yfiles.layout.OrientationLayout#mirrorMode + * @see yfiles.layout.OrientationLayout#orientation + */ + LEFT_TO_RIGHT + } + export enum PortDirections{ + /** + * A port direction specifier indicating a port on the north (i.e., top) side of a node. + */ + NORTH, + /** + * A port direction specifier indicating a port on the east (i.e., right) side of a node. + */ + EAST, + /** + * A port direction specifier indicating a port on the west (i.e., left) side of a node. + */ + WEST, + /** + * A port direction specifier indicating a port on the south (i.e., bottom) side of a node. + */ + SOUTH, + /** + * A port direction specifier indicating a port lying in the direction of the main flow of the edge or of the overall + * layout. + *

+ * The exact direction is domain-specific. + *

+ */ + WITH_THE_FLOW, + /** + * A port direction specifier indicating a port lying in the opposite direction of the main flow of the edge or of the + * overall layout. + *

+ * The exact direction is domain-specific. + *

+ */ + AGAINST_THE_FLOW, + /** + * A port direction specifier indicating a port lying left of the direction of the main flow of the edge or of the overall + * layout. + *

+ * The exact direction is domain-specific. + *

+ */ + LEFT_IN_FLOW, + /** + * A port direction specifier indicating a port lying right of the direction of the main flow of the edge or of the overall + * layout. + *

+ * The exact direction is domain-specific. + *

+ */ + RIGHT_IN_FLOW, + /** + * A combination of all possible direction specifiers indicating that edges can connect to any side of a node. + */ + ANY + } + export enum PortSide{ + /** + * A weak constraint indicating that edges can connect to any side of a node. + * @see yfiles.layout.PortConstraint#create + */ + ANY, + /** + * A weak constraint indicating that edges can connect to the north side (i.e. top side) of a node. + * @see yfiles.layout.PortConstraint#create + */ + NORTH, + /** + * A weak constraint indicating that edges can connect to the south side (i.e. bottom side) of a node. + * @see yfiles.layout.PortConstraint#create + */ + SOUTH, + /** + * A weak constraint indicating that edges can connect to the east side (i.e. right side) of a node. + * @see yfiles.layout.PortConstraint#create + */ + EAST, + /** + * A weak constraint indicating that edges can connect to the west side (i.e. left side) of a node. + * @see yfiles.layout.PortConstraint#create + */ + WEST + } + export enum LabelSideReferences{ + /** + * Side placement specifier for edge labels which expresses that the preferred side of the edge is interpreted relative to + * the edge flow. + * @see yfiles.layout.PreferredPlacementDescriptor#sideReference + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + RELATIVE_TO_EDGE_FLOW, + /** + * Side placement specifier for edge labels which defines that the preferred side for the label is interpreted + * independently of the edge direction placing {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left labels} above horizontal segments. + *

+ * For vertical segments the label is placed {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left} or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE right} of the edge. In case the segment is horizontal, the label is + * placed above the segment if it should be left of the edge, otherwise below the segment. + *

+ * @see yfiles.layout.PreferredPlacementDescriptor#sideReference + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + ABSOLUTE_WITH_LEFT_IN_NORTH, + /** + * Side placement specifier for edge labels which defines that the preferred side for the label is interpreted + * independently of the edge direction placing {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE left labels} above horizontal segments. + *

+ * For vertical segments the label is placed {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE left} or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE right} of the edge. In case the segment is horizontal, the label is + * placed above the segment if it should be right of the edge, otherwise below the segment. + *

+ * @see yfiles.layout.PreferredPlacementDescriptor#sideReference + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + ABSOLUTE_WITH_RIGHT_IN_NORTH + } + export enum LabelAngleReferences{ + /** + * Angle interpretation specifier for edge labels which expresses that the rotation angle should be interpreted absolute + * and not relative to the edge slope. + * @see yfiles.layout.PreferredPlacementDescriptor#angleReference + * @see yfiles.layout.PreferredPlacementDescriptor#angle + */ + ABSOLUTE, + /** + * Angle interpretation specifier for edge labels which expresses that the rotation angle should be interpreted relative to + * the edge slope. + * @see yfiles.layout.PreferredPlacementDescriptor#angleReference + * @see yfiles.layout.PreferredPlacementDescriptor#angle + */ + RELATIVE_TO_EDGE_FLOW + } + export enum LabelAngleOnRightSideRotations{ + /** + * Angle interpretation specifier which expresses that the rotation angle should be interpreted clockwise. + *

+ * Therefore, edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} will be co-rotating with the angle of labels that are placed left of or + * centered on the edge. + *

+ * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide + * @see yfiles.layout.PreferredPlacementDescriptor#angle + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + CLOCKWISE, + /** + * Angle interpretation specifier which expresses that the rotation angle should be interpreted counter-clockwise. + *

+ * Therefore, edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} will be counter-rotating with the angle of labels that are placed left of or + * centered on the edge. + *

+ * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide + * @see yfiles.layout.PreferredPlacementDescriptor#angle + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + COUNTER_CLOCKWISE + } + export enum LabelAngleOnRightSideOffsets{ + /** + * Angle offset specifier for edge labels which expresses that no additional offset should be added to the angle. + * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide + * @see yfiles.layout.PreferredPlacementDescriptor#angle + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + NONE, + /** + * Angle offset specifier for edge labels which expresses that an additional offset of 180 degrees should be added to the + * angle. That way, point-symmetric label placements left and right of the edge can be attained. + * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide + * @see yfiles.layout.PreferredPlacementDescriptor#angle + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + */ + SEMI + } + export enum SliderMode{ + /** + * Slider mode specifier which describes continuous label positions directly on the edge path. + * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode + */ + CENTER, + /** + * Slider mode specifier which describes continuous label positions along the sides of the edge path. + * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode + */ + SIDE, + /** + * Slider mode specifier which describes continuous label positions along one side of the edge path. + * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode + */ + SINGLE_SIDE + } + export enum SelfLoopStyle{ + /** + * Self-loop style specifier which defines that the routes of self-loops are orthogonal. + *

+ * The routes consist of an alternating sequence of horizontal and vertical line segments. + *

+ * @see yfiles.layout.SelfLoopRouter#layoutStyle + */ + ORTHOGONAL, + /** + * Self-loop style specifier which defines that the routes of self-loops are rounded. + *

+ * The {@link yfiles.layout.SelfLoopRouter#lineDistance distance between incident self-loops} and {@link yfiles.layout.SelfLoopRouter#cornerApproximationPointsCount rounding of the corners} can be customized for rounded self-loops. + *

+ * @see yfiles.layout.SelfLoopRouter#layoutStyle + * @see yfiles.layout.SelfLoopRouter#lineDistance + * @see yfiles.layout.SelfLoopRouter#cornerApproximationPointsCount + */ + ROUNDED + } + export enum SwimlanesMode{ + /** + * Swimlane ordering mode specifier defining that node grouping is ignored during the swimlane ordering optimization. + * @see yfiles.layout.Swimlanes#arrangeSwimlanes + */ + IGNORE_GROUPS, + /** + * Swimlane ordering mode specifier defining that only node grouping is considered during the swimlane ordering + * optimization. + * @see yfiles.layout.Swimlanes#arrangeSwimlanes + */ + ONLY_GROUPS, + /** + * Swimlane ordering mode specifier defining that both node grouping and edge length are considered during the swimlane + * ordering optimization. + * @see yfiles.layout.Swimlanes#arrangeSwimlanes + */ + MIXED + } + /** + * {@link yfiles.layout.GraphLayoutLineWrapper} can line-wrap or column-wrap a graph layout. + *

+ * This {@link yfiles.layout.ILayoutStage} supports both wrapping a layout at a given width (height) and wrapping a layout + * automatically at some width (height) such that the resulting overall aspect ratio is close to a desired {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio target ratio}. + *

+ *

+ * The {@link yfiles.layout.GraphLayoutLineWrapper} can be used on an existing graph layout or on the result of the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * @class yfiles.layout.GraphLayoutLineWrapper + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface GraphLayoutLineWrapper extends yfiles.layout.LayoutStageBase{} + export class GraphLayoutLineWrapper { + /** + * Creates a new {@link yfiles.layout.GraphLayoutLineWrapper} instance with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the space that should be kept between edges. + *

+ * The spacing must be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is a negative value + * @type {number} + */ + edgeSpacing:number; + /** + * Gets or sets whether this {@link yfiles.layout.ILayoutStage} wraps lines/rows or columns. + *

+ * If this mode is enabled, the layout is wrapped vertically and new columns are appended to the right of the first column. + * Otherwise, the layout is wrapped horizontally and new rows are appended below the first row. + *

+ *

+ * Also, the {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} property will be interpreted as a fixed height if this mode is enabled. + *

+ * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidth + * @type {boolean} + */ + columnMode:boolean; + /** + * Gets or sets the space between adjacent lines of the wrapped graph layout. + *

+ * If the {@link yfiles.layout.GraphLayoutLineWrapper#columnMode column mode} is enabled, this spacing defines the distance between adjacent columns. + *

+ *

+ * The spacing should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative + * @type {number} + */ + spacing:number; + /** + * Gets or sets whether or not every other line is mirrored. + *

+ * When breaking a line and placing the remaining line below, this remainder can be rotated by 180 degrees. Then, the edges + * connecting both lines + * stay short. In case the remainder is not rotated, the edges are routed between the two lines to connect to the front of the + * non-mirrored line. + *

+ * @type {boolean} + */ + mirror:boolean; + /** + * Gets or sets whether the algorithm should use the {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth fixed width} or {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio target aspect ratio} to determine line breaks. + * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidth + * @see yfiles.layout.GraphLayoutLineWrapper#targetRatio + * @type {boolean} + */ + fixedWidthLineBreaks:boolean; + /** + * Gets or sets the desired target aspect ratio for the layout. + *

+ * The aspect ratio needs to be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the target ratio is 0 or less + * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks + * @type {number} + */ + targetRatio:number; + /** + * Gets or sets the desired width of the lines. + *

+ * The {@link yfiles.layout.GraphLayoutLineWrapper} breaks the lines at the specified width. + *

+ *

+ * In {@link yfiles.layout.GraphLayoutLineWrapper#columnMode column mode}, the fixed width is interpreted as fixed height for a column. + *

+ * @see yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks + * @see yfiles.layout.GraphLayoutLineWrapper#columnMode + * @type {number} + */ + fixedWidth:number; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.ILayoutStage} that temporarily removes all nodes and edges with NaN-coordinates. + *

+ * This layout stage may be necessary when a {@link yfiles.layout.ILayoutAlgorithm} takes the initial coordinates into account. In + * this case initial coordinates containing NaN-values, can cause exceptions or strange results. + *

+ *

+ * Layouters that consider initial coordinates: + *

+ *
    + *
  • {@link yfiles.hierarchic.HierarchicLayout} in incremental mode
  • + *
  • {@link yfiles.orthogonal.OrthogonalLayout} with activated from sketch drawing
  • + *
  • {@link yfiles.organic.OrganicLayout} for a subset of nodes
  • + *
  • {@link yfiles.tree.TreeLayout} when using a from sketch comparator.
  • + *
  • {@link yfiles.tree.BalloonLayout} in incremental mode
  • + *
  • {@link yfiles.partial.PartialLayout}
  • + *
  • + * all edge routing algorithms: {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter}, {@link yfiles.router.BusRouter}, + * {@link yfiles.router.OrganicEdgeRouter} + *
  • + *
+ *

+ * Since this stage only hides the invalid graph elements and doesn't apply any new coordinates, it is not defined where + * those nodes and edges will be placed within the calculated layout. + *

+ * @class yfiles.layout.HandleNaNCoordinatesStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface HandleNaNCoordinatesStage extends yfiles.layout.LayoutStageBase{} + export class HandleNaNCoordinatesStage { + constructor(); + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.IEdgeLabelLayout} defines the properties of one edge label from the perspective of a labeling algorithm. + *

+ * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding + * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. + *

+ * @interface + * @implements {yfiles.layout.ILabelLayout} + */ + export interface IEdgeLabelLayout extends Object,yfiles.layout.ILabelLayout{ + /** + * Gets the label model that describes the valid locations for this label. + * @abstract + * @type {yfiles.layout.IEdgeLabelLayoutModel} + */ + labelModel:yfiles.layout.IEdgeLabelLayoutModel; + /** + * Gets the preferred placement for this edge label, which can be considered by {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. + * @abstract + * @type {yfiles.layout.PreferredPlacementDescriptor} + */ + preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; + } + var IEdgeLabelLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface defines the properties of the model associated with an {@link yfiles.layout.IEdgeLabelLayout}. + *

+ * An {@link yfiles.layout.IEdgeLabelLayoutModel} provides a set of possible candidates for the placement of an edge label. It also defines a + * parameter that describes the current location of the label. + *

+ *

+ * It is important that all state information is encapsulated in the {@link yfiles.layout.IEdgeLabelLayoutModel#createModelParameter model parameter}. {@link yfiles.layout.IEdgeLabelLayoutModel} + * instances may be shared between multiple edge labels but produce different parameters for labels with different + * locations. + *

+ * @interface + */ + export interface IEdgeLabelLayoutModel extends Object{ + /** + * Creates a model parameter that represents the given edge label position within this model. + *

+ * The created model parameter is the closest parameter representation of the given label location that can be achieved + * within this model. + *

+ *

+ * This parameter can be passed to {@link yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement} to retrieve the current label + * box. + *

+ *

+ * A model parameter can be an arbitrary {@link Object}. However it must contain all information to allow restoring of the encoded + * location with this {@link yfiles.layout.IEdgeLabelLayoutModel}. + *

+ * @param {yfiles.algorithms.YOrientedRectangle} labelBounds the oriented box of the label, encoding the label location for which the parameter should be created + * @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 + * @returns {Object} the model parameter representing the given label location + * @see yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement + * @abstract + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):Object; + /** + * Returns all {@link yfiles.layout.EdgeLabelCandidate}s that describe valid label positions within this model. + *

+ * In case the implementing {@link yfiles.layout.IEdgeLabelLayoutModel} allows every possible location, this method always returns + * the current location as a {@link yfiles.layout.LabelCandidate}. + *

+ * @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 + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.layout.EdgeLabelCandidate} instances + * @abstract + */ + getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Returns the oriented box of the label for the position encoded by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize the width and height of the label + * @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} parameter the model parameter that describes the abstract position of the label within this model + * @returns {yfiles.algorithms.YOrientedRectangle} the oriented bounds of the label + * @abstract + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,parameter:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Gets a model parameter that encodes the default position of this model's allowed edge label positions. + *

+ * This parameter can be passed to {@link yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding + * label box. + *

+ * @abstract + * @type {Object} + */ + defaultParameter:Object; + } + var IEdgeLabelLayoutModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.layout.IEdgeLayout} 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. + *

+ * @interface + */ + export interface IEdgeLayout extends Object{ + /** + * Adds a control point to the end of the control point sequence. + * @param {number} x the absolute x-coordinate of the new control point + * @param {number} y the absolute y-coordinate of the new control point + * @abstract + */ + addPoint(x:number,y:number):void; + /** + * Removes all control points from this edge layout. + *

+ * The {@link yfiles.layout.IEdgeLayout} still keeps the {@link yfiles.layout.IEdgeLayout#sourcePoint source point} and the {@link yfiles.layout.IEdgeLayout#targetPoint target point}. + *

+ * @abstract + */ + clearPoints():void; + /** + * Returns the control point at the given position in the sequence of control points. + *

+ * The first control point in the sequence has index 0 and the last control point has index {@link yfiles.layout.IEdgeLayout#pointCount} + * -1. + *

+ * @param {number} index the position of the control point in the control point sequence + * @returns {yfiles.algorithms.YPoint} the absolute coordinates of the control point at the given index + * @see yfiles.layout.IEdgeLayout#setPoint + * @abstract + */ + getPoint(index:number):yfiles.algorithms.YPoint; + /** + * Returns the number of control points of the edge. + *

+ * The source and target points are not included in the point count. + *

+ * @returns {number} the number of control points + * @abstract + */ + pointCount():number; + /** + * Sets the absolute coordinates of the control point at the given position in the sequence of control points. + *

+ * The first control point in the sequence has index 0 and the last control point has index {@link yfiles.layout.IEdgeLayout#pointCount} + * -1. + *

+ * @param {number} index the position of the changing control point in the sequence + * @param {number} x the new absolute x-coordinate of the control point at the given index + * @param {number} y the new absolute y-coordinate of the control point at the given index + * @abstract + */ + setPoint(index:number,x:number,y:number):void; + /** + * Gets or sets the relative coordinates of the first end point of this layout. + *

+ * These coordinates are relative to the center location of the edge's source node. To obtain the absolute coordinates of + * the end point, the relative coordinates have to be added to the center coordinates of the source + * {@link yfiles.layout.INodeLayout}. + *

+ * @see yfiles.layout.LayoutGraph#getCenterX + * @see yfiles.layout.LayoutGraph#getCenterY + * @see yfiles.layout.INodeLayout#x + * @see yfiles.layout.INodeLayout#y + * @abstract + * @type {yfiles.algorithms.YPoint} + */ + sourcePoint:yfiles.algorithms.YPoint; + /** + * Gets or sets the relative coordinates of the second end point of this layout. + *

+ * These coordinates are relative to the center location of the edge's target node. To obtain the absolute coordinates of + * the end point, the relative coordinates have to be added to the center coordinates of the target + * {@link yfiles.layout.INodeLayout}. + *

+ * @see yfiles.layout.LayoutGraph#getCenterX + * @see yfiles.layout.LayoutGraph#getCenterY + * @see yfiles.layout.INodeLayout#x + * @see yfiles.layout.INodeLayout#y + * @abstract + * @type {yfiles.algorithms.YPoint} + */ + targetPoint:yfiles.algorithms.YPoint; + } + var IEdgeLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.layout.IIntersectionCalculator} is 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 {@link yfiles.layout.PortCalculator} when adjusting the final port + * locations after the layout is calculated. + *

+ * @see yfiles.layout.PortCalculator + * @interface + */ + export interface IIntersectionCalculator extends Object{ + /** + * Calculates an intersection point between the edge and the given {@link yfiles.layout.INodeLayout}. + *

+ * Implementing classes use a point on the connecting edge segment (specified with an offset to the node's center) along + * with a direction pointing to the node and calculate the intersection between this line and the node. + *

+ * @param {yfiles.layout.INodeLayout} nodeLayout the layout information of the node + * @param {number} xOffset the x-coordinate of a point on the last line segment relative to the node's center + * @param {number} yOffset the y-coordinate of a point on the last line segment relative to the node's center + * @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 + * @returns {yfiles.algorithms.YPoint} the intersection coordinates relative to the node's center or null if no such intersection was found + * @abstract + */ + calculateIntersectionPoint(nodeLayout:yfiles.layout.INodeLayout,xOffset:number,yOffset:number,dx:number,dy:number):yfiles.algorithms.YPoint; + } + var IIntersectionCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class that declares several keys for {@link yfiles.algorithms.IDataProvider} that provide + * {@link yfiles.layout.IIntersectionCalculator}. + * @class yfiles.layout.IntersectionCalculatorKeys + * @static + */ + export interface IntersectionCalculatorKeys extends Object{} + export class IntersectionCalculatorKeys { + /** + * Data provider key for providing an individual intersection calculation for each edge source in the graph + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static SOURCE_INTERSECTION_CALCULATOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for providing an individual intersection calculation for each edge target in the graph + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static TARGET_INTERSECTION_CALCULATOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.ILabelLayout} defines the properties of a label from the perspective of a labeling algorithm. + *

+ * Both node and edge labels need to implement this interface. It describes the size and position of a label. + *

+ *

+ * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding + * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. + *

+ * @interface + */ + export interface ILabelLayout extends Object{ + /** + * Gets the bounding box of the label. + *

+ * The bounding box is the smallest, paraxial rectangle that contains the whole label. + *

+ * @abstract + * @type {yfiles.algorithms.YRectangle} + */ + boundingBox:yfiles.algorithms.YRectangle; + /** + * Gets the box of the label. + *

+ * This box matches the area that is covered by the label. The {@link yfiles.algorithms.YOrientedRectangle#setUpVector up vector} of the rectangle encodes the orientation of the + * label. + *

+ * @abstract + * @type {yfiles.algorithms.YOrientedRectangle} + */ + orientedBox:yfiles.algorithms.YOrientedRectangle; + /** + * Gets or sets the label model parameter that describes the position of this label. + *

+ * The model parameter must fit the according label model. + *

+ * @abstract + * @type {Object} + */ + modelParameter:Object; + } + var ILabelLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.layout.ILabelLayoutFactory} 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. + *

+ *

+ * An instance of this factory can be obtained with method {@link yfiles.layout.LayoutGraphUtilities#getLabelFactory}. This method + * uses the {@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 which was given to method {@link yfiles.layout.LayoutGraphUtilities#getLabelFactory}. + *

+ * @interface + */ + export interface ILabelLayoutFactory extends Object{ + /** + * Adds the given {@link yfiles.layout.IEdgeLabelLayout} to the given edge. + *

+ * The given {@link yfiles.layout.ILabelLayout} has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout} + * or {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout}. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout the edge label layout that should be added to the given edge + * @throws {Stubs.Exceptions.ArgumentError} if the given label layout has already been added to the graph + * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout + * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout + * @abstract + */ + addLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; + /** + * Adds the given node label layout to the given node. + *

+ * The given label layout has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout} or + * {@link yfiles.layout.ILabelLayoutFactory#createLabelLayout}. + *

+ * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.layout.INodeLabelLayout} labelLayout the node label layout that should be added to the given node + * @throws {Stubs.Exceptions.ArgumentError} if the given label layout has already been added to the graph + * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout + * @see yfiles.layout.ILabelLayoutFactory#createLabelLayout + * @abstract + */ + addLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; + /** + * Creates a new {@link yfiles.layout.ILabelLayout} for the given edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label + * @param {yfiles.layout.IEdgeLabelLayoutModel} 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 + * @returns {yfiles.layout.IEdgeLabelLayout} a new edge label layout + * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout + * @abstract + */ + createLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.IEdgeLabelLayoutModel,descriptor:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.IEdgeLabelLayout; + /** + * Creates a new {@link yfiles.layout.ILabelLayout} for the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label + * @param {yfiles.layout.INodeLabelLayoutModel} model specifies the model of the created node label + * @returns {yfiles.layout.INodeLabelLayout} a new node label layout + * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout + * @abstract + */ + createLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.INodeLabelLayoutModel):yfiles.layout.INodeLabelLayout; + /** + * Creates a new {@link yfiles.layout.ILabelLayout} for the given edge. + *

+ * This method should create a {@link yfiles.layout.ILabelLayout} with an {@link yfiles.layout.IEdgeLabelLayoutModel} that supports the + * desired oriented label box exactly as given. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label + * @returns {yfiles.layout.IEdgeLabelLayout} a new edge label layout + * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout + * @abstract + */ + createLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.IEdgeLabelLayout; + /** + * Creates a new {@link yfiles.layout.ILabelLayout} for the given node. + *

+ * This method should create a {@link yfiles.layout.ILabelLayout} with a {@link yfiles.layout.INodeLabelLayoutModel} that supports the + * desired oriented label box exactly as given. + *

+ * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label + * @returns {yfiles.layout.INodeLabelLayout} a new node label layout + * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout + * @abstract + */ + createLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.INodeLabelLayout; + /** + * Removes the given {@link yfiles.layout.IEdgeLabelLayout} from the given edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout the label layout that should be removed from the given edge + * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout + * @abstract + */ + removeLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; + /** + * Removes the given node label layout from the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.layout.INodeLabelLayout} labelLayout the label layout that should be removed from the given node + * @see yfiles.layout.ILabelLayoutFactory#addLabelLayout + * @abstract + */ + removeLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; + /** + * Gets the graph associated with this label factory instance. + * @abstract + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + } + var ILabelLayoutFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.layout.ILayoutAlgorithm} describes the general interface for algorithms that perform a layout process on a + * {@link yfiles.layout.LayoutGraph}. + *

+ * The main method for invoking the layout calculation is + * {@link yfiles.layout.ILayoutAlgorithm#applyLayout}. Implementing classes will arrange the graph there. + *

+ *

+ * This class also provides keys to register {@link yfiles.algorithms.IDataProvider}s with the graph that contain information about + * the nodes and edges in the graph. {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.layout.LayoutKeys#NODE_ID_DP_KEY} + * and {@link yfiles.layout.LayoutKeys#EDGE_ID_DP_KEY} contain unique identifiers for both nodes and edges. These identifiers allow + * for ensuring consistent results even if the order of nodes and edges was changed between two layout runs. + *
+ * The selection state of nodes and edges is stored in {@link yfiles.algorithms.IDataProvider}s registered with the keys {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} + * and + * {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. Based on this information, the layout algorithm may reduce its + * calculations to the selected subset of nodes or edges. + *

+ * @interface + */ + export interface ILayoutAlgorithm extends Object{ + /** + * Main layout routine that assigns new layout information to the given graph. + *

+ * The call to this routine will only succeed if the layout algorithm can handle the input graph. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @abstract + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + } + var ILayoutAlgorithm:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class that provides unique identifiers for some general purpose {@link yfiles.algorithms.IDataProvider data providers}. + * @class yfiles.layout.LayoutKeys + * @static + */ + export interface LayoutKeys extends Object{} + export class LayoutKeys { + /** + * Data provider key for looking up a unique identifier for each node in a graph + *

+ * Layout algorithms may use this information to provide consistent layouts for multiple runs. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for looking up a unique identifier for each edge in a graph + *

+ * Layout algorithms may use this information to provide consistent layouts for multiple runs. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for looking up the selected state of the nodes in the graph + *

+ * A layout algorithm can retrieve a {@link yfiles.algorithms.IDataProvider} registered with this key to apply a special handling + * to the selected nodes. For example, the layout algorithm may restrict its scope, i.e., it only arranges the selected + * nodes. + *

+ *

+ * However, it is often more convenient to use a specific {@link yfiles.algorithms.IDataProvider} key for this purpose, e.g., if + * you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. + * Thus, these algorithms may provide a method like setSubgraphNodesDpKey(Object) that customizes the {@link yfiles.algorithms.IDataProvider} + * key allowing to specify different sets of selected nodes for nested layout algorithms. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for looking up the selected state of the edges in the graph + *

+ * A layout algorithm can retrieve a {@link yfiles.algorithms.IDataProvider} registered with this key to apply a special handling + * to the selected edges. For example, the layout algorithm may restrict its scope, i.e., it only routes the selected + * edges. + *

+ *

+ * However, it is often more convenient to use a specific {@link yfiles.algorithms.IDataProvider} key for this purpose, e.g., if + * you want to combine two layout algorithms of the same kind which have to operate on different subsets of the graph. + * Thus, these algorithms may provide a method like setSubgraphEdgesDpKey(Object) that customizes the {@link yfiles.algorithms.IDataProvider} + * key allowing to specify different sets of selected edges for nested layout algorithms. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.ILayoutStage} is a layout algorithm that represents a stage of a larger layout process. + *

+ * It delegates the core layout process to another {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. Implementing classes may perform pre-processing steps + * before the {@link yfiles.layout.ILayoutStage#coreLayout core layout algorithm} gets called and post-processing steps afterwards. + *

+ * @see yfiles.layout.MultiStageLayout + * @interface + * @implements {yfiles.layout.ILayoutAlgorithm} + */ + export interface ILayoutStage extends Object,yfiles.layout.ILayoutAlgorithm{ + /** + * Gets or sets the core layout algorithm. + *

+ * This algorithm is wrapped by this stage. It is invoked in {@link yfiles.layout.ILayoutAlgorithm#applyLayout}. The {@link yfiles.layout.ILayoutStage} + * may add pre- and post-processing steps before and after calling the core layout algorithm. + *

+ * @abstract + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + } + var ILayoutStage:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.layout.INodeLabelLayout} defines the properties of one node label from the perspective of a labeling algorithm. + *

+ * Note: To avoid inconsistencies, changing the {@link yfiles.layout.ILabelLayout#modelParameter model parameter} should always be combined with updating the corresponding + * {@link yfiles.layout.ILabelLayout#orientedBox oriented box}. + *

+ * @interface + * @implements {yfiles.layout.ILabelLayout} + */ + export interface INodeLabelLayout extends Object,yfiles.layout.ILabelLayout{ + /** + * Gets the label model that describes the valid locations for this label. + * @abstract + * @type {yfiles.layout.INodeLabelLayoutModel} + */ + labelModel:yfiles.layout.INodeLabelLayoutModel; + } + var INodeLabelLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.layout.INodeLabelLayoutModel} defines the properties of the model associated with a + * {@link yfiles.layout.INodeLabelLayout}. + *

+ * A {@link yfiles.layout.INodeLabelLayoutModel} provides a set of possible candidates for the placement of a node label. It also defines a parameter + * that describes the current location of the label. + *

+ *

+ * It is important that all state information is encapsulated in the {@link yfiles.layout.INodeLabelLayoutModel#createModelParameter model parameter}. {@link yfiles.layout.INodeLabelLayoutModel} + * instances may be shared between multiple node labels but produce different parameters for labels with different + * locations. + *

+ * @interface + */ + export interface INodeLabelLayoutModel extends Object{ + /** + * Creates a model parameter that represents the given node label position within this model. + *

+ * The created model parameter is the closest parameter representation of the given label location that can be achieved + * within this model. + *

+ *

+ * This parameter can be passed to {@link yfiles.layout.INodeLabelLayoutModel#getLabelPlacement} to retrieve the current label + * box. + *

+ *

+ * A model parameter can be an arbitrary {@link Object}. However it must contain all information to allow restoring of the encoded + * location with this {@link yfiles.layout.INodeLabelLayoutModel}. + *

+ * @param {yfiles.algorithms.YOrientedRectangle} labelBounds the box of the label, encoding the label location for which the parameter should be created + * @param {yfiles.layout.INodeLayout} nodeLayout the layout of the node to which the label belongs + * @returns {Object} the model parameter representing the given label location + * @see yfiles.layout.INodeLabelLayoutModel#getLabelPlacement + * @abstract + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + /** + * Returns all {@link yfiles.layout.NodeLabelCandidate}s that describe valid label positions within this model. + *

+ * In case the implementing {@link yfiles.layout.INodeLabelLayoutModel} allows every possible location, this method always returns + * the current location as a {@link yfiles.layout.LabelCandidate}. + *

+ * @param {yfiles.layout.INodeLabelLayout} labelLayout the label for which candidates should be generated + * @param {yfiles.layout.INodeLayout} nodeLayout the layout of the node to which the label belongs + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.layout.NodeLabelCandidate} instances + * @abstract + */ + getLabelCandidates(labelLayout:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Returns the bounds of the label for the position encoded by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize the width and height of the label + * @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 + * @returns {yfiles.algorithms.YOrientedRectangle} the oriented box of the label + * @abstract + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Gets a model parameter that encodes the default position of this model's allowed node label positions. + *

+ * This parameter can be passed to {@link yfiles.layout.INodeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding + * label box. + *

+ * @abstract + * @type {Object} + */ + defaultParameter:Object; + } + var INodeLabelLayoutModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.layout.INodeLayout} encapsulates the layout information for a node. + *

+ * The layout information consists of the size and position of the node. + *

+ * @interface + */ + export interface INodeLayout extends Object{ + /** + * Sets the coordinates of the upper-left corner of the node. + * @param {number} x the new x-coordinate of the node + * @param {number} y the new y-coordinate of the node + * @abstract + */ + setLocation(x:number,y:number):void; + /** + * Sets the size of the node. + * @param {number} width the new width of the node + * @param {number} height the new height of the node + * @abstract + */ + setSize(width:number,height:number):void; + /** + * Gets the x-coordinate of the upper-left corner of the node. + *

+ * The location of the node is described by the coordinates of the upper-left corner of the node. + *

+ * @abstract + * @type {number} + */ + x:number; + /** + * Gets the y-coordinate of the upper-left corner of the node. + *

+ * The location of the node is described by the coordinates of the upper-left corner of the node. + *

+ * @abstract + * @type {number} + */ + y:number; + /** + * Gets the width of the node. + *

+ * The width of the node is the horizontal distance the node spans. + *

+ * @abstract + * @type {number} + */ + width:number; + /** + * Gets the height of the node. + *

+ * The height of the node is the vertical distance the node spans. + *

+ * @abstract + * @type {number} + */ + height:number; + } + var INodeLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.layout.IPartitionInterEdgeRouter} is responsible for routing inter-edges. + *

+ * An inter-edge is an edge that connects nodes that belong to different partitions. + *

+ * @interface + */ + export interface IPartitionInterEdgeRouter 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 the map that marks inter-edges + * @abstract + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + /** + * Gets or sets whether or not to route inter-edges only. + *

+ * Inter-edges are edges that connect nodes from different partitions. If this feature is disabled, all edges are routed by + * this routing algorithm. + *

+ * @abstract + * @type {boolean} + */ + routeInterEdgesOnly:boolean; + } + var IPartitionInterEdgeRouter:{ + /** + * Routes inter-edges using {@link yfiles.router.ChannelEdgeRouter}. + * @param {yfiles.router.ChannelEdgeRouter} [router=null] The router instance to use for the edge routing. If not specified, a internal instance is used. + * @returns {yfiles.layout.IPartitionInterEdgeRouter} + * @static + */ + createChannelInterEdgeRouter?(router?:yfiles.router.ChannelEdgeRouter):yfiles.layout.IPartitionInterEdgeRouter; + /** + * Routes inter-edges using {@link yfiles.router.EdgeRouter}. + * @param {yfiles.router.EdgeRouter} [router=null] The router instance to use for the edge routing. If not specified, a internal instance is used. + * @returns {yfiles.layout.IPartitionInterEdgeRouter} + * @static + */ + createPolylineInterEdgeRouter?(router?:yfiles.router.EdgeRouter):yfiles.layout.IPartitionInterEdgeRouter; + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.layout.IProfitModel} ranks + * {@link yfiles.layout.LabelCandidate}s used for prioritizing certain label locations over others. + *

+ * Generic labeling algorithm {@link yfiles.labeling.GenericLabeling} will use the ranking to decide which + * {@link yfiles.layout.LabelCandidate}s to eliminate. + *

+ *

+ * {@link yfiles.layout.LabelCandidate}s with a high profit will be preferred over + * {@link yfiles.layout.LabelCandidate}s with a low profit. + *

+ * @interface + */ + export interface IProfitModel extends Object{ + /** + * Returns the profit for placing a label using the given {@link yfiles.layout.LabelCandidate}. + *

+ * Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling + * algorithm. + *

+ *

+ * Profits need to have a value between 0 and 1. + *

+ * @param {yfiles.layout.LabelCandidate} candidate the candidate + * @returns {number} the profit of the candidate + * @abstract + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + } + var IProfitModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.layout.LabelCandidate} describes one valid placement for a label considering the label model. + *

+ * Generic labeling algorithms place labels according to their label model. To get valid locations for the label, the label + * model generates various + * {@link yfiles.layout.LabelCandidate}s. One of these candidates will be chosen to provide the actual placement of the label. + *

+ * @see yfiles.layout.INodeLabelLayoutModel + * @see yfiles.layout.IEdgeLabelLayoutModel + * @see yfiles.labeling.GenericLabeling + * @class yfiles.layout.LabelCandidate + * @implements {yfiles.algorithms.IPlaneObject} + */ + export interface LabelCandidate extends Object,yfiles.algorithms.IPlaneObject{} + export class LabelCandidate { + /** + * Creates a new instance of {@link yfiles.layout.LabelCandidate} described by location, size, model parameter and internal flag. + * @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 label model associated with this candidate + * @param {yfiles.layout.ILabelLayout} owner the label associated with the candidate + * @param {boolean} [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.ILabelLayout,internal?:boolean); + /** + * Creates a new instance of {@link yfiles.layout.LabelCandidate} described by its box, model parameter and internal flag. + * @param {yfiles.algorithms.YOrientedRectangle} labelBox the box that specifies the candidate's size and position + * @param {Object} param the parameters of the label model associated with this candidate + * @param {yfiles.layout.ILabelLayout} owner the label associated with the candidate + * @param {boolean} [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise + * @constructor + */ + constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.ILabelLayout,internal?:boolean); + /** + * Replaces the model parameter and box of the owner with the model parameter and box of this candidate. + *

+ * When this candidate is chosen to provide the placement of the label, this method transfers the model parameter and the + * candidate box to the {@link yfiles.layout.ILabelLayout}. + *

+ * @see yfiles.layout.LabelCandidate#owner + * @see yfiles.layout.LabelCandidate#modelParameter + * @see yfiles.layout.LabelCandidate#box + */ + propagate():void; + /** + * Gets or sets the custom profit for this candidate. + *

+ * The profit describes the priority of this candidate with respect to other candidates. Labeling algorithms will use the + * profit to decide which candidate to choose. + *

+ *

+ * The value is restricted to the interval [0,1], where 1 specifies the highest possible profit. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value lies outside of [0,1] + * @type {number} + */ + customProfit:number; + /** + * Gets the model parameter that was used by the underlying model to generate this label candidate. + * @type {Object} + */ + modelParameter:Object; + /** + * Gets the coordinates of the upper-left corner of the candidate's bounds. + *

+ * The bounds are the smallest paraxial box that contains the candidate. + *

+ * @see yfiles.layout.LabelCandidate#boundingBox + * @type {yfiles.algorithms.YPoint} + */ + location:yfiles.algorithms.YPoint; + /** + * Gets the width and height of the candidate's bounds. + *

+ * The bounds are the smallest paraxial box that contains the candidate. + *

+ * @see yfiles.layout.LabelCandidate#boundingBox + * @type {yfiles.algorithms.YDimension} + */ + size:yfiles.algorithms.YDimension; + /** + * Gets the minimum x-coordinate of the candidate's bounds. + *

+ * The bounds are the smallest paraxial box that contains the candidate. + *

+ * @see yfiles.layout.LabelCandidate#location + * @see yfiles.layout.LabelCandidate#boundingBox + * @type {number} + */ + x:number; + /** + * Gets the minimum y-coordinate of the candidate's bounds. + *

+ * The bounds are the smallest paraxial box that contains the candidate. + *

+ * @see yfiles.layout.LabelCandidate#location + * @see yfiles.layout.LabelCandidate#boundingBox + * @type {number} + */ + y:number; + /** + * Gets the width of the candidate's bounds. + *

+ * The bounds are the smallest paraxial box that contains the candidate. + *

+ * @see yfiles.layout.LabelCandidate#size + * @see yfiles.layout.LabelCandidate#boundingBox + * @type {number} + */ + width:number; + /** + * Gets the height of the candidate's bounding box. + *

+ * The bounding box is the smallest paraxial box that contains the candidate. + *

+ * @see yfiles.layout.LabelCandidate#size + * @see yfiles.layout.LabelCandidate#boundingBox + * @type {number} + */ + height:number; + /** + * Gets the bounding box of this candidate. + *

+ * The bounding box describes the smallest paraxial box that contains the candidate. + *

+ * @type {yfiles.algorithms.YRectangle} + */ + boundingBox:yfiles.algorithms.YRectangle; + /** + * Gets the oriented box of this candidate. + *

+ * If the label is rotated, this box will be oriented accordingly. + *

+ * @type {yfiles.algorithms.YOrientedRectangle} + */ + box:yfiles.algorithms.YOrientedRectangle; + /** + * Gets the {@link yfiles.layout.ILabelLayout} for which this candidate was created. + * @type {yfiles.layout.ILabelLayout} + */ + owner:yfiles.layout.ILabelLayout; + /** + * Gets whether or not this candidate describes an internal label. + *

+ * Internal labels reside inside the boundaries of a node. + *

+ * @type {boolean} + */ + internal:boolean; + /** + * Gets or sets a penalty for a candidate position that overlaps the box 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. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified penalty is outside [0,1] + * @type {number} + */ + nodeOverlapPenalty:number; + /** + * Gets or sets a penalty 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. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified penalty is outside [0,1] + * @type {number} + */ + edgeOverlapPenalty:number; + /** + * Gets the sum of node overlap penalty and edge overlap penalty. + * @see yfiles.layout.LabelCandidate#edgeOverlapPenalty + * @see yfiles.layout.LabelCandidate#nodeOverlapPenalty + * @type {number} + */ + overlapPenalty:number; + /** + * Gets whether or not this candidate's box had already been chosen by the labeling algorithm. + *

+ * If this candidate is propagated, its model parameter and box were transferred to the {@link yfiles.layout.LabelCandidate#owner label}. + *

+ * @see yfiles.layout.LabelCandidate#propagate + * @type {boolean} + */ + propagated:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.LabelLayoutBase} is the default implementation of the {@link yfiles.layout.ILabelLayout} interface. + * @class yfiles.layout.LabelLayoutBase + * @implements {yfiles.layout.ILabelLayout} + */ + export interface LabelLayoutBase extends Object,yfiles.layout.ILabelLayout{} + export class LabelLayoutBase { + /** + * Creates a new {@link yfiles.layout.LabelLayoutBase} instance. + * @constructor + */ + constructor(); + /** + * Sets the box of the label. + *

+ * This box matches the area that is covered by the label. The {@link yfiles.algorithms.YOrientedRectangle#setUpVector up vector} of the rectangle encodes the orientation of the + * label. + *

+ * @type {yfiles.algorithms.YOrientedRectangle} + */ + orientedBox:yfiles.algorithms.YOrientedRectangle; + /** + * Sets the bounding box of the label. + *

+ * The bounding box is the smallest, paraxial rectangle that contains the whole label. + *

+ * @type {yfiles.algorithms.YRectangle} + */ + boundingBox:yfiles.algorithms.YRectangle; + /** + * + * @type {Object} + */ + modelParameter:Object; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.LabelLayoutData} encapsulates layout information for a label. + *

+ * The information is used by clients to inform label-aware {@link yfiles.layout.ILayoutAlgorithm layout algorithms} about labeling constraints like label size + * and preferred placement. + *

+ *

+ * Label-aware algorithms like {@link yfiles.hierarchic.HierarchicLayout} return the calculated label positions by assigning the + * corresponding box to the provided {@link yfiles.layout.LabelLayoutData} instances. + *

+ *

+ * {@link yfiles.algorithms.IDataProvider DataProviders} are used for associating an array of {@link yfiles.layout.LabelLayoutData} instances with either the nodes or the + * edges of a {@link yfiles.layout.LayoutGraph}. The {@link yfiles.algorithms.IDataProvider DataProviders} must be registered with the input graph using one of the keys + * defined in {@link yfiles.layout.LabelLayoutKeys}. + *

+ * @class yfiles.layout.LabelLayoutData + */ + export interface LabelLayoutData extends Object{} + export class LabelLayoutData { + /** + * Creates a new instance of {@link yfiles.layout.LabelLayoutData} for a label with the given width and height. + * @param {number} width the width of the label + * @param {number} height the height of the label + * @constructor + */ + constructor(width:number,height:number); + /** + * Creates a new instance of {@link yfiles.layout.LabelLayoutData} for a label with the given oriented box and preferred placement + * descriptor. + * @param {yfiles.algorithms.YOrientedRectangle} bounds the box of the label + * @param {yfiles.layout.PreferredPlacementDescriptor} [preferredPlacement=null] a preferred placement descriptor + * @throws {Stubs.Exceptions.ArgumentError} if the specified descriptor is null + * @see yfiles.layout.PreferredPlacementDescriptor + * @see yfiles.layout.LabelLayoutData#preferredPlacementDescriptor + * @constructor + */ + constructor(bounds:yfiles.algorithms.YOrientedRectangle,preferredPlacement?:yfiles.layout.PreferredPlacementDescriptor); + /** + * Specifies the coordinates of the upper-left corner of the bounding box of the label. + * @param {number} x the new x-coordinate of the upper-left corner + * @param {number} y the new y-coordinate of the upper-left corner + * @see yfiles.layout.LabelLayoutData#x + * @see yfiles.layout.LabelLayoutData#y + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + */ + setLocation(x:number,y:number):void; + /** + * Specifies the width and height of the {@link yfiles.layout.LabelLayoutData#bounds oriented box} of this label. + * @param {number} width the width of the oriented box + * @param {number} height the height of the oriented box + * @see yfiles.layout.LabelLayoutData#bounds + */ + setSize(width:number,height:number):void; + /** + * Gets or sets the {@link yfiles.algorithms.YOrientedRectangle oriented box} of the label. + * @type {yfiles.algorithms.YOrientedRectangle} + */ + bounds:yfiles.algorithms.YOrientedRectangle; + /** + * Gets the width of the label's bounding box. + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + * @type {number} + */ + width:number; + /** + * Gets the height of the label's bounding box. + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + * @type {number} + */ + height:number; + /** + * Gets the x-coordinate of the upper-left corner of the label's bounding box. + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + * @type {number} + */ + x:number; + /** + * Gets the y-coordinate of the upper-left corner of the label's bounding box. + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + * @type {number} + */ + y:number; + /** + * Gets or sets the preferred placement of this label. + * @throws {Stubs.Exceptions.ArgumentError} if the specified descriptor is null + * @type {yfiles.layout.PreferredPlacementDescriptor} + */ + preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.LabelLayoutKeys} are used for associating + * {@link yfiles.algorithms.IDataProvider}s that contain label-specific information for edge and node labels. + *

+ * Label-aware layout algorithms like {@link yfiles.hierarchic.HierarchicLayout} may look for such {@link yfiles.algorithms.IDataProvider}s + * that contain {@link yfiles.layout.LabelLayoutData} for each edge. + *

+ *

+ * Instead of setting up {@link yfiles.layout.LabelLayoutData} and {@link yfiles.algorithms.IDataProvider}s one can also use {@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 through the keys defined below. + *

+ * @class yfiles.layout.LabelLayoutKeys + * @static + */ + export interface LabelLayoutKeys extends Object{} + export class LabelLayoutKeys { + /** + * Data provider key for accessing label information of each edge in the input graph + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_LABEL_LAYOUT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for accessing label information of each node in the input graph + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_LABEL_LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for marking labels that should be ignored by the layout algorithm + *

+ * A label is ignored if there is a {@link yfiles.algorithms.IDataProvider} registered with this key which returns true for the + * given {@link yfiles.layout.ILabelLayout}. + *

+ *

+ * The {@link yfiles.layout.LabelLayoutTranslator} only translates labels that should not be ignored. + *

+ * @const + * @static + * @type {yfiles.algorithms.ILabelLayoutDpKey.} + */ + static IGNORED_LABELS_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.LabelLayoutTranslator} 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 {@link yfiles.layout.ILayoutStage} as label layout algorithm of a label-aware layout algorithm like + * {@link yfiles.hierarchic.HierarchicLayout}. This can be done by assigning the stage by an appropriate call to {@link yfiles.layout.MultiStageLayout#labeling setLabelLayouter}. + *

+ *

+ * When writing the {@link yfiles.layout.LabelLayoutData}, the {@link yfiles.layout.LabelLayoutData#bounds boxes} are set relative. In case of a node label, the box's {@link yfiles.algorithms.YOrientedRectangle#anchor anchor} is + * relative to the center of the owning node. In case of an edge label the box's 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 transferred + * back to the {@link yfiles.layout.INodeLabelLayout}s and/or {@link yfiles.layout.IEdgeLabelLayout}s. + *

+ *

+ * By default, the {@link yfiles.layout.LabelLayoutData#bounds boxes} 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 the 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. + *

+ * @class yfiles.layout.LabelLayoutTranslator + * @implements {yfiles.layout.ILayoutStage} + */ + export interface LabelLayoutTranslator extends Object,yfiles.layout.ILayoutStage{} + export class LabelLayoutTranslator { + /** + * Creates a new {@link yfiles.layout.LabelLayoutTranslator} instance with default settings. + * @constructor + */ + constructor(); + /** + * Translates traditional {@link yfiles.layout.ILabelLayout} information to {@link yfiles.algorithms.IDataProvider}-based + * {@link yfiles.layout.LabelLayoutData}. + *

+ * Afterwards, the calculated layout data will be written back to the original label layout. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Gets or sets the core layout algorithm that is wrapped by this {@link yfiles.layout.ILayoutStage}. + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets 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} points downwards ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0), this {@link yfiles.layout.ILayoutStage} automatically flips the + * label. It rotates the label by 180 degrees without changing the label's center. + *

+ * @see yfiles.layout.LayoutGraphUtilities#autoFlipBox + * @see yfiles.layout.ILabelLayout#orientedBox + * @type {boolean} + */ + autoFlippingEnabled:boolean; + /** + * Gets or sets 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) before adding it to the + * {@link yfiles.algorithms.IDataProvider}. + *

+ * @type {boolean} + */ + resettingNodeLabelOrientation:boolean; + /** + * Gets or sets 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) before adding it to the + * {@link yfiles.algorithms.IDataProvider}. + *

+ * @type {boolean} + */ + resettingEdgeLabelOrientation:boolean; + /** + * Gets or sets whether or not edge label information is written back to the model after core layout. + * @type {boolean} + */ + writeBackEdgeLabels:boolean; + /** + * Gets or sets whether or not edge label {@link yfiles.layout.LabelLayoutData#bounds boxes} are interpreted relative to the edge when writing them back to the model. + * @type {boolean} + */ + writeBackRelativeEdgeLabelLocation:boolean; + /** + * Gets or sets whether or not node label information is written back to the model after the core layout. + * @type {boolean} + */ + writeBackNodeLabels:boolean; + /** + * Gets or sets whether or not node label {@link yfiles.layout.LabelLayoutData#bounds bounds} are interpreted relative to the node when writing them back to the model. + * @type {boolean} + */ + writeBackRelativeNodeLabelLocation:boolean; + /** + * Gets or sets whether or not node label information is translated. + * @type {boolean} + */ + translateNodeLabels:boolean; + /** + * Gets or sets whether or not edge label information is translated. + * @type {boolean} + */ + translateEdgeLabels:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.LayoutGraph} is a {@link yfiles.algorithms.Graph} with attached layout information that basically represents a + * drawing of a graph. + *

+ * It provides access to the layout information for nodes, edges and labels. This layout information consists of + * coordinates for the elements. + *

+ *

+ * {@link yfiles.layout.ILayoutAlgorithm Layout algorithms} work on {@link yfiles.layout.LayoutGraph}s and arrange their nodes and edges. + *

+ * @class yfiles.layout.LayoutGraph + * @extends {yfiles.algorithms.Graph} + */ + export interface LayoutGraph extends yfiles.algorithms.Graph{} + export class LayoutGraph { + /** + * Creates a new {@link yfiles.layout.LayoutGraph} which is a copy of the given subgraph. + * @param {yfiles.layout.LayoutGraph} graph the original graph + * @param {yfiles.algorithms.ICursor} nodeSubset the nodes that induce the subgraph + * @constructor + */ + constructor(graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor); + /** + * Creates a new {@link yfiles.layout.LayoutGraph} which is a copy of the given subgraph. + * @param {yfiles.layout.LayoutGraph} subgraph the original subgraph + * @constructor + */ + constructor(subgraph:yfiles.layout.LayoutGraph); + /** + * Creates a new, empty {@link yfiles.layout.LayoutGraph} with default settings. + * @constructor + */ + constructor(); + /** + * Creates a new {@link yfiles.layout.ILabelLayoutFactory} for this {@link yfiles.layout.LayoutGraph} that can be used for copying layout + * information of labels. + * @returns {yfiles.layout.ILabelLayoutFactory} the new {@link yfiles.layout.ILabelLayoutFactory} + * @protected + * @abstract + */ + createLabelFactory():yfiles.layout.ILabelLayoutFactory; + /** + * Returns the rectangle describing the bounding box of the given node. + * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.algorithms.YRectangle} the bounds of the node + * @see yfiles.layout.LayoutGraph#getLocation + * @see yfiles.layout.LayoutGraph#getSize + */ + getBoundingBox(node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; + /** + * Returns the center coordinates of the given node. + * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.algorithms.YPoint} the location of the node's center + * @see yfiles.layout.INodeLayout + * @see yfiles.layout.LayoutGraph#setCenter + */ + getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; + /** + * Returns the x-coordinate of the given node's center. + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the x-value of the node's center coordinate + * @see yfiles.layout.INodeLayout + */ + getCenterX(node:yfiles.algorithms.Node):number; + /** + * Returns the y-coordinate of the given node's center. + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the y-value of the node's center coordinate + * @see yfiles.layout.INodeLayout + */ + getCenterY(node:yfiles.algorithms.Node):number; + /** + * Returns the height of the given node. + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the height of the node + * @see yfiles.layout.INodeLayout#height + */ + getHeight(node:yfiles.algorithms.Node):number; + /** + * Returns the layout information for all labels associated with the given edge. + *

+ * The layout information consists of the location, size and orientation of the label. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @returns {Array.} the layout information for the edge's labels + * @abstract + */ + getLabelLayout(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the layout information for all labels associated with the given node. + *

+ * The layout information consists of the location, size and orientation of the label. + *

+ * @param {yfiles.algorithms.Node} node the node + * @returns {Array.} the layout information for the node's labels + * @abstract + */ + getLabelLayout(node:yfiles.algorithms.Node):yfiles.layout.INodeLabelLayout[]; + /** + * Returns the layout information for the given edge. + *

+ * The layout information consists of the locations of the control points and end points of the edge. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.layout.IEdgeLayout} the layout information for the edge + * @abstract + */ + getLayout(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLayout; + /** + * Returns the layout information for the given node. + *

+ * The layout information consists of the location and size of the node. + *

+ * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.layout.INodeLayout} the layout information for the node + * @abstract + */ + getLayout(node:yfiles.algorithms.Node):yfiles.layout.INodeLayout; + /** + * Returns the coordinates of the given node's upper-left corner. + * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.algorithms.YPoint} the location of the node's upper-left corner + * @see yfiles.layout.INodeLayout#x + * @see yfiles.layout.INodeLayout#y + */ + getLocation(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; + /** + * Returns the edge to which the given {@link yfiles.layout.IEdgeLabelLayout} belongs. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout the label's layout information + * @returns {yfiles.algorithms.Edge} the edge that owns the label + * @abstract + */ + getOwnerEdge(labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.algorithms.Edge; + /** + * Returns the node to which the given {@link yfiles.layout.INodeLabelLayout} belongs. + * @param {yfiles.layout.INodeLabelLayout} labelLayout the label's layout information + * @returns {yfiles.algorithms.Node} the node that owns the label + * @abstract + */ + getOwnerNode(labelLayout:yfiles.layout.INodeLabelLayout):yfiles.algorithms.Node; + /** + * Returns the path of an edge, including the ports. + *

+ * 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 the edge + * @returns {yfiles.algorithms.YPointPath} the path of the given edge + */ + getPath(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; + /** + * Returns the path of an edge, including the ports. + *

+ * 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 the edge + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.algorithms.YPoint}s representing the path of the given edge + */ + getPathList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; + /** + * Returns the control points of an edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.algorithms.YPoint}s representing the sequence of control points of the edge + * @see yfiles.layout.IEdgeLayout + */ + getPointList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; + /** + * Returns the control points of an edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.YPointPath} a {@link yfiles.algorithms.YPointPath} representing the sequence of control points of the edge + * @see yfiles.layout.IEdgeLayout + */ + getPoints(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; + /** + * Returns the size of the given node. + * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.algorithms.YDimension} the size of the node + * @see yfiles.layout.INodeLayout#width + * @see yfiles.layout.INodeLayout#height + */ + getSize(node:yfiles.algorithms.Node):yfiles.algorithms.YDimension; + /** + * Returns the absolute coordinates of the source point of the given edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.YPoint} the absolute source point coordinates of the edge + */ + getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the relative coordinates of the source point of the given edge. + *

+ * The coordinates are interpreted relative to the center of the source node. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.YPoint} the relative source point coordinates of the edge + * @see yfiles.layout.IEdgeLayout#sourcePoint + */ + getSourcePointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the absolute coordinates of the target point of the given edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.YPoint} the absolute target point coordinates of the edge + */ + getTargetPointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the relative coordinates of the target point of the given edge. + *

+ * The coordinates are interpreted relative to the center of the target node. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.YPoint} the relative target point coordinates of the edge + * @see yfiles.layout.IEdgeLayout#targetPoint + */ + getTargetPointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the width of the given node. + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the width of the node + * @see yfiles.layout.INodeLayout#width + */ + getWidth(node:yfiles.algorithms.Node):number; + /** + * Returns the x-coordinate of the given node's upper-left corner. + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the x-value of the node's upper-left corner + * @see yfiles.layout.INodeLayout#x + */ + getX(node:yfiles.algorithms.Node):number; + /** + * Returns the y-coordinate of the given node's upper-left corner. + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the y-value of the node's upper-left corner + * @see yfiles.layout.INodeLayout#y + */ + getY(node:yfiles.algorithms.Node):number; + /** + * Moves the upper-left corner of a node by a given vector. + * @param {yfiles.algorithms.Node} node the node + * @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; + /** + * Specifies the center coordinates of the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {number} x the new x-coordinate of the node's center + * @param {number} y the new y-coordinate of the node's center + * @see yfiles.layout.INodeLayout + */ + setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; + /** + * Specifies the center coordinates of the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.YPoint} position the new location of the node's center + * @see yfiles.layout.INodeLayout + * @see yfiles.layout.LayoutGraph#setCenter + */ + setCenter(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; + /** + * Specifies the two end points of the given edge in absolute coordinates. + * @param {yfiles.algorithms.Edge} edge the edge + * @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 + * @see yfiles.layout.LayoutGraph#setSourcePointAbs + * @see yfiles.layout.LayoutGraph#setTargetPointAbs + */ + setEndPointsAbs(edge:yfiles.algorithms.Edge,source:yfiles.algorithms.YPoint,target:yfiles.algorithms.YPoint):void; + /** + * Specifies the coordinates of the upper-left corner of the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {number} x the new x-coordinate of the upper-left corner + * @param {number} y the new y-coordinate of the upper-left corner + * @see yfiles.layout.INodeLayout#setLocation + */ + setLocation(node:yfiles.algorithms.Node,x:number,y:number):void; + /** + * Specifies the coordinates of the upper-left corner of the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.YPoint} position the new location of the upper-left corner + * @see yfiles.layout.INodeLayout#setLocation + * @see yfiles.layout.LayoutGraph#setLocation + */ + setLocation(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; + /** + * Sets the path of the given 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. + *

+ * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YList} path the list of {@link yfiles.algorithms.YPoint}s representing the new path sequence of the edge + */ + setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList):void; + /** + * Sets the path of the given 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. + *

+ * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPointPath} path the new path sequence of the edge + */ + setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YPointPath):void; + /** + * Sets the control points of the given edge. + *

+ * The source and target points of the edge will not be modified. + *

+ * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YList} points the list of {@link yfiles.algorithms.YPoint}s representing the new sequence of control points + */ + setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YList):void; + /** + * Sets the control points of the given edge. + *

+ * The source and target points of the edge will not be modified. + *

+ * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPointPath} points the new sequence of control points + */ + setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YPointPath):void; + /** + * Specifies the width and height of the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {number} width the new width of the node + * @param {number} height the new height of the node + * @see yfiles.layout.INodeLayout#setSize + */ + setSize(node:yfiles.algorithms.Node,width:number,height:number):void; + /** + * Specifies the size of the given node. + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.YDimension} size the new size of the node + * @see yfiles.layout.LayoutGraph#setSize + * @see yfiles.layout.INodeLayout#setSize + */ + setSize(node:yfiles.algorithms.Node,size:yfiles.algorithms.YDimension):void; + /** + * Specifies the absolute coordinates of the source point of the given edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.YPoint} point the new absolute source point coordinates of the edge + */ + setSourcePointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Specifies the relative coordinates of the source point of the given edge. + *

+ * The coordinates are interpreted relative to the center of the source node. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.YPoint} point the new relative source point coordinates of the edge + * @see yfiles.layout.IEdgeLayout#sourcePoint + */ + setSourcePointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Specifies the absolute coordinates of the target point of the given edge. + * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.YPoint} point the new absolute target point coordinates of the edge + */ + setTargetPointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Specifies the relative coordinates of the target point of the given edge. + *

+ * The coordinates are interpreted relative to the center of the target node. + *

+ * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.YPoint} point the new relative target point coordinates of the edge + * @see yfiles.layout.IEdgeLayout#targetPoint + */ + setTargetPointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Gets a list of all edges in the graph. + * @type {yfiles.algorithms.EdgeList} + */ + edgeList:yfiles.algorithms.EdgeList; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.layout.LayoutGraphUtilities} provides several helper and utility functions for {@link yfiles.layout.LayoutGraph} and + * the {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. + * @see yfiles.layout.LayoutGraph + * @class yfiles.layout.LayoutGraphUtilities + * @static + */ + export interface LayoutGraphUtilities extends Object{} + export class LayoutGraphUtilities { + /** + * 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. For example, after vertically distributing nodes, (n1.y + n1.height) <= n2.y + * for two consecutively placed nodes n1 and n2. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the specified nodes + * @param {yfiles.algorithms.NodeList} nodes the 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 true if nodes should be 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 the valid alignment modes + * @static + */ + static alignNodeLayouts(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,referenceNode:yfiles.algorithms.Node,vertical:boolean,mode:yfiles.layout.NodeAlignment):void; + /** + * Reassigns the bounds of the rectangles in a grid to fit in a large rectangle with an aspect ratio close to the specified + * aspect ratio. + *

+ * The aspect ratio must be greater than 0. + *

+ * @param {Array.} rectangles the rectangles whose coordinates will be modified + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact dimension will be placed in this rectangle + * @param {number} aspectRatio the preferred aspect ratio of the grid + * @returns {yfiles.algorithms.YDimension} the dimension of the grid + * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is less than or equal to zero + * @static + */ + static arrangeRectangleGrid(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,aspectRatio:number):yfiles.algorithms.YDimension; + /** + * Reassigns the bounds of the rectangles in multiple rows to fit the preferred width and height. + *

+ * The rectangles will be placed within this bound, arranged in 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.LayoutGraphUtilities#arrangeRectangleRows}. 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. + *

+ *

+ * The preferred width and height should be greater than 0, otherwise the nodes are not arranged. + *

+ * @param {Array.} rectangles 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 rectangle + * @param {number} preferredHeight the preferred height of the result rectangle + * @param {boolean} compaction true if the algorithm tries to always minimize the resulting dimension, whilst respecting the given constraints, false + * otherwise + * @param {yfiles.layout.MultiRowConstraint} constraintMode the width or height constraints to consider + * @param {yfiles.layout.RowAlignment} [alignment=yfiles.layout.RowAlignment.LEADING] the alignment inside a row + * @returns {number} the number of rows used + * @see yfiles.layout.LayoutGraphUtilities#arrangeRectangleMultiRows + * @static + */ + static arrangeRectangleMultiRows(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,preferredWidth:number,preferredHeight:number,compaction:boolean,constraintMode:yfiles.layout.MultiRowConstraint,alignment?:yfiles.layout.RowAlignment):number; + /** + * Reassigns the bounds of the rectangles to fit in a large rectangle with an aspect ratio close to the specified aspect + * ratio. + *

+ * This is achieved by arranging the rectangles in rows. + *

+ *

+ * The aspect ratio must be greater than 0. + *

+ * @param {Array.} rectangles the rectangles whose coordinates will be modified + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact dimension of the resulting rectangle + * @param {number} aspectRatio the preferred aspect ratio of the resulting rectangle + * @param {yfiles.layout.RowAlignment} [alignment=yfiles.layout.RowAlignment.LEADING] one of the valid row alignments + * @returns {number} the number of used rows + * @throws {Stubs.Exceptions.ArgumentError} if the aspect ratio is 0 or less + * @static + */ + static arrangeRectangleRows(rectangles:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,aspectRatio:number,alignment?:yfiles.layout.RowAlignment):number; + /** + * Applies the reversed layout of the first edge to the second edge. + * @param {yfiles.layout.LayoutGraph} graph the graph to which both edges belong + * @param {yfiles.algorithms.Edge} edge1 the edge which adopts the points + * @param {yfiles.algorithms.Edge} edge2 the template + * @static + */ + static assignReverseLayout(graph:yfiles.layout.LayoutGraph,edge1:yfiles.algorithms.Edge,edge2:yfiles.algorithms.Edge):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 degrees without changing the rectangle's center. + *

+ * @param {yfiles.algorithms.YOrientedRectangle} rect the given rectangle + * @returns {boolean} true if the given rectangle was flipped, false otherwise + * @static + */ + static autoFlipBox(rect:yfiles.algorithms.YOrientedRectangle):boolean; + /** + * Clips the path of the given edge on the bounding box of the source and target points. + *

+ * On a clipped edge, the source and target port will be located at the border of the corresponding node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the edge to clip + * @static + */ + static clipEdgeOnBounds(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Returns the path of an edge clipped on the bounding box of the source and target node. + *

+ * On the clipped edge, the source and target port will be located at the border of the corresponding node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the clipped edge + * @returns {yfiles.algorithms.YPointPath} the clipped path of the edge + * @static + */ + static clipEdgePathOnBounds(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; + /** + * Returns the path of an edge clipped on insets of the bounding box of the source and target node. + *

+ * On the clipped edge, the source and target port will be located inside the node with an inset to the border of the + * corresponding node. + *

+ * @param {yfiles.layout.IEdgeLayout} edge the clipped edge + * @param {yfiles.layout.INodeLayout} source the source of the edge + * @param {yfiles.layout.INodeLayout} target the target of the edge + * @param {number} [inset=0.0] the inset of the node + * @returns {yfiles.algorithms.YPointPath} the clipped path of the edge + * @static + */ + static clipEdgePathOnBounds(edge:yfiles.layout.IEdgeLayout,source:yfiles.layout.INodeLayout,target:yfiles.layout.INodeLayout,inset?:number):yfiles.algorithms.YPointPath; + /** + * Clips the path of all edges in the graph on the bounding box of their source and target points. + *

+ * On a clipped edge, the source and target port will be located at the border of the corresponding node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph + * @see yfiles.layout.LayoutGraphUtilities#clipEdgeOnBounds + * @static + */ + static clipEdgesOnBounds(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns the path of a given edge path clipped on the given bounding boxes of the source and target node. + * @param {yfiles.algorithms.YPointPath} path the path that will be clipped + * @param {yfiles.algorithms.YRectangle} sourceBox the box of the source node that the given path should be clipped at + * @param {yfiles.algorithms.YRectangle} targetBox the box of the target node that the given path should be clipped at + * @returns {yfiles.algorithms.YPointPath} the path clipped on the given nodes boxes + * @static + */ + static clipPathOnBounds(path:yfiles.algorithms.YPointPath,sourceBox:yfiles.algorithms.YRectangle,targetBox:yfiles.algorithms.YRectangle):yfiles.algorithms.YPointPath; + /** + * Determines the main direction of the edge flow by analyzing the current layout of the graph. + *

+ * The method only considers edges that are marked in the given {@link yfiles.algorithms.IDataProvider}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the underlying graph + * @param {yfiles.algorithms.IDataProvider} considerEdges the edges to consider + * @returns {yfiles.layout.EdgeFlow} one of the predefined flow directions + * @static + */ + static determineEdgeFlowDirection(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):yfiles.layout.EdgeFlow; + /** + * Returns a {@link string} representation of the path of the given edge. + * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {string} the {@link string} that contains all control points of the edge + * @static + */ + static edgeLayoutString(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):string; + /** + * Returns the bounding box of the given edge. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the control points as well as the + * absolute coordinates of the source and target point of the edge. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the edge + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.algorithms.Rectangle2D} the bounding box of the edge + * @see yfiles.layout.LayoutGraph#getSourcePointAbs + * @see yfiles.layout.LayoutGraph#getTargetPointAbs + * @see yfiles.layout.LayoutGraph#getLayout + * @static + */ + static getBoundingBox(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the given node. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the given node. It is identical to the + * node's bounds. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the node + * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.algorithms.Rectangle2D} the bounding box of the node + * @see yfiles.layout.LayoutGraph#getLayout + * @static + */ + static getBoundingBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors, optionally including node labels, + * edge labels or {@link yfiles.layout.NodeHalo}s. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points + * as well as the source and target points of all edges. If node or edge labels should be included, it also contains their + * boxes. {@link yfiles.layout.NodeHalo}s can also extend the bounding box if desired. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the given nodes and edges + * @param {yfiles.algorithms.INodeCursor} nodes the nodes to include in the bounding box + * @param {yfiles.algorithms.IEdgeCursor} edges the edges to include in the bounding box + * @param {boolean} includeNodeLabels true if labels of nodes should be included, false otherwise + * @param {boolean} includeEdgeLabels true if labels of edges should be included, false otherwise + * @param {boolean} [includeHalos=false] true if {@link yfiles.layout.NodeHalo}s should be included, false otherwise + * @returns {yfiles.algorithms.Rectangle2D} the bounding box of the given nodes and edges + * @static + */ + static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor,includeNodeLabels:boolean,includeEdgeLabels:boolean,includeHalos?:boolean):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors, optionally including node labels + * and edge labels. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points + * as well as the source and target points of all edges. If labels should be included, it also contains their boxes. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the given nodes and edges + * @param {yfiles.algorithms.INodeCursor} nodes the nodes to include in the bounding box + * @param {yfiles.algorithms.IEdgeCursor} edges the edges to include in the bounding box + * @param {boolean} includeLabels true if labels of nodes and edges should be included, false otherwise + * @returns {yfiles.algorithms.Rectangle2D} the bounding box of the given nodes and edges + * @see yfiles.layout.LayoutGraphUtilities#getBoundingBox + * @static + */ + static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor,includeLabels:boolean):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes and the control points + * as well as the source and target points of all edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes and edges + * @param {yfiles.algorithms.INodeCursor} nodes the nodes to include in the bounding box + * @param {yfiles.algorithms.IEdgeCursor} edges the edges to include in the bounding box + * @returns {yfiles.algorithms.Rectangle2D} the bounding box containing the given nodes and edges + * @see yfiles.layout.LayoutGraphUtilities#getBoundingBoxOfEdges + * @see yfiles.layout.LayoutGraphUtilities#getBoundingBoxOfNodes + * @static + */ + static getBoundingBox(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,edges:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the edges accessible through the given cursor. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the control points as well as the + * absolute coordinates of the source and target points of all given edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the edges + * @param {yfiles.algorithms.IEdgeCursor} edges the edges to include in the bounding box + * @returns {yfiles.algorithms.Rectangle2D} the bounding box containing the given edges + * @see yfiles.layout.LayoutGraph#getSourcePointAbs + * @see yfiles.layout.LayoutGraph#getTargetPointAbs + * @see yfiles.layout.LayoutGraph#getLayout + * @static + */ + static getBoundingBoxOfEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes accessible through the given cursor. + *

+ * In this case, the bounding box is the smallest paraxial rectangle which contains the given nodes. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes + * @param {yfiles.algorithms.INodeCursor} nodes the nodes to include in the bounding box + * @returns {yfiles.algorithms.Rectangle2D} the bounding box containing the given nodes + * @see yfiles.layout.LayoutGraph#getLayout + * @static + */ + static getBoundingBoxOfNodes(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor):yfiles.algorithms.Rectangle2D; + /** + * Returns the {@link yfiles.layout.ILabelLayoutFactory} for the given graph. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @returns {yfiles.layout.ILabelLayoutFactory} the label factory of the graph + * @static + */ + static getLabelFactory(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILabelLayoutFactory; + /** + * Returns the upper-left corner of the paraxial bounding box of the given edge label as encoded by the specified model + * parameter. + *

+ * The parameter describes the abstract position of the label within the specified model. The parameter must have been + * generated by that model. + *

+ * @param {yfiles.layout.IEdgeLabelLayoutModel} model the {@link yfiles.layout.IEdgeLabelLayoutModel} used for placing 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 edge's source node + * @param {yfiles.layout.INodeLayout} targetLayout the layout of the edge's target node + * @param {Object} param the model parameter + * @returns {yfiles.algorithms.YPoint} the upper-left corner of the label's bounding box + * @see yfiles.layout.IEdgeLabelLayoutModel#getLabelPlacement + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + * @static + */ + static getLabelPlacement(model:yfiles.layout.IEdgeLabelLayoutModel,labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YPoint; + /** + * Returns the upper-left corner of the paraxial bounding box of the given node label as encoded by the specified model + * parameter. + *

+ * The parameter describes the abstract position of the label within the specified model. The parameter must have been + * generated by that model. + *

+ * @param {yfiles.layout.INodeLabelLayoutModel} model the {@link yfiles.layout.INodeLabelLayoutModel} used for placing the label + * @param {yfiles.algorithms.YDimension} labelSize the size of the label + * @param {yfiles.layout.INodeLayout} nodeLayout the layout of the node to which the label belongs + * @param {Object} param the model parameter + * @returns {yfiles.algorithms.YPoint} the upper-left corner of the label's bounding box + * @see yfiles.layout.INodeLabelLayoutModel#getLabelPlacement + * @see yfiles.algorithms.YOrientedRectangle#boundingBox + * @static + */ + static getLabelPlacement(model:yfiles.layout.INodeLabelLayoutModel,labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YPoint; + /** + * Returns the distance between the centers of the two given nodes. + * @param {yfiles.layout.LayoutGraph} graph the graph to which the nodes belong + * @param {yfiles.algorithms.Node} node1 the first node + * @param {yfiles.algorithms.Node} node2 the second node + * @returns {number} the distance between the nodes' centers + * @static + */ + static getNodeDistance(graph:yfiles.layout.LayoutGraph,node1:yfiles.algorithms.Node,node2:yfiles.algorithms.Node):number; + /** + * Returns a {@link string} representation of all node positions in the graph. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @returns {string} the {@link string} containing all node locations + * @see yfiles.layout.LayoutGraph#getLocation + * @static + */ + static getNodePositions(graph:yfiles.layout.LayoutGraph):string; + /** + * Returns the length of the path of the given edge. + *

+ * The path starts at the source point, traverses through all control points and ends at the target point. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {number} the length of the edge's path + * @static + */ + static getPathLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Checks whether or not the path of an edge is outside the bounding box of the source and target node, considering the + * given halo. + *

+ * The edge is outside the nodes if its control points as well as the source and target point are not inside the nodes' + * bounding boxes. + *

+ *

+ * The nodes can be enlarged by a halo to check if the edge keeps some distance to the nodes. + *

+ * @param {yfiles.layout.IEdgeLayout} edge the edge + * @param {yfiles.layout.INodeLayout} source the source of the edge + * @param {yfiles.layout.INodeLayout} target the target of the edge + * @param {number} halo the halo for the nodes + * @returns {boolean} true if the edge is outside the nodes, false otherwise + * @static + */ + static isEdgeOutsideNodes(edge:yfiles.layout.IEdgeLayout,source:yfiles.layout.INodeLayout,target:yfiles.layout.INodeLayout,halo:number):boolean; + /** + * Checks whether or not the path of an edge is outside the bounding box of the source and target node. + *

+ * The edge is outside the nodes if its control points as well as the source and target point are not inside the nodes' + * bounding boxes. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {boolean} true if the edge is outside the nodes, false otherwise + * @static + */ + static isEdgeOutsideNodes(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; + /** + * Determines whether or not most of the edges of the graph are routed octilinear. + *

+ * The method only considers edges marked in the given {@link yfiles.algorithms.IDataProvider}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the underlying graph + * @param {yfiles.algorithms.IDataProvider} considerEdges the edges to consider + * @returns {boolean} true if most of the edges in the graph are routed octilinear, false otherwise + * @static + */ + static isUsingOctilinearEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; + /** + * Determines whether or not most of the edges of the graph are routed orthogonally. + *

+ * The method only considers edges marked in the given {@link yfiles.algorithms.IDataProvider}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the underlying graph + * @param {yfiles.algorithms.IDataProvider} considerEdges the edges to consider + * @returns {boolean} true if most of the edges in the graph are routed orthogonally, false otherwise + * @static + */ + static isUsingOrthogonalEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; + /** + * Moves all control points of the given edge by the vector (dx,dy). + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Edge} edge the edge + * @param {number} dx the horizontal distance to move + * @param {number} dy the vertical distance to move + * @static + */ + static moveEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dx:number,dy:number):void; + /** + * Moves the control points of all edges accessible through the given {@link yfiles.algorithms.IEdgeCursor} by the vector (dx,dy). + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.IEdgeCursor} edges the edges to be moved + * @param {number} dx the horizontal distance to move + * @param {number} dy the vertical distance to move + * @static + */ + static moveEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; + /** + * Moves the given node by the vector (dx,dy). + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Node} node the node + * @param {number} dx the horizontal distance to move + * @param {number} dy the vertical distance to move + * @static + */ + static moveNode(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,dx:number,dy:number):void; + /** + * Moves all nodes accessible through the given {@link yfiles.algorithms.INodeCursor} by the vector (dx,dy). + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.INodeCursor} nodes the nodes to be moved + * @param {number} dx the horizontal distance to move + * @param {number} dy the vertical distance to move + * @static + */ + static moveNodes(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; + /** + * Moves the subgraph induced by the nodes accessible through the given {@link yfiles.algorithms.INodeCursor} by the vector + * (dx,dy). + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the subgraph + * @param {yfiles.algorithms.INodeCursor} nodes the nodes that induce the subgraph + * @param {number} dx the horizontal distance to move + * @param {number} dy the vertical distance to move + * @static + */ + static moveSubgraph(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; + /** + * Moves the subgraph induced by the edges accessible through the given {@link yfiles.algorithms.IEdgeCursor} by the vector + * (dx,dy). + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the subgraph + * @param {yfiles.algorithms.IEdgeCursor} edges the edges that induce the subgraph + * @param {number} dx the horizontal distance to move + * @param {number} dy the vertical distance to move + * @static + */ + static moveSubgraphOfEdges(graph:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; + /** + * Checks whether or not the path of the given edge intersects the interior of a given rectangular area. + * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the edge + * @param {yfiles.algorithms.Rectangle2D} rect the rectangular area to check for intersection + * @returns {boolean} true if the edge path intersects with the given rectangle, false otherwise + * @static + */ + static pathIntersectsRect(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,rect:yfiles.algorithms.Rectangle2D):boolean; + /** + * Removes successive bends that have the same coordinates from the given edge. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Edge} edge the edge + * @static + */ + static removeDuplicateBends(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Removes successive bends that have the same coordinates from all edges in the graph. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @static + */ + static removeDuplicateBends(graph:yfiles.layout.LayoutGraph):void; + /** + * Assigns a trivial path which has no control points to the specified edge. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Edge} edge the edge + * @param {boolean} [resetPorts=true] true if the ports of the edge should be set to the center of the corresponding nodes, false otherwise + * @static + */ + static resetPath(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,resetPorts?:boolean):void; + /** + * Assigns a trivial path which has no control points to all edges in the specified graph. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {boolean} [resetPorts=true] true if the ports of the edges should be set to the center of the corresponding nodes, false otherwise + * @static + */ + static resetPaths(graph:yfiles.layout.LayoutGraph,resetPorts?:boolean):void; + /** + * Sets the ports of all edges in the graph to the center of the nodes. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @see yfiles.layout.LayoutGraph#setSourcePointRel + * @see yfiles.layout.LayoutGraph#setTargetPointRel + * @static + */ + static resetPorts(graph:yfiles.layout.LayoutGraph):void; + /** + * Reverses the layout of an edge. + *

+ * The order of the control points is reversed and source and target point are swapped. + *

+ * @param {yfiles.layout.IEdgeLayout} el the layout information of an edge + * @static + */ + static reverseEdgeLayout(el:yfiles.layout.IEdgeLayout):void; + /** + * Rounds the locations of the control points and ports of the given edge to integer values. + * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the edge whose values are rounded + * @static + */ + static roundEdgeLayout(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Rounds coordinates and sizes in the layout of an entire graph to integer values. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @see yfiles.layout.LayoutGraphUtilities#roundNodeLayout + * @see yfiles.layout.LayoutGraphUtilities#roundEdgeLayout + * @static + */ + static roundLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Rounds the location and size of the given node to integer values. + * @param {yfiles.layout.LayoutGraph} graph the graph to which the node belongs + * @param {yfiles.algorithms.Node} node the node whose values are rounded + * @static + */ + static roundNodeLayout(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + /** + * Routes a list of edges which are incident to the same nodes in parallel, optionally joining the end points. + *

+ * All edges get a path that is parallel to the path of the first (leading) edge. + *

+ *

+ * The position of the leading edge may be adjusted if there is an odd number of parallel edges. It will be moved from the + * center to achieve a more symmetric port assignment. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Edge} leadingEdge the leading edge + * @param {yfiles.algorithms.EdgeList} edges the list of edges that will be aligned with the leading edge + * @param {number} lineDistance the distance between two edges + * @param {boolean} [adjustLeadingEdge=false] true if the leading edge should be adjusted if the size of list is odd, false otherwise + * @param {boolean} [joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise + * @param {number} [absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined + * @param {number} [relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined + * @static + */ + static routeEdgesParallel(graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edges:yfiles.algorithms.EdgeList,lineDistance:number,adjustLeadingEdge?:boolean,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number):void; + /** + * Routes a list of edges which are incident to the same nodes in parallel, optionally joining the end points. + *

+ * All edges get a path that is parallel to the path of the first (leading) edge. + *

+ *

+ * The position of the leading edge may be adjusted if there is an odd number of parallel edges. It will be moved from the + * center to achieve a more symmetric port assignment. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.layout.LayoutGraph} options.graph the graph + * @param {yfiles.algorithms.Edge} options.leadingEdge the leading edge + * @param {yfiles.algorithms.EdgeList} options.edges the list of edges that will be aligned with the leading edge + * @param {number} options.lineDistance the distance between two edges + * @param {boolean} [options.adjustLeadingEdge=false] true if the leading edge should be adjusted if the size of list is odd, false otherwise + * @param {boolean} [options.joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise + * @param {number} [options.absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined + * @param {number} [options.relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined + * @static + */ + static routeEdgesParallel(options:{graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edges:yfiles.algorithms.EdgeList,lineDistance:number,adjustLeadingEdge?:boolean,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number}):void; + /** + * Routes two edges which are incident to the same nodes in parallel, optionally joining the end points. + *

+ * The second edge gets a path that is parallel to the path of the first (leading) edge. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Edge} leadingEdge the leading edge + * @param {yfiles.algorithms.Edge} edge the edge to be adjusted + * @param {number} lineDistance the distance between the two edges + * @param {boolean} [joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise + * @param {number} [absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined + * @param {number} [relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined + * @static + */ + static routeEdgesParallel(graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edge:yfiles.algorithms.Edge,lineDistance:number,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number):void; + /** + * Routes two edges which are incident to the same nodes in parallel, optionally joining the end points. + *

+ * The second edge gets a path that is parallel to the path of the first (leading) edge. + *

+ * @param {Object} options The parameters to pass. + * @param {yfiles.layout.LayoutGraph} options.graph the graph + * @param {yfiles.algorithms.Edge} options.leadingEdge the leading edge + * @param {yfiles.algorithms.Edge} options.edge the edge to be adjusted + * @param {number} options.lineDistance the distance between the two edges + * @param {boolean} [options.joinEnds=false] true if the edges should share their end points (the ones of the leading edge), false otherwise + * @param {number} [options.absJoinDistance=0.0] the absolute distance between the end points and the beginning of the parallel segment routing if the ends are joined + * @param {number} [options.relJoinDistance=0.0] the relative distance, measured relative to the length of the first/last segments if the ends are joined + * @static + */ + static routeEdgesParallel(options:{graph:yfiles.layout.LayoutGraph,leadingEdge:yfiles.algorithms.Edge,edge:yfiles.algorithms.Edge,lineDistance:number,joinEnds?:boolean,absJoinDistance?:number,relJoinDistance?:number}):void; + /** + * Routes a self-loop. + *

+ * For a self-loop edge, source and target are identical. The path of the self-loop will start at the top of the node, go + * around the upper-left corner and end at the left side of the node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph to which the edge belongs + * @param {yfiles.algorithms.Edge} edge the self-loop + * @static + */ + static routeSelfLoop(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.LayoutMultiplexer} 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 {@link yfiles.algorithms.IDataProvider} is registered with the given graph using the look-up key + * {@link yfiles.layout.LayoutMultiplexer#LAYOUT_DP_KEY}, it is used for retrieving the {@link yfiles.layout.ILayoutAlgorithm} objects that + * are stored for the graph's nodes. If no such {@link yfiles.algorithms.IDataProvider} is registered, this layout stage's {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} + * (if any) is used for the layout calculation of all nodes. + *

+ *

+ * Note that the first non-null {@link yfiles.layout.ILayoutAlgorithm} instance retrieved from the {@link yfiles.algorithms.IDataProvider} + * is used for all nodes. + *

+ *

+ * The main purpose of this class is to enable the use of individual layout algorithms for different components (when used + * as the core layout algorithm of {@link yfiles.layout.ComponentLayout}) or for the contents of group nodes (when used as the core + * layout algorithm of {@link yfiles.layout.RecursiveGroupLayout}). + *

+ * @class yfiles.layout.LayoutMultiplexer + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface LayoutMultiplexer extends yfiles.layout.LayoutStageBase{} + export class LayoutMultiplexer { + /** + * Creates a new instance of {@link yfiles.layout.LayoutMultiplexer}. + * @constructor + */ + constructor(); + /** + * Returns the core layout algorithm associated with the nodes contained in the given graph. + *

+ * This implementation looks up the layout algorithm in the {@link yfiles.algorithms.IDataProvider} registered with the key + * {@link yfiles.layout.LayoutMultiplexer#LAYOUT_DP_KEY}. The first non-null {@link yfiles.layout.ILayoutAlgorithm layout algorithm} instance found for a node of the + * given graph will be returned by this method. If no algorithm is registered at all, it will fall back to the + * {@link yfiles.layout.LayoutStageBase#coreLayout default core layout algorithm}. + *

+ *

+ * This method is called in {@link yfiles.layout.LayoutMultiplexer#applyLayout} and may be overridden to implement a different way + * of selecting the {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.layout.ILayoutAlgorithm} the according layout algorithm + * @protected + */ + getCoreLayout(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILayoutAlgorithm; + /** + * Data provider key for assigning layout algorithms to the nodes + *

+ * At runtime, the layout algorithms are determined and applied to the current graph. The first non-null {@link yfiles.layout.ILayoutAlgorithm} + * instance is used for the whole graph. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static LAYOUT_DP_KEY:yfiles.algorithms.NodeDpKey; + static $class:yfiles.lang.Class; + } + /** + * Abstract base class implementing {@link yfiles.layout.ILayoutStage} that handles the management of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * Subclasses of this stage can use the provided methods, such that the management of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} does not + * need to be considered anymore. + *

+ * @see yfiles.layout.MultiStageLayout + * @class yfiles.layout.LayoutStageBase + * @implements {yfiles.layout.ILayoutStage} + */ + export interface LayoutStageBase extends Object,yfiles.layout.ILayoutStage{} + export class LayoutStageBase { + /** + * Creates a new {@link yfiles.layout.ILayoutStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @abstract + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Invokes the layout process of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * Overriding classes may call this method during {@link yfiles.layout.ILayoutAlgorithm#applyLayout} to delegate arranging the + * graph to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. They can add pre- and post-processing code before and after this call. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @protected + */ + applyLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Gets or sets the core layout algorithm that is wrapped by this stage. + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.MinimumNodeSizeStage} enforces a given minimum width/height of the nodes of a graph during the layout + * process. + *

+ * It temporarily enlarges nodes whose width/height is below the specified minimum values. + *

+ *

+ * This {@link yfiles.layout.ILayoutStage} is especially useful to prevent that the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} has to handle zero-sized + * nodes or nodes with negative sizes. + *

+ * @class yfiles.layout.MinimumNodeSizeStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface MinimumNodeSizeStage extends yfiles.layout.LayoutStageBase{} + export class MinimumNodeSizeStage { + /** + * Creates a new {@link yfiles.layout.MinimumNodeSizeStage} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} along with a specific + * minimum width and height for the nodes. + * @param {yfiles.layout.ILayoutAlgorithm} coreLayouter the core layout routine + * @param {number} minWidth the minimum width of nodes that should be enforced + * @param {number} minHeight the minimum height of nodes that should be enforced + * @constructor + */ + constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm,minWidth:number,minHeight:number); + /** + * Creates a new {@link yfiles.layout.MinimumNodeSizeStage} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * The nodes will be enlarged to be at least 1 wide and 1 high. + *

+ * @param {yfiles.layout.ILayoutAlgorithm} coreLayouter the core routine + * @constructor + */ + constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm); + static $class:yfiles.lang.Class; + } + /** + * An abstract base class for layout algorithms that provides services to simplify and decompose the input graph before it + * is passed to the {@link yfiles.layout.MultiStageLayout#applyLayoutCore core layout algorithm} itself. + *

+ * Subclasses of this layout algorithm have to provide implementations for the abstract method + * {@link yfiles.layout.MultiStageLayout#applyLayoutCore}. It invokes the actual layout routine of this layout algorithm. + *

+ *

+ * Concept + *

+ *

+ * This class provides a configurable pipeline that contains {@link yfiles.layout.ILayoutStage}s that add preprocessing steps + * and/or postprocessing steps to the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. {@link yfiles.layout.MultiStageLayout} provides some predefined + * {@link yfiles.layout.ILayoutStage}s, that simplify the input graph for the layout algorithm and complement the result. It is + * also possible to add custom {@link yfiles.layout.ILayoutStage}s which are executed {@link yfiles.layout.MultiStageLayout#prependStage before} or {@link yfiles.layout.MultiStageLayout#appendStage after the predefined ones}. + *

+ *

+ * Each {@link yfiles.layout.ILayoutStage} in the pipeline wraps its successor. When the layout pipeline is processed, the + * preprocessing code of the preceding {@link yfiles.layout.ILayoutStage} is executed before the code in the current {@link yfiles.layout.ILayoutStage} + * while the postprocessing code is executed afterwards. + *

+ *

+ * The pipeline of predefined {@link yfiles.layout.ILayoutStage}s of {@link yfiles.layout.MultiStageLayout} (when all are activated) causes + * the following sequence of steps: + *

+ *
    + *
  1. Hides the group nodes.
  2. + *
  3. Hides all except for the induced subgraph.
  4. + *
  5. Decomposes the graph into its connected components. Performs steps 4-12 on each component.
  6. + *
  7. Prepares for label placement.
  8. + *
  9. Prepares the layout for an orientation change.
  10. + *
  11. Hides self-loops.
  12. + *
  13. Hides parallel edges.
  14. + *
  15. Invokes the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} on the simplified graph.
  16. + *
  17. Un-hides and routes parallel edges.
  18. + *
  19. Un-hides and routes self-loops.
  20. + *
  21. Completes orientation change of the layout.
  22. + *
  23. Assigns label positions.
  24. + *
  25. Arranges the connected components of the graph.
  26. + *
  27. Un-hides non-induced subgraph.
  28. + *
  29. Un-hides the group nodes.
  30. + *
+ *

+ * In order to take effect, a stage that is not already activated by default needs to be activated using the corresponding + * method, e.g., {@link yfiles.layout.MultiStageLayout#hideGroupsStageEnabled}. Vice versa, a stage can also be deactivated, if necessary. + *

+ * @class yfiles.layout.MultiStageLayout + * @implements {yfiles.layout.ILayoutAlgorithm} + */ + export interface MultiStageLayout extends Object,yfiles.layout.ILayoutAlgorithm{} + export class MultiStageLayout { + /** + * Creates a new {@link yfiles.layout.MultiStageLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Appends the given {@link yfiles.layout.ILayoutStage} to the layout pipeline. + *

+ * Stages that are added with this method will be invoked at the very end of the layout pipeline. This means after all + * prepended {@link yfiles.layout.ILayoutStage}s, all predefined stages, and all previously appended {@link yfiles.layout.ILayoutStage}s, + * but just before the invocation of the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. + *

+ * @param {yfiles.layout.ILayoutStage} stage the {@link yfiles.layout.ILayoutStage} instance to be added + * @see yfiles.layout.MultiStageLayout#removeStage + * @see yfiles.layout.MultiStageLayout#prependStage + */ + appendStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Calculates a layout for the given graph and applies it directly to the graph. + *

+ * This method executes all activated {@link yfiles.layout.ILayoutStage}s in the layout pipeline as well as the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. + *

+ * @param {yfiles.layout.LayoutGraph} layoutGraph the input graph + * @see yfiles.layout.MultiStageLayout#appendStage + * @see yfiles.layout.MultiStageLayout#prependStage + * @see yfiles.layout.MultiStageLayout#applyLayoutCore + */ + applyLayout(layoutGraph:yfiles.layout.LayoutGraph):void; + /** + * Invokes the core layout algorithm. + *

+ * This method should be implemented by subclasses in order to perform the layout routine of the layout algorithm. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @abstract + */ + applyLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Checks the sizes of the nodes to be non-zero. + * @param {yfiles.layout.LayoutGraph} g The graph to check. + * @protected + */ + checkNodeSize(g:yfiles.layout.LayoutGraph):void; + /** + * Deactivates all predefined {@link yfiles.layout.ILayoutStage}s so that upon {@link yfiles.layout.MultiStageLayout#applyLayout} only the + * {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} will be executed. + */ + disableAllStages():void; + /** + * Prepends the given {@link yfiles.layout.ILayoutStage} to the layout pipeline. + *

+ * Stages that are added with this method will be invoked at the very beginning of the layout pipeline. This means before + * all previously prepended {@link yfiles.layout.ILayoutStage}s, all predefined stages, and all appended + * {@link yfiles.layout.ILayoutStage}s. + *

+ * @param {yfiles.layout.ILayoutStage} stage the {@link yfiles.layout.ILayoutStage} instance to be added + * @see yfiles.layout.MultiStageLayout#removeStage + * @see yfiles.layout.MultiStageLayout#appendStage + */ + prependStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Removes the given {@link yfiles.layout.ILayoutStage} from the layout pipeline. + *

+ * This method can only remove {@link yfiles.layout.ILayoutStage}s that have been previously added using {@link yfiles.layout.MultiStageLayout#appendStage} + * or {@link yfiles.layout.MultiStageLayout#prependStage}. Predefined {@link yfiles.layout.ILayoutStage}s can be deactivated separately. + *

+ * @param {yfiles.layout.ILayoutStage} stage a {@link yfiles.layout.ILayoutStage} to be removed from the layout pipeline + * @see yfiles.layout.MultiStageLayout#prependStage + * @see yfiles.layout.MultiStageLayout#appendStage + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#subgraphLayoutEnabled + * @see yfiles.layout.MultiStageLayout#labelingEnabled + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + */ + removeStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that places the labels of the input graph. + * @see yfiles.layout.MultiStageLayout#labelingEnabled + * @see yfiles.labeling.GenericLabeling + * @type {yfiles.layout.ILayoutStage} + */ + labeling:yfiles.layout.ILayoutStage; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that routes self-loops. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.SelfLoopRouter + * @type {yfiles.layout.ILayoutStage} + */ + selfLoopRouter:yfiles.layout.ILayoutStage; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that routes parallel edges. + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.router.ParallelEdgeRouter + * @type {yfiles.layout.ILayoutStage} + */ + parallelEdgeRouter:yfiles.layout.ILayoutStage; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that arranges the connected components of an input graph. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.ComponentLayout + * @type {yfiles.layout.ILayoutStage} + */ + componentLayout:yfiles.layout.ILayoutStage; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that constrains the layout process to a subgraph of the input graph. + * @see yfiles.layout.MultiStageLayout#subgraphLayoutEnabled + * @see yfiles.layout.SubgraphLayout + * @type {yfiles.layout.ILayoutStage} + */ + subgraphLayout:yfiles.layout.ILayoutStage; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that hides the group nodes of the input graph. + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @see yfiles.layout.HideGroupsStage + * @type {yfiles.layout.ILayoutStage} + */ + hideGroupsStage:yfiles.layout.ILayoutStage; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that modifies the orientation of a computed layout. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {yfiles.layout.ILayoutStage} + */ + orientationLayout:yfiles.layout.ILayoutStage; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} may be deactivated if the orientation is irrelevant for the layout or if the core layout + * algorithm already handles the layout orientation by itself. + *

+ * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + /** + * Gets or sets the main orientation of the layout. + *

+ * This is a convenience method that configures the {@link yfiles.layout.MultiStageLayout#orientationLayout orientation layout stage}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation does not match a default layout orientation + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @type {yfiles.layout.LayoutOrientation} + */ + layoutOrientation:yfiles.layout.LayoutOrientation; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles self-loops by itself. + *

+ * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for placing the labels of the input graph is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} may be activated to apply a generic labeling algorithm to the input graph. It will then + * try to find the best locations for the labels in the layout calculated by the + * {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm}. When the stage is deactivated, the labels are ignored or placed by an integrated labeling of the + * layout algorithm. + *

+ * @see yfiles.layout.MultiStageLayout#labeling + * @see yfiles.labeling.GenericLabeling + * @type {boolean} + */ + labelingEnabled:boolean; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles group nodes itself. + *

+ * @see yfiles.layout.MultiStageLayout#hideGroupsStage + * @see yfiles.layout.HideGroupsStage + * @type {boolean} + */ + hideGroupsStageEnabled:boolean; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} is able to handle several connected + * components. + *

+ * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} should be deactivated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} handles parallel edges itself. + *

+ * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter + * @see yfiles.router.ParallelEdgeRouter + * @type {boolean} + */ + parallelEdgeRouterEnabled:boolean; + /** + * Gets or sets whether or not the {@link yfiles.layout.ILayoutStage} used for constraining the layout process to a subgraph of the + * input graph is activated. + *

+ * This {@link yfiles.layout.ILayoutStage} may be activated if the {@link yfiles.layout.MultiStageLayout#applyLayoutCore layout algorithm} should be applied only to a specific part of + * the graph. The remaining graph will stay unchanged. + *

+ * @see yfiles.layout.MultiStageLayout#subgraphLayout + * @see yfiles.layout.SubgraphLayout + * @type {boolean} + */ + subgraphLayoutEnabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.NodeHalo} specifies a rectangular area around a specific node. + *

+ * A {@link yfiles.layout.ILayoutAlgorithm layout algorithm} that supports + * {@link yfiles.layout.NodeHalo}s, 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., + * minimum first segment length, will be extended by the halo size. + *

+ *

+ * This class defines a key used for registering a {@link yfiles.algorithms.IDataProvider} that provides {@link yfiles.layout.NodeHalo}s + * for all nodes of the input graph. {@link yfiles.layout.NodeHalo}-aware layout algorithms like {@link yfiles.hierarchic.HierarchicLayout} + * look for {@link yfiles.algorithms.IDataProvider}s registered with this key to retrieve {@link yfiles.layout.NodeHalo} information. + *

+ *

+ * The following layouters support {@link yfiles.layout.NodeHalo}s with different restrictions: + *

+ *
    + *
  • {@link yfiles.hierarchic.HierarchicLayout}
  • + *
  • {@link yfiles.orthogonal.OrthogonalLayout}
  • + *
  • {@link yfiles.orthogonal.CompactOrthogonalLayout}
  • + *
  • {@link yfiles.tree.TreeLayout}
  • + *
  • {@link yfiles.tree.ClassicTreeLayout}
  • + *
  • {@link yfiles.organic.OrganicLayout}
  • + *
  • {@link yfiles.labeling.GenericLabeling}
  • + *
  • {@link yfiles.router.EdgeRouter}
  • + *
  • {@link yfiles.circular.CircularLayout}
  • + *
  • {@link yfiles.tree.BalloonLayout}
  • + *
  • {@link yfiles.layout.SelfLoopRouter}
  • + *
  • {@link yfiles.radial.RadialLayout}
  • + *
  • {@link yfiles.layout.RecursiveGroupLayout}
  • + *
  • {@link yfiles.layout.ComponentLayout}
  • + *
+ * @class yfiles.layout.NodeHalo + * @final + */ + export interface NodeHalo extends Object{} + export class NodeHalo { + /** + * Creates a {@link yfiles.layout.NodeHalo} with the specified values. + *

+ * The values must not be negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY}. + *

+ * @param {number} top the {@link yfiles.layout.NodeHalo} size at the top side of the node + * @param {number} left the {@link yfiles.layout.NodeHalo} size at the left side of the node + * @param {number} bottom the {@link yfiles.layout.NodeHalo} size at the bottom side of the node + * @param {number} right the {@link yfiles.layout.NodeHalo} size at the right side of the node + * @returns {yfiles.layout.NodeHalo} the newly created {@link yfiles.layout.NodeHalo} + * @throws {Stubs.Exceptions.ArgumentError} if one of the values is negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY} + * @static + */ + static create(top:number,left:number,bottom:number,right:number):yfiles.layout.NodeHalo; + /** + * Creates a {@link yfiles.layout.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}. + *

+ * @param {number} value the halo size at each side of the node + * @returns {yfiles.layout.NodeHalo} the newly created {@link yfiles.layout.NodeHalo} + * @throws {Stubs.Exceptions.ArgumentError} if the value is negative, {@link number#NaN} or {@link number#POSITIVE_INFINITY} + * @static + */ + static create(value:number):yfiles.layout.NodeHalo; + /** + * Returns the {@link yfiles.layout.NodeHalo} associated with the given node. + *

+ * If no such {@link yfiles.layout.NodeHalo} is available, this method returns a {@link yfiles.layout.NodeHalo#ZERO_HALO}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph containing the given node + * @param {yfiles.algorithms.Node} node the node whose {@link yfiles.layout.NodeHalo} will be determined + * @returns {yfiles.layout.NodeHalo} the {@link yfiles.layout.NodeHalo} of the given node if available, otherwise a {@link yfiles.layout.NodeHalo#ZERO_HALO} + * @static + */ + static 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 including its {@link yfiles.layout.NodeHalo}. + *

+ * This {@link yfiles.algorithms.YRectangle} is located at the position of the node. + *

+ *

+ * If the node does not have a {@link yfiles.layout.NodeHalo} assigned, this box has the same size as the node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph containing the given node + * @param {yfiles.algorithms.Node} node the node whose {@link yfiles.layout.NodeHalo} will be determined + * @returns {yfiles.algorithms.YRectangle} a {@link yfiles.algorithms.YRectangle} instance with the bounds of the given node including its {@link yfiles.layout.NodeHalo} + * @static + */ + static getHaloBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; + /** + * Checks whether or not the given graph contains {@link yfiles.layout.NodeHalo} information. + *

+ * This method looks for a {@link yfiles.algorithms.IDataProvider} that has been registered with the given graph using + * {@link yfiles.layout.NodeHalo#NODE_HALO_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {boolean} true if a {@link yfiles.algorithms.IDataProvider} has been registered with the according key, false otherwise + * @static + */ + static hasHalos(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Data provider key for assigning halos for the nodes + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_HALO_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * A constant holding a {@link yfiles.layout.NodeHalo} with zero size on each side. + * @const + * @static + * @type {yfiles.layout.NodeHalo} + */ + static ZERO_HALO:yfiles.layout.NodeHalo; + /** + * The {@link yfiles.layout.NodeHalo} size at the top side of the node. + * @const + * @type {number} + */ + top:number; + /** + * The {@link yfiles.layout.NodeHalo} size at the left side of the node. + * @const + * @type {number} + */ + left:number; + /** + * The {@link yfiles.layout.NodeHalo} size at the bottom side of the node. + * @const + * @type {number} + */ + bottom:number; + /** + * The {@link yfiles.layout.NodeHalo} size at the right side of the node. + * @const + * @type {number} + */ + right:number; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.NodeLabelCandidate} describes one valid placement for a node label considering the label model. + * @class yfiles.layout.NodeLabelCandidate + * @extends {yfiles.layout.LabelCandidate} + */ + export interface NodeLabelCandidate extends yfiles.layout.LabelCandidate{} + export class NodeLabelCandidate { + /** + * Creates a new instance of {@link yfiles.layout.NodeLabelCandidate} described by location, size, model parameter and internal + * flag. + * @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 label model associated with this candidate + * @param {yfiles.layout.INodeLabelLayout} owner the label associated with the candidate + * @param {boolean} [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout,internal?:boolean); + /** + * Creates a new instance of {@link yfiles.layout.NodeLabelCandidate} described by its box, model parameter and internal flag. + * @param {yfiles.algorithms.YOrientedRectangle} labelBox the box that specifies the candidate's size and position + * @param {Object} param the parameters of the label model associated with this candidate + * @param {yfiles.layout.INodeLabelLayout} owner the label associated with the candidate + * @param {boolean} [internal=false] true if the candidate is allowed to overlap with its owner, false otherwise + * @constructor + */ + constructor(labelBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.INodeLabelLayout,internal?:boolean); + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.NormalizeGraphElementOrderStage} normalizes the order of the elements within a graph to ensure the same + * order for multiple layout invocations. + *

+ * Among 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 {@link yfiles.layout.ILayoutStage} 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 {@link yfiles.lang.IComparable} value using a {@link yfiles.algorithms.IDataProvider} registered with the key {@link yfiles.layout.NormalizeGraphElementOrderStage#NODE_COMPARABLE_DP_KEY} + * or {@link yfiles.layout.NormalizeGraphElementOrderStage#EDGE_COMPARABLE_DP_KEY}, respectively. + *

+ * @class yfiles.layout.NormalizeGraphElementOrderStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface NormalizeGraphElementOrderStage extends yfiles.layout.LayoutStageBase{} + export class NormalizeGraphElementOrderStage { + /** + * Creates a new {@link yfiles.layout.NormalizeGraphElementOrderStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * 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. + *

+ *

+ * This is a convenient method to fill the given {@link yfiles.algorithms.IDataMap}s which can then be registered with the graph + * with keys {@link yfiles.layout.NormalizeGraphElementOrderStage#NODE_COMPARABLE_DP_KEY} and {@link yfiles.layout.NormalizeGraphElementOrderStage#EDGE_COMPARABLE_DP_KEY} + * and used for several layout calculations. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataMap} comparableNodeMap the map that will be filled with comparable values for the nodes + * @param {yfiles.algorithms.IDataMap} comparableEdgeMap the map that will be filled with comparable values for the edges + * @static + */ + static fillComparableMapFromGraph(graph:yfiles.algorithms.Graph,comparableNodeMap:yfiles.algorithms.IDataMap,comparableEdgeMap:yfiles.algorithms.IDataMap):void; + /** + * Data provider key for defining a (global) order for nodes + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_COMPARABLE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for defining a (global) order for edges + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_COMPARABLE_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.OrientationLayout} is a {@link yfiles.layout.ILayoutStage} that changes the orientation of the layout. + *

+ * Layout Style There are four orientations that can be used for a layout. These orientations can exist with or without mirroring at + * the x-axis or y-axis. + *

+ *

+ * Changing the layout orientation is useful for layout styles that show a main direction. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[327.5,0],[136.25,100.31],[327.5,100.31],[507.5,100.31],[507.5,180.94],[260,180.94],[327.5,180.94],[447.5,180.94],[440,262.19],[136.25,180.94],[76.25,180.94],[387.5,342.81],[380,262.19],[500,262.19],[320,262.19],[320,342.81],[560,262.19],[196.25,180.94],[20,262.19],[260,262.19],[80,262.19],[387.5,417.81],[140,262.19],[447.5,342.81],[80,342.81],[620,180.94],[200,262.19],[387.5,180.94],[200,342.81],[140,342.81],[20,342.81],[447.5,417.81],[200,417.81],[320,417.81],[620,262.19],[507.5,342.81],[507.5,417.81],[620,342.81],[567.5,417.81],[687.5,342.81],[687.5,417.81],[627.5,417.81]],"e":[[0,1,-10,15,0,-15,[332.5,40,151.25,85.31]],[0,2,0,15,0,-15],[0,3,10,15,0,-15,[352.5,40,522.5,85.31]],[3,4,0,15,0,-15],[2,5,-10,15,0,-15,[332.5,140.31,275,165.94]],[2,6,0,15,0,-15],[3,7,-10,15,0,-15,[512.5,140.31,462.5,165.94]],[7,8,0,15,0,-15,[462.5,220.94,455,247.19]],[1,9,0,15,0,-15],[1,10,-10,15,0,-15,[141.25,140.31,91.25,165.94]],[8,11,-7.5,15,0,-15,[447.5,302.19,402.5,327.81]],[6,12,7.5,15,0,-15,[350,220.94,395,247.19]],[4,13,-7.5,15,0,-15],[6,14,-7.5,15,0,-15],[14,15,0,15,0,-15],[4,16,7.5,15,0,-15,[530,220.94,575,247.19]],[1,17,10,15,0,-15,[161.25,140.31,211.25,165.94]],[9,18,-11.25,15,0,-15,[140,220.94,35,247.19]],[5,19,0,15,0,-15],[9,20,-3.75,15,0,-15,[147.5,220.94,95,247.19]],[11,21,0,15,0,-15],[9,22,3.75,15,0,-15],[8,23,7.5,15,0,-15],[20,24,0,15,0,-15],[3,25,10,15,0,-15,[532.5,140.31,635,165.94]],[9,26,11.25,15,0,-15,[162.5,220.94,215,247.19]],[2,27,10,15,0,-15,[352.5,140.31,402.5,165.94]],[26,28,0,15,0,-15],[22,29,0,15,0,-15],[18,30,0,15,0,-15],[23,31,0,15,0,-15],[28,32,0,15,0,-15],[15,33,0,15,0,-15],[25,34,0,15,0,-15],[34,35,-10,15,0,-15,[625,302.19,522.5,327.81]],[35,36,0,15,0,-15],[34,37,0,15,0,-15],[37,38,-7.5,15,0,-15,[627.5,382.81,582.5,402.81]],[34,39,10,15,0,-15,[645,302.19,702.5,327.81]],[39,40,0,15,0,-15],[37,41,7.5,15,0,-15]],"vp":[20.0,0.0,698.0,448.0]}} + *

+ *

+ * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} layout + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[327.5,-30],[136.25,-130.31],[327.5,-130.31],[507.5,-130.31],[507.5,-210.94],[260,-210.94],[327.5,-210.94],[447.5,-210.94],[440,-292.19],[136.25,-210.94],[76.25,-210.94],[387.5,-372.81],[380,-292.19],[500,-292.19],[320,-292.19],[320,-372.81],[560,-292.19],[196.25,-210.94],[20,-292.19],[260,-292.19],[80,-292.19],[387.5,-447.81],[140,-292.19],[447.5,-372.81],[80,-372.81],[620,-210.94],[200,-292.19],[387.5,-210.94],[200,-372.81],[140,-372.81],[20,-372.81],[447.5,-447.81],[200,-447.81],[320,-447.81],[620,-292.19],[507.5,-372.81],[507.5,-447.81],[620,-372.81],[567.5,-447.81],[687.5,-372.81],[687.5,-447.81],[627.5,-447.81]],"e":[[0,1,-10,-15,0,15,[332.5,-40,151.25,-85.31]],[0,2,0,-15,0,15],[0,3,10,-15,0,15,[352.5,-40,522.5,-85.31]],[3,4,0,-15,0,15],[2,5,-10,-15,0,15,[332.5,-140.31,275,-165.94]],[2,6,0,-15,0,15],[3,7,-10,-15,0,15,[512.5,-140.31,462.5,-165.94]],[7,8,0,-15,0,15,[462.5,-220.94,455,-247.19]],[1,9,0,-15,0,15],[1,10,-10,-15,0,15,[141.25,-140.31,91.25,-165.94]],[8,11,-7.5,-15,0,15,[447.5,-302.19,402.5,-327.81]],[6,12,7.5,-15,0,15,[350,-220.94,395,-247.19]],[4,13,-7.5,-15,0,15],[6,14,-7.5,-15,0,15],[14,15,0,-15,0,15],[4,16,7.5,-15,0,15,[530,-220.94,575,-247.19]],[1,17,10,-15,0,15,[161.25,-140.31,211.25,-165.94]],[9,18,-11.25,-15,0,15,[140,-220.94,35,-247.19]],[5,19,0,-15,0,15],[9,20,-3.75,-15,0,15,[147.5,-220.94,95,-247.19]],[11,21,0,-15,0,15],[9,22,3.75,-15,0,15],[8,23,7.5,-15,0,15],[20,24,0,-15,0,15],[3,25,10,-15,0,15,[532.5,-140.31,635,-165.94]],[9,26,11.25,-15,0,15,[162.5,-220.94,215,-247.19]],[2,27,10,-15,0,15,[352.5,-140.31,402.5,-165.94]],[26,28,0,-15,0,15],[22,29,0,-15,0,15],[18,30,0,-15,0,15],[23,31,0,-15,0,15],[28,32,0,-15,0,15],[15,33,0,-15,0,15],[25,34,0,-15,0,15],[34,35,-10,-15,0,15,[625,-302.19,522.5,-327.81]],[35,36,0,-15,0,15],[34,37,0,-15,0,15],[37,38,-7.5,-15,0,15,[627.5,-382.81,582.5,-402.81]],[34,39,10,-15,0,15,[645,-302.19,702.5,-327.81]],[39,40,0,-15,0,15],[37,41,7.5,-15,0,15]],"vp":[20.0,-448.0,698.0,448.0]}} + *

+ *

+ * {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} layout with {@link yfiles.layout.MirrorModes#BOTTOM_TO_TOP mirroring} + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,-357.5],[100.31,-166.25],[100.31,-357.5],[100.31,-537.5],[180.94,-537.5],[180.94,-290],[180.94,-357.5],[180.94,-477.5],[262.19,-470],[180.94,-166.25],[180.94,-106.25],[342.81,-417.5],[262.19,-410],[262.19,-530],[262.19,-350],[342.81,-350],[262.19,-590],[180.94,-226.25],[262.19,-50],[262.19,-290],[262.19,-110],[417.81,-417.5],[262.19,-170],[342.81,-477.5],[342.81,-110],[180.94,-650],[262.19,-230],[180.94,-417.5],[342.81,-230],[342.81,-170],[342.81,-50],[417.81,-477.5],[417.81,-230],[417.81,-350],[262.19,-650],[342.81,-537.5],[417.81,-537.5],[342.81,-650],[417.81,-597.5],[342.81,-717.5],[417.81,-717.5],[417.81,-657.5]],"e":[[0,1,15,10,-15,-0,[40,-332.5,85.31,-151.25]],[0,2,15,-0,-15,-0],[0,3,15,-10,-15,-0,[40,-352.5,85.31,-522.5]],[3,4,15,-0,-15,-0],[2,5,15,10,-15,-0,[140.31,-332.5,165.94,-275]],[2,6,15,-0,-15,-0],[3,7,15,10,-15,-0,[140.31,-512.5,165.94,-462.5]],[7,8,15,-0,-15,-0,[220.94,-462.5,247.19,-455]],[1,9,15,-0,-15,-0],[1,10,15,10,-15,-0,[140.31,-141.25,165.94,-91.25]],[8,11,15,7.5,-15,-0,[302.19,-447.5,327.81,-402.5]],[6,12,15,-7.5,-15,-0,[220.94,-350,247.19,-395]],[4,13,15,7.5,-15,-0],[6,14,15,7.5,-15,-0],[14,15,15,-0,-15,-0],[4,16,15,-7.5,-15,-0,[220.94,-530,247.19,-575]],[1,17,15,-10,-15,-0,[140.31,-161.25,165.94,-211.25]],[9,18,15,11.25,-15,-0,[220.94,-140,247.19,-35]],[5,19,15,-0,-15,-0],[9,20,15,3.75,-15,-0,[220.94,-147.5,247.19,-95]],[11,21,15,-0,-15,-0],[9,22,15,-3.75,-15,-0],[8,23,15,-7.5,-15,-0],[20,24,15,-0,-15,-0],[3,25,15,-10,-15,-0,[140.31,-532.5,165.94,-635]],[9,26,15,-11.25,-15,-0,[220.94,-162.5,247.19,-215]],[2,27,15,-10,-15,-0,[140.31,-352.5,165.94,-402.5]],[26,28,15,-0,-15,-0],[22,29,15,-0,-15,-0],[18,30,15,-0,-15,-0],[23,31,15,-0,-15,-0],[28,32,15,-0,-15,-0],[15,33,15,-0,-15,-0],[25,34,15,-0,-15,-0],[34,35,15,10,-15,-0,[302.19,-625,327.81,-522.5]],[35,36,15,-0,-15,-0],[34,37,15,-0,-15,-0],[37,38,15,7.5,-15,-0,[382.81,-627.5,402.81,-582.5]],[34,39,15,-10,-15,-0,[302.19,-645,327.81,-702.5]],[39,40,15,-0,-15,-0],[37,41,15,-7.5,-15,-0]],"vp":[0.0,-718.0,448.0,698.0]}} + *

+ *

+ * {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} layout + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[-30,327.5],[-130.31,136.25],[-130.31,327.5],[-130.31,507.5],[-210.94,507.5],[-210.94,260],[-210.94,327.5],[-210.94,447.5],[-292.19,440],[-210.94,136.25],[-210.94,76.25],[-372.81,387.5],[-292.19,380],[-292.19,500],[-292.19,320],[-372.81,320],[-292.19,560],[-210.94,196.25],[-292.19,20],[-292.19,260],[-292.19,80],[-447.81,387.5],[-292.19,140],[-372.81,447.5],[-372.81,80],[-210.94,620],[-292.19,200],[-210.94,387.5],[-372.81,200],[-372.81,140],[-372.81,20],[-447.81,447.5],[-447.81,200],[-447.81,320],[-292.19,620],[-372.81,507.5],[-447.81,507.5],[-372.81,620],[-447.81,567.5],[-372.81,687.5],[-447.81,687.5],[-447.81,627.5]],"e":[[0,1,-15,-10,15,0,[-40,332.5,-85.31,151.25]],[0,2,-15,0,15,0],[0,3,-15,10,15,0,[-40,352.5,-85.31,522.5]],[3,4,-15,0,15,0],[2,5,-15,-10,15,0,[-140.31,332.5,-165.94,275]],[2,6,-15,0,15,0],[3,7,-15,-10,15,0,[-140.31,512.5,-165.94,462.5]],[7,8,-15,0,15,0,[-220.94,462.5,-247.19,455]],[1,9,-15,0,15,0],[1,10,-15,-10,15,0,[-140.31,141.25,-165.94,91.25]],[8,11,-15,-7.5,15,0,[-302.19,447.5,-327.81,402.5]],[6,12,-15,7.5,15,0,[-220.94,350,-247.19,395]],[4,13,-15,-7.5,15,0],[6,14,-15,-7.5,15,0],[14,15,-15,0,15,0],[4,16,-15,7.5,15,0,[-220.94,530,-247.19,575]],[1,17,-15,10,15,0,[-140.31,161.25,-165.94,211.25]],[9,18,-15,-11.25,15,0,[-220.94,140,-247.19,35]],[5,19,-15,0,15,0],[9,20,-15,-3.75,15,0,[-220.94,147.5,-247.19,95]],[11,21,-15,0,15,0],[9,22,-15,3.75,15,0],[8,23,-15,7.5,15,0],[20,24,-15,0,15,0],[3,25,-15,10,15,0,[-140.31,532.5,-165.94,635]],[9,26,-15,11.25,15,0,[-220.94,162.5,-247.19,215]],[2,27,-15,10,15,0,[-140.31,352.5,-165.94,402.5]],[26,28,-15,0,15,0],[22,29,-15,0,15,0],[18,30,-15,0,15,0],[23,31,-15,0,15,0],[28,32,-15,0,15,0],[15,33,-15,0,15,0],[25,34,-15,0,15,0],[34,35,-15,-10,15,0,[-302.19,625,-327.81,522.5]],[35,36,-15,0,15,0],[34,37,-15,0,15,0],[37,38,-15,-7.5,15,0,[-382.81,627.5,-402.81,582.5]],[34,39,-15,10,15,0,[-302.19,645,-327.81,702.5]],[39,40,-15,0,15,0],[37,41,-15,7.5,15,0]],"vp":[-448.0,20.0,448.0,698.0]}} + *

+ *

+ * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT} layout + *

+ *

+ * Concept {@link yfiles.layout.OrientationLayout} performs three basic steps. + *

+ *
    + *
  1. + * Preparation: The sizes and locations of nodes and edge bends as well as labels and {@link yfiles.layout.PortConstraint}s are + * transformed to the {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. + *
  2. + *
  3. + * Delegation: The {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is invoked and calculates the layout for orientation + * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. + *
  4. + *
  5. Completion: The result of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is rotated and mirrored to fit the desired layout orientation.
  6. + *
+ *

+ * Features + *

+ *

+ * {@link yfiles.layout.OrientationLayout} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm}. Then it + * will change the orientation of the result of the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *
+ * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.layout.OrientationLayout} can work alone. It will just change the + * orientation of the layout without arranging nodes and edges. + *

+ * @class yfiles.layout.OrientationLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface OrientationLayout extends yfiles.layout.LayoutStageBase{} + export class OrientationLayout { + /** + * Creates a new {@link yfiles.layout.OrientationLayout} instance using the given orientation. + * @param {yfiles.layout.LayoutOrientation} orientation the orientation specifier + * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation is unknown + * @see yfiles.layout.OrientationLayout#orientation + * @constructor + */ + constructor(orientation:yfiles.layout.LayoutOrientation); + /** + * Creates a new {@link yfiles.layout.OrientationLayout} instance using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} coreLayouter the core layout routine + * @constructor + */ + constructor(coreLayouter:yfiles.layout.ILayoutAlgorithm); + /** + * Creates a new {@link yfiles.layout.OrientationLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Applies the desired orientation to the graph. + *

+ * It performs the inverse coordinate transformation that has been applied to the layout by method + * {@link yfiles.layout.OrientationLayout#prepareOrientationChange}. + *

+ *

+ * This method is called by {@link yfiles.layout.OrientationLayout#applyLayout} after invoking the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to extend the orientation change to custom layout features. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @see yfiles.layout.OrientationLayout#prepareOrientationChange + */ + completeOrientationChange(graph:yfiles.layout.LayoutGraph):void; + /** + * Transforms the given point during completion. + *

+ * The point is transformed from {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation to the desired orientation. + *

+ * @param {yfiles.algorithms.YPoint} point the calculated point + * @returns {yfiles.algorithms.YPoint} the transformed point + * @see yfiles.layout.OrientationLayout#completeOrientationChange + */ + completeTransform(point:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Creates {@link yfiles.algorithms.Insets} that are a geometric transformation of the given {@link yfiles.algorithms.Insets}. + *

+ * The transform will correspond to the currently set orientation. + *

+ * @param {yfiles.algorithms.Insets} insets the original insets + * @returns {yfiles.algorithms.Insets} the oriented insets + * @see yfiles.layout.OrientationLayout#orientation + */ + createOrientedInsets(insets:yfiles.algorithms.Insets):yfiles.algorithms.Insets; + /** + * Creates a {@link yfiles.layout.NodeHalo} that is a geometric transformation of the given {@link yfiles.layout.NodeHalo}. + *

+ * The transform will correspond to the currently set orientation. + *

+ * @param {yfiles.layout.NodeHalo} halo the original {@link yfiles.layout.NodeHalo} + * @returns {yfiles.layout.NodeHalo} the oriented {@link yfiles.layout.NodeHalo} + * @see yfiles.layout.OrientationLayout#orientation + */ + createOrientedNodeHalo(halo:yfiles.layout.NodeHalo):yfiles.layout.NodeHalo; + /** + * Creates a {@link yfiles.algorithms.YDimension} that is a geometric transformation of the given size. + *

+ * The transform will correspond to the currently set orientation. + *

+ * @param {yfiles.algorithms.YDimension} nodeSize the original node size + * @returns {yfiles.algorithms.YDimension} the oriented node size + * @see yfiles.layout.OrientationLayout#orientation + */ + createOrientedNodeSize(nodeSize:yfiles.algorithms.YDimension):yfiles.algorithms.YDimension; + /** + * Returns whether or not this {@link yfiles.layout.OrientationLayout} instance will mirror the graph for a given layout + * orientation. + *

+ * Horizontal orientations get mirrored at the x-axis while vertical orientations are mirrored at the y-axis. + *

+ * @param {yfiles.layout.LayoutOrientation} orientation the layout orientation for which to check the mirror state + * @returns {boolean} true if the layout algorithm will mirror the graph at the corresponding axis for the given layout orientation, false + * otherwise + * @see yfiles.layout.OrientationLayout#orientation + * @see yfiles.layout.OrientationLayout#mirrorMode + */ + isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation):boolean; + /** + * Prepares the layout for the desired orientation. + *

+ * It will rotate and mirror the coordinates and bounds of the graph layout such that the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can perform + * its calculations assuming the canonical {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. + *

+ *

+ * This method is called by {@link yfiles.layout.OrientationLayout#applyLayout} before invoking the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It might be overridden to extend the preparations to custom layout features. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @see yfiles.layout.OrientationLayout#completeOrientationChange + */ + prepareOrientationChange(graph:yfiles.layout.LayoutGraph):void; + /** + * Transforms the given point during preparation. + *

+ * The point is transformed so it matches the {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} orientation. + *

+ * @param {yfiles.algorithms.YPoint} point the original point + * @returns {yfiles.algorithms.YPoint} the transformed point + * @see yfiles.layout.OrientationLayout#prepareOrientationChange + */ + prepareTransform(point:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Transforms the given point during the preparation or completion step. + *

+ * This method is called by {@link yfiles.layout.OrientationLayout#prepareOrientationChange} and {@link yfiles.layout.OrientationLayout#completeOrientationChange} + * to get the according point location. + *

+ * @param {yfiles.algorithms.YPoint} point the original/calculated point + * @param {boolean} prepare true if this method is called during preparation, false if it is called during completion + * @returns {yfiles.algorithms.YPoint} the transformed point + * @see yfiles.layout.OrientationLayout#prepareOrientationChange + * @see yfiles.layout.OrientationLayout#completeOrientationChange + * @see yfiles.layout.OrientationLayout#prepareTransform + * @see yfiles.layout.OrientationLayout#completeTransform + * @protected + */ + transform(point:yfiles.algorithms.YPoint,prepare:boolean):yfiles.algorithms.YPoint; + /** + * Gets or sets the main direction of the layout. + * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation is unknown + * @type {yfiles.layout.LayoutOrientation} + */ + orientation:yfiles.layout.LayoutOrientation; + /** + * Gets or sets the mirror mask that defines which orientations this {@link yfiles.layout.OrientationLayout} shall mirror. + *

+ * {@link yfiles.layout.OrientationLayout#orientation Setting a layout orientation} can be seen as rotating the graph by 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. It can combine several mirrored directions with a + * logical or-operation. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown mask is specified + * @type {yfiles.layout.MirrorModes} + */ + mirrorMode:yfiles.layout.MirrorModes; + /** + * Gets whether or not the current orientation is horizontal. + *

+ * The orientation is horizontal if it is {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} or + * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT}. + *

+ * @see yfiles.layout.OrientationLayout#orientation + * @type {boolean} + */ + horizontalOrientation:boolean; + /** + * Gets or sets whether or not the position of the edge labels should be changed during orientation change. + * @type {boolean} + */ + considerEdgeLabels:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.PortCalculator} adjusts 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 registered with the graph using the keys defined in the {@link yfiles.layout.IIntersectionCalculator} interface to + * calculate the new port offsets. + *

+ *

+ * For each edge in the graph, {@link yfiles.layout.IIntersectionCalculator}s are retrieved from these + * {@link yfiles.algorithms.IDataProvider}s. If such an {@link yfiles.layout.IIntersectionCalculator} is assigned, it will provide the + * intersection point of the edge and the node. Then this point is added to the {@link yfiles.layout.IEdgeLayout}. + *

+ *

+ * For this layout stage to work properly, use {@link yfiles.layout.CompositeLayoutStage#prependStage} or {@link yfiles.layout.MultiStageLayout#prependStage} + * to add this layout stage and register appropriate {@link yfiles.algorithms.IDataProvider}s with 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 yfiles.layout.IIntersectionCalculator + * @see yfiles.layout.IntersectionCalculatorKeys#SOURCE_INTERSECTION_CALCULATOR_DP_KEY + * @see yfiles.layout.IntersectionCalculatorKeys#TARGET_INTERSECTION_CALCULATOR_DP_KEY + * @see yfiles.layout.PortConstraint + * @class yfiles.layout.PortCalculator + * @extends {yfiles.layout.LayoutStageBase} + * @implements {yfiles.layout.ILayoutStage} + */ + export interface PortCalculator extends yfiles.layout.LayoutStageBase,yfiles.layout.ILayoutStage{} + export class PortCalculator { + /** + * Creates a new {@link yfiles.layout.PortCalculator} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @constructor + */ + constructor(); + /** + * Performs the actual port calculation on the specified graph instance. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @protected + */ + calculatePorts(graph:yfiles.layout.LayoutGraph):void; + /** + * Determines whether two points are equal. + *

+ * This implementation uses {@link yfiles.layout.PortCalculator#Eps} to add some tolerance to the comparison. It is called by {@link yfiles.layout.PortCalculator#calculatePorts} + * and may be overridden to change the accuracy/tolerance of the comparison. + *

+ * @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 + * @returns {boolean} true if both points are considered equal, false otherwise + * @see yfiles.layout.PortCalculator#calculatePorts + * @see yfiles.layout.PortCalculator#Eps + * @protected + */ + equalsEps(x1:number,y1:number,x2:number,y2:number):boolean; + /** + * EPSILON used by {@link yfiles.layout.PortCalculator#equalsEps}. + *

+ * By default this is 0.2d. + *

+ * @protected + * @type {number} + */ + Eps:number; + static $class:yfiles.lang.Class; + } + /** + * This class represents a candidate port on which edges can be connected to their source and/or target node. + *

+ * The notion of {@link yfiles.layout.PortCandidate}s extends the one of {@link yfiles.layout.PortConstraint}s. In contrast to + * {@link yfiles.layout.PortConstraint}s, they can be associated with both edges and nodes. Moreover, more than one {@link yfiles.layout.PortCandidate} + * can be specified for an edge or a node. + *

+ *

+ * Edge {@link yfiles.layout.PortCandidate}s can be introduced to define specific sides or exact locations on which a given edge can be + * connected to its source or target node. + *
+ * Information about edge {@link yfiles.layout.PortCandidate}s is held by {@link yfiles.algorithms.IDataProvider}s that are registered with + * the graph using keys {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY} (to specify + * {@link yfiles.layout.PortCandidate}s for an edge on the source node) and {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY} + * (to specify {@link yfiles.layout.PortCandidate}s for an edge on the target node). The {@link yfiles.algorithms.IDataProvider}s hold a {@link yfiles.collections.ICollection. collection} + * of {@link yfiles.layout.PortCandidate}s for each edge. + *

+ *

+ * Node {@link yfiles.layout.PortCandidate}s determine available ports on the nodes to which edges can be connected. This means that an + * edge of the graph can be connected to any of these node ports (unless edge {@link yfiles.layout.PortCandidate}s are specified + * too). + *
+ * To register and define node {@link yfiles.layout.PortCandidate}s refer to {@link yfiles.layout.PortCandidateSet}. + *

+ *

+ * A {@link yfiles.layout.PortCandidate} is described by the following attributes: + *

+ *
    + *
  • + * Offsets: The X-offset (Y-offset) determines the horizontal (vertical) distance of the {@link yfiles.layout.PortCandidate} + * relative to the center of the node. + *
  • + *
  • + * Fixed or free: Fixed + * {@link yfiles.layout.PortCandidate}s are defined using exact coordinates, whereas coordinates of free candidates are selected + * arbitrarily. + *
  • + *
  • + * Direction: Corresponds to the incoming or outgoing directions of the edges when connecting to a target or source node, + * respectively. + *
  • + *
  • + * Penalty cost: Represents the cost of usage of a + * {@link yfiles.layout.PortCandidate}. During the processing of an edge by a layout or routing algorithm, candidates of lower cost + * will be considered first. + *
  • + *
+ *

+ * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ff0000","b":1, "c":1}, "7":{"f":"#00ffff","b":1}, "8":{"f":"#008000","b":1}},"n":[[646.5,475.5],[725.5,528.5],[831.5,470],[669.5,605.5],[722.5,530.5,6,6,8],[724,549.5,3,8,7],[783,531,5,5,6],[783,551,5,5,6],[667.5,502,6,6,8],[696.5,604.5,8,3,7],[848,498,5,5,6],[696.5,634,8,3,7],[848,468.12,5,5,6],[667.5,472.5,6,6,8],[737.5,525,6,6,8]],"e":[[0,1,-6,15,-30,-10,[670.5,533.5]],[2,1,-11,15,30,-10,[850.5,533.5]],[3,1,1,-15,-30,10,[700.5,553.5]]],"vp":[646.0,468.0,246.0,169.0]}} Example of using edge port candidates. Edge port candidates are colored uniquely based on the edge with which they are + * associated. + *

+ *

+ * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortCandidate}s. Major layout algorithms that obey + * them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} and + * {@link yfiles.router.BusRouter}. + *

+ * @class yfiles.layout.PortCandidate + */ + export interface PortCandidate extends Object{} + export class PortCandidate { + /** + * Factory method that creates a fixed {@link yfiles.layout.PortCandidate} instance with the given cost of usage, direction and + * offset values. + * @param {yfiles.layout.PortDirections} directionMask any combination of the default direction specifiers + * @param {number} xOffset the X-offset relative to the center of the node + * @param {number} yOffset the Y-offset relative to the center of the node + * @param {number} [cost=0.0] the penalty cost for using this {@link yfiles.layout.PortCandidate} instance + * @returns {yfiles.layout.PortCandidate} a new {@link yfiles.layout.PortCandidate} instance + * @static + */ + static createCandidate(xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirections,cost?:number):yfiles.layout.PortCandidate; + /** + * Factory method that creates a free {@link yfiles.layout.PortCandidate} instance with the given direction and cost of usage. + * @param {yfiles.layout.PortDirections} directionMask any combination of the default direction specifiers + * @param {number} cost the penalty cost for using this {@link yfiles.layout.PortCandidate} + * @returns {yfiles.layout.PortCandidate} a new {@link yfiles.layout.PortCandidate} instance + * @static + */ + static createCandidate(directionMask:yfiles.layout.PortDirections,cost:number):yfiles.layout.PortCandidate; + /** + * Factory method that returns a free {@link yfiles.layout.PortCandidate} instance with zero cost of usage and the direction + * specified by the {@link yfiles.layout.PortConstraint#side side} of the given {@link yfiles.layout.PortConstraint}. + * @param {yfiles.layout.PortConstraint} fromPortConstraint the {@link yfiles.layout.PortConstraint} whose {@link yfiles.layout.PortConstraint#side side} should be used as direction + * @returns {yfiles.layout.PortCandidate} a new {@link yfiles.layout.PortCandidate} instance + * @static + */ + static createCandidate(fromPortConstraint:yfiles.layout.PortConstraint):yfiles.layout.PortCandidate; + /** + * Factory method that creates a free {@link yfiles.layout.PortCandidate} instance with the given direction and zero cost of + * usage. + * @param {yfiles.layout.PortDirections} directionMask any combination of the default direction specifiers + * @returns {yfiles.layout.PortCandidate} a new {@link yfiles.layout.PortCandidate} instance + * @static + */ + static createCandidate(directionMask:yfiles.layout.PortDirections):yfiles.layout.PortCandidate; + /** + * Returns the direction of this {@link yfiles.layout.PortCandidate} instance with respect to the given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. + *

+ * If the direction mask is not required to be calculated with respect to the actual {@link yfiles.layout.OrientationLayout#orientation layout orientation}, {@link yfiles.layout.PortCandidate#direction} should be used + * instead. + *

+ * @param {yfiles.layout.LayoutOrientation} layoutOrientation + * @returns {yfiles.layout.PortDirections} the direction of this {@link yfiles.layout.PortCandidate} with respect to the given layout orientation + * @see yfiles.layout.PortCandidate#direction + */ + getDirectionForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortDirections; + /** + * Returns the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the + * given {@link yfiles.layout.OrientationLayout#orientation layout orientation} and {@link yfiles.layout.OrientationLayout#mirrorMode mirror mask}. + *

+ * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} + * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is equal to zero. + *

+ * @param {yfiles.layout.LayoutOrientation} layoutOrientation the layout orientation + * @param {yfiles.layout.MirrorModes} mirrorMask the mirror mask + * @returns {number} the X-offset of the port with respect to the given orientation and mirror mask + */ + getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):number; + /** + * Returns the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the + * given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. + *

+ * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} + * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is equal to zero. + *

+ * @param {yfiles.layout.LayoutOrientation} layoutOrientation the layout orientation + * @returns {number} the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the given layout orientation + */ + getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; + /** + * Returns the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the + * given {@link yfiles.layout.OrientationLayout#orientation layout orientation} and {@link yfiles.layout.OrientationLayout#mirrorMode mirror mask}. + *

+ * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} + * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is equal to zero. + *

+ * @param {yfiles.layout.LayoutOrientation} layoutOrientation the layout orientation + * @param {yfiles.layout.MirrorModes} mirrorMask the mirror mask + * @returns {number} the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the given orientation and mirror mask + */ + getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorModes):number; + /** + * Returns the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node for the + * given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. + *

+ * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} + * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is equal to zero. + *

+ * @param {yfiles.layout.LayoutOrientation} layoutOrientation the layout orientation + * @returns {number} the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the given layout orientation + */ + getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; + /** + * Returns whether or not this {@link yfiles.layout.PortCandidate} lies in the given direction. + * @param {yfiles.layout.PortDirections} directionMask one of the default direction specifiers + * @returns {boolean} true if this {@link yfiles.layout.PortCandidate} lies in the given direction, false otherwise + */ + isInDirection(directionMask:yfiles.layout.PortDirections):boolean; + /** + * A utility method that converts the current {@link yfiles.layout.PortCandidate} instance to a {@link yfiles.layout.PortConstraint}. + *

+ * The {@link yfiles.layout.PortConstraint#side side} of the created {@link yfiles.layout.PortConstraint} matches the {@link yfiles.layout.PortCandidate#direction direction} of this {@link yfiles.layout.PortCandidate}. + *

+ *

+ * If this {@link yfiles.layout.PortCandidate} is {@link yfiles.layout.PortCandidate#fixed fixed}, the resulting {@link yfiles.layout.PortConstraint} will be {@link yfiles.layout.PortConstraint#strong strong}. + *

+ * @returns {yfiles.layout.PortConstraint} a {@link yfiles.layout.PortConstraint} that matches this {@link yfiles.layout.PortCandidate} + */ + toPortConstraint():yfiles.layout.PortConstraint; + /** + * A utility method that converts the current {@link yfiles.layout.PortCandidate} instance to a {@link yfiles.layout.PortConstraint} with + * respect to the given {@link yfiles.layout.OrientationLayout#orientation layout orientation}. + *

+ * The {@link yfiles.layout.PortConstraint#side side} of the created {@link yfiles.layout.PortConstraint} is the {@link yfiles.layout.PortCandidate#direction direction} of this {@link yfiles.layout.PortCandidate} interpreted + * for the given orientation. + *

+ *

+ * If this {@link yfiles.layout.PortCandidate} is {@link yfiles.layout.PortCandidate#fixed fixed}, the resulting {@link yfiles.layout.PortConstraint} will be {@link yfiles.layout.PortConstraint#strong strong}. + *

+ * @param {yfiles.layout.LayoutOrientation} layoutOrientation + * @returns {yfiles.layout.PortConstraint} a {@link yfiles.layout.PortConstraint} that matches this {@link yfiles.layout.PortCandidate} with respect to the given orientation + */ + toPortConstraintForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortConstraint; + /** + * Data provider key for specifying source port candidates for each edge. + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.>} + */ + static SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY:yfiles.algorithms.EdgeDpKey>; + /** + * Data provider key for specifying target port candidates for each edge. + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.>} + */ + static TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY:yfiles.algorithms.EdgeDpKey>; + /** + * Gets the direction of this {@link yfiles.layout.PortCandidate}. + *

+ * If the direction is required to be calculated with respect to the actual {@link yfiles.layout.OrientationLayout#orientation layout orientation}, {@link yfiles.layout.PortCandidate#getDirectionForLayoutOrientation} + * should be used instead. + *

+ * @see yfiles.layout.PortCandidate#getDirectionForLayoutOrientation + * @type {yfiles.layout.PortDirections} + */ + direction:yfiles.layout.PortDirections; + /** + * Gets whether or not this {@link yfiles.layout.PortCandidate} is fixed. + *

+ * Fixed + * {@link yfiles.layout.PortCandidate}s are defined using exact coordinates, whereas coordinates of free candidates are selected + * arbitrarily. + *

+ * @type {boolean} + */ + fixed:boolean; + /** + * Gets the X-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node. + *

+ * The X-offset encodes the horizontal distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} + * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the X-offset is zero. + *

+ * @type {number} + */ + xOffset:number; + /** + * Gets the Y-offset of the {@link yfiles.layout.PortCandidate} with respect to the center of the corresponding node. + *

+ * The Y-offset encodes the vertical distance of the port relative to the center of a node. If the {@link yfiles.layout.PortCandidate} + * is not {@link yfiles.layout.PortCandidate#fixed fixed} (i.e., free), the Y-offset is zero. + *

+ * @type {number} + */ + yOffset:number; + /** + * Gets the penalty cost for using this {@link yfiles.layout.PortCandidate} instance. + * @type {number} + */ + cost:number; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.IPortCandidateMatcher} retrieves the best matching {@link yfiles.layout.IPortCandidateSetEntry entries} from a {@link yfiles.layout.PortCandidateSet}. + *

+ * How well a candidate is matching can be decided based on its cost, its currently available capacity, its offsets or + * whether or not its direction is consistent with the desired one. + *

+ *

+ * To use custom implementations of this interface, method {@link yfiles.layout.PortCandidateSet#createMatcher} should be + * overridden. + *

+ * @interface + */ + export interface IPortCandidateMatcher extends Object{ + /** + * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry} for the given parameters. + * @param {yfiles.algorithms.Edge} edge the edge for which to find a candidate + * @param {boolean} source true if the given edge connects to its source node, false otherwise + * @param {number} xOffset the preferred X-offset of the port relative to the center of the node + * @param {number} yOffset the preferred Y-offset of the port relative to the center of the node + * @param {yfiles.layout.PortDirections} directionMask any combination of default directions defined in {@link yfiles.layout.PortCandidate} + * @returns {yfiles.layout.IPortCandidateSetEntry} a matching {@link yfiles.layout.IPortCandidateSetEntry} instance + * @abstract + */ + findMatchingCandidate(edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirections):yfiles.layout.IPortCandidateSetEntry; + /** + * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry} for the given parameters. + * @param {yfiles.algorithms.Edge} edge the edge for which to find a candidate + * @param {boolean} source true if the given edge connects to its source node, false otherwise + * @param {yfiles.layout.PortDirections} directionMask any combination of default directions defined in {@link yfiles.layout.PortCandidate} + * @returns {yfiles.layout.IPortCandidateSetEntry} a matching {@link yfiles.layout.IPortCandidateSetEntry} instance + * @abstract + */ + findMatchingCandidate(edge:yfiles.algorithms.Edge,source:boolean,directionMask:yfiles.layout.PortDirections):yfiles.layout.IPortCandidateSetEntry; + /** + * Returns the next best matching {@link yfiles.layout.IPortCandidateSetEntry}. + * @returns {yfiles.layout.IPortCandidateSetEntry} a matching {@link yfiles.layout.IPortCandidateSetEntry} instance + * @abstract + */ + findMatchingCandidate():yfiles.layout.IPortCandidateSetEntry; + } + var IPortCandidateMatcher:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface represents an entry of a {@link yfiles.layout.PortCandidateSet} and provides access to the actual {@link yfiles.layout.PortCandidate} + * instance and the maximum number of edges allowed to connect to it. + * @interface + */ + export interface IPortCandidateSetEntry extends Object{ + /** + * Gets the actual {@link yfiles.layout.PortCandidate} associated with this {@link yfiles.layout.IPortCandidateSetEntry}. + * @abstract + * @type {yfiles.layout.PortCandidate} + */ + portCandidate:yfiles.layout.PortCandidate; + /** + * Gets the maximum number of edges allowed to connect to the {@link yfiles.layout.PortCandidate} associated with this + * {@link yfiles.layout.IPortCandidateSetEntry}. + *

+ * 0x7FFFFFFF indicates that the number of connections is unbounded. + *

+ * @abstract + * @type {number} + */ + connections:number; + } + var IPortCandidateSetEntry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class associates {@link yfiles.layout.PortCandidate}s with the nodes of a graph. + *

+ * {@link yfiles.layout.PortCandidate}s defined on nodes specify sides or even exact locations at which edges can be connected. + * This means that an edge can be connected to any of the available node ports (unless edge {@link yfiles.layout.PortCandidate}s + * are specified too). Each node {@link yfiles.layout.PortCandidate} has a capacity, i.e., a maximum number of edges allowed to + * connect to it. + *

+ *

+ * Information about {@link yfiles.layout.PortCandidate}s on nodes is held by a {@link yfiles.algorithms.IDataProvider} that stores a {@link yfiles.layout.PortCandidateSet} + * for each node and is registered with the graph using key {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY}. + *

+ *

+ * The {@link yfiles.layout.PortCandidate}s are retrieved from the {@link yfiles.layout.PortCandidateSet} through a {@link yfiles.layout.IPortCandidateSetEntry} + * that holds the information about the actual {@link yfiles.layout.PortCandidate}. This object is also used for retrieving the + * best candidate from a {@link yfiles.layout.PortCandidateSet} based on the cost (lower costs are considered first) and the + * available capacity of each candidate. Custom searching for the best {@link yfiles.layout.PortCandidate} can be achieved by + * implementing {@link yfiles.layout.IPortCandidateMatcher} interface. + *

+ *

+ * {@graph {"ann":{"s":[5,5],"d":1},"styles":{"6":{"f":"#008000","b":1, "c":1}, "7":{"f":"#00ffff","b":1}, "8":{"f":"#ff0000","b":1}},"n":[[-54,-100,60,30],[25,-47,60,30],[131,-105.5,60,30],[-31,30,60,30],[111,30.5,60,30],[63.81,-49.5,8],[40.81,-49.5,8],[23.5,-46,3,8,7],[23.5,-26,3,8,7],[83.5,-46,3,8,7],[83.5,-26,3,8,7,6],[40.81,-19.5,8],[63.81,-19.5,8],[-32.5,-73,6],[-2.5,28,6],[132.5,28,6],[147.5,-77.5,6]],"e":[[0,1,-6,15,-30,-10,[-30,-42]],[2,1,-11,15,30,-10,[150,-42]],[3,1,1,-15,-30,10,[0,-22]],[4,1,-6,-15,30,10,[135,-22]]],"vp":[-54.0,-106.0,245.0,167.0]}} Example of node port candidates. Circular ports represent node port candidates on source nodes of each edge. Square and + * rectangular ports are possible port candidates on the target node. Rectangular ports have zero cost of usage and unit + * capacity whereas square rectangles have unit cost and capacity. + *

+ *

+ * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortCandidate}s. Major layout algorithms that obey + * them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} and + * {@link yfiles.router.BusRouter}. + *

+ * @class yfiles.layout.PortCandidateSet + */ + export interface PortCandidateSet extends Object{} + export class PortCandidateSet { + /** + * Creates a new empty {@link yfiles.layout.PortCandidateSet} instance. + *

+ * Addition of {@link yfiles.layout.PortCandidate}s to this {@link yfiles.layout.PortCandidateSet set} can be performed using Add or {@link yfiles.layout.PortCandidateSet#add}. + *

+ * @constructor + */ + constructor(); + /** + * Adds a {@link yfiles.layout.PortCandidate} with the given capacity to this {@link yfiles.layout.PortCandidateSet}. + *

+ * The capacity value defines the maximum number of edges allowed to connect to the candidate. If no limitation for this + * number exists, 0x7FFFFFFF can be used. + *

+ *

+ * The capacity must be greater than zero. + *

+ * @param {yfiles.layout.PortCandidate} p the {@link yfiles.layout.PortCandidate} to add + * @param {number} [connections=1] the capacity of the given port + * @throws {Stubs.Exceptions.ArgumentError} if the given capacity is less than or equal to zero + */ + add(p:yfiles.layout.PortCandidate,connections?:number):void; + /** + * Creates a {@link yfiles.layout.IPortCandidateMatcher} that retrieves {@link yfiles.layout.IPortCandidateSetEntry entries} from this {@link yfiles.layout.PortCandidateSet}. + *

+ * Each next best matching candidate is determined based on its cost, its current available capacity and based on whether + * or not its direction is consistent with the desired one. + *

+ *

+ * This method may be overridden to support custom implementations of {@link yfiles.layout.IPortCandidateMatcher}. + *

+ * @returns {yfiles.layout.IPortCandidateMatcher} a new {@link yfiles.layout.IPortCandidateMatcher} instance + */ + createMatcher():yfiles.layout.IPortCandidateMatcher; + /** + * Calculates the penalty cost for the usage of the given {@link yfiles.layout.IPortCandidateSetEntry entry} and the given parameters. + *

+ * The cost is equal to the {@link yfiles.layout.PortCandidate#cost cost of usage} of the {@link yfiles.layout.IPortCandidateSetEntry#portCandidate associated port candidate}. + *

+ *

+ * This method may be overridden to customize the calculation of the cost of usage of an {@link yfiles.layout.IPortCandidateSetEntry entry}. + *

+ * @param {yfiles.layout.IPortCandidateSetEntry} entry the entry for which the cost is computed + * @param {yfiles.algorithms.Edge} edge the edge that will connect to the {@link yfiles.layout.PortCandidate} associated with the entry + * @param {boolean} source true if the given edge connects to its source node, false otherwise + * @param {number} xOffset the preferred X-offset of the port relative to the center of the node + * @param {number} yOffset the preferred Y-offset of the port relative to the center of the node + * @returns {number} the penalty cost for the usage of the given {@link yfiles.layout.IPortCandidateSetEntry} + */ + getCost(entry:yfiles.layout.IPortCandidateSetEntry,edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number):number; + /** + * Calculates the priority of the given {@link yfiles.layout.IPortCandidateSetEntry entry}. + *

+ * Higher priority means that the entry will be considered earlier by a {@link yfiles.layout.IPortCandidateMatcher}. + *

+ *

+ * This method may be overridden to customize the calculation of the priority of {@link yfiles.layout.IPortCandidateSetEntry entries}. + *

+ * @param {yfiles.layout.IPortCandidateSetEntry} entry the entry for which the cost is computed + * @param {yfiles.algorithms.Edge} edge the edge that will connect to the {@link yfiles.layout.PortCandidate} associated with the entry + * @param {boolean} source true if the given edge connects to its source node, false otherwise + * @returns {number} the priority of the given {@link yfiles.layout.IPortCandidateSetEntry} + */ + getPriority(entry:yfiles.layout.IPortCandidateSetEntry,edge:yfiles.algorithms.Edge,source:boolean):number; + /** + * Removes the given {@link yfiles.layout.IPortCandidateSetEntry entry} from the list of candidate entries. + * @param {yfiles.layout.IPortCandidateSetEntry} entry the entry to remove + */ + remove(entry:yfiles.layout.IPortCandidateSetEntry):void; + /** + * Data provider key for specifying a port candidate set for each node. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_PORT_CANDIDATE_SET_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets the total number of connections allowed by the {@link yfiles.layout.PortCandidate}s described by this {@link yfiles.layout.PortCandidateSet} + * or 0x7FFFFFFF if the number is unbounded. + * @type {number} + */ + connectionCount:number; + /** + * Gets an {@link yfiles.collections.IEnumerator.} over the list of candidate {@link yfiles.layout.IPortCandidateSetEntry entries} of this {@link yfiles.layout.PortCandidateSet}. + * @type {yfiles.collections.IEnumerator.} + */ + entries:yfiles.collections.IEnumerator; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.PortConstraint} represents a constraint for the source or target port of an edge path. + *

+ * It determines the location at which an edge path can be connected to its source and/or target node. There exist two + * different types of {@link yfiles.layout.PortConstraint}s: + *

+ *
    + *
  • Weak {@link yfiles.layout.PortConstraint}s determine the side of the node to which an edge can be connected.
  • + *
  • + * Strong + * {@link yfiles.layout.PortConstraint}s determine the exact coordinates of the point to which an edge path can be connected. These + * coordinates are determined at the time the edge is processed by a layout or routing algorithm and are always interpreted + * relative to a node's center. + *
  • + *
+ *

+ * {@graph {"ann":{"s":[3,8],"d":1},"styles":{"6":{"f":"#FF0000"},"7":{"f":"#000000"}},"n":[[-570,-40,90,30],[-395,-140,90,30],[-563.02,-184.16,90,30],[-398.2,-140,9,30,6],[-477,-184.16,9,30,6],[-484.4,-40,9,30,6],[-474,-173.16,7],[-395.2,-135.01,7],[-395.2,-122.49,7],[-481.4,-29,7]],"e":[[0,1,45,0,-45,6,[-463.02,-25,-463.02,-119]],[2,1,45,0,-45,-6,[-424.34,-169.16,-424.34,-131]]],"vp":[-570.0,-185.0,265.0,175.0]}} Sample output of weak port constraints. For both edges, source port constraints are associated with side {@link yfiles.layout.PortSide#EAST} + * while target port constraints are associated with side {@link yfiles.layout.PortSide#WEST}. Red rectangles indicate that edges + * can be connected to any point of these sides. Black rectangles represent the selected ports. {@graph {"ann":{"s":[90,30],"d":1},"styles":{"6":{"f":"#FF0000"},"7":{"f":"#000000"}},"n":[[-145,135.67],[30,35.67],[-138.02,-8.49],[-49.82,1.51,4,10,7],[28,45.67,4,10,7],[-57.36,145.67,4,10,7]],"e":[[0,1,[-35,150.67,-35,50.67]],[2,1,[-0.22,6.51,-0.22,50.67]]],"vp":[-145.0,-9.0,265.0,175.0]}} Sample output of strong port + * constraints. For both edges, source port constraints are associated with side {@link yfiles.layout.PortSide#EAST} while target + * port constraints are associated with side + * {@link yfiles.layout.PortSide#WEST}. Black rectangles indicate the exact points on the corresponding sides of the nodes to which + * edges can be connected. + *

+ *

+ * Information about {@link yfiles.layout.PortConstraint}s is held by {@link yfiles.algorithms.IDataProvider}s that are registered with the + * graph using keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} (to specify + * {@link yfiles.layout.PortConstraint}s for an edge on its source node) and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} + * (to specify {@link yfiles.layout.PortConstraint}s for an edge on its target node). + *

+ *

+ * Not all layout and routing algorithms are able to handle {@link yfiles.layout.PortConstraint}s. Major layout algorithms that + * obey them are {@link yfiles.hierarchic.HierarchicLayout}, {@link yfiles.tree.TreeLayout}, {@link yfiles.router.EdgeRouter}, {@link yfiles.router.ChannelEdgeRouter} + * and {@link yfiles.router.BusRouter}. + *

+ * @see yfiles.layout.PortConstraintKeys + * @class yfiles.layout.PortConstraint + */ + export interface PortConstraint extends Object{} + export class PortConstraint { + /** + * Creates a new {@link yfiles.layout.PortConstraint} that constrains the edge to connect to the given side of a node and that can + * be either strong or weak. + *

+ * If the {@link yfiles.layout.PortConstraint} is strong, the layout or routing algorithm should use the port coordinates of this + * constraint. + *

+ * @param {yfiles.layout.PortSide} side one of the default side specifiers + * @param {boolean} [strong=false] true if this {@link yfiles.layout.PortConstraint} is strong, false otherwise + * @returns {yfiles.layout.PortConstraint} a new {@link yfiles.layout.PortConstraint} instance + * @throws {Stubs.Exceptions.ArgumentError} if an unknown side is given + * @static + */ + static create(side:yfiles.layout.PortSide,strong?:boolean):yfiles.layout.PortConstraint; + /** + * Returns the source {@link yfiles.layout.PortConstraint} associated with the given edge. + *

+ * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about source {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * is used. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} e the edge + * @returns {yfiles.layout.PortConstraint} the source {@link yfiles.layout.PortConstraint} of the given edge or null if there is none + * @static + */ + static getSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; + /** + * Returns the target {@link yfiles.layout.PortConstraint} associated with the given edge. + *

+ * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about target {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} + * is used. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} e the edge + * @returns {yfiles.layout.PortConstraint} the target {@link yfiles.layout.PortConstraint} of the given edge or null if there is none + * @static + */ + static getTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; + /** + * Checks whether or not there exist source or target {@link yfiles.layout.PortConstraint}s associated with the given edge. + *

+ * To retrieve the {@link yfiles.algorithms.IDataProvider}s that hold information about source or target + * {@link yfiles.layout.PortConstraint}s, keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} + * are used. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} e the edge + * @returns {boolean} true if the edge has source or target {@link yfiles.layout.PortConstraint}s, false otherwise + * @static + */ + static hasPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; + /** + * Checks whether or not there exist source {@link yfiles.layout.PortConstraint}s associated with the given edge. + *

+ * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about source {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * is used. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} e the edge + * @returns {boolean} true if the edge has source {@link yfiles.layout.PortConstraint}s, false otherwise + * @static + */ + static hasSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; + /** + * Checks whether or not there exist target {@link yfiles.layout.PortConstraint}s associated with the given edge. + *

+ * To retrieve the {@link yfiles.algorithms.IDataProvider} that holds information about target {@link yfiles.layout.PortConstraint}s, key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} + * is used. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} e the edge + * @returns {boolean} true if the edge has target {@link yfiles.layout.PortConstraint}s, false otherwise + * @static + */ + static hasTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; + /** + * Gets whether or not this {@link yfiles.layout.PortConstraint} instance represents a strong constraint. + *

+ * A strong {@link yfiles.layout.PortConstraint} determines the exact coordinates where the edge path's end should be located. + *

+ * @type {boolean} + */ + strong:boolean; + /** + * Gets the side of the node to which an edge should connect. + * @type {yfiles.layout.PortSide} + */ + side:yfiles.layout.PortSide; + /** + * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#NORTH}. + * @type {boolean} + */ + atNorth:boolean; + /** + * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#SOUTH}. + * @type {boolean} + */ + atSouth:boolean; + /** + * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#EAST}. + * @type {boolean} + */ + atEast:boolean; + /** + * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#WEST}. + * @type {boolean} + */ + atWest:boolean; + /** + * Gets whether or not this {@link yfiles.layout.PortConstraint} instance is associated with side {@link yfiles.layout.PortSide#ANY}. + * @type {boolean} + */ + atAnySide:boolean; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.layout.PortConstraintConfigurator} provides the possibility to create + * {@link yfiles.layout.PortConstraint}s according to the initial connecting side of an edge. + * @class yfiles.layout.PortConstraintConfigurator + */ + export interface PortConstraintConfigurator extends Object{} + export class PortConstraintConfigurator { + /** + * Creates a new {@link yfiles.layout.PortConstraintConfigurator} instance. + * @constructor + */ + constructor(); + /** + * Creates a {@link yfiles.layout.PortConstraint} for the given edge. + *

+ * The side of the constraint is set up according to the current drawing of the edge within the given graph. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the edge + * @param {boolean} source true if a source {@link yfiles.layout.PortConstraint} for the given edge will be created, false for a target + * {@link yfiles.layout.PortConstraint} + * @param {boolean} strong true if a strong {@link yfiles.layout.PortConstraint} is created, false for a weak {@link yfiles.layout.PortConstraint} + * @returns {yfiles.layout.PortConstraint} the {@link yfiles.layout.PortConstraint} for the given edge whose side is retrieved from the initial drawing + */ + createPortConstraintFromSketch(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,source:boolean,strong:boolean):yfiles.layout.PortConstraint; + /** + * Creates {@link yfiles.layout.PortConstraint}s for some edges of the given graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IEdgeCursor} ec the {@link yfiles.algorithms.IEdgeCursor} that provides access to the edges for which to create {@link yfiles.layout.PortConstraint}s + * @param {yfiles.algorithms.IEdgeMap} spcMap the {@link yfiles.algorithms.IEdgeMap} that will be used for storing the source {@link yfiles.layout.PortConstraint}s of the edges + * @param {boolean} strongSP true if strong source {@link yfiles.layout.PortConstraint}s should be assigned, false otherwise + * @param {yfiles.algorithms.IEdgeMap} tpcMap the {@link yfiles.algorithms.IEdgeMap} that will be used for storing the target {@link yfiles.layout.PortConstraint}s of the edges + * @param {boolean} strongTP true if strong target {@link yfiles.layout.PortConstraint}s should be assigned, false otherwise + */ + createPortConstraintsFromSketch(graph:yfiles.layout.LayoutGraph,ec:yfiles.algorithms.IEdgeCursor,spcMap:yfiles.algorithms.IEdgeMap,strongSP:boolean,tpcMap:yfiles.algorithms.IEdgeMap,strongTP:boolean):void; + /** + * Creates weak {@link yfiles.layout.PortConstraint}s for all edges of the given graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IEdgeMap} spcMap the {@link yfiles.algorithms.IEdgeMap} that will be used for storing the source {@link yfiles.layout.PortConstraint}s of the edges + * @param {yfiles.algorithms.IEdgeMap} tpcMap the {@link yfiles.algorithms.IEdgeMap} that will be used for storing the target {@link yfiles.layout.PortConstraint}s of the edges + */ + createPortConstraintsFromSketch(graph:yfiles.layout.LayoutGraph,spcMap:yfiles.algorithms.IEdgeMap,tpcMap:yfiles.algorithms.IEdgeMap):void; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.PortConstraintKeys} are used for associating {@link yfiles.algorithms.IDataProvider DataProviders} that contain constraints for the edges of the + * input graph. + *

+ * These constraints can either be {@link yfiles.layout.PortConstraint}s or edge groups. + * {@link yfiles.layout.PortConstraint}s force the edges to start/end on specified sides of the node. They may also restrict ports + * of edges to certain coordinates. Edge groups will bundle edges at a common source or target. They will start at the same + * coordinates and may share parts of their edge routes. + *

+ *

+ * Layout algorithms that support {@link yfiles.layout.PortConstraint}s or edge groups will access the + * {@link yfiles.algorithms.IDataProvider}s using the provided keys. + *

+ * @class yfiles.layout.PortConstraintKeys + * @static + */ + export interface PortConstraintKeys extends Object{} + export class PortConstraintKeys { + /** + * Data provider key for providing source constraints for edges in the input graph + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static SOURCE_PORT_CONSTRAINT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for providing target constraints for edges in the input graph + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static TARGET_PORT_CONSTRAINT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for assigning source group information for edges of the input graph + *

+ * Edges sharing a source group identifier will share a common bus near the source or at a common source node if possible. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static SOURCE_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for assigning target group information for edges of the input graph + *

+ * Edges sharing a target group identifier will share a common bus near the target or at a common target node if possible. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static TARGET_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for assigning port group ids to the edges' source. + *

+ * All edges with the same port id at a node will share the same port location. However, they will be routed + * independently. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static SOURCE_PORT_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for assigning port group ids to the edges' target. + *

+ * All edges with the same port id at a node will share the same port location. However, they will be routed + * independently. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static TARGET_PORT_GROUP_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.PreferredPlacementDescriptor} provides placement information for automatic edge labeling. + *

+ * It provides several options that influence the label placement in generic labeling algorithms and layout algorithms that + * support integrated label placement. + *

+ *

+ * The preferred placement can describe multiple locations. For some options, like the {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along the edge}, it is + * possible to have a combination of the valid values. These values can be connected with a logical or-operation. + *

+ *

+ * The following options describe the preferred placement: + *

+ *
    + *
  • the placement along the edge
  • + *
  • the side of the edge
  • + *
  • the reference of the side
  • + *
  • the rotation angle of the label
  • + *
  • the reference for the rotation angle
  • + *
  • the rotation behavior for label on the right side of the edge
  • + *
  • the angle offset for label on the right side of the edge
  • + *
  • the distance between the label and its edge segment
  • + *
+ *

+ * The {@link yfiles.layout.PreferredPlacementDescriptor} will be immutable after {@link yfiles.layout.PreferredPlacementDescriptor#freeze} + * is called. + *

+ *

+ * A {@link yfiles.layout.PreferredPlacementDescriptor} must be set for each label and will be retrieved by the layout algorithms + * calling {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor}. + *

+ * @class yfiles.layout.PreferredPlacementDescriptor + */ + export interface PreferredPlacementDescriptor extends Object{} + export class PreferredPlacementDescriptor { + /** + * Creates a new {@link yfiles.layout.PreferredPlacementDescriptor} instance that copies the given descriptor. + * @param {yfiles.layout.PreferredPlacementDescriptor} descriptor the {@link yfiles.layout.PreferredPlacementDescriptor} that is copied + * @constructor + */ + constructor(descriptor:yfiles.layout.PreferredPlacementDescriptor); + /** + * Creates a new {@link yfiles.layout.PreferredPlacementDescriptor} instance with default settings. + * @constructor + */ + constructor(); + /** + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance is already {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen frozen}. + * @returns {Object} An instance of the same type as this instance. + */ + clone():Object; + /** + * Makes this {@link yfiles.layout.PreferredPlacementDescriptor} instance immutable. + *

+ * If this instance is immutable, all setter methods will throw an {@link Stubs.Exceptions.InvalidOperationError} when invoked. + *

+ * @see yfiles.layout.PreferredPlacementDescriptor#isFrozen + */ + freeze():void; + /** + * Returns whether or not this is an immutable instance of {@link yfiles.layout.PreferredPlacementDescriptor}. + *

+ * If this instance is immutable, all setter methods will throw an {@link Stubs.Exceptions.InvalidOperationError} when invoked. + *

+ * @returns {boolean} true if this instance is immutable, false otherwise + * @see yfiles.layout.PreferredPlacementDescriptor#freeze + */ + isFrozen():boolean; + /** + * 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 a combination of valid placements along the edge and valid sides of the edge + * @returns {yfiles.layout.PreferredPlacementDescriptor} an immutable descriptor instance for the specified placement + * @see yfiles.layout.PreferredPlacementDescriptor#isFrozen + * @see yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge + * @see yfiles.layout.PreferredPlacementDescriptor#sideOfEdge + * @static + */ + static newSharedInstance(placement:yfiles.layout.LabelPlacements):yfiles.layout.PreferredPlacementDescriptor; + /** + * Gets or sets the preferred placement along the edge. + * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @type {yfiles.layout.LabelPlacements} + */ + placeAlongEdge:yfiles.layout.LabelPlacements; + /** + * Gets or sets the preferred side of the edge. + * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @type {yfiles.layout.LabelPlacements} + */ + sideOfEdge:yfiles.layout.LabelPlacements; + /** + * Gets or sets how to interpret the preferred side as given by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge}. + * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @throws {Stubs.Exceptions.ArgumentError} if the specified side reference is invalid + * @type {yfiles.layout.LabelSideReferences} + */ + sideReference:yfiles.layout.LabelSideReferences; + /** + * Gets or sets the angle (in radians) for the label rotation. + *

+ * How this angle is applied depends on the {@link yfiles.layout.PreferredPlacementDescriptor#angleReference angle reference}, the {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide rotation} and the {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide offset} for labels on the right side of + * the edge. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @see yfiles.layout.PreferredPlacementDescriptor#angleReference + * @see yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide + * @see yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide + * @type {number} + */ + angle:number; + /** + * Gets or sets the reference of the angle given by {@link yfiles.layout.PreferredPlacementDescriptor#angle}. + * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not a valid angle reference + * @type {yfiles.layout.LabelAngleReferences} + */ + angleReference:yfiles.layout.LabelAngleReferences; + /** + * Gets or sets how the angle is applied to labels on the right side in respect of the labels of the left side of the + * edge. + * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not a valid angle rotation + * @type {yfiles.layout.LabelAngleOnRightSideRotations} + */ + angleRotationOnRightSide:yfiles.layout.LabelAngleOnRightSideRotations; + /** + * Gets or sets the angle offset for labels that are placed on the right side of the edge. + * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @throws {Stubs.Exceptions.ArgumentError} if the specified value is not valid angle offset + * @type {yfiles.layout.LabelAngleOnRightSideOffsets} + */ + angleOffsetOnRightSide:yfiles.layout.LabelAngleOnRightSideOffsets; + /** + * Gets or sets 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. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable} + * @throws {Stubs.Exceptions.ArgumentError} if the specified value is infinite or NaN + * @type {number} + */ + distanceToEdge:number; + /** + * Gets whether or not one of the preferred placement locations for this label is at source. + * @see yfiles.layout.LabelPlacements#AT_SOURCE + * @type {boolean} + */ + isAtSource:boolean; + /** + * Gets whether or not one of the preferred placement locations for this label is at center. + * @see yfiles.layout.LabelPlacements#AT_CENTER + * @type {boolean} + */ + isAtCenter:boolean; + /** + * Gets whether or not one of the preferred placements for this label is at target. + * @see yfiles.layout.LabelPlacements#AT_TARGET + * @type {boolean} + */ + isAtTarget:boolean; + /** + * Gets whether or not one of the preferred placements for this label is at the source port. + * @see yfiles.layout.LabelPlacements#AT_SOURCE_PORT + * @type {boolean} + */ + isAtSourcePort:boolean; + /** + * Gets whether or not one of the preferred placements for this label is at the target port. + * @see yfiles.layout.LabelPlacements#AT_TARGET_PORT + * @type {boolean} + */ + isAtTargetPort:boolean; + /** + * Gets whether or not one of the preferred sides for this label is left of the edge. + * @see yfiles.layout.LabelPlacements#LEFT_OF_EDGE + * @type {boolean} + */ + isLeftOfEdge:boolean; + /** + * Gets whether or not one of the preferred sides for this label is on the edge. + * @see yfiles.layout.LabelPlacements#ON_EDGE + * @type {boolean} + */ + isOnEdge:boolean; + /** + * Gets whether or not one of the preferred sides for this label is right of the edge. + * @see yfiles.layout.LabelPlacements#RIGHT_OF_EDGE + * @type {boolean} + */ + isRightOfEdge:boolean; + /** + * Gets whether or not one of the angle interpretations is absolute. + * @see yfiles.layout.LabelAngleReferences#ABSOLUTE + * @type {boolean} + */ + isAngleAbsolute:boolean; + /** + * Gets whether or not one of the angle interpretation is relative to the edge slope. + * @see yfiles.layout.LabelAngleReferences#RELATIVE_TO_EDGE_FLOW + * @type {boolean} + */ + isAngleRelativeToEdgeFlow:boolean; + /** + * Gets whether or not one of the angle interpretations is to rotate the angle of labels that are right of the edge + * co-rotating with the labels left of or centered on the edge, i.e., the angle of all labels is interpreted clockwise. + * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge + * @see yfiles.layout.LabelAngleOnRightSideRotations#CLOCKWISE + * @type {boolean} + */ + isAngleOnRightSideCoRotating:boolean; + /** + * Gets whether or not one of the angle interpretations is to rotate the angle of labels that are right of the edge + * counter-rotating with the labels left of or centered on the 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 yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge + * @see yfiles.layout.LabelAngleOnRightSideRotations#COUNTER_CLOCKWISE + * @type {boolean} + */ + isAngleOnRightSideCounterRotating:boolean; + /** + * Gets whether or not one of the angle interpretations is to add no angle offset to labels that are right of the edge. + * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge + * @see yfiles.layout.LabelAngleOnRightSideOffsets#NONE + * @type {boolean} + */ + isAngleOffsetOnRightSideZero:boolean; + /** + * Gets whether or not one of the angle interpretations is to add an angle offset of 180 degrees to labels that are right + * of the edge. + * @see yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge + * @see yfiles.layout.LabelAngleOnRightSideOffsets#SEMI + * @type {boolean} + */ + isAngleOffsetOnRightSide180:boolean; + /** + * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted relative to the edge flow. + * @see yfiles.layout.LabelSideReferences#RELATIVE_TO_EDGE_FLOW + * @type {boolean} + */ + isSideRelativeToEdgeFlow:boolean; + /** + * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted absolute, and on horizontal segments, labels with + * preferred side {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} are placed above the segment. + * @see yfiles.layout.LabelSideReferences#ABSOLUTE_WITH_LEFT_IN_NORTH + * @type {boolean} + */ + isSideAbsoluteWithLeftInNorth:boolean; + /** + * Gets whether or not the preferred side specified by {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge} is interpreted absolute, and on horizontal segments, labels with + * preferred side {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} are placed above the segment. + * @see yfiles.layout.LabelSideReferences#ABSOLUTE_WITH_RIGHT_IN_NORTH + * @type {boolean} + */ + isSideAbsoluteWithRightInNorth:boolean; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.layout.RemoveCollinearBendsStage} removes all collinear bends found in a graph. + *

+ * The algorithm traverses each edge path from source to target and removes for each triple of consecutive collinear bends + * the middle one. + *

+ *

+ * A collinear bend forms a straight line with its preceding bend and its subsequent bend. The angle between the connecting + * edge segments is either 0 or 180 degrees. + *

+ * @class yfiles.layout.RemoveCollinearBendsStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface RemoveCollinearBendsStage extends yfiles.layout.LayoutStageBase{} + export class RemoveCollinearBendsStage { + /** + * Creates a new {@link yfiles.layout.RemoveCollinearBendsStage} instance with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the scale that defines how accurate the algorithm is when it comes to comparing the coordinates of two + * bends. + *

+ * This value determines how the values of the coordinates are rounded. If rounded coordinates lead to a collinear bend, + * this bend will be removed. + *

+ *

+ * The scaling factor needs to be positive. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified factor is less than or equal to 0 + * @type {number} + */ + scale:number; + /** + * Gets or sets whether the algorithm removes only collinear bends which lie in the middle of their neighbors or all + * collinear bends. + *

+ * 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 degrees. + *

+ * @type {boolean} + */ + removeStraightOnly:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.ReverseEdgesStage} selectively reverses 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. + * @class yfiles.layout.ReverseEdgesStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface ReverseEdgesStage extends yfiles.layout.LayoutStageBase{} + export class ReverseEdgesStage { + /** + * Creates a new {@link yfiles.layout.ReverseEdgesStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @see yfiles.layout.LayoutStageBase#coreLayout + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * 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. + *

+ * @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 {@link yfiles.algorithms.IDataAcceptor} to mark edges for reversal + * @throws {Stubs.Exceptions.ArgumentError} if the specified root node is null or does not belong to the specified graph + * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY + * @static + */ + static findReversedTreeEdges(graph:yfiles.layout.LayoutGraph,root:yfiles.algorithms.Node,reversedEdges:yfiles.algorithms.IDataAcceptor):void; + /** + * Reverses the specified edge in the specified graph. + *

+ * The layout of the specified edge is reversed as specified in + * {@link yfiles.layout.LayoutGraphUtilities#reverseEdgeLayout}. Moreover, the positions of all labels associated with 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 + * @see yfiles.layout.LayoutGraphUtilities#reverseEdgeLayout + */ + reverseEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Reverses selected edges in the specified graph. + *

+ * Selected edges are marked in a {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY}. + *

+ *

+ * Implementation detail: This method calls {@link yfiles.layout.ReverseEdgesStage#reverseEdge} in order to reverse a selected edge. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph in which to reverse edges. + * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY + * @see yfiles.layout.ReverseEdgesStage#reverseEdge + */ + reverseEdges(graph:yfiles.layout.LayoutGraph):void; + /** + * Data provider key for selecting edges for reversal + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.SelfLoopRouter} routes the self-loops (reflexive edges) of a graph. + *

+ * Layout Style The nodes and normal edges are arranged by the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. This layout algorithm only handles the paths of self-loops. + *

+ *

+ * Self-loops are routed either {@link yfiles.layout.SelfLoopStyle#ORTHOGONAL orthogonal} or with {@link yfiles.layout.SelfLoopStyle#ROUNDED rounded} corners. The layout algorithm places the self-loops in the least + * crowded quadrant around a node. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[100,100],[100,0],[0,100],[0,0]],"e":[[0,0,7.5,15,15,7.5,[122.5,145,145,145,145,122.5]],[0,1,5,-15,5,15],[1,1,10,-15,15,-10,[125,-15,145,-15,145,5]],[1,1,5,-15,15,-5,[120,-20,150,-20,150,10]],[1,0,-5,15,-5,-15],[0,2,-15,5,15,5],[2,2,-10,15,-15,10,[5,145,-15,145,-15,125]],[2,2,-5,15,-15,5,[10,150,-20,150,-20,120]],[2,0,15,-5,-15,-5],[1,3,-15,5,15,5],[2,3,5,-15,5,15],[3,3,-7.5,-15,-15,-7.5,[7.5,-15,-15,-15,-15,7.5]],[3,1,15,-5,-15,-5],[3,2,-5,15,-5,-15]],"vp":[-20.0,-20.0,170.0,170.0]}} + *

+ *

+ * Small graph with self-loops + *

+ *

+ * Concept Self-loops are handled in four steps: + *

+ *
    + *
  1. Remove all self-loops of the input graph
  2. + *
  3. Invoke the core layout algorithm on the now self-loops free graph
  4. + *
  5. Reinsert all formerly removed self-loops
  6. + *
  7. Route the self-loops of the input graph
  8. + *
+ *

+ * Features + *

+ *

+ * {@link yfiles.layout.SelfLoopRouter} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} which cannot + * handle self-loops. Then it will hide the self-loops from this {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} and take over the routing of them. + *
+ * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.layout.SelfLoopRouter} can work alone. It will route only the self-loops + * and keep the remaining graph unchanged. + *

+ *

+ * When all self-loops already have a suitable layout, this layout algorithm can {@link yfiles.layout.SelfLoopRouter#keepAllSelfLoopRoutes keep the self-loop paths}. It will just + * hide the self-loops before invoking the core layout algorithm, such that they are not altered by it. + *
+ * To only exclude some self-loops from routing, a {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.layout.SelfLoopRouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY} + * can be used for marking those self-loops. + *

+ * @see yfiles.layout.MultiStageLayout + * @class yfiles.layout.SelfLoopRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface SelfLoopRouter extends yfiles.layout.LayoutStageBase{} + export class SelfLoopRouter { + /** + * Creates a new {@link yfiles.layout.SelfLoopRouter} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Calculates the routes of the self-loops in the given graph. + *

+ * This method will only change the routes of self-loops that are not marked to be {@link yfiles.layout.SelfLoopRouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY kept}. + *

+ *

+ * This method is called by {@link yfiles.layout.SelfLoopRouter#applyLayout} after the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} has arranged the graph + * and all self-loops have been reinserted into the graph. It may be overridden to introduce custom self-loop styles. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @protected + */ + layoutSelfLoops(graph:yfiles.layout.LayoutGraph):void; + /** + * Data provider key for determining which self-loops should keep their current path + *

+ * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all self-loops will be routed. + *

+ * @see yfiles.layout.SelfLoopRouter#keepAllSelfLoopRoutes + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static KEEP_SELF_LOOP_LAYOUT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the number of points that are used for rounding the corners of the self-loops. + *

+ * For rounded corners, the number of points should be at least + * 2. All smaller values will produce one bend and, therefore, an orthogonal path. + *

+ *

+ * The number of points for a corner must be at least 1. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified point count is less than 1 + * @see yfiles.layout.SelfLoopRouter#layoutStyle + * @see yfiles.layout.SelfLoopStyle#ROUNDED + * @type {number} + */ + cornerApproximationPointsCount:number; + /** + * Gets or sets the distance between two self-loops incident to the same node. + *

+ * The distance needs to be a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @see yfiles.layout.SelfLoopStyle#ROUNDED + * @type {number} + */ + lineDistance:number; + /** + * Gets or sets whether or not the algorithm chooses the side of the self-loop depending on the incident edges. + *

+ * If this option is enabled, self-loops 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, self-loops are always placed at the upper left corner + * of the corresponding node. + *

+ * @type {boolean} + */ + smartSelfLoopPlacement:boolean; + /** + * Gets or sets the layout style of the self-loops. + * @throws {Stubs.Exceptions.ArgumentError} if the specified style is unknown + * @type {yfiles.layout.SelfLoopStyle} + */ + layoutStyle:yfiles.layout.SelfLoopStyle; + /** + * Gets or sets whether or not this algorithm should keep all self-loop routes. + *

+ * When enabled, no self-loop will be routed, instead the existing self-loop layout will be moved with its node. + *

+ * @type {boolean} + */ + keepAllSelfLoopRoutes:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.SequentialLayout} allows for chaining multiple {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. + *

+ * The {@link yfiles.layout.ILayoutAlgorithm layout algorithms} are invoked one after the other in the order in which they were + * {@link yfiles.layout.SequentialLayout#appendLayout added to the chain}. They all run independently of each other, i.e., they only influence each other by the changed input + * graph. Hence, the sequence determines the result. + *

+ *

+ * One possible application would be to bundle several {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and pass a single {@link yfiles.layout.ILayoutAlgorithm} + * instance to a {@link yfiles.layout.BufferedLayout}. + *

+ * @class yfiles.layout.SequentialLayout + * @implements {yfiles.layout.ILayoutAlgorithm} + */ + export interface SequentialLayout extends Object,yfiles.layout.ILayoutAlgorithm{} + export class SequentialLayout { + /** + * Creates a new {@link yfiles.layout.SequentialLayout} instance with an empty chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. + * @constructor + */ + constructor(); + /** + * Appends the given {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to the end of the chain. + * @param {yfiles.layout.ILayoutAlgorithm} layouter the {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to append + */ + appendLayout(layouter:yfiles.layout.ILayoutAlgorithm):void; + /** + * Appends the specified list of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} to the end of the chain. + * @param {yfiles.collections.ICollection.} layouters the list of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} to append + */ + appendLayouts(layouters:yfiles.collections.ICollection):void; + /** + * Executes all {@link yfiles.layout.ILayoutAlgorithm layout algorithms} in the chain, one after the other. + *

+ * The order of the layout algorithms is defined by the order in which they were appended. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Clears the current chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms} and therefore removes all layout algorithms. + */ + removeAll():void; + /** + * Gets or sets the chain of {@link yfiles.layout.ILayoutAlgorithm layout algorithms}. + * @see yfiles.layout.SequentialLayout#appendLayout + * @see yfiles.layout.SequentialLayout#appendLayouts + * @type {yfiles.collections.IList.} + */ + layouts:yfiles.collections.IList; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.SimpleProfitModel} implements the ranking for edge and node labels. + *

+ * In this implementation node label positions have no ranking, the profit for all candidates is 1. + *

+ *

+ * The ranking of edge label positions depends on the locations described in the {@link yfiles.layout.PreferredPlacementDescriptor} + * associated with an edge. + *

+ * @class yfiles.layout.SimpleProfitModel + * @implements {yfiles.layout.IProfitModel} + */ + export interface SimpleProfitModel extends Object,yfiles.layout.IProfitModel{} + export class SimpleProfitModel { + /** + * Creates a new instance of {@link yfiles.layout.SimpleProfitModel}. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.layout.LabelCandidate} candidate + * @returns {number} + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.SliderEdgeLabelLayoutModel} allows placement of labels at a set of continuous rotated positions along both + * sides of an edge or directly on the edge path. + *

+ * It is possible to specify distance values that control the distance between label and edge and between label and nodes. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1,"lblB":1},"n":[[14,10],[14,310],[184,10],[184,310],[354,10],[354,310]],"e":[[0,1,[],[[10.59,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[10.59,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]],[2,3,[],[[157.19,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[204,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[157.19,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]],[4,5,[],[[327.19,58.22,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,281.41,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,253.51,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,225.61,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,197.72,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,141.92,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,169.82,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,114.02,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"],[327.19,86.12,33.36,18.7,0.7071067811865477,-0.7071067811865474,"Label"]]]],"vp":[10.0,10.0,374.0,330.0]}} + *

+ *

+ * {@link yfiles.layout.SliderMode#CENTER} mode on the left, {@link yfiles.layout.SliderMode#SIDE} mode in the middle and {@link yfiles.layout.SliderMode#SINGLE_SIDE} + * on the right + *

+ * @class yfiles.layout.SliderEdgeLabelLayoutModel + * @implements {yfiles.layout.IEdgeLabelLayoutModel} + */ + export interface SliderEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelLayoutModel{} + export class SliderEdgeLabelLayoutModel { + /** + * Creates a new instance of {@link yfiles.layout.SliderEdgeLabelLayoutModel} with the given mode. + * @param {yfiles.layout.SliderMode} mode the slider mode + * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode + * @constructor + */ + constructor(mode:yfiles.layout.SliderMode); + /** + * + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds + * @param {yfiles.layout.IEdgeLayout} edgeLayout + * @param {yfiles.layout.INodeLayout} sourceNode + * @param {yfiles.layout.INodeLayout} targetNode + * @returns {Object} + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + /** + * Returns all {@link yfiles.layout.EdgeLabelCandidate}s that describe valid label positions within this model. + *

+ * The number of candidates and their respective locations are computed depending on the geometries of both label and + * edge. + *

+ * @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 + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.layout.EdgeLabelCandidate} instances + */ + getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * + * @param {yfiles.algorithms.YDimension} labelSize + * @param {yfiles.layout.IEdgeLayout} edgeLayout + * @param {yfiles.layout.INodeLayout} sourceNode + * @param {yfiles.layout.INodeLayout} targetNode + * @param {Object} para + * @returns {yfiles.algorithms.YOrientedRectangle} + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,para:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Gets the model's slider mode which determines whether the label slides {@link yfiles.layout.SliderMode#CENTER on the edge}, {@link yfiles.layout.SliderMode#SIDE along both sides of the edge} or + * {@link yfiles.layout.SliderMode#SINGLE_SIDE along one side of the edge}. + * @type {yfiles.layout.SliderMode} + */ + mode:yfiles.layout.SliderMode; + /** + * Gets or sets whether or not the distance to the edge is interpreted relative to the edge's path. + *

+ * If enabled, the label is placed to the left of the edge segment (relative to the segment direction) if the given + * distance is less than 0 and to the right of the edge segment if the given distance is greater than 0. + *

+ *

+ * If disabled, the label is placed below the edge segment (in geometric sense) if the distance is less than 0 and above + * the edge segment if the distance is greater than 0. + *

+ * @see yfiles.layout.SliderEdgeLabelLayoutModel#distance + * @type {boolean} + */ + distanceRelativeToEdge:boolean; + /** + * Gets or sets the distance between the label's box and the edge's path. + * @see yfiles.layout.SliderEdgeLabelLayoutModel#distanceRelativeToEdge + * @type {number} + */ + distance:number; + /** + * Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference + * edge segment. + * @type {boolean} + */ + autoRotationEnabled:boolean; + /** + * Gets or sets whether or not edge labels get flipped if they would be upside down in their current position. + * @type {boolean} + */ + autoFlipping:boolean; + /** + * Gets or sets the angle (measured in radians) of the label model. + *

+ * The angle is applied in clockwise direction. + *

+ * @type {number} + */ + angle:number; + /** + * Gets a model parameter that encodes the default position of this model's allowed edge label positions. + *

+ * This parameter can be passed to {@link yfiles.layout.SliderEdgeLabelLayoutModel#getLabelPlacement} to retrieve the corresponding + * label box. + *

+ *

+ * The default positions for the {@link yfiles.layout.SliderEdgeLabelLayoutModel#mode slider modes} are relative to the first edge segment, either at the beginning of the + * segment ({@link yfiles.layout.SliderMode#SIDE} or + * {@link yfiles.layout.SliderMode#SINGLE_SIDE}) or at its middle ({@link yfiles.layout.SliderMode#CENTER}). + *

+ * @see yfiles.layout.SliderEdgeLabelLayoutModel#mode + * @type {Object} + */ + defaultParameter:Object; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.SubgraphLayout} is a {@link yfiles.layout.ILayoutStage} that filters out all graph elements that are not part of + * a specific subgraph. + *

+ * The nodes that induce this subgraph are marked using a {@link yfiles.algorithms.IDataProvider} registered with a {@link yfiles.layout.SubgraphLayout#affectedNodesDpKey specific key}. + * They will be arranged by the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * @class yfiles.layout.SubgraphLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface SubgraphLayout extends yfiles.layout.LayoutStageBase{} + export class SubgraphLayout { + /** + * Creates a new {@link yfiles.layout.SubgraphLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which marks the nodes that induce the subgraph to be + * arranged. + * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @type {Object} + */ + affectedNodesDpKey:Object; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.SwimlaneRepresentative SwimlaneRepresentative} represents the position and arrangement mode for a swimlane. + * @class yfiles.layout.SwimlaneRepresentative + */ + export interface SwimlaneRepresentative extends Object{} + export class SwimlaneRepresentative { + /** + * Creates a new {@link yfiles.layout.SwimlaneRepresentative} instance. + * @param {number} swimlanePos denotes the current position of the represented swimlane + * @param {boolean} allowRearrangement true if the represented swimlane may be {@link yfiles.layout.SwimlaneRepresentative#allowRearrangement rearranged}, false otherwise + * @constructor + */ + constructor(swimlanePos:number,allowRearrangement:boolean); + /** + * Gets or sets the current position of the represented swimlane. + *

+ * The swimlane positions are described by a zero-based index and must not be negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the position is smaller than 0 + * @type {number} + */ + swimlanePos:number; + /** + * Gets or sets whether or not the represented swimlane can be rearranged. + *

+ * For all swimlanes with disabled rearrangement, the relative ordering given by {@link yfiles.layout.SwimlaneRepresentative#swimlanePos} is preserved. The other swimlanes may be + * rearranged. + *

+ * @type {boolean} + */ + allowRearrangement:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.layout.Swimlanes} provides helper classes and methods to handle swimlanes. + *

+ * It is used by {@link yfiles.hierarchic.HierarchicLayout} to arrange the nodes in lanes. + *

+ * @class yfiles.layout.Swimlanes + * @static + */ + export interface Swimlanes extends Object{} + export class Swimlanes { + /** + * Calculates an ordering of the swimlanes considering the specified ordering mode. + *

+ * Depending on the swimlane mode, the ordering will try to reduce: + *

+ *
    + *
  1. the number of swimlanes traversed by edges
  2. + *
  3. the number of swimlanes spanned by {@link yfiles.layout.GroupingSupport#isGroupNode group nodes}
  4. + *
+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} node2Swimlane the assignment of nodes to swimlanes + * @param {number} iterations the number of iterations performed by the heuristic. + * @param {yfiles.layout.SwimlanesMode} mode one of the valid swimlane ordering mode specifier + * @see yfiles.layout.SwimlaneRepresentative + * @see yfiles.layout.GroupingSupport + * @static + */ + static arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider,iterations:number,mode:yfiles.layout.SwimlanesMode):void; + /** + * Calculates an ordering of the swimlanes. + *

+ * The ordering will try to reduce: + *

+ *
    + *
  1. the number of swimlanes traversed by edges
  2. + *
  3. the number of swimlanes spanned by {@link yfiles.layout.GroupingSupport#isGroupNode group nodes}
  4. + *
+ * @param {yfiles.algorithms.Graph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} node2Swimlane the assignment of nodes to swimlanes + * @see yfiles.layout.SwimlaneRepresentative + * @see yfiles.layout.GroupingSupport + * @static + */ + static arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider):void; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.ILayoutStage layout stage} that can handle fixed nodes in hierarchically grouped graphs. + *

+ * This stage guarantees that a {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} will maintain + * 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.FixGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY}) with normal nodes of the same size while the content of the + * groups is removed from the graph during layout. + *

+ *

+ * The nodes are used as placeholders and are responsible for keeping the relations to the remaining graph elements. Edges + * that originate from the outside of the group node and terminate in its interior (inter-edges) are redirected such that + * they connect to the node that replaces the group. + *

+ *

+ * After the layout process, 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.FixGroupLayoutStage#interEdgeRouter}). + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[759.46,-86.88,290.54,283.26,2],[982.99,109.5,6],[796.47,109.5,6],[854.11,-67.88,6],[925.35,-67.88,6],[1005,41.75,6],[925.35,151.37,6],[796.47,-26.01,6],[774.46,41.75,6],[982.99,-26.01,6],[854.11,151.37,6],[123.31,-231.69,216.69,224.72,2],[212.57,-132.33,6],[263.97,-67.88,6],[263.97,-196.77,6],[138.31,-168.09,6],[194.23,-51.97,6],[295,-132.33,6],[138.31,-96.56,6],[194.23,-212.69,6],[265,40.5,430,339,2],[465,234.5,45,30],[380,59.5,45,30],[465,284.5,45,30],[380,109.5,45,30],[465,84.5,45,30],[465,134.5,45,30],[550,209.5,45,30],[380,309.5,45,30],[550,259.5,45,30],[380,259.5,45,30],[465,334.5,45,30],[550,134.5,45,30],[635,134.5,45,30],[465,184.5,45,30],[280,184.5,60,30]],"e":[[9,4],[3,7],[8,7],[4,3],[2,8],[10,2],[6,10],[1,6],[5,1],[2,3],[2,9],[2,1],[5,9],[12,18],[12,13],[12,14],[12,15],[12,19],[12,17],[12,16],[30,21],[21,29],[21,27],[35,22],[30,23],[35,24],[24,26],[24,25],[26,32],[35,28],[35,30],[30,31],[30,34],[32,33],[33,2],[33,8],[33,7],[35,17]],"vp":[123.0,-232.0,927.0,612.0]}} Initial graph. Nodes inside groups have to remain at their relative positions. {@graph {"ann":{"s":[30,30],"d":1},"styles":{"6":{"c":1}},"n":[[754.73,68.37,290.54,283.26,2],[978.26,264.75,6],[791.74,264.75,6],[849.38,87.37,6],[920.62,87.37,6],[1000.27,197,6],[920.62,306.63,6],[791.74,129.25,6],[769.73,197,6],[978.26,129.25,6],[849.38,306.63,6],[-18.35,97.64,216.69,224.72,2],[70.92,197,6],[122.31,261.44,6],[122.31,132.56,6],[-3.35,161.24,6],[52.58,277.36,6],[153.35,197,6],[-3.35,232.76,6],[52.58,116.64,6],[265,40.5,430,339,2],[465,234.5,45,30],[380,59.5,45,30],[465,284.5,45,30],[380,109.5,45,30],[465,84.5,45,30],[465,134.5,45,30],[550,209.5,45,30],[380,309.5,45,30],[550,259.5,45,30],[380,259.5,45,30],[465,334.5,45,30],[550,134.5,45,30],[635,134.5,45,30],[465,184.5,45,30],[280,184.5,60,30]],"e":[[9,4],[3,7],[8,7],[4,3],[2,8],[10,2],[6,10],[1,6],[5,1],[2,3],[2,9],[2,1],[5,9],[12,18],[12,13],[12,14],[12,15],[12,19],[12,17],[12,16],[30,21],[21,29],[21,27],[35,22],[30,23],[35,24],[24,26],[24,25],[26,32],[35,28],[35,30],[30,31],[30,34],[32,33],[33,8,22.5,6,-2.49,-14.78,[782.24,155.5]],[33,7,22.5,-6,-15,-0.75],[33,2,0,15,-15,0,[657.5,279.75]],[35,17,-30,6.25,13.66,-6.25]],"vp":[-19.0,40.0,1065.0,340.0]}} Example after using {@link yfiles.layout.FixGroupLayoutStage} + * with {@link yfiles.orthogonal.OrthogonalLayout}. Nodes inside groups did not change relative positions. + *

+ * @class yfiles.layout.FixGroupLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface FixGroupLayoutStage extends yfiles.layout.LayoutStageBase{} + export class FixGroupLayoutStage { + /** + * Creates a new instance of {@link yfiles.layout.FixGroupLayoutStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The core layout algorithm. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Data provider key for selecting group nodes whose contents should keep their relative positions. + *

+ * A group node is considered selected in this context, if the corresponding {@link yfiles.algorithms.IDataProvider} returns true for the + * group node or any of its ancestor (group) nodes. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FIXED_GROUP_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the inter-edge routing style used by this layout stage. + * @throws {Stubs.Exceptions.ArgumentError} if the given routing style is unknown + * @type {yfiles.layout.InterEdgeRoutingStyle} + */ + interEdgeRoutingStyle:yfiles.layout.InterEdgeRoutingStyle; + /** + * Gets or sets the edge routing algorithm that is applied to route the inter-edges. + *

+ * If no routing algorithm is set, a new instance of {@link yfiles.layout.CompositeLayoutStage} associated with a {@link yfiles.layout.HideGroupsStage} + * and an {@link yfiles.router.EdgeRouter} will be used. + *

+ * @type {yfiles.layout.ILayoutAlgorithm} + */ + interEdgeRouter:yfiles.layout.ILayoutAlgorithm; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.IPartitionFinder} is responsible for partitioning the input graph. + * @interface + */ + export interface IPartitionFinder extends Object{ + /** + * Returns a partition ID for each node of an input graph. + *

+ * Nodes that share a common partition ID are considered to belong to the same partition. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.INodeMap} partitionIDMap the map that is filled with the resulting partition IDs + * @abstract + */ + findPartitions(graph:yfiles.layout.LayoutGraph,partitionIDMap:yfiles.algorithms.INodeMap):void; + } + var IPartitionFinder:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.layout.IPartitionPlacer} is responsible for arranging the graph partitions. + *

+ * Arranging a graph partition usually involves applying a coordinate translation to all elements that belong to the + * partition in order to generate a non-overlapping node arrangement. + *

+ * @interface + */ + export interface IPartitionPlacer extends Object{ + /** + * Arranges the graph while taking partition IDs and inter-edge information into account. + *

+ * Edges which connect nodes that belong to two different partitions are called inter-edges + *

+ * @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 the map which marks inter-edges + * @abstract + */ + placePartitions(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + } + var IPartitionPlacer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.layout.PartitionLayout} provides a framework for layouts that are based on a divide and conquer approach. + *

+ * Concept The approach can be subdivided into four stages: + *

+ *
    + *
  1. The input graph is partitioned into smaller units. Implementations of this phase can be set using method {@link yfiles.layout.PartitionLayout#partitionFinder}.
  2. + *
  3. Optionally, the layout algorithm arranges each partition. Implementations of this phase can be set using method {@link yfiles.layout.LayoutStageBase#coreLayout}.
  4. + *
  5. + * The graph partitions are arranged next to each other keeping their layout. Implementations of this phase can be set + * using method {@link yfiles.layout.PartitionLayout#partitionPlacer}. + *
  6. + *
  7. + * Edges that connect nodes in different graph partitions will be routed. Implementations of this phase can be set using + * method {@link yfiles.layout.PartitionLayout#interEdgeRouter} + *
  8. + *
+ * @class yfiles.layout.PartitionLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface PartitionLayout extends yfiles.layout.LayoutStageBase{} + export class PartitionLayout { + /** + * Creates a new {@link yfiles.layout.PartitionLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Creates a {@link yfiles.layout.IPartitionPlacer} that uses {@link yfiles.layout.ComponentLayout} to place the partitions. + * @param {yfiles.layout.ComponentLayout} [componentLayout=null] An optional {@link yfiles.layout.ComponentLayout} to use. + * @returns {yfiles.layout.IPartitionPlacer} + * @static + */ + static createComponentPartitionPlacer(componentLayout?:yfiles.layout.ComponentLayout):yfiles.layout.IPartitionPlacer; + /** + * Creates a {@link yfiles.layout.IPartitionFinder} that uses {@link yfiles.algorithms.Groups#edgeBetweennessClustering} as strategy for + * finding graph partitions. + * @param {number} [minimumPartitionCount=0] The minimum number of partitions the result should have. + * @param {number} [maximumPartitionCount=0x7FFFFFFF] The maximum number of partitions the result should have. + * @returns {yfiles.layout.IPartitionFinder} + * @static + */ + static createEdgeBetweennessPartitionFinder(minimumPartitionCount?:number,maximumPartitionCount?:number):yfiles.layout.IPartitionFinder; + /** + * Creates a {@link yfiles.layout.IPartitionFinder} that uses {@link yfiles.algorithms.Groups#edgeBetweennessClustering} as strategy for + * finding graph partitions. + * @param {Object} options The parameters to pass. + * @param {number} [options.minimumPartitionCount=0] The minimum number of partitions the result should have. + * @param {number} [options.maximumPartitionCount=0x7FFFFFFF] The maximum number of partitions the result should have. + * @returns {yfiles.layout.IPartitionFinder} + * @static + */ + static createEdgeBetweennessPartitionFinder(options:{minimumPartitionCount?:number,maximumPartitionCount?:number}):yfiles.layout.IPartitionFinder; + /** + * Gets or sets the {@link yfiles.layout.IPartitionFinder} instance that is responsible for partitioning the input graph. + * @type {yfiles.layout.IPartitionFinder} + */ + partitionFinder:yfiles.layout.IPartitionFinder; + /** + * Gets or sets the {@link yfiles.layout.IPartitionPlacer} instance that is responsible for arranging the graph partitions. + * @type {yfiles.layout.IPartitionPlacer} + */ + partitionPlacer:yfiles.layout.IPartitionPlacer; + /** + * Gets or sets the IInterEdgeRouter instance that is responsible for inter-edge routing. + * @type {yfiles.layout.IPartitionInterEdgeRouter} + */ + interEdgeRouter:yfiles.layout.IPartitionInterEdgeRouter; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.layout.PortPlacementStage} assigns edges to the ports specified by {@link yfiles.layout.PortConstraint}s or + * {@link yfiles.layout.PortCandidate}s after calling the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * It can be used for adjusting ports for layout algorithms that cannot handle {@link yfiles.layout.PortConstraint}s. + *

+ *

+ * If {@link yfiles.layout.PortCandidate}s are assigned for edges and nodes, this stage tries to match them. When there is no + * match, the {@link yfiles.layout.PortCandidate} with the lowest costs specified for the edge is chosen. While + * {@link yfiles.layout.PortConstraint}s are also matched to + * {@link yfiles.layout.PortCandidate}s at nodes and edges, it is not recommended to mix them because they belong to different + * concepts. + *

+ *

+ * Furthermore, option {@link yfiles.layout.PortPlacementStage#pathCorrection} allows to specify whether the edge path should be corrected after correcting a port. + *

+ *

+ * It is recommended that the {@link yfiles.layout.PortPlacementStage} is prepended to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} in order to be + * able to process all the edges and especially, self-loops and parallel edges. Note that edges that might be hidden by + * other {@link yfiles.layout.ILayoutStage}s cannot be handled by {@link yfiles.layout.PortPlacementStage}. + *

+ * @see yfiles.layout.PortConstraint + * @see yfiles.layout.PortCandidate + * @see yfiles.layout.PortCandidateSet + * @see yfiles.layout.PortPlacementStage#pathCorrection + * @class yfiles.layout.PortPlacementStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface PortPlacementStage extends yfiles.layout.LayoutStageBase{} + export class PortPlacementStage { + /** + * Creates a new {@link yfiles.layout.PortPlacementStage} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Gets or sets whether or not this {@link yfiles.layout.ILayoutStage} 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.LayoutStageBase#coreLayout core layout algorithm}. If this feature is disabled, only the ports are moved which may be more suitable for initially + * straight edges. + *

+ * @type {boolean} + */ + pathCorrection:boolean; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.layout.ComponentLayout}. + * @class yfiles.layout.ComponentLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface ComponentLayoutData extends yfiles.layout.LayoutData{} + export class ComponentLayoutData { + constructor(); + /** + * Gets or sets a collection of nodes that determine the components that shall be laid out. + *

+ * Note that components will be laid out if and only if at least one of the nodes is in this collection. + *

+ * @see yfiles.layout.ComponentLayout#AFFECTED_COMPONENTS_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedComponents:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping from nodes to their component comparable that is used to sort the components. + * @see yfiles.layout.ComponentLayout#COMPONENT_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + componentIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + /** + * Combines several {@link yfiles.layout.LayoutData} instances. + *

+ * This is especially useful if several layouts are run at once, for example a general layout and a subsequent edge + * routing. + *

+ * @class yfiles.layout.CompositeLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface CompositeLayoutData extends yfiles.layout.LayoutData{} + export class CompositeLayoutData { + constructor(); + /** + * Gets or sets a collection of composed layout data objects. + * @type {yfiles.collections.ICollection.} + */ + items:yfiles.collections.ICollection; + static $class:yfiles.lang.Class; + } + /** + * Provides different ways to define a mapping from items to values that takes a context object into consideration, too. + *

+ * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties {@link yfiles.layout.ContextItemMapping.#contextDelegate}, {@link yfiles.layout.ItemMapping.#delegate}, + * {@link yfiles.layout.ItemMapping.#mapper}, and {@link yfiles.layout.ItemMapping.#constant} should be set on each instance. + *

+ *

+ * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. + *

+ * Type parameter TItem: The type of the items that are mapped. + * Type parameter TValue: The type of the values the items are mapped to. + * Type parameter TContext: The type of the context passed to the {@link yfiles.layout.ContextItemMapping.#contextDelegate} + * @class yfiles.layout.ContextItemMapping. + * @extends {yfiles.layout.ItemMapping.} + * @template TItem,TValue,TContext + */ + export interface ContextItemMapping extends yfiles.layout.ItemMapping{} + export class ContextItemMapping { + constructor(); + /** + * Provides a mapper mapping the items to values. + * @param {yfiles.layout.LayoutGraphAdapter} adapter The graph adapter the mapper shall be provided for. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout using the mapper. + * @param {TContext} context The context object passed to the {@link yfiles.layout.ContextItemMapping.#contextDelegate}. + * @returns {yfiles.collections.IMapper.} A mapper mapping the items to values. + */ + provideMapperForContext(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm,context:TContext):yfiles.collections.IMapper; + /** + * Gets or sets a delegate from the items and a context object to the values. + * @type {function(TItem, TContext): TValue} + */ + contextDelegate:(arg1:TItem,arg2:TContext)=>TValue; + static $class:yfiles.lang.Class; + } + /** + * Wraps an {@link yfiles.collections.IMapper.} into an {@link yfiles.algorithms.IDataProvider}. + *

+ * This class is used by {@link yfiles.layout.LayoutExecutor}, {@link yfiles.layout.LayoutGraphAdapter}, and {@link yfiles.layout.YGraphAdapter} to + * convert an {@link yfiles.graph.IGraph} into a corresponding + * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this + * class usually doesn't need to be used explicitly. + *

+ * Type parameter TKey: The type of the keys. + * Type parameter TValue: The type of the values. + * @class yfiles.layout.DataProviderAdapter. + * @implements {yfiles.algorithms.IDataProvider} + * @template TKey,TValue + */ + export interface DataProviderAdapter extends Object,yfiles.algorithms.IDataProvider{} + export class DataProviderAdapter { + /** + * Creates a new instance that adapts the provided mapper instance. + * @param {yfiles.lang.Class} keyType The type of the keys. + * @param {yfiles.collections.IMapper.} mapper The mapper to adapt. + * @constructor + */ + constructor(keyType:yfiles.lang.Class,mapper:yfiles.collections.IMapper); + /** + * + * @param {Object} dataHolder + * @returns {Object} + */ + get(dataHolder:Object):Object; + /** + * + * @param {Object} dataHolder + * @returns {boolean} + */ + getBoolean(dataHolder:Object):boolean; + /** + * + * @param {Object} dataHolder + * @returns {number} + */ + getInt(dataHolder:Object):number; + /** + * + * @param {Object} dataHolder + * @returns {number} + */ + getNumber(dataHolder:Object):number; + static $class:yfiles.lang.Class; + } + /** + * An adapter implementation that wraps an {@link yfiles.collections.IMapper.} to an {@link yfiles.algorithms.IDataMap}. + * Type parameter K: The type of the key for the mapper. + * Type parameter V: The type of the value for the mapper. + * @see yfiles.layout.DataProviderAdapter. + * @class yfiles.layout.DataMapAdapter. + * @extends {yfiles.layout.DataProviderAdapter.} + * @implements {yfiles.algorithms.IDataMap} + * @template K,V + */ + export interface DataMapAdapter extends yfiles.layout.DataProviderAdapter,yfiles.algorithms.IDataMap{} + export class DataMapAdapter { + /** + * Initializes a new instance of the {@link yfiles.layout.DataMapAdapter.} class. + * @param {yfiles.lang.Class} keyType1 The type of the key for the mapper. + * @param {yfiles.lang.Class} valueType The type of the value for the mapper. + * @param {yfiles.collections.IMapper.} mapper The mapper to adapt. + * @constructor + */ + constructor(keyType1:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper); + /** + * + * @param {Object} dataHolder + * @param {Object} value + */ + set(dataHolder:Object,value:Object):void; + /** + * + * @param {Object} dataHolder + * @param {boolean} value + */ + setBoolean(dataHolder:Object,value:boolean):void; + /** + * + * @param {Object} dataHolder + * @param {number} value + */ + setInt(dataHolder:Object,value:number):void; + /** + * + * @param {Object} dataHolder + * @param {number} value + */ + setNumber(dataHolder:Object,value:number):void; + static $class:yfiles.lang.Class; + } + /** + * An item collection that allows to specify the data provider key the collection is registered with. + *

+ * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. + *

+ * Type parameter T: The type of the items in the collection. + * @class yfiles.layout.DpKeyItemCollection. + * @extends {yfiles.layout.ItemCollection.} + * @template T + */ + export interface DpKeyItemCollection extends yfiles.layout.ItemCollection{} + export class DpKeyItemCollection { + constructor(); + /** + * Gets or sets the data provider key that is used for the item collection. + *

+ * If no key is set, the default data provider key is used. + *

+ * @type {yfiles.algorithms.DpKeyBase.} + */ + dpKey:yfiles.algorithms.DpKeyBase; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.layout.EdgeLabelCandidate} that provides a {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. + *

+ * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} + * into a corresponding + * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this + * class usually doesn't need to be used explicitly. + *

+ * @class yfiles.layout.ExtendedEdgeLabelCandidate + * @extends {yfiles.layout.EdgeLabelCandidate} + */ + export interface ExtendedEdgeLabelCandidate extends yfiles.layout.EdgeLabelCandidate{} + export class ExtendedEdgeLabelCandidate { + /** + * Returns a new instance of 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. + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Returns a new instance of 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. + * @constructor + */ + constructor(orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Returns a new instance of 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 {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Gets the label candidate descriptor. + * @type {yfiles.graph.ILabelCandidateDescriptor} + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.layout.IProfitModel} that returns the profit of a label candidate for instances of {@link yfiles.layout.ExtendedNodeLabelCandidate} + * and {@link yfiles.layout.ExtendedEdgeLabelCandidate}. + *

+ * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} + * into a corresponding + * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this + * class usually doesn't need to be used explicitly. + *

+ * @class yfiles.layout.ExtendedLabelCandidateProfitModel + * @implements {yfiles.layout.IProfitModel} + */ + export interface ExtendedLabelCandidateProfitModel extends Object,yfiles.layout.IProfitModel{} + export class ExtendedLabelCandidateProfitModel { + /** + * Returns the profit for placing a label-candidate. + *

+ * This implementation returns the profit for instances of {@link yfiles.layout.ExtendedNodeLabelCandidate} or 0.0 for other + * {@link yfiles.layout.LabelCandidate}s. + *

+ * @param {yfiles.layout.LabelCandidate} candidate a label candidate + * @returns {number} a value between 0 and 1. + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.layout.NodeLabelCandidate} that provides a {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. + *

+ * This class is used by {@link yfiles.layout.LayoutExecutor} and {@link yfiles.layout.LayoutGraphAdapter} to convert an {@link yfiles.graph.IGraph} + * into a corresponding + * {@link yfiles.algorithms.Graph}. Unless that conversion needs to be customized, or aforementioned classes cannot be used, this + * class usually doesn't need to be used explicitly. + *

+ * @class yfiles.layout.ExtendedNodeLabelCandidate + * @extends {yfiles.layout.NodeLabelCandidate} + */ + export interface ExtendedNodeLabelCandidate extends yfiles.layout.NodeLabelCandidate{} + export class ExtendedNodeLabelCandidate { + /** + * Returns a new instance of 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. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Returns a new instance of NodeLabelCandidate. + *

+ * 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. + * @constructor + */ + constructor(orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Returns a new instance of ExtendedNodeLabelCandidate. + *

+ * 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. + * @constructor + */ + constructor(pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor); + /** + * Gets the label candidate descriptor. + * @type {yfiles.graph.ILabelCandidateDescriptor} + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.layout.FixGroupLayoutStage}. + * @class yfiles.layout.FixGroupLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface FixGroupLayoutData extends yfiles.layout.LayoutData{} + export class FixGroupLayoutData { + constructor(); + /** + * Gets or sets the collection of group nodes whose contents should keep their relative positions. + * @see yfiles.layout.FixGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + fixedGroupNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.layout.FixNodeLayoutStage}. + * @class yfiles.layout.FixNodeLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface FixNodeLayoutData extends yfiles.layout.LayoutData{} + export class FixNodeLayoutData { + constructor(); + /** + * Gets or sets the collection of nodes which should be considered fixed. + * @see yfiles.layout.FixNodeLayoutStage#FIXED_NODE_DP_KEY + * @type {yfiles.layout.SingleItemCollection.} + */ + fixedNode:yfiles.layout.SingleItemCollection; + static $class:yfiles.lang.Class; + } + /** + * Provides different ways to define the items in a collection for use with {@link yfiles.layout.LayoutData}. + *

+ * Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties + * {@link yfiles.layout.ItemCollection.#items}, {@link yfiles.layout.ItemCollection.#mapper}, and {@link yfiles.layout.ItemCollection.#delegate} should be set on each instance. + *

+ *

+ * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. + *

+ * Type parameter TItem: The type of the items in the collection. + * @class yfiles.layout.ItemCollection. + * @template TItem + */ + export interface ItemCollection extends Object{} + export class ItemCollection { + /** + * Provides a mapper describing which elements are contained in this {@link yfiles.layout.ItemCollection.}. + * @param {yfiles.layout.LayoutGraphAdapter} adapter The graph adapter the mapper shall be provided for. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout using the item collection. + * @returns {yfiles.collections.IMapper.} + */ + provideMapper(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm):yfiles.collections.IMapper; + /** + * Gets or sets a mapping from the items to a boolean value. + *

+ * The mapped boolean value specifies whether an item is contained in the collection. + *

+ * @type {yfiles.collections.IMapper.} + */ + mapper:yfiles.collections.IMapper; + /** + * Gets or sets a delegate from the items to a boolean value. + *

+ * The returned boolean value describes whether an item is contained in the collection. + *

+ * @type {function(TItem): boolean} + */ + delegate:(obj:TItem)=>boolean; + /** + * Gets or sets a collection of items. + *

+ * This collection contains exactly the items in the given collection. + *

+ * @type {yfiles.collections.ICollection.} + */ + items:yfiles.collections.ICollection; + /** + * Sets an enumerable of items. + *

+ * This collection contains exactly the items in the given enumerable. + *

+ * @type {yfiles.collections.IEnumerable.} + */ + source:yfiles.collections.IEnumerable; + static $class:yfiles.lang.Class; + } + /** + * Provides different ways to define a mapping from items to values for use with {@link yfiles.layout.LayoutData}. + *

+ * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties {@link yfiles.layout.ItemMapping.#mapper}, {@link yfiles.layout.ItemMapping.#delegate} + * and {@link yfiles.layout.ItemMapping.#constant} should be set on each instance. + *

+ *

+ * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. + *

+ * Type parameter TItem: The type of the items that are mapped. + * Type parameter TValue: The type of the values the items are mapped to. + * @class yfiles.layout.ItemMapping. + * @template TItem,TValue + */ + export interface ItemMapping extends Object{} + export class ItemMapping { + /** + * Provides a mapper mapping the items to values. + * @param {yfiles.layout.LayoutGraphAdapter} adapter The graph adapter the mapper shall be provided for. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout using the mapper. + * @returns {yfiles.collections.IMapper.} A mapper mapping the items to values. + */ + provideMapper(adapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm):yfiles.collections.IMapper; + /** + * Gets or sets a delegate that implements the mapping. + * @type {function(TItem): TValue} + */ + delegate:(key:TItem)=>TValue; + /** + * Gets or sets an {@link yfiles.collections.IMapper.} that realizes the mapping. + * @type {yfiles.collections.IMapper.} + */ + mapper:yfiles.collections.IMapper; + /** + * Gets or sets a constant value all items are mapped to. + * @type {TValue} + */ + constant:TValue; + static $class:yfiles.lang.Class; + } + /** + * Base for convenience classes that specify custom data for a layout calculation done with the + * {@link yfiles.layout.LayoutExecutor}. + *

+ * Implementations of this class provide item-specific configuration options for a specific layout. Single properties that + * affect the complete layout are available on the specific layout class itself. + *

+ *

+ * The {@link yfiles.layout.LayoutExecutor} {@link yfiles.layout.LayoutData#apply applies} these configurations when {@link yfiles.layout.LayoutExecutor#start started}. + *

+ * @class yfiles.layout.LayoutData + */ + export interface LayoutData extends Object{} + export class LayoutData { + /** + * Applies this layout data to the specified layoutGraphAdapter. + * @param {yfiles.layout.LayoutGraphAdapter} layoutGraphAdapter The adapter to add the layout data to. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout that shall use this layout data. + * @param {yfiles.layout.CopiedLayoutGraph} layoutGraph The layout graph used for the layout calculation. + * @abstract + */ + apply(layoutGraphAdapter:yfiles.layout.LayoutGraphAdapter,layout:yfiles.layout.ILayoutAlgorithm,layoutGraph:yfiles.layout.CopiedLayoutGraph):void; + static $class:yfiles.lang.Class; + } + /** + * Executes a {@link yfiles.layout.ILayoutAlgorithm} and optionally animates the transition to the calculated layout. + *

+ * This class is the preferred way to execute a layout. Its animation can be customized in various ways. + *

+ *

+ * If no fine-grain control of the animation is required, the convenience methods {@link yfiles.graph.IGraph#applyLayout} and {@link yfiles.view.GraphComponent#morphLayout} + * can be used instead. + *

+ * @see yfiles.layout.LayoutGraphAdapter + * @class yfiles.layout.LayoutExecutor + */ + export interface LayoutExecutor extends Object{} + export class LayoutExecutor { + /** + * Initializes a new instance of the {@link yfiles.layout.LayoutExecutor} class. + * @param {yfiles.view.GraphComponent} graphComponent 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.ILayoutAlgorithm} layout The {@link yfiles.layout.ILayoutAlgorithm} to use. + * @constructor + */ + constructor(graphComponent:yfiles.view.GraphComponent,graph:yfiles.graph.IGraph,layout:yfiles.layout.ILayoutAlgorithm); + /** + * Initializes a new instance of the {@link yfiles.layout.LayoutExecutor} class. + *

+ * Use the {@link yfiles.layout.LayoutExecutor#start} method to actually execute the task. This will disable animation and content + * rect updates. + *

+ * @param {yfiles.view.GraphComponent} graphComponent The control which will be animated and provides the {@link yfiles.graph.IGraph} instance. + * @param {yfiles.layout.ILayoutAlgorithm} layout The {@link yfiles.layout.ILayoutAlgorithm} to use. + * @constructor + */ + constructor(graphComponent:yfiles.view.GraphComponent,layout:yfiles.layout.ILayoutAlgorithm); + /** + * Creates an instance of {@link yfiles.algorithms.AbortHandler}. + *

+ * This method is called upon first access to the {@link yfiles.layout.LayoutExecutor#abortHandler} property. + *

+ * @returns {yfiles.algorithms.AbortHandler} A new {@link yfiles.algorithms.AbortHandler} instance to use during layout calculation. + * @protected + */ + createAbortHandler():yfiles.algorithms.AbortHandler; + /** + * Factory method that creates the {@link yfiles.view.IAnimation} that will be used by this instance after the layout has been + * calculated. + * @returns {yfiles.view.IAnimation} The animation to use after the layout. + * @see yfiles.layout.LayoutExecutor#duration + * @see yfiles.layout.LayoutExecutor#animateViewport + * @see yfiles.layout.LayoutExecutor#createMorphAnimation + * @see yfiles.layout.LayoutExecutor#createViewportAnimation + * @protected + */ + createAnimation():yfiles.view.IAnimation; + /** + * Factory method that creates the animation for the {@link yfiles.graph.IGraph}. + * @returns {yfiles.view.IAnimation} The animation instance. + * @see yfiles.layout.LayoutExecutor#createAnimation + * @protected + */ + createMorphAnimation():yfiles.view.IAnimation; + /** + * Creates an animation that morphs the layout of all {@link yfiles.graph.ITable}s in the graph. + * @returns {yfiles.view.IAnimation} + * @see yfiles.view.TableAnimation + * @see yfiles.layout.LayoutExecutor#configureTableLayout + * @protected + */ + createTableAnimations():yfiles.view.IAnimation; + /** + * Create a new instance of {@link yfiles.layout.TableLayoutConfigurator} that is used if {@link yfiles.layout.LayoutExecutor#configureTableLayout} is enabled. + *

+ * This method is called upon first access to the {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} property. + *

+ * @returns {yfiles.layout.TableLayoutConfigurator} A new instance of the {@link yfiles.layout.TableLayoutConfigurator} class. + * @protected + */ + createTableLayoutConfigurator():yfiles.layout.TableLayoutConfigurator; + /** + * Factory method that creates the animation for the {@link yfiles.view.CanvasComponent#viewport}. + * @param {yfiles.geometry.Rect} targetBounds The target bounds of the animation. + * @returns {yfiles.view.IAnimation} The animation instance. + * @see yfiles.layout.LayoutExecutor#createAnimation + * @protected + */ + createViewportAnimation(targetBounds:yfiles.geometry.Rect):yfiles.view.IAnimation; + /** + * Callback method that performs the actual layout. + * @protected + */ + execute():void; + /** + * Calculate the target bounds to be used for the {@link yfiles.view.CanvasComponent#contentRect} as well as the {@link yfiles.view.ViewportAnimation} after the layout has + * finished. + *

+ * By default, the value is computed with {@link yfiles.layout.LayoutGraphUtilities#getBoundingBox} with labels and {@link yfiles.layout.LayoutExecutor#targetBoundsInsets} taken into + * account. + *

+ * @returns {yfiles.geometry.Rect} The desired content rectangle and the bounds for a viewport animation. + * @protected + */ + getTargetBounds():yfiles.geometry.Rect; + /** + * Set up {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} for a layout. + *

+ * This implementation configures {@link yfiles.layout.TableLayoutConfigurator#horizontalLayout} according to the {@link yfiles.layout.MultiStageLayout#layoutOrientation} and calls {@link yfiles.layout.TableLayoutConfigurator#prepare} + *

+ * @protected + */ + prepareTableLayout():void; + /** + * Writes the table layout information provided through {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} back to all tables. + *

+ * This method is only called when the layout is not animated. + *

+ * @see yfiles.layout.LayoutExecutor#prepareTableLayout + * @protected + */ + restoreTableLayout():void; + /** + * Actually starts the layout calculation and the optional animation asynchronously using a Promise. + *

+ * This method will ultimately call the {@link yfiles.layout.LayoutExecutor#execute} method. If the {@link yfiles.layout.LayoutExecutor#duration} is zero no animation will be + * performed. + *

+ *

+ * If this instance is already running, this method returns immedetaly without doing anything, return the previous + * Promise. + *

+ * @returns {Promise.} A Promise that will be fulfilled once the layout and optional animation is done. + * @see yfiles.layout.LayoutExecutor#execute + */ + start():Promise; + /** + * Stops a currently running layout calculation or animation. + *

+ * If a layout calculation is still running, it will be requested to stopped via {@link yfiles.algorithms.AbortHandler#stop} and + * the animation will not run. If the layout calculation was already completed, the animation will be aborted immediately + * and the layout result will be shown immediately. + *

+ *

+ * To just skip the animation but let the calculation finish normally, the {@link yfiles.layout.LayoutExecutor#duration} can be set to zero at any time before the + * animation was started. + *

+ * @returns {Promise.} + */ + stop():Promise; + /** + * Gets the {@link yfiles.algorithms.AbortHandler} that is used during the layout calculation. + * @see yfiles.layout.LayoutExecutor#createAbortHandler + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets the {@link yfiles.layout.LayoutExecutor#tableLayoutConfigurator} that is used if {@link yfiles.layout.LayoutExecutor#configureTableLayout} is enabled. + * @see yfiles.layout.LayoutExecutor#createTableLayoutConfigurator + * @type {yfiles.layout.TableLayoutConfigurator} + */ + tableLayoutConfigurator:yfiles.layout.TableLayoutConfigurator; + /** + * Gets or sets a value indicating whether to automatically perform calls to {@link yfiles.layout.TableLayoutConfigurator#prepare} + * and {@link yfiles.layout.TableLayoutConfigurator#restore} in order to layout table nodes. + *

+ * The default value is true. + *

+ * @type {boolean} + */ + configureTableLayout:boolean; + /** + * Gets or sets the duration of the animation. + *

+ * The default value is {@link yfiles.lang.TimeSpan#ZERO}. + *

+ * @type {yfiles.lang.TimeSpan} + */ + duration:yfiles.lang.TimeSpan; + /** + * Gets or sets a value indicating whether edge groups are automatically created for edges that are connected to the same + * port. + *

+ * If this property is enabled and no edge groups are explicitly created (no {@link yfiles.collections.IMapper.} are registered for the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for each port with multiple outgoing resp. incoming edges + * these edges will be assigned to the same edge group. The necessary + * {@link yfiles.algorithms.IDataProvider}s will be created automatically. + *

+ *

+ * Without an {@link yfiles.layout.ILayoutAlgorithm} that supports edge groups, this property ahs no visual effect. + *

+ *

+ * The default value is true. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @see yfiles.layout.LayoutGraphAdapter#automaticEdgeGrouping + * @see yfiles.layout.LayoutExecutor#fixPorts + * @type {boolean} + */ + automaticEdgeGrouping:boolean; + /** + * Controls whether strong port constraints are automatically created. + *

+ * If this property is enabled and no edge groups are explicitly created (no {@link yfiles.collections.IMapper.} are registered for the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for all edges strong source and target point constraints + * with {@link yfiles.layout.PortSide#ANY} are created. The necessary + * {@link yfiles.algorithms.IDataProvider}s will be created automatically. + *

+ *

+ * This ensures that view {@link yfiles.graph.IPort}s are not moved during the layout, if the {@link yfiles.layout.ILayoutAlgorithm} + * supports port constraints. + *

+ *

+ * The default value is false. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @see yfiles.layout.LayoutGraphAdapter#fixPorts + * @see yfiles.layout.LayoutExecutor#automaticEdgeGrouping + * @type {boolean} + */ + fixPorts:boolean; + /** + * Gets or sets a value indicating whether to animate the viewport. + *

+ * The default value is false. + *

+ * @type {boolean} + */ + animateViewport:boolean; + /** + * Gets or sets a value indicating whether to respect the {@link yfiles.view.CanvasComponent#viewportLimiter} of the {@link yfiles.view.GraphComponent} of this instance. + *

+ * The default value is false. + *

+ * @type {boolean} + */ + considerViewportLimiter:boolean; + /** + * Gets or sets a value indicating whether to use eased animation. + *

+ * The default value is false. + *

+ * @type {boolean} + */ + easedAnimation:boolean; + /** + * Gets or sets the insets (in world coordinates) that will be added to the content rectangle when calculating the target + * viewport. + *

+ * The default value is {@link yfiles.geometry.Insets#EMPTY}. + *

+ * @type {yfiles.geometry.Insets} + */ + targetBoundsInsets:yfiles.geometry.Insets; + /** + * Gets or sets a value indicating whether the content rectangle property of the {@link yfiles.view.CanvasComponent} should be + * updated upon completion. + *

+ * The default value is false. + *

+ * @type {boolean} + */ + updateContentRect:boolean; + /** + * Gets a value indicating whether this instance is currently running. + * @type {boolean} + */ + running:boolean; + /** + * Gets or sets the layout data that is applied when {@link yfiles.layout.LayoutExecutor#start starting} the executor. + * @type {yfiles.layout.LayoutData} + */ + layoutData:yfiles.layout.LayoutData; + /** + * Gets or sets the {@link yfiles.view.ISelectionModel.} to use for the automatically registered {@link yfiles.algorithms.IDataProvider} instances for {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} + * and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. + *

+ * If this value is null and {@link yfiles.layout.LayoutExecutor#graph} is the same instance as {@link yfiles.layout.LayoutExecutor#graphComponent}'s {@link yfiles.graph.IGraph} instance, the selection model from {@link yfiles.layout.LayoutExecutor#graphComponent} is used + * instead. + *

+ * @type {yfiles.view.ISelectionModel.} + */ + selectionModel:yfiles.view.ISelectionModel; + /** + * Gets the layout graph that is used by this instance to calculate the layout. + * @protected + * @type {yfiles.layout.CopiedLayoutGraph} + */ + layoutGraph:yfiles.layout.CopiedLayoutGraph; + /** + * Gets the control this instance has been created for. + * @protected + * @type {yfiles.view.GraphComponent} + */ + graphComponent:yfiles.view.GraphComponent; + /** + * Gets the {@link yfiles.layout.ILayoutAlgorithm} this instance is using. + * @protected + * @type {yfiles.layout.ILayoutAlgorithm} + */ + layout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets the graph this instance is working on. + * @protected + * @type {yfiles.graph.IGraph} + */ + graph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + /** + * Adapter class that can be used to obtain an {@link yfiles.layout.LayoutGraph} from an {@link yfiles.graph.IGraph}. + *

+ * Typically, this class is not used directly but through the convenience class {@link yfiles.layout.LayoutExecutor} or the + * convenience methods {@link yfiles.graph.IGraph#applyLayout} and MorphLayout + *

+ *

+ * This class will use the provided {@link yfiles.layout.LayoutGraphAdapter#selectionModel} to register corresponding {@link yfiles.algorithms.IDataProvider}s for the data provider keys + * {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY} to the layout graph. + * Moreover, it will automatically convert {@link yfiles.collections.IMapper.} instances registered with the {@link yfiles.graph.IMapperRegistry} of the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} into + * corresponding {@link yfiles.algorithms.IDataProvider} instances of the layout graph. + *

+ *

+ * In addition, this class supports {@link yfiles.graph.IGraph}s with edge to edge connections, i.e., edges that are adjacent to + * other edges. Since such edges are not allowed in an {@link yfiles.layout.LayoutGraph}, the property {@link yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges} specifies whether these + * edges shouldn't be converted into the layout graph at all or converted into a corresponding structure with dummy nodes. + *

+ *

+ * The chapter {@link @DGUIDE_LAYOUT_PREFIX@/layout-applying_a_layout.html Applying an Automatic Layout} describes how automatic layout and graph analysis algorithms from the yFiles + * Layout and yFiles Basic library components can be accessed from @COMPONENT_NAME@. + *

+ * @see yfiles.layout.CopiedLayoutGraph + * @see yfiles.layout.ILayoutAlgorithm + * @class yfiles.layout.LayoutGraphAdapter + */ + export interface LayoutGraphAdapter extends Object{} + export class LayoutGraphAdapter { + /** + * Creates the adapter using a given {@link yfiles.graph.IGraph} and {@link yfiles.view.ISelectionModel.}. + * @param {yfiles.graph.IGraph} graph The graph to build an adapter for. + * @param {yfiles.view.ISelectionModel.} [selectionModel=null] The optional selection model to use by the {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY} + * {@link yfiles.algorithms.IDataProvider} instances that are automatically bound to this adapter. + * @throws {Stubs.Exceptions.ArgumentError} graph is null. + * @constructor + */ + constructor(graph:yfiles.graph.IGraph,selectionModel?:yfiles.view.ISelectionModel); + /** + * Creates the adapter with no initial {@link yfiles.graph.IGraph} and no {@link yfiles.view.ISelectionModel.}. + *

+ * Before this instance can be used for automatic layouts, you mus assign a value to the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} property. + *

+ * @constructor + */ + constructor(); + /** + * Registers a data provider with the graph using the given look-up key and wrapping the given mapper. + *

+ * If a mapper is already registered under the given key, it is overwritten. + *

+ * Type parameter K: The type of the key to use. + * Type parameter V: The type of the value to use. + * @param {yfiles.lang.Class} valueType The type of the value to use. + * @param {yfiles.lang.Class} keyType The type of the key to use. + * @param {Object} dataKey The look-up key to register the data provider with. + * @param {yfiles.collections.IMapper.} mapper The mapper wrapped as data provider. + * @returns {yfiles.algorithms.IDataProvider} + * @template K,V + */ + addDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,dataKey:Object,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataProvider; + /** + * Convenience method that applies a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to an {@link yfiles.graph.IGraph}. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout algorithm to apply. + * @param {yfiles.layout.LayoutData} [layoutData=null] The layout data. + */ + applyLayout(layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; + /** + * Static convenience method that applies a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} to an {@link yfiles.graph.IGraph}. + * @param {yfiles.layout.ILayoutAlgorithm} layout The layout algorithm to apply. + * @param {yfiles.graph.IGraph} graph The graph to compute the layout on. + * @param {yfiles.layout.LayoutData} [layoutData=null] The layout data. + * @static + */ + static applyLayout(graph:yfiles.graph.IGraph,layout:yfiles.layout.ILayoutAlgorithm,layoutData?:yfiles.layout.LayoutData):void; + /** + * Creates a {@link yfiles.layout.CopiedLayoutGraph} for this instance. + * @returns {yfiles.layout.CopiedLayoutGraph} An instance whose {@link yfiles.layout.CopiedLayoutGraph#commitLayoutToOriginalGraph} will update this instance. + */ + createCopiedLayoutGraph():yfiles.layout.CopiedLayoutGraph; + /** + * 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} layoutParameter 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. + * @returns {yfiles.layout.EdgeLabelCandidate} A candidate to yield for the labeling algorithms or null. + */ + createEdgeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.layout.EdgeLabelCandidate; + /** + * 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. + * @returns {yfiles.layout.IEdgeLayout} A wrapper instance. + * @protected + */ + createEdgeLayout(edge:yfiles.graph.IEdge):yfiles.layout.IEdgeLayout; + /** + * 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. + * @returns {yfiles.layout.INodeLayout} A suitable implementation of {@link yfiles.layout.INodeLayout} that uses the {@link yfiles.graph.IPort#location port's location} as the center of the node. + * @see yfiles.layout.LayoutGraphAdapter#edgePortNodeSize + * @see yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges + * @protected + */ + createEdgePortLayout(port:yfiles.graph.IPort):yfiles.layout.INodeLayout; + /** + * 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} layoutParameter 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. + * @returns {yfiles.layout.NodeLabelCandidate} A candidate to yield for the labeling algorithms or null. + */ + createNodeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter,ownerLayout:yfiles.layout.INodeLabelLayout):yfiles.layout.NodeLabelCandidate; + /** + * 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. + * @returns {yfiles.layout.INodeLayout} A wrapper instance. + * @protected + */ + createNodeLayout(node:yfiles.graph.INode):yfiles.layout.INodeLayout; + /** + * + * @returns {yfiles.collections.IEnumerable.} + */ + edgeObjects():yfiles.collections.IEnumerable; + /** + * + * @param {Object} dataKey + * @returns {yfiles.algorithms.IDataProvider} + */ + getDataProvider(dataKey:Object):yfiles.algorithms.IDataProvider; + /** + * + * @param {Object} edge + * @returns {Array.} + */ + getEdgeLabelLayout(edge:Object):yfiles.layout.IEdgeLabelLayout[]; + /** + * + * @param {Object} edge + * @returns {yfiles.layout.IEdgeLayout} + */ + getEdgeLayout(edge:Object):yfiles.layout.IEdgeLayout; + /** + * 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} layoutParameter The parameter to apply. + * @returns {yfiles.graph.ILabelCandidateDescriptor} A descriptor or null. + * @see yfiles.layout.LayoutGraphAdapter#createNodeLabelCandidate + * @see yfiles.layout.LayoutGraphAdapter#createEdgeLabelCandidate + * @see yfiles.layout.LayoutGraphAdapter#getLabelCandidateDescriptorProvider + * @protected + */ + getLabelCandidateDescriptor(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,layoutParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + /** + * 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.graph.ILookup} to find an implementation of the + * {@link yfiles.graph.ILabelCandidateDescriptorProvider}. + *

+ * @param {yfiles.graph.IGraph} graph The graph. + * @returns {yfiles.graph.ILabelCandidateDescriptorProvider} The result of a {@link yfiles.graph.ILookup#lookup} query on graph for the {@link yfiles.graph.ILabelCandidateDescriptorProvider} type. + * @protected + */ + getLabelCandidateDescriptorProvider(graph:yfiles.graph.IGraph):yfiles.graph.ILabelCandidateDescriptorProvider; + /** + * + * @param {Object} node + * @returns {Array.} + */ + getNodeLabelLayout(node:Object):yfiles.layout.INodeLabelLayout[]; + /** + * + * @param {Object} o + * @returns {yfiles.layout.INodeLayout} + */ + getNodeLayout(o:Object):yfiles.layout.INodeLayout; + /** + * + * @param {Object} edgeObject + * @returns {Object} + */ + getSource(edgeObject:Object):Object; + /** + * + * @param {Object} edgeObject + * @returns {Object} + */ + getTarget(edgeObject:Object):Object; + /** + * + * @returns {yfiles.collections.IEnumerable.} + */ + nodeObjects():yfiles.collections.IEnumerable; + /** + * 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.Point} newLocation The new location of the port as calculated by the layout algorithm. + * @protected + */ + setEdgePortLocation(port:yfiles.graph.IPort,newLocation:yfiles.geometry.Point):void; + /** + * Callback method that assigns a new relative location to port. + *

+ * The default implementation calls {@link yfiles.graph.IGraph#setRelativePortLocation} 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.Point} newRelativeLocation The new coordinate offsets relative to the center of the node's {@link yfiles.graph.INode#layout}'s center. + * @protected + */ + setRelativePortLocation(port:yfiles.graph.IPort,newRelativeLocation:yfiles.geometry.Point):void; + /** + * An {@link yfiles.graph.IMapperRegistry} tag for an {@link yfiles.collections.IMapper.} that provides for the edge {@link yfiles.graph.ILabel}s in the {@link yfiles.layout.LayoutGraphAdapter#adaptedGraph} a {@link yfiles.layout.PreferredPlacementDescriptor} + * instance. + *

+ * If there is a {@link yfiles.collections.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. + *

+ * @const + * @static + * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} + */ + static EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; + /** + * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static ORIGINAL_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static ORIGINAL_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.INodeLabelLayoutDpKey.} + */ + static ORIGINAL_NODE_LABEL_DP_KEY:yfiles.algorithms.INodeLabelLayoutDpKey; + /** + * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} + */ + static ORIGINAL_EDGE_LABEL_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; + /** + * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static ORIGINAL_SOURCE_PORT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static ORIGINAL_TARGET_PORT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * A data provider key that can be used to look up the original unconnected{@link yfiles.graph.IPort ports} of the original {@link yfiles.graph.IPortOwner} of an {@link yfiles.algorithms.Node} + * or, in the case of edge-to-edge connections, an {@link yfiles.algorithms.Edge}. + *

+ * You can access all (connected and unconnected) ports through the {@link yfiles.graph.IPortOwner#ports} property of the original {@link yfiles.graph.IGraph} elements, + * which can be retrieved through the {@link yfiles.layout.LayoutGraphAdapter#ORIGINAL_NODE_DP_KEY} and {@link yfiles.layout.LayoutGraphAdapter#ORIGINAL_EDGE_DP_KEY} + * data providers. The information about whether a port is connected or not is not readily accessible from there, though. + * You can use this data provider to specifically find these port, e.g. to create additional + * {@link yfiles.layout.PortCandidate}s or just reserve space for them. + *

+ *

+ * 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.layout.LayoutGraphAdapter}. Especially, it is available if the layout is run with a {@link yfiles.layout.LayoutExecutor} + * or the convenience methods MorphLayout and {@link yfiles.graph.IGraph#applyLayout}. + *

+ * @const + * @static + * @type {yfiles.algorithms.GraphObjectDpKey.>} + */ + static UNCONNECTED_PORTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey>; + /** + * 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#getBoolean} + * 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}. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static PORT_DUMMY_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * 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 + * {@link yfiles.layout.LayoutGraphAdapter#LayoutGraphAdapter}. Note that this property cannot be assigned again if its value is + * already non null. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the value of this property is already non null + * @type {yfiles.graph.IGraph} + */ + adaptedGraph:yfiles.graph.IGraph; + /** + * Gets or sets the {@link yfiles.view.ISelectionModel.} to use for the automatically registered {@link yfiles.algorithms.IDataProvider} instances for the keys {@link yfiles.layout.LayoutKeys#AFFECTED_NODES_DP_KEY} + * and {@link yfiles.layout.LayoutKeys#AFFECTED_EDGES_DP_KEY}. + * @type {yfiles.view.ISelectionModel.} + */ + selectionModel:yfiles.view.ISelectionModel; + /** + * 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 yfiles.layout.LayoutGraphAdapter#hideEdgesAtEdges + * @type {yfiles.geometry.Size} + */ + edgePortNodeSize:yfiles.geometry.Size; + /** + * Determines whether edges at other edges will be hidden from the layout graph or included. + *

+ * If this property is set to true, edges at other edges are simply ignored and not part of the layout graph. The default + * is false 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 yfiles.layout.LayoutGraphAdapter#edgePortNodeSize + * @type {boolean} + */ + hideEdgesAtEdges:boolean; + /** + * Controls whether edge groups are automatically created for edges that are connected to the same port. + *

+ * If this property is enabled and no edge groups are explicitly created ({@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}), for all ports with multiple outgoing resp. incoming edges + * these edges will be assigned to the same edge group. The necessary + * {@link yfiles.algorithms.IDataProvider}s will be created automatically. + *

+ *

+ * This features requires edge group support from the {@link yfiles.layout.ILayoutAlgorithm}. + *

+ *

+ * Default value is true + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @see yfiles.layout.LayoutExecutor#automaticEdgeGrouping + * @see yfiles.layout.LayoutGraphAdapter#fixPorts + * @type {boolean} + */ + automaticEdgeGrouping:boolean; + /** + * Controls whether strong port constraints are automatically created. + *

+ * If this property is enabled and no port constraints are explicitly created ({@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}), for all edges strong source and target point + * constraints with {@link yfiles.layout.PortSide#ANY} are created. The necessary + * {@link yfiles.algorithms.IDataProvider}s will be created automatically. + *

+ *

+ * This ensures that view {@link yfiles.graph.IPort}s are not moved during the layout, if the {@link yfiles.layout.ILayoutAlgorithm} + * supports port constraints. + *

+ *

+ * Default value is false + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @see yfiles.layout.LayoutExecutor#fixPorts + * @see yfiles.layout.LayoutGraphAdapter#automaticEdgeGrouping + * @type {boolean} + */ + fixPorts:boolean; + /** + * + * @type {Array.} + */ + dataProviderKeys:Object[]; + static $class:yfiles.lang.Class; + } + /** + * Specifies a {@link yfiles.layout.PartitionGrid} for a layout. + *

+ * The {@link yfiles.layout.PartitionCellId} mapping has to be specified by either setting the {@link yfiles.layout.PartitionGridData#cellIds} property, or both the {@link yfiles.layout.PartitionGridData#rowIndices} and {@link yfiles.layout.PartitionGridData#columnIndices} + * properties. When {@link yfiles.layout.PartitionGridData#cellIds} is set, the {@link yfiles.layout.PartitionGridData#grid} property is expected to be set as well. Otherwise the size of the grid may be induced by + * the maximum row and column indices returned by {@link yfiles.layout.PartitionGridData#rowIndices} and {@link yfiles.layout.PartitionGridData#columnIndices}. + *

+ *

+ * Note that cell spanning is only supported using the {@link yfiles.layout.PartitionGridData#cellIds}. + *

+ * @class yfiles.layout.PartitionGridData + * @extends {yfiles.layout.LayoutData} + */ + export interface PartitionGridData extends yfiles.layout.LayoutData{} + export class PartitionGridData { + constructor(); + /** + * Gets or sets the partition grid. + * @see yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY + * @type {yfiles.layout.PartitionGrid} + */ + grid:yfiles.layout.PartitionGrid; + /** + * Gets or sets the mapping from nodes to {@link yfiles.layout.PartitionCellId} using the partition grid as context. + * @type {yfiles.layout.ContextItemMapping.} + */ + cellIds:yfiles.layout.ContextItemMapping; + /** + * Gets or sets the mapping from nodes to the index of their rows. + * @type {yfiles.layout.ItemMapping.} + */ + rowIndices:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to the index of their columns. + * @type {yfiles.layout.ItemMapping.} + */ + columnIndices:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.layout.PartitionLayout}. + * @class yfiles.layout.PartitionLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface PartitionLayoutData extends yfiles.layout.LayoutData{} + export class PartitionLayoutData { + constructor(); + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.layout.RecursiveGroupLayout}. + * @class yfiles.layout.RecursiveGroupLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface RecursiveGroupLayoutData extends yfiles.layout.LayoutData{} + export class RecursiveGroupLayoutData { + constructor(); + /** + * Gets or sets the mapping from group nodes to the {@link yfiles.layout.ILayoutAlgorithm} used for their child nodes. + * @see yfiles.layout.RecursiveGroupLayout#GROUP_NODE_LAYOUT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + groupNodeLayouts:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges connecting to group nodes to source split ids. + *

+ * Edges will be aligned with edges that connect to the same group node and have the same split id at their source + * (preferably) or target. + *

+ * @see yfiles.layout.RecursiveGroupLayout#SOURCE_SPLIT_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceSplitIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges connecting to group nodes to target split ids. + *

+ * Edges will be aligned with edges that connect to the same group node and have the same split id at their source or + * target (preferably). + *

+ * @see yfiles.layout.RecursiveGroupLayout#TARGET_SPLIT_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetSplitIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. + * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodePortCandidateSets:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.layout.ReverseEdgesStage}. + * @class yfiles.layout.ReverseEdgesStageData + * @extends {yfiles.layout.LayoutData} + */ + export interface ReverseEdgesStageData extends yfiles.layout.LayoutData{} + export class ReverseEdgesStageData { + constructor(); + /** + * Gets or sets the collection of affected edges. + * @see yfiles.layout.ReverseEdgesStage#AFFECTED_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroupIds:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Provides different ways to define the items in a collection for use with + * {@link yfiles.layout.LayoutData}, especially if the collection contains only one item. + *

+ * Only one of the provided ways to define a collection can be used at the same time, therefore only one of the properties + * {@link yfiles.layout.SingleItemCollection.#item}, {@link yfiles.layout.ItemCollection.#items}, {@link yfiles.layout.ItemCollection.#mapper}, and {@link yfiles.layout.ItemCollection.#delegate} should be set on each instance. + *

+ *

+ * This class supports {@link yfiles.layout.LayoutData} implementations and does not usually have to be used explicitly. + *

+ * Type parameter V: The type of the items in the collection. + * @class yfiles.layout.SingleItemCollection. + * @extends {yfiles.layout.ItemCollection.} + * @template V + */ + export interface SingleItemCollection extends yfiles.layout.ItemCollection{} + export class SingleItemCollection { + constructor(); + /** + * Gets or sets the single item this item collection contains. + * @type {V} + */ + item:V; + static $class:yfiles.lang.Class; + } + /** + * Creates a {@link yfiles.layout.PartitionGrid} that matches a given table configuration of an {@link yfiles.graph.IGraph} and registers {@link yfiles.collections.IMapper.} + * for that grid at the graph. + *

+ * Typically, this class is used as part of the convenience class {@link yfiles.layout.LayoutExecutor} to {@link yfiles.layout.TableLayoutConfigurator#prepare} + * a partition grid before the layout is calculated and {@link yfiles.layout.TableLayoutConfigurator#restore} the graph + * afterwards. + *

+ * @class yfiles.layout.TableLayoutConfigurator + */ + export interface TableLayoutConfigurator extends Object{} + export class TableLayoutConfigurator { + /** + * Destroy all information that results from a previous {@link yfiles.layout.TableLayoutConfigurator#prepare} 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.layout.TableLayoutConfigurator#cleanUp} + * explicitly if you don't need the {@link yfiles.layout.TableLayoutConfigurator} anymore. + *

+ * @param {yfiles.graph.ITable} originalTable The table + * @param {yfiles.geometry.Rect} nodeLayout The final layout of the node that owns the table + * @returns {Array.} The sizes of all leaf rows in originalTable, in their natural order. + */ + getColumnLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.Rect):number[]; + /** + * Return the sizes of all leaf rows. + *

+ * This method does not modify originalTable. You also need to call {@link yfiles.layout.TableLayoutConfigurator#cleanUp} + * explicitly if you don't need the {@link yfiles.layout.TableLayoutConfigurator} anymore. + *

+ * @param {yfiles.graph.ITable} originalTable The table + * @param {yfiles.geometry.Rect} nodeLayout The final layout of the node that owns the table + * @returns {Array.} The sizes of all leaf rows in originalTable, in their natural order. + */ + getRowLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.Rect):number[]; + /** + * Setup partition grid information from a graph that contains table structures + * @param {yfiles.graph.IGraph} graph + */ + prepare(graph:yfiles.graph.IGraph):void; + /** + * Write back all information from the partition grid + * @param {yfiles.graph.IGraph} graph + */ + restore(graph:yfiles.graph.IGraph):void; + /** + * Gets or sets the minimum distance between two different table nodes + * @type {number} + */ + minimumTableDistance: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. + *

+ * @type {boolean} + */ + compaction: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. + *

+ * @type {boolean} + */ + 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. + *

+ * @type {boolean} + */ + fromSketch:boolean; + static $class:yfiles.lang.Class; + } + /** + * Converts an {@link yfiles.graph.IGraph} instance into 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 items + * from one graph instance to their corresponding item in the other graph instance. + *

+ *

+ * The main use case of this class is executing one of the analysis algorithms on an {@link yfiles.graph.IGraph}, for example + * {@link yfiles.algorithms.ShortestPaths}, {@link yfiles.algorithms.Cycles}, and {@link yfiles.algorithms.Centrality}. For executing a layout + * algorithm, use the convenience class {@link yfiles.layout.LayoutExecutor}, the convenience methods {@link yfiles.graph.IGraph#applyLayout} + * and MorphLayout, or {@link yfiles.layout.LayoutGraphAdapter}. + *

+ * @see yfiles.layout.LayoutGraphAdapter + * @see yfiles.layout.LayoutExecutor + * @see yfiles.algorithms.Bipartitions + * @see yfiles.algorithms.Centrality + * @see yfiles.algorithms.Cycles + * @see yfiles.algorithms.GraphChecker + * @see yfiles.algorithms.GraphConnectivity + * @see yfiles.algorithms.Groups + * @see yfiles.algorithms.IndependentSets + * @see yfiles.algorithms.NetworkFlows + * @see yfiles.algorithms.NodeOrders + * @see yfiles.algorithms.Paths + * @see yfiles.algorithms.RankAssignments + * @see yfiles.algorithms.ShortestPaths + * @see yfiles.algorithms.SpanningTrees + * @see yfiles.algorithms.Transitivity + * @see yfiles.algorithms.Trees + * @class yfiles.layout.YGraphAdapter + */ + export interface YGraphAdapter extends Object{} + export class YGraphAdapter { + /** + * Initializes a new instance of the {@link yfiles.layout.YGraphAdapter} class. + *

+ * This will create a copy of the originalGraph that has the same structure and makes it available via the {@link yfiles.layout.YGraphAdapter#yGraph} property. + *

+ * @param {yfiles.graph.IGraph} originalGraph The original graph whose structure will be copied. + * @constructor + */ + constructor(originalGraph:yfiles.graph.IGraph); + /** + * Creates an {@link yfiles.algorithms.IDataMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for items in the {@link yfiles.layout.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.collections.IMapper.} instances that provide and accept values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. + *

+ * Type parameter K: The type of the keys in the mapper. + * Type parameter V: The type of the values in the mapper. + * @param {yfiles.lang.Class} valueType The type of the values in the mapper. + * @param {yfiles.lang.Class} keyType The type of the keys in the mapper. + * @param {yfiles.collections.IMapper.} mapper The mapper to direct requests to. + * @returns {yfiles.algorithms.IDataMap} An {@link yfiles.algorithms.IDataMap} that will delegate the functionality to the mapper. + * @see yfiles.layout.YGraphAdapter#createDataProvider + * @template K,V + */ + createDataMap(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataMap; + /** + * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided delegate when queried for items in the {@link yfiles.layout.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.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. + *

+ * Type parameter K: The type of the keys in the mapper. + * Type parameter V: The type of the values in the mapper. + * @param {yfiles.lang.Class} valueType The type of the values in the mapper. + * @param {yfiles.lang.Class} keyType The type of the keys in the mapper. + * @param {function(K): V} getter The mapper delegate to direct requests to. + * @returns {yfiles.algorithms.IDataProvider} A DataProvider that will delegate requests to the getter. + * @template K,V + */ + createDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,getter:(key:K)=>V):yfiles.algorithms.IDataProvider; + /** + * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for items in the {@link yfiles.layout.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.collections.IMapper.} instances that provide the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes} and {@link yfiles.layout.YGraphAdapter#getOriginalEdge edges}. + *

+ * Type parameter K: The type of the keys in the mapper. + * Type parameter V: The type of the values in the mapper. + * @param {yfiles.lang.Class} valueType The type of the values in the mapper. + * @param {yfiles.lang.Class} keyType The type of the keys in the mapper. + * @param {yfiles.collections.IMapper.} mapper The mapper to direct requests to. + * @returns {yfiles.algorithms.IDataProvider} A DataProvider that will delegate requests to the mapper. + * @template K,V + */ + createDataProvider(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.collections.IMapper):yfiles.algorithms.IDataProvider; + /** + * Creates an {@link yfiles.collections.IEnumerable. enumerable of edges} that maps the edges from the {@link yfiles.algorithms.EdgeList} to their {@link yfiles.layout.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.layout.YGraphAdapter#originalGraph}. + *

+ * @param {yfiles.algorithms.EdgeList} edges The edge list. + * @returns {yfiles.collections.IListEnumerable.} An enumerable that contains the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original} edges for the ones in the list. + */ + createEdgeEnumerable(edges:yfiles.algorithms.EdgeList):yfiles.collections.IListEnumerable; + /** + * Creates an {@link yfiles.algorithms.EdgeList} that maps the edges from the {@link yfiles.collections.IEnumerable.} to their {@link yfiles.layout.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.layout.YGraphAdapter#originalGraph}. + *

+ * @param {yfiles.collections.IEnumerable.} edges The edges from the {@link yfiles.layout.YGraphAdapter#originalGraph}. + * @returns {yfiles.algorithms.EdgeList} An {@link yfiles.algorithms.EdgeList} that contains the {@link yfiles.layout.YGraphAdapter#getCopiedEdge copied} edges for the ones in the enumerable. + */ + createEdgeList(edges:yfiles.collections.IEnumerable):yfiles.algorithms.EdgeList; + /** + * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided delegate when queried for {@link yfiles.algorithms.Edge}s + * in the {@link yfiles.layout.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.layout.YGraphAdapter#getOriginalEdge original edges}. + *

+ * Type parameter V: The type of the values in the mapper. + * @param {function(yfiles.graph.IEdge): V} getter The mapper delegate to direct read requests to. + * @returns {yfiles.algorithms.IEdgeMap} An {@link yfiles.algorithms.INodeMap} that will delegate reads to the getter. + * @template V + */ + createEdgeMap(getter:(key:yfiles.graph.IEdge)=>V):yfiles.algorithms.IEdgeMap; + /** + * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for {@link yfiles.algorithms.Edge}s in the {@link yfiles.layout.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.collections.IMapper.} instances that provide and accept the values for the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. + *

+ * Type parameter V: The type of the values in the mapper. + * @param {yfiles.collections.IMapper.} mapper The mapper to direct requests to. + * @returns {yfiles.algorithms.IEdgeMap} An {@link yfiles.algorithms.IEdgeMap} that will delegate reads and writes to the mapper. + * @template V + */ + createEdgeMap(mapper:yfiles.collections.IMapper):yfiles.algorithms.IEdgeMap; + /** + * Creates an {@link yfiles.collections.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.collections.IMapper.} + * instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. + *

+ * Type parameter T: The type of the values in the mapper. + * @param {yfiles.algorithms.INodeMap} nodeMap The map to direct requests to. + * @returns {yfiles.collections.IMapper.} A mapper that will delegate requests to the nodeMap. + * @template T + */ + createEdgeMapper(nodeMap:yfiles.algorithms.INodeMap):yfiles.collections.IMapper; + /** + * Creates an {@link yfiles.collections.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.collections.IMapper.} instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges} and the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. + *

+ * Type parameter T: The type of the values in the mapper. + * @param {yfiles.algorithms.IDataProvider} dataProvider The provider to direct requests to. + * @returns {yfiles.collections.IMapper.} A mapper that will delegate requests to the dataProvider. + * @template T + */ + createMapper(dataProvider:yfiles.algorithms.IDataProvider):yfiles.collections.IMapper; + /** + * Creates an {@link yfiles.collections.IEnumerable. enumerable of nodes} that maps the nodes from the {@link yfiles.algorithms.NodeList} to their {@link yfiles.layout.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.layout.YGraphAdapter#originalGraph}. + *

+ * @param {yfiles.algorithms.NodeList} nodes The node list. + * @returns {yfiles.collections.IListEnumerable.} An enumerable that contains the {@link yfiles.layout.YGraphAdapter#getOriginalNode original} nodes for the ones in the list. + */ + createNodeEnumerable(nodes:yfiles.algorithms.NodeList):yfiles.collections.IListEnumerable; + /** + * Creates a {@link yfiles.algorithms.NodeList} that maps the nodes from the {@link yfiles.collections.IEnumerable.} to their {@link yfiles.layout.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.layout.YGraphAdapter#originalGraph}. + *

+ * @param {yfiles.collections.IEnumerable.} nodes The nodes from the {@link yfiles.layout.YGraphAdapter#originalGraph}. + * @returns {yfiles.algorithms.NodeList} A {@link yfiles.algorithms.NodeList} that contains the {@link yfiles.layout.YGraphAdapter#getCopiedNode copied} nodes for the ones in the enumerable. + */ + createNodeList(nodes:yfiles.collections.IEnumerable):yfiles.algorithms.NodeList; + /** + * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided delegate when queried for {@link yfiles.algorithms.Node}s + * in the {@link yfiles.layout.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.layout.YGraphAdapter#getOriginalNode original nodes}. + *

+ * Type parameter V: The type of the values in the mapper. + * @param {function(yfiles.graph.INode): V} getter The mapper delegate to direct read requests to. + * @returns {yfiles.algorithms.INodeMap} An {@link yfiles.algorithms.INodeMap} that will delegate reads to the getter. + * @template V + */ + createNodeMap(getter:(key:yfiles.graph.INode)=>V):yfiles.algorithms.INodeMap; + /** + * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided {@link yfiles.collections.IMapper.} when queried for {@link yfiles.algorithms.Node}s in the {@link yfiles.layout.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.collections.IMapper.} instances that provide and accept the values for the {@link yfiles.layout.YGraphAdapter#getOriginalNode original nodes}. + *

+ * Type parameter V: The type of the values in the mapper. + * @param {yfiles.collections.IMapper.} mapper The mapper to direct requests to. + * @returns {yfiles.algorithms.INodeMap} An {@link yfiles.algorithms.INodeMap} that will delegate reads and writes to the mapper. + * @template V + */ + createNodeMap(mapper:yfiles.collections.IMapper):yfiles.algorithms.INodeMap; + /** + * Creates an {@link yfiles.collections.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.collections.IMapper.} instances that use the {@link yfiles.layout.YGraphAdapter#getOriginalEdge original edges}. + *

+ * Type parameter T: The type of the values in the mapper. + * @param {yfiles.algorithms.IEdgeMap} edgeMap The map to direct requests to. + * @returns {yfiles.collections.IMapper.} A mapper that will delegate requests to the edgeMap. + * @template T + */ + createNodeMapper(edgeMap:yfiles.algorithms.IEdgeMap):yfiles.collections.IMapper; + /** + * Yields the edge that has been created as a copy in {@link yfiles.layout.YGraphAdapter#yGraph} to represent the given edge. + * @param {yfiles.graph.IEdge} edge The edge for which the representation is returned. + * @returns {yfiles.algorithms.Edge} The edge that represents edge in {@link yfiles.layout.YGraphAdapter#yGraph}. + */ + getCopiedEdge(edge:yfiles.graph.IEdge):yfiles.algorithms.Edge; + /** + * Yields the node that has been created as a copy in {@link yfiles.layout.YGraphAdapter#yGraph} to represent the given node. + * @param {yfiles.graph.INode} node The node for which the representation is returned. + * @returns {yfiles.algorithms.Node} The node that represents node in {@link yfiles.layout.YGraphAdapter#yGraph}. + */ + getCopiedNode(node:yfiles.graph.INode):yfiles.algorithms.Node; + /** + * Yields the original edge from the {@link yfiles.layout.YGraphAdapter#originalGraph original IGraph} that the given edge has been created for. + * @param {yfiles.algorithms.Edge} edge The edge for which the original instance will be returned. + * @returns {yfiles.graph.IEdge} The original instance. + */ + getOriginalEdge(edge:yfiles.algorithms.Edge):yfiles.graph.IEdge; + /** + * Yields the original node from the {@link yfiles.layout.YGraphAdapter#originalGraph original IGraph} that the given node has been created for. + * @param {yfiles.algorithms.Node} node The node for which the original instance will be returned. + * @returns {yfiles.graph.INode} The original instance. + */ + getOriginalNode(node:yfiles.algorithms.Node):yfiles.graph.INode; + /** + * Gets the graph instance that is created during the constructor call. + * @type {yfiles.algorithms.Graph} + */ + yGraph:yfiles.algorithms.Graph; + /** + * Gets the original graph instance. + * @type {yfiles.graph.IGraph} + */ + originalGraph:yfiles.graph.IGraph; + static $class:yfiles.lang.Class; + } + }export namespace labeling{ + export enum OptimizationStrategy{ + /** + * An optimization strategy aiming at a good balance between the available optimization options. + * @see yfiles.labeling.MISLabelingBase#optimizationStrategy + */ + BALANCED, + /** + * An optimization strategy that especially reduces overlaps between labels and nodes as well as labels and node halos. + * @see yfiles.labeling.MISLabelingBase#optimizationStrategy + */ + NODE_OVERLAP, + /** + * An optimization strategy that especially reduces overlaps between labels. + * @see yfiles.labeling.MISLabelingBase#optimizationStrategy + */ + LABEL_OVERLAP, + /** + * An optimization strategy that especially reduces overlaps between labels and edges. + * @see yfiles.labeling.MISLabelingBase#optimizationStrategy + */ + EDGE_OVERLAP, + /** + * An optimization strategy that mainly tries to satisfy the preferences described by a {@link yfiles.layout.PreferredPlacementDescriptor} + * associated with edge labels. + * @see yfiles.labeling.MISLabelingBase#optimizationStrategy + */ + PREFERRED_PLACEMENT, + /** + * Use no optimization strategy. + */ + NONE + } + /** + * A generic labeling algorithm for placing the labels of a graph. + *

+ * {@graph {"ann":{"s":[30,30],"d":1,"c":1,"lblFlip":1,"lblB":1},"n":[[249.44,602.63,[[212.75,626.98,32.69,18.7,"Node"]]],[306.92,686.94,[[270.24,711.29,32.69,18.7,"Node"]]],[481.7,787.85,[[515.7,812.2,32.69,18.7,"Node"]]],[219.36,505.12,[[182.67,529.47,32.69,18.7,"Node"]]],[386.71,750.57,[[350.02,774.92,32.69,18.7,"Node"]]],[885,353.19,[[883.66,405.89,32.69,18.7,"Node"]]],[840.72,261.25,[[839.38,257.25,32.69,18.7,"Node"]]],[583.46,112.72,[[582.11,108.72,32.69,18.7,"Node"]]],[249.44,305.56,[[212.75,329.91,32.69,18.7,"Node"]]],[682.94,135.42,[[681.6,131.42,32.69,18.7,"Node"]]],[481.7,120.34,[[480.35,116.34,32.69,18.7,"Node"]]],[771.32,186.45,[[769.97,182.45,32.69,18.7,"Node"]]],[219.36,403.07,[[182.67,427.42,32.69,18.7,"Node"]]],[306.92,221.25,[[270.24,245.6,32.69,18.7,"Node"]]],[386.71,157.62,[[385.36,153.62,32.69,18.7,"Node"]]]],"e":[[0,1,[],[[259.45,643.51,32.03,18.7,0.826238774315996,-0.5633200580636204,"Edge"]]],[3,0,[],[[221.61,542.21,32.03,18.7,0.9555728057861415,-0.294755174410902,"Edge"]]],[1,4,[],[[349.3,723.77,32.03,18.7,0.6234898018587343,-0.7818314824680294,"Edge"]]],[4,2,[],[[418.05,771.98,32.03,18.7,0.36534102436639637,-0.9308737486442037,"Edge"]]],[3,5,[],[[262.64,513.66,32.03,18.7,-0.2225209339563144,-0.9749279121818236,"Edge"]]],[2,5,[],[[534.29,789.82,32.03,18.7,-0.7330518718298267,-0.680172737770919,"Edge"]]],[4,5,[],[[427.6,744.91,32.03,18.7,-0.6234898018587336,-0.7818314824680299,"Edge"]]],[1,5,[],[[350.46,685.47,32.03,18.7,-0.5000000000000003,-0.8660254037844386,"Edge"]]],[0,5,[],[[298.89,624.2,32.03,18.7,-0.3653410243663947,-0.9308737486442044,"Edge"]]],[5,6,[],[[878.37,323.28,32.03,18.7,0.9009688679024184,-0.4338837391175598,"Edge"]]],[7,5,[],[[611.91,162.36,32.03,18.7,0.6234898018587336,-0.7818314824680299,"Edge"]]],[8,5,[],[[292.35,341.41,32.03,18.7,0.07473009358642455,-0.9972037971811801,"Edge"]]],[9,7,[],[[645.8,157.7,32.03,18.7,0.2225209339563144,-0.9749279121818236,"Edge"]]],[7,10,[],[[549.55,131.38,32.03,18.7,-0.07473009358642278,-0.9972037971811804,"Edge"]]],[10,5,[],[[515.14,167.59,32.03,18.7,0.5000000000000003,-0.8660254037844386,"Edge"]]],[6,11,[],[[796.42,239.83,32.03,18.7,0.7330518718298267,-0.680172737770919,"Edge"]]],[11,9,[],[[733.51,192.55,32.03,18.7,0.4999999999999995,-0.866025403784439,"Edge"]]],[8,12,[],[[267.76,373.25,32.03,18.7,-0.9555728057861401,-0.29475517441090626,"Edge"]]],[12,3,[],[[253.06,467.1,32.03,18.7,-1.0,-2.7257675990577433E-15,"Edge"]]],[12,5,[],[[265.18,415.76,32.03,18.7,-0.07473009358642366,-0.9972037971811802,"Edge"]]],[13,5,[],[[347.6,261.29,32.03,18.7,0.22252093395631525,-0.9749279121818234,"Edge"]]],[13,8,[],[[284.16,291.63,32.03,18.7,-0.826238774315993,-0.5633200580636247,"Edge"]]],[10,14,[],[[450.54,153.46,32.03,18.7,-0.3653410243663931,-0.930873748644205,"Edge"]]],[14,13,[],[[349.3,214.42,32.03,18.7,-0.6234898018587314,-0.7818314824680315,"Edge"]]],[14,5,[],[[424.24,201.56,32.03,18.7,0.36534102436639554,-0.930873748644204,"Edge"]]]],"vp":[182.0,90.0,735.0,728.0]}} Node labels and edge labels placed by the labeling algorithm + *

+ *

+ * This algorithm can switch between two internal implementations. By default, it generates high quality label placements + * even for difficult instances. This especially holds if the label models allow a large number of different + * {@link yfiles.layout.LabelCandidate}s, i.e., there is a high potential for optimizations. + *

+ *

+ * If the duration of the calculation is of utmost importance, the internal algorithm can be changed to a simpler + * implementation by setting {@link yfiles.labeling.GenericLabeling#maximumDuration} to 0. On the downside, the results will not be as good as the ones of the default mode. + *

+ *

+ * In default mode, this algorithm reduces the labeling problem to the maximum independent set (MIS) problem and solves the + * problem using simulated annealing. It is inspired by the article from Christensen, Marks and Shieber: A General + * Cartographic Labelling Algorithm. + *

+ *

+ * It is recommended to use {@link yfiles.layout.IEdgeLabelLayoutModel}s and + * {@link yfiles.layout.INodeLabelLayoutModel}s which allow free positioning of labels to achieve best results with this generic + * labeling algorithm. + *

+ *

+ * This algorithm works according to the general labeling concept defined by {@link yfiles.labeling.LabelingBase}. + *

+ * @see yfiles.labeling.LabelingBase + * @class yfiles.labeling.GenericLabeling + * @extends {yfiles.labeling.MISLabelingBase} + */ + export interface GenericLabeling extends yfiles.labeling.MISLabelingBase{} + export class GenericLabeling { + /** + * Creates a new instance of {@link yfiles.labeling.GenericLabeling} with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets whether or not this algorithm behaves deterministically. + *

+ * If enabled, it produces the same results given the same input graph and settings. + *

+ * @type {boolean} + */ + deterministic:boolean; + /** + * Gets or sets the time limit for this algorithm in milliseconds. + *

+ * 0x7FFFFFFF denotes that there is no time limit. Values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given maximum duration is negative + * @type {number} + */ + maximumDuration:number; + static $class:yfiles.lang.Class; + } + /** + * An abstract base class for generic labeling algorithms which place labels of graphs. + *

+ * Labeling algorithms compute positions for labels in a given graph. The main goal is to place labels such that they do + * not overlap with other graph elements. Labeling algorithms do not modify positions of nodes and edges. + *

+ *

+ * Concept + *

+ *

+ * Generic labeling algorithms use the model associated with a label (i.e. {@link yfiles.layout.INodeLabelLayout#labelModel node label model} for nodes and {@link yfiles.layout.IEdgeLabelLayout#labelModel edge label model} + * for edges). The models are necessary to compute a set of {@link yfiles.layout.LabelCandidate}s, i.e., candidate positions for a + * label. Then, one best matching candidate from the set will be selected. This selection depends on several preferences, e.g., if {@link yfiles.labeling.LabelingBase#removeNodeOverlaps overlaps with nodes} + * are not allowed, candidates encoding overlapping positions will be ignored. + *

+ *

+ * After one {@link yfiles.layout.LabelCandidate} has been chosen, the label model's parameter is used for encoding the label + * position. Therefore, the result of a generic labeling algorithm is one model parameter per label. The parameter is {@link yfiles.layout.ILabelLayout#modelParameter stored with the label} + * and expresses the label position with respect to the underlying label model. + *

+ *

+ * Features + *

+ *

+ * This class provides a general frame, offering functionality which can be shared by other generic labeling algorithms. + *

+ *

+ * To only place labels or a subset of labels, the main labeling methods Label, {@link yfiles.labeling.LabelingBase#label} and {@link yfiles.labeling.LabelingBase#label} + * are offered. + *

+ *

+ * As this class represents an {@link yfiles.layout.LayoutStageBase}, it allows usage as a generic labeling stage. By combining it + * with a + * {@link yfiles.layout.LayoutStageBase#coreLayout core layouter}, the labeling will take place after the core layouter was executed + * ({@link yfiles.labeling.LabelingBase#applyLayout}). This is especially useful if the core layouter does not support label + * handling. + *

+ * @class yfiles.labeling.LabelingBase + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface LabelingBase extends yfiles.layout.LayoutStageBase{} + export class LabelingBase { + /** + * Creates a new {@link yfiles.labeling.LabelingBase} instance with default settings. + * @constructor + */ + constructor(); + /** + * Returns the profit for placing a {@link yfiles.layout.LabelCandidate} with respect to the current {@link yfiles.labeling.LabelingBase#profitModel profit model}. + *

+ * Method {@link yfiles.layout.IProfitModel#getProfit} on the current profit model will be invoked to compute the actual profit + * value. + *

+ *

+ * The higher the profit (rank) of a candidate is, the more likely it will be chosen as actual position by the algorithm. + *

+ * @param {yfiles.layout.LabelCandidate} candidate a label candidate + * @returns {number} the profit value between 0 and 1 + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + /** + * Places the labels of the input graph restricting the placement to labels contained in the given lists. + *

+ * The {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey selection} will not be considered; the given lists will define the selection of labels that are to be placed. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.YList} nodeLabels a list of {@link yfiles.layout.INodeLabelLayout}s defining the set of node labels that will be placed + * @param {yfiles.algorithms.YList} edgeLabels a list of {@link yfiles.layout.IEdgeLabelLayout}s defining the set of edge labels that will be placed + */ + label(graph:yfiles.layout.LayoutGraph,nodeLabels:yfiles.algorithms.YList,edgeLabels:yfiles.algorithms.YList):void; + /** + * Places the labels of the input graph using a {@link yfiles.algorithms.IDataProvider} registered to the input graph with the + * given key for determining which labels to place. + *

+ * Instead of considering the current {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey selection key}, the {@link yfiles.algorithms.IDataProvider} registered with the given key will + * be used for selecting labels. Invoking this method has the same effect as first {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey specifying the key} as selection key and + * then invoking Label. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {Object} [key=null] the {@link yfiles.algorithms.IDataProvider} key for label selection + */ + label(graph:yfiles.layout.LayoutGraph,key?:Object):void; + /** + * Data provider key for mapping models to edge/node labels + *

+ * The {@link yfiles.layout.INodeLabelLayoutModel}s and {@link yfiles.layout.IEdgeLabelLayoutModel}s linked to + * {@link yfiles.layout.INodeLabelLayout}s and {@link yfiles.layout.IEdgeLabelLayout}s by this {@link yfiles.algorithms.IDataProvider} are taken as + * replacement models. This means that the original model is internally replaced by another model when computing valid + * positions for the label. A model parameter that fits the calculated position of the replacement model best is set for + * the original label model. + *

+ * @const + * @static + * @type {yfiles.algorithms.ILabelLayoutDpKey.} + */ + static LABEL_MODEL_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; + /** + * Gets or sets the {@link yfiles.layout.IProfitModel} for ranking the {@link yfiles.layout.LabelCandidate}s for labels. + *

+ * The profit model is used when {@link yfiles.labeling.LabelingBase#getProfit calculating the profit} of a candidate. + *

+ *

+ * The higher the profit (rank) of a candidate is, the more likely it will be chosen as actual position by the algorithm. + *

+ * @see yfiles.layout.IProfitModel + * @see yfiles.layout.SimpleProfitModel + * @see yfiles.labeling.LabelingBase#getProfit + * @type {yfiles.layout.IProfitModel} + */ + profitModel:yfiles.layout.IProfitModel; + /** + * Gets or sets whether or not internal node labels are allowed to move. + *

+ * A node label is internal if the label's boundaries are completely within the node's boundaries. + *

+ * @type {boolean} + */ + moveInternalNodeLabels:boolean; + /** + * Gets or sets whether or not a post-processing step to reduce the number of label overlaps is applied. + * @type {boolean} + */ + reduceLabelOverlaps:boolean; + /** + * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with nodes are removed. + *

+ * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely + * that an overlapping candidate is finally chosen. + *

+ *

+ * The detection and removal of labels that overlap with nodes may increase the runtime of this algorithm. + *

+ * @type {boolean} + */ + removeNodeOverlaps:boolean; + /** + * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with edges are removed. + *

+ * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely + * that an overlapping candidate is finally chosen. + *

+ *

+ * The detection and removal of labels that overlap with edges may increase the runtime of this algorithm. + *

+ * @type {boolean} + */ + removeEdgeOverlaps:boolean; + /** + * Gets or sets whether or not labels assigned to nodes are placed. + * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey + * @type {boolean} + */ + placeNodeLabels:boolean; + /** + * Gets or sets whether or not labels assigned to edges are placed. + * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey + * @type {boolean} + */ + placeEdgeLabels:boolean; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to mark labels as selected for placement. + *

+ * If a {@link yfiles.algorithms.IDataProvider} is registered with this key, only the selected labels will be placed, while all + * other labels are considered fixed. + *

+ *

+ * The registered {@link yfiles.algorithms.IDataProvider} needs to map from {@link yfiles.layout.ILabelLayout} to {@link boolean} where true indicates + * that a label should be placed and false indicates that a label should be ignored. + *

+ * @type {Object} + */ + affectedLabelsDpKey:Object; + /** + * Gets or sets whether or not edge labels are automatically flipped if otherwise they would be upside-down. + * @type {boolean} + */ + autoFlipping:boolean; + /** + * Gets or sets whether or not edge labels may overlap with edges belonging to the same edge group as the label's edge. + *

+ * An edge group is a set of edges which share a common bus near the target or source node. They are defined using + * {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} and + * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {boolean} + */ + edgeGroupOverlapAllowed:boolean; + static $class:yfiles.lang.Class; + } + /** + * A base class for generic labeling algorithms which solve the labeling problem by reducing it to the maximum independent + * set (MIS) problem. + *

+ * Different optimization strategies are available; an optimization strategy defines which criteria the algorithm should + * try to optimize. For example, reducing the number of overlaps between labels and nodes may be considered more important + * than reducing the number of overlaps between labels and edges. + *

+ * @see yfiles.labeling.GenericLabeling + * @class yfiles.labeling.MISLabelingBase + * @extends {yfiles.labeling.LabelingBase} + */ + export interface MISLabelingBase extends yfiles.labeling.LabelingBase{} + export class MISLabelingBase { + /** + * Creates a new {@link yfiles.labeling.MISLabelingBase} instance with default settings. + * @constructor + */ + constructor(); + /** + * Returns a {@link yfiles.algorithms.INodeMap} which assigns a profit value to each node in the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. + *

+ * As the conflict graph's nodes represent {@link yfiles.layout.LabelCandidate}s, this mapping gives the profit value of label + * candidates. The assigned value is defined as the difference between the {@link yfiles.labeling.LabelingBase#getProfit profit induced by the profit model} and the + * candidate's {@link yfiles.layout.LabelCandidate#overlapPenalty overlap penalty}. + *

+ *

+ * The returned map is a mapping from each {@link yfiles.algorithms.Node} (representing a label candidate) in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} + * to a {@link number} representing the profit value of the candidate. + *

+ * @returns {yfiles.algorithms.INodeMap} a mapping from nodes (i.e. label candidates) to their profit value + */ + assignProfit():yfiles.algorithms.INodeMap; + /** + * Creates the edges in the conflict graph, i.e., one edge between two nodes if the corresponding + * {@link yfiles.layout.LabelCandidate}s intersect. + *

+ * The nodes of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph} represent + * {@link yfiles.layout.LabelCandidate}s. An edge between candidates signals that they overlap. A maximum independent set will be + * computed on the conflict graph to choose candidates such that no two candidates overlap. + *

+ *

+ * This method may be overridden to change the structure of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. Edges between two + * {@link yfiles.layout.LabelCandidate}s in the conflict graph signal that the two candidates should not be selected together. By + * overriding this method, arbitrary reasons for indicating that two label candidates should not be chosen at the same time + * can be modeled. + *

+ * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @see yfiles.labeling.MISLabelingBase#nodesToBoxes + * @see yfiles.labeling.MISLabelingBase#boxesToNodes + * @see yfiles.labeling.MISLabelingBase#nodesToID + * @protected + */ + createEdges():void; + /** + * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and an {@link yfiles.algorithms.Edge} of the input graph has + * been found. + *

+ * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor + * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. + *

+ *

+ * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and edges. + *

+ * @param {yfiles.layout.LabelCandidate} labelCandidate the {@link yfiles.layout.LabelCandidate} overlapping with the given {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Edge} edge the {@link yfiles.algorithms.Edge} overlapping with the given {@link yfiles.layout.LabelCandidate} + * @param {yfiles.algorithms.LineSegment} eSegment the {@link yfiles.algorithms.LineSegment} of the given edge overlapping with the given candidate + * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @see yfiles.labeling.MISLabelingBase#createEdges + */ + foundEdgeOverlap(labelCandidate:yfiles.layout.LabelCandidate,edge:yfiles.algorithms.Edge,eSegment:yfiles.algorithms.LineSegment):void; + /** + * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and a {@link yfiles.layout.NodeHalo} of the input graph has + * been found. + *

+ * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor + * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. + *

+ *

+ * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and node + * halos. + *

+ * @param {yfiles.layout.LabelCandidate} labelCandidate the {@link yfiles.layout.LabelCandidate} overlapping with a node halo + * @param {yfiles.algorithms.Node} node the {@link yfiles.algorithms.Node} whose {@link yfiles.layout.NodeHalo} is overlapping with the given label candidate + * @param {yfiles.algorithms.YRectangle} haloRect the bounding box of the {@link yfiles.layout.NodeHalo} overlapping with the given label candidate + * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @see yfiles.labeling.MISLabelingBase#createEdges + */ + foundHaloOverlap(labelCandidate:yfiles.layout.LabelCandidate,node:yfiles.algorithms.Node,haloRect:yfiles.algorithms.YRectangle):void; + /** + * Indicates that an overlap between two {@link yfiles.layout.LabelCandidate}s has been found. + *

+ * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the + * {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor indicating how much the two candidates overlap. The factor influences the penalty + * assigned when both candidates are chosen, i.e., the penalty for the corresponding overlap. + *

+ *

+ * This method may be overridden to realize a custom strategy for reacting to overlaps among + * {@link yfiles.layout.LabelCandidate}s. + *

+ * @param {yfiles.layout.LabelCandidate} candidate1 the first overlapping {@link yfiles.layout.LabelCandidate} + * @param {yfiles.layout.LabelCandidate} candidate2 the second overlapping {@link yfiles.layout.LabelCandidate} + * @param {yfiles.algorithms.Edge} edge the {@link yfiles.algorithms.Edge} in {@link yfiles.labeling.MISLabelingBase#conflictGraph} representing the found overlap + * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @see yfiles.labeling.MISLabelingBase#createEdges + */ + foundLabelOverlap(candidate1:yfiles.layout.LabelCandidate,candidate2:yfiles.layout.LabelCandidate,edge:yfiles.algorithms.Edge):void; + /** + * Indicates that an overlap between a {@link yfiles.layout.LabelCandidate} and a {@link yfiles.algorithms.Node} of the input graph has + * been found. + *

+ * This method is called when finding overlaps while {@link yfiles.labeling.MISLabelingBase#createEdges creating edges} of the {@link yfiles.labeling.MISLabelingBase#conflictGraph conflict graph}. It will store a factor + * indicating how much the two elements overlap. The factor influences the {@link yfiles.labeling.LabelingBase#getProfit profit} assigned to the given label candidate. + *

+ *

+ * This method may be overridden to realize a custom strategy for reacting to overlaps between label candidates and nodes. + *

+ * @param {yfiles.layout.LabelCandidate} labelCandidate the {@link yfiles.layout.LabelCandidate} overlapping with the given node + * @param {yfiles.algorithms.Node} node the {@link yfiles.algorithms.Node} overlapping with the given label candidate + * @param {yfiles.algorithms.YRectangle} nodeBox the bounding box of the given node + * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @see yfiles.labeling.MISLabelingBase#createEdges + */ + foundNodeOverlap(labelCandidate:yfiles.layout.LabelCandidate,node:yfiles.algorithms.Node,nodeBox:yfiles.algorithms.YRectangle):void; + /** + * The input graph that will be labeled. + * @type {yfiles.layout.LayoutGraph} + */ graph:yfiles.layout.LayoutGraph; /** - * The horizontal distance between adjacent nodes. - * By default a value of 10 is set. - */ - horizontalSpace:number; + * The conflict graph modeling + * {@link yfiles.layout.LabelCandidate}s as nodes and edges between them as conflicts, i.e., overlaps among candidates. + * @see yfiles.labeling.MISLabelingBase#createEdges + * @type {yfiles.algorithms.Graph} + */ + conflictGraph:yfiles.algorithms.Graph; /** - * The vertical distance between adjacent nodes. - * By default a value of 10 is set. - */ - verticalSpace:number; + * The mapping from each node in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} to the corresponding {@link yfiles.layout.LabelCandidate} + * instance. + * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @type {yfiles.algorithms.INodeMap} + */ + nodesToBoxes:yfiles.algorithms.INodeMap; /** - * Core layout routine. - * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} - */ - doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + * The mapping from the {@link yfiles.layout.LabelCandidate}s to the corresponding nodes in the + * {@link yfiles.labeling.MISLabelingBase#conflictGraph}. + * @see yfiles.labeling.MISLabelingBase#conflictGraph + * @type {yfiles.collections.IMap.} + */ + boxesToNodes:yfiles.collections.IMap; /** - * The core layouter can layout trees. - * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} - */ - canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + * The mapping from nodes in the {@link yfiles.labeling.MISLabelingBase#conflictGraph} to a corresponding integer value (ID). + *

+ * The ID denotes the actual label which a {@link yfiles.layout.LabelCandidate} (i.e. a node in the conflict graph) belongs to. + *

+ * @type {yfiles.algorithms.INodeMap} + */ + nodesToID:yfiles.algorithms.INodeMap; /** - * Returns whether or not the subtree rooted at the given node should - * be laid out vertically. - */ - isVerticalRoot(v:yfiles.algorithms.Node):boolean; + * Gets or sets the ratio between the internal profit (ip) and the profit computed using the specified {@link yfiles.labeling.LabelingBase#profitModel profit model} (sp). + *

+ * This ratio defines how to weight the two profit values (ip) and (sp). The overall ratio is then computed as + * ratio * sp + (1 - ratio) * ip. The profit of a {@link yfiles.layout.LabelCandidate} defines how likely it is that the candidate + * will be chosen as actual label position. + *

+ *

+ * The ratio is defined to be a value from the interval [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative or larger than 1 + * @see yfiles.labeling.LabelingBase#profitModel + * @see yfiles.labeling.MISLabelingBase#optimizationStrategy + * @type {number} + */ + customProfitModelRatio:number; /** - * 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; + * Gets or sets the optimization strategy which defines the importance of criteria when optimizing labeling results. + *

+ * Depending on the strategy, criteria like label-node overlaps, label-label overlaps and others are more or less + * important. For example, if the number of overlaps between labels and nodes is the most important criterion for the + * result, strategy {@link yfiles.labeling.OptimizationStrategy#NODE_OVERLAP} should be chosen. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given strategy is unknown + * @type {yfiles.labeling.OptimizationStrategy} + */ + optimizationStrategy:yfiles.labeling.OptimizationStrategy; /** - * 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; + * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with nodes are removed. + *

+ * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely + * that an overlapping candidate is finally chosen. + *

+ *

+ * The detection and removal of labels that overlap with nodes may increase the runtime of this algorithm. + *

+ * @type {boolean} + */ + removeNodeOverlaps:boolean; + /** + * Gets or sets whether or not {@link yfiles.layout.LabelCandidate label candidates} that overlap with edges are removed. + *

+ * If overlapping candidates are not removed, they will be considered but get a penalty. Therefore, it is still less likely + * that an overlapping candidate is finally chosen. + *

+ *

+ * The detection and removal of labels that overlap with edges may increase the runtime of this algorithm. + *

+ * @type {boolean} + */ + removeEdgeOverlaps:boolean; + /** + * Gets or sets whether or not the number of ambiguous label placements is reduced by applying an additional optimization + * step. + *

+ * A label position is considered to be ambiguous if it might not be possible to identify to which graph element the label + * belongs. For example, an edge label placed in between two edges is ambiguous. + *

+ *

+ * Enabling this reduction step does not guarantee that no ambiguous placements are selected. The algorithm will try to + * avoid them if other good positions without ambiguity are available. Other aspects like {@link yfiles.layout.PreferredPlacementDescriptor preferred placement} for edge + * labels will still be more important than the reduction of ambiguity. + *

+ * @type {boolean} + */ + reduceAmbiguity:boolean; + static $class:yfiles.lang.Class; } - 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} - */ + * Specifies custom data for the {@link yfiles.labeling.GenericLabeling}. + * @class yfiles.labeling.LabelingData + * @extends {yfiles.layout.LayoutData} + */ + export interface LabelingData extends yfiles.layout.LayoutData{} + export class LabelingData { + constructor(); + /** + * Gets or sets the collection of labels that shall be placed by the algorithm. + *

+ * Note that the {@link yfiles.layout.DpKeyItemCollection.#dpKey} has to be set to the key assigned to {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey}. + *

+ * @see yfiles.labeling.LabelingBase#affectedLabelsDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedLabels:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets the mapping from node labels to an {@link yfiles.layout.INodeLabelLayoutModel} used by the labeling algorithm + * instead of the original label model. + *

+ * If a label has no mapping, the original model is used as normal. + *

+ * @see yfiles.labeling.LabelingBase#LABEL_MODEL_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeLabelModels:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edge labels to an {@link yfiles.layout.IEdgeLabelLayoutModel} used by the labeling algorithm + * instead of the original label model. + *

+ * If a label has no mapping, the original model is used as normal. + *

+ * @see yfiles.labeling.LabelingBase#LABEL_MODEL_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeLabelModels:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + }export namespace partial{ + export enum EdgeRoutingStrategy{ + /** + * A routing strategy that produces orthogonal routes for partial edges and inter-edges. + *

+ * A route of an edge is called orthogonal if it only consists of vertical and horizontal segments. + *

+ *

+ * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. + *

+ * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + */ + ORTHOGONAL, + /** + * A routing strategy that produces straight-line routes for partial edges and inter-edges. + *

+ * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. + *

+ * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + */ + STRAIGHTLINE, + /** + * Automatically chooses a suitable routing strategy for partial edges and inter-edges by analyzing the routes of the fixed + * edges. If, for example, all fixed edges have orthogonal edge routes, inter-edges will be routed orthogonally, too. + *

+ * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. + *

+ * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + */ + AUTOMATIC, + /** + * A routing strategy that produces organic routes for partial edges and inter-edges. + *

+ * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. + *

+ * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + */ + ORGANIC, + /** + * A routing strategy that produces octilinear routes for partial edges and inter-edges. + *

+ * A route of an edge is called octilinear if the slope of each segment is a multiple of 45 degrees. + *

+ *

+ * Inter-edges are edges between fixed and partial nodes as well as edges between different subgraph components. + *

+ * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + */ + OCTILINEAR + } + export enum ComponentAssignmentStrategy{ + /** + * A component assignment strategy that assigns each partial node to a separate subgraph component. + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + */ + SINGLE, + /** + * A component assignment strategy where the subgraph components correspond to the connected components of the graph + * induced by the partial elements. + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + */ + CONNECTED, + /** + * A component assignment strategy where the subgraph components correspond to the clusters computed by a clustering + * algorithm based on {@link yfiles.algorithms.Groups#edgeBetweennessClustering edge betweenness centrality}. + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + */ + CLUSTERING, + /** + * A component assignment strategy where the subgraph components are defined by the user. Two partial nodes are considered + * to be in the same component if the {@link yfiles.algorithms.IDataProvider} associated with key {@link yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY} + * returns the same object for both of them. + * @see yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + */ + CUSTOMIZED + } + export enum SubgraphPlacement{ + /** + * A positioning strategy which tries to place each subgraph component close to the barycenter of its graph neighbors. + * @see yfiles.partial.PartialLayout#subgraphPlacement + */ + BARYCENTER, + /** + * A positioning strategy which tries to place each subgraph component close to its original position. + * @see yfiles.partial.PartialLayout#subgraphPlacement + */ + FROM_SKETCH + } + export enum LayoutOrientation{ + /** + * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each + * predecessor of a node v is placed above v and each successor below v. + * @see yfiles.partial.PartialLayout#layoutOrientation + */ + TOP_TO_BOTTOM, + /** + * Layout orientation specifier where the algorithm tries to place partial nodes (subgraph components) such that each + * predecessor of a node v is placed below v and each successor above v. + * @see yfiles.partial.PartialLayout#layoutOrientation + */ + BOTTOM_TO_TOP, + /** + * Layout orientation specifier where the algorithm tries 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 yfiles.partial.PartialLayout#layoutOrientation + */ + LEFT_TO_RIGHT, + /** + * Layout orientation specifier where the algorithm tries 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 yfiles.partial.PartialLayout#layoutOrientation + */ + RIGHT_TO_LEFT, + /** + * Layout orientation specifier where the algorithm automatically detects the layout orientation. + *

+ * The algorithm analyzes the flow direction of fixed edges in the current drawing. If there is no common flow direction, + * the results are the same as for {@link yfiles.partial.LayoutOrientation#NONE}. Otherwise, the layout orientation is either + * {@link yfiles.partial.LayoutOrientation#TOP_TO_BOTTOM}, {@link yfiles.partial.LayoutOrientation#BOTTOM_TO_TOP}, {@link yfiles.partial.LayoutOrientation#LEFT_TO_RIGHT} + * or {@link yfiles.partial.LayoutOrientation#RIGHT_TO_LEFT}. + *

+ * @see yfiles.partial.PartialLayout#layoutOrientation + */ + AUTO_DETECT, + /** + * Layout orientation specifier where the layout orientation is completely ignored. + * @see yfiles.partial.PartialLayout#layoutOrientation + */ + NONE + } + /** + * This class represents a partial layout algorithm which changes the coordinates for a given set of graph elements (called + * partial elements) only. + *

+ * The location and size of the remaining elements (called fixed elements) is not allowed to be changed.Layout Style + *

+ *

+ * This partial layout algorithm offers a kind of generic partial layout support for other existing layout algorithms. + * Hence, its layout style heavily depends on the selected {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm} as well as the specified {@link yfiles.partial.PartialLayout#edgeRouter edge router} or + * {@link yfiles.partial.PartialLayout#edgeRoutingStrategy edge routing strategy}. + *

+ *

+ * The partial layout is suitable for applications where users may incrementally add new elements to an existing drawing. + * The added elements should be arranged so that they fit best possible into the given diagram without making any changes + * to the already existing layout. Hence, the so-called mental map of the existing drawing is preserved. + *

+ *

+ * {@graph {"ann":{"s":[60,30],"d":1},"n":[[49.74,127.62,295.26,342.38,2,[[49.74,150,295.26,22.38,"Group"]]],[270,425,[[291.33,449.35,17.35,18.7,"16"]]],[270,375,[[291.33,399.35,17.35,18.7,"18"]]],[200,375,[[221.33,399.35,17.35,18.7,"19"]]],[64.74,405.17,1,[[86.07,429.52,17.35,18.7,"13"]]],[200,265,[[221.33,289.35,17.35,18.7,"20"]]],[100,215,[[124.66,239.35,10.67,18.7,"2"]]],[100,165,[[124.66,189.35,10.67,18.7,"3"]]],[100,265,[[121.33,289.35,17.35,18.7,"22"]]],[-420.63,317.87,375.21,302.93,3,[[-420.63,340.25,375.21,22.38,"Group"]]],[-179.98,534.8,1,[[-155.31,559.15,10.67,18.7,"6"]]],[-163.42,363.25,1,[[-142.09,387.6,17.35,18.7,"12"]]],[-371.63,364.65,1,[[-346.96,389,10.67,18.7,"8"]]],[-333.29,532.76,1,[[-308.62,557.11,10.67,18.7,"9"]]],[-176.17,453.25,1,[[-154.84,477.6,17.35,18.7,"11"]]],[370,215,[[394.66,239.35,10.67,18.7,"1"]]],[370,165,[[394.66,189.35,10.67,18.7,"4"]]],[-130.4,215,1,[[-105.74,239.35,10.67,18.7,"5"]]],[-224.19,264.44,1,[[-199.52,288.79,10.67,18.7,"7"]]],[370,425,[[391.33,449.35,17.35,18.7,"10"]]],[370,265,[[391.33,289.35,17.35,18.7,"14"]]],[370,375,[[391.33,399.35,17.35,18.7,"15"]]],[270,505,[[291.33,529.35,17.35,18.7,"17"]]],[440,165,[[461.33,189.35,17.35,18.7,"21"]]]],"e":[[13,12,0,-15,0,15],[13,14],[10,13,-30,4,0,0],[14,11],[6,7,0,-15,0,15],[5,8,-30,0,30,0],[1,2,0,-15,0,15],[2,3,-30,0,30,0],[4,3],[15,6,-30,0,30,0],[15,16,0,-15,0,15],[7,16,30,0,-30,0],[6,17],[17,18],[18,12],[10,19],[15,20,0,15,0,-15],[19,21,0,-15,0,15],[21,20,0,-15,0,15],[19,1,-30,0,30,0],[1,22,0,15,0,-15],[20,5,-30,0,30,0],[16,23,30,0,-30,0],[11,4,-30,0,0,0]],"vp":[-421.0,127.0,921.0,494.0]}} The input graph where marked nodes denote the partial elements that were incrementally added to the existing diagram. {@graph {"ann":{"s":[60,30],"d":1},"n":[[67.37,127.62,260,342.38,2,[[67.37,150,260,22.38,"Group"]]],[252.37,425,[[273.7,449.35,17.35,18.7,"16"]]],[252.37,375,[[273.7,399.35,17.35,18.7,"18"]]],[182.37,375,[[203.7,399.35,17.35,18.7,"19"]]],[182.37,321,1,[[203.7,345.35,17.35,18.7,"13"]]],[182.37,265,[[203.7,289.35,17.35,18.7,"20"]]],[82.37,215,[[107.03,239.35,10.67,18.7,"2"]]],[82.37,165,[[107.03,189.35,10.67,18.7,"3"]]],[82.37,265,[[103.7,289.35,17.35,18.7,"22"]]],[-147.05,387.62,180,185.56,3,[[-147.05,410,180,22.38,"Group"]]],[-42.05,425,1,[[-17.38,449.35,10.67,18.7,"6"]]],[-42.05,474.19,1,[[-20.72,498.54,17.35,18.7,"12"]]],[-132.05,425,1,[[-107.38,449.35,10.67,18.7,"8"]]],[-132.05,474.19,1,[[-107.38,498.54,10.67,18.7,"9"]]],[-42.05,528.19,1,[[-20.72,552.54,17.35,18.7,"11"]]],[352.37,215,[[377.03,239.35,10.67,18.7,"1"]]],[352.37,165,[[377.03,189.35,10.67,18.7,"4"]]],[-13.63,215,1,[[11.03,239.35,10.67,18.7,"5"]]],[-13.63,265,1,[[11.03,289.35,10.67,18.7,"7"]]],[352.37,425,[[373.7,449.35,17.35,18.7,"10"]]],[352.37,265,[[373.7,289.35,17.35,18.7,"14"]]],[352.37,375,[[373.7,399.35,17.35,18.7,"15"]]],[252.37,505,[[273.7,529.35,17.35,18.7,"17"]]],[422.37,165,[[443.7,189.35,17.35,18.7,"21"]]]],"e":[[13,12,0,-15,0,15],[13,14,0,15,-30,0,[-102.05,543.19]],[10,13,-30,0,30,0,[-54.55,440,-54.55,489.19]],[14,11,0,-15,0,15],[6,7,0,-15,0,15],[5,8,-30,0,30,0],[1,2,0,-15,0,15],[2,3,-30,0,30,0],[4,3,0,15,0,-15],[15,6,-30,0,30,0],[15,16,0,-15,0,15],[7,16,30,0,-30,0],[6,17,-30,0,30,0],[17,18,0,15,0,-15],[18,12,-30,0,0,-15,[-102.05,280]],[10,19,30,0,0,15,[27.95,440,27.95,474,382.37,474]],[15,20,0,15,0,-15],[19,21,0,-15,0,15],[21,20,0,-15,0,15],[19,1,-30,0,30,0],[1,22,0,15,0,-15],[20,5,-30,0,30,0],[16,23,30,0,-30,0],[11,4,30,5.2,-30,0,[119.87,494.39,119.87,336]]],"vp":[-148.0,127.0,631.0,447.0]}} + * The result of a partial layout run with {@link yfiles.partial.PartialLayout#componentAssignmentStrategy component assignment strategy} set to {@link yfiles.partial.ComponentAssignmentStrategy#SINGLE} + * and with {@link yfiles.partial.PartialLayout#considerNodeAlignment node alignment} enabled.Features + *

+ *

+ * Similar to the layout style, the supported feature set mainly depends on the features supported by the specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm} + * as well as the specified {@link yfiles.partial.PartialLayout#edgeRouter edge router} or {@link yfiles.partial.PartialLayout#edgeRoutingStrategy edge routing strategy}. The internal step that {@link yfiles.partial.PartialLayout#placeSubgraphs places the components} can handle + * group nodes as well as minimum distance constraints. Furthermore, it is able to consider node labels. + *

+ *

+ * Concept 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. + *

+ *

+ * The layout algorithm handles each selected graph element as partial element. For this, it looks up the {@link yfiles.algorithms.IDataProvider} + * keys {@link yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY} and {@link yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY}. Partial + * node elements can be assigned to the so-called subgraph components. During the layout process each subgraph induced by the nodes of a + * component is first laid out using the specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm}. 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 (see {@link yfiles.partial.PartialLayout#subgraphPlacement}), e.g., {@link yfiles.partial.SubgraphPlacement#BARYCENTER} + * specifies that the component should be placed close to the barycenter of its graph neighbors and {@link yfiles.partial.SubgraphPlacement#FROM_SKETCH} + * specifies that the component should be placed close to its original position. + *

+ *

+ * Method {@link yfiles.partial.PartialLayout#componentAssignmentStrategy} allows to specify the strategy that assigns 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 that nodes of a component cannot be assigned to different group nodes. + *

+ *

+ * Furthermore, the user can specify the edge routing strategy (see {@link yfiles.partial.PartialLayout#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}. + *

+ * @class yfiles.partial.PartialLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface PartialLayout extends yfiles.layout.LayoutStageBase{} + export class PartialLayout { + /** + * Creates a new instance of {@link yfiles.partial.PartialLayout} which uses the specified {@link yfiles.layout.ILayoutAlgorithm} instance + * as the core layout algorithm. + *

+ * This instance is applied to each subgraph component, see {@link yfiles.partial.PartialLayout#componentAssignmentStrategy}. + *

+ * @param {yfiles.layout.ILayoutAlgorithm} [subgraphLayouter=null] the layout algorithm that is applied to the subgraph components + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + * @constructor + */ + constructor(subgraphLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * This method is called each time when edges are routed with an edge router. + *

+ * Subclasses may modify the configuration of the given edge router instance. + *

+ *

+ * 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.EdgeRouter}, if the routing strategy + * is set to {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC} it's an instance of {@link yfiles.organic.OrganicLayout}, and, if the + * routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE} it's an instance of a private + * {@link yfiles.router.StraightLineEdgeRouter}. If the edge routing strategy is set to + * {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC}, the layout algorithm chooses one of the above strategies that best fits + * the routing style of the fixed edges. + *

+ * @param {yfiles.layout.ILayoutAlgorithm} edgeRouter the instance used for routing the edges + * @see yfiles.partial.PartialLayout#edgeRouter + * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + * @protected + */ + configureEdgeRouter(edgeRouter:yfiles.layout.ILayoutAlgorithm):void; + /** + * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and calculates the layout for the given subgraph component using the + * specified {@link yfiles.partial.PartialLayout#coreLayout core layout algorithm}. + *

+ * It is called once for each subgraph component. + *

+ *

+ * Subclasses may implement a custom layout strategy or add some additional data. + *

+ * @param {yfiles.layout.LayoutGraph} subGraph the subgraph component + * @protected + */ + layoutSubgraph(subGraph:yfiles.layout.LayoutGraph):void; + /** + * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and places the subgraph components one-by-one onto the drawing area. + *

+ * Therefore, it considers the {@link yfiles.partial.PartialLayout#subgraphPlacement specified objective} for finding a suitable position. + *

+ *

+ * Subclasses may implement a custom placement strategy or add some additional data. However, they must not modify the + * given subgraph component lists. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {Array.} subgraphComponents each entry contains a {@link yfiles.algorithms.NodeList} that induces a subgraph component + * @protected + */ + placeSubgraphs(graph:yfiles.layout.LayoutGraph,subgraphComponents:yfiles.algorithms.NodeList[]):void; + /** + * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and routes all partial edges that connect two fixed elements. + *

+ * It either uses a {@link yfiles.partial.PartialLayout#edgeRouter custom edge router} or an internal edge router that produces routes according to the specified + * {@link yfiles.partial.PartialLayout#edgeRoutingStrategy routing strategy}. + *

+ *

+ * Subclasses may implement a custom routing strategy or add some additional data. + *

+ * @param {yfiles.layout.LayoutGraph} graph the subgraph of the input graph induced by the fixed nodes + * @param {yfiles.algorithms.EdgeList} partialEdges the {@link yfiles.algorithms.EdgeList list of partial edges} to be routed + * @protected + */ + routeEdgesBetweenFixedElements(graph:yfiles.layout.LayoutGraph,partialEdges:yfiles.algorithms.EdgeList):void; + /** + * This method is called during the {@link yfiles.partial.PartialLayout#applyLayout layout process} and routes all inter-edges. + *

+ * Inter-edges are edges between different subgraph components including edges between fixed and partial elements. For the routing, + * this method uses the edge router instance set with method {@link yfiles.partial.PartialLayout#edgeRouter}. If no edge router was specified by the user, it uses an + * internal edge router with routing strategy {@link yfiles.partial.PartialLayout#edgeRoutingStrategy}. + *

+ *

+ * Subclasses may implement a custom routing strategy or add some additional data. + *

+ * @param {yfiles.layout.LayoutGraph} graph the relevant subgraph + * @param {yfiles.algorithms.EdgeList} interEdges the {@link yfiles.algorithms.EdgeList list of inter-edges} to be routed + * @protected + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; + /** + * Data provider key for marking partial nodes. + * @see yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for specifying the edges that should be considered to be directed. + *

+ * If a layout orientation is specified (i.e., {@link yfiles.partial.PartialLayout#layoutOrientation} is not + * {@link yfiles.partial.LayoutOrientation#NONE}), the algorithm tries to route directed edges such that they adhere to that + * orientation. + *

+ * @see yfiles.partial.PartialLayout#layoutOrientation + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DIRECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for marking partial edges. + * @see yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for obtaining the edges that should be routed by the edge router. + * @see yfiles.partial.PartialLayout#edgeRouter + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static ROUTE_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for defining custom subgraph components. + * @see yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static COMPONENT_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm} instance that is applied to each subgraph component. + *

+ * More precisely, during the layout process each subgraph induced by the (partial) nodes of a component (see + * {@link yfiles.partial.PartialLayout#componentAssignmentStrategy}) is first laid out using this instance. + *

+ * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the preferred time limit (in milliseconds) for the layout algorithm. + *

+ * The specified value has to be greater than or equal to 0. If the value is 0x7FFFFFFF, the time is not limited. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets 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. Hence, while enabling this option usually leads to shorter edge + * routes, the placement of subgraph components is less compact. + *

+ * @see yfiles.partial.PartialLayout#routeInterEdges + * @see yfiles.partial.PartialLayout#placeSubgraphs + * @type {boolean} + */ + routeInterEdgesImmediately:boolean; + /** + * Gets or sets whether or not a subgraph component may be placed within another subgraph component. + *

+ * Enabling this option leads to more compact layout results but requires more runtime. + *

+ * @type {boolean} + */ + componentCompaction:boolean; + /** + * Gets or sets whether or not fixed (non-partial) group nodes may be resized. + *

+ * Enabling this option may lead to better results if there are fixed group nodes, since there is more space for the + * partial elements. + *

+ * @type {boolean} + */ + resizeFixedGroups:boolean; + /** + * Gets or sets the objective used for finding 'good' positions for subgraph components. + * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined positioning strategies + * @type {yfiles.partial.SubgraphPlacement} + */ + subgraphPlacement:yfiles.partial.SubgraphPlacement; + /** + * Gets or sets the minimum distance between two adjacent nodes. + *

+ * The specified value has to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets whether or not partial nodes should be aligned. + *

+ * If this option is enabled, the algorithm tries to align the center of partial nodes with other nodes. + *

+ * @type {boolean} + */ + considerNodeAlignment:boolean; + /** + * Gets or sets the strategy that assigns partial nodes to subgraph components. + *

+ * The specified core layouter (see {@link yfiles.partial.PartialLayout#coreLayout}) independently calculates the layout for each such subgraph component. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined assignment strategies. + * @see yfiles.partial.PartialLayout#coreLayout + * @type {yfiles.partial.ComponentAssignmentStrategy} + */ + componentAssignmentStrategy:yfiles.partial.ComponentAssignmentStrategy; + /** + * Gets or sets whether or not a postprocessing step should be applied to reduce the number of directed edges that do not + * comply with the specified layout orientation. + * @see yfiles.partial.PartialLayout#layoutOrientation + * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY + * @type {boolean} + */ + optimizeOrientation:boolean; + /** + * Gets or sets the custom edge router instance that is used for partial edges and edges between different subgraph + * components (so-called inter-edges). + * @see yfiles.partial.PartialLayout#ROUTE_EDGE_DP_KEY + * @see yfiles.partial.PartialLayout#edgeRoutingStrategy + * @type {yfiles.layout.ILayoutAlgorithm} + */ + edgeRouter:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the routing strategy that is used for partial edges and edges between different subgraph components + * (so-called inter-edges). + * @throws {Stubs.Exceptions.ArgumentError} if the specified strategy does not match one of the predefined routing strategies + * @see yfiles.partial.PartialLayout#edgeRouter + * @type {yfiles.partial.EdgeRoutingStrategy} + */ + edgeRoutingStrategy:yfiles.partial.EdgeRoutingStrategy; + /** + * Gets or sets the layout orientation that is considered during the placement of partial elements. + *

+ * More precisely, the algorithm tries to place each {@link yfiles.partial.PartialLayout#componentAssignmentStrategy subgraph component} such that each predecessor of a component's node v + * is placed before v and each successor after v with respect to the layout orientation. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified orientation does not match one of the predefined orientations + * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY + * @type {yfiles.partial.LayoutOrientation} + */ + layoutOrientation:yfiles.partial.LayoutOrientation; + /** + * Gets or sets whether or not subgraph components are mirrored to improve the layout quality. + *

+ * If enabled, the algorithm checks for each component which of the four possible mirrorings minimizes the edge length. + *

+ * @type {boolean} + */ + allowMirroring:boolean; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.partial.PartialLayout}. + * @class yfiles.partial.PartialLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface PartialLayoutData extends yfiles.layout.LayoutData{} + export class PartialLayoutData { + constructor(); + /** + * Gets or sets the collection of nodes placed by the layout. + * @see yfiles.partial.PartialLayout#AFFECTED_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets the collection of edges placed by the layout. + * @see yfiles.partial.PartialLayout#AFFECTED_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the collection of edges that are considered as directed by the layout. + *

+ * Only if the {@link yfiles.partial.PartialLayout#layoutOrientation} is not {@link yfiles.partial.LayoutOrientation#NONE} the directedness of edges has an effect. + *

+ * @see yfiles.partial.PartialLayout#DIRECTED_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + directedEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping from partial nodes to an object defining their component assignment. + *

+ * All partial nodes associated with the same object are assigned to the same subgraph component. + *

+ * @see yfiles.partial.PartialLayout#COMPONENT_ID_DP_KEY + * @see yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED + * @see yfiles.partial.PartialLayout#componentAssignmentStrategy + * @type {yfiles.layout.ItemMapping.} + */ + componentIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the partition grid layout data. + * @type {yfiles.layout.PartitionGridData} + */ + partitionGridData:yfiles.layout.PartitionGridData; + static $class:yfiles.lang.Class; + } + }export namespace tree{ + /** + * Encapsulates information bound to a node while the algorithm calculates a layout. + * @class yfiles.tree.BalloonLayoutNodeInfo + */ + export interface BalloonLayoutNodeInfo extends Object{} + export class BalloonLayoutNodeInfo { + /** + * The upper angle of the subtree wedge rooted at the node. + * @type {number} + */ + upperAngle:number; + /** + * The lower angle of the subtree wedge rooted at the node. + * @type {number} + */ + lowerAngle:number; + /** + * The angle of the gap to the wedge of the previous child node. + * @type {number} + */ + gapAngle:number; + /** + * The distance of the node to its root node. + * @type {number} + */ + dist:number; + /** + * Gets the sum of all wedge angles of the subtree rooted at this node. + * @type {number} + */ + angleSum:number; + static $class:yfiles.lang.Class; + } + /** + * A tree layout algorithm that arranges the subtrees of the tree in a balloon-like fashion. + *

+ * Layout Style {@link yfiles.tree.BalloonLayout} is designed to arrange directed and undirected tree graphs. Subtrees rooted at a node are + * placed in a radial fashion around their root node. All direct children of one node can be placed on a common circle + * around their parent node (depending on the {@link yfiles.tree.BalloonLayout#childAlignmentPolicy alignment policy}). Therefore, subtrees look like balloons or stars, + * especially if subtrees have similar sizes. The edges of the tree are drawn as straight lines. {@graph {"ann":{"s":[30,30],"d":1,"c":1},"n":[[765.94,466.2],[616.19,1035.44],[858.96,1192.81],[289.45,1092.35],[983.21,685.48],[390.63,1191.59],[1141.69,322.61],[1215.22,473.98],[599.06,923.71],[924.21,1082.3],[291.41,844.85],[1077.22,396.06],[999.14,1284.78],[391.43,1274.01],[324.89,753.04],[236.05,1223.63],[930.33,1330.15],[1013.36,1203.58],[1165.73,539.9],[1084.13,551.52],[612.56,192.18],[1004.03,1061.74],[901.39,675.54],[684.7,152.3],[1022.85,458.01],[190.18,1336.4],[767.32,1282.66],[473.05,1190.8],[684.09,233.13],[385.33,871.88],[1139.17,442.18],[925.13,116.39],[353.13,675.6],[334.78,932.43],[685.33,1291.17],[152.25,1056.81],[427.86,640.81],[1239.04,331.19],[1006.49,764.55],[934.86,198.24],[732.68,1169.96],[1046.6,632.79],[412.14,1021.39],[1266.98,538.13],[716.32,76.19],[1068.06,1329.99],[76.94,1090.32],[792.51,44.73],[576.22,1141.17],[944.59,280.09],[718.72,987.86],[132.38,1277.64],[1007.52,113.83],[318.35,600.87],[686.08,946.6],[0,1060.76],[621.34,1239.22],[684.87,0],[47.38,1167.26],[929.76,34.1],[866.88,1320.91],[425.22,944.01],[1181.1,233.18],[374.69,793.72],[118.75,981.5],[903.65,1002.48],[532.13,493.99],[200.85,981.73],[760.81,183.93],[633.38,1355.17],[1177.35,621.5],[775.83,1364.64],[784.35,1446.63],[1237.23,394.55],[272.59,1334.67],[974.02,603.57],[457.46,831.99],[159.13,1412.75],[260.6,752.11],[1069.67,256.55],[1044.67,310.87],[1121.63,226.96],[1225.82,272.87],[597.56,111.13],[530.37,198.46],[610.06,274.57],[555.63,251.79],[547.23,141.92],[1062.07,709.49],[929.94,748.38],[843.55,104.61],[857.02,162.82],[1295.93,457.26],[193.97,837.29],[246.66,931.74],[206.06,892.47],[214.43,784.65],[979.61,1149.06],[838.99,1066.04],[786.55,1086.86],[172.43,1172.3],[317.44,1231.28],[428.9,1117.65],[872.95,52.59],[984.14,58.85],[987.6,170.17],[521.61,289.78],[410.77,300.73],[412.02,412.1],[523.07,420.56],[465.9,437.92],[389.75,356.66],[464.06,273.7],[553.17,340.51],[472.17,355.73]],"e":[[0,1],[1,2],[1,3],[0,4],[3,5],[0,6],[6,7],[1,8],[2,9],[3,10],[6,11],[2,12],[5,13],[10,14],[3,15],[12,16],[12,17],[7,18],[18,19],[0,20],[9,21],[4,22],[20,23],[11,24],[15,25],[2,26],[5,27],[20,28],[10,29],[7,30],[0,31],[14,32],[10,33],[26,34],[3,35],[32,36],[6,37],[4,38],[31,39],[2,40],[4,41],[3,42],[7,43],[23,44],[12,45],[35,46],[44,47],[1,48],[39,49],[1,50],[25,51],[31,52],[32,53],[1,54],[46,55],[34,56],[44,57],[46,58],[31,59],[2,60],[29,61],[6,62],[10,63],[35,64],[9,65],[0,66],[3,67],[23,68],[34,69],[18,70],[26,71],[71,72],[7,73],[25,74],[4,75],[29,76],[25,77],[10,78],[6,79],[6,80],[6,81],[6,82],[20,83],[20,84],[20,85],[20,86],[20,87],[4,88],[4,89],[31,90],[31,91],[7,92],[10,93],[10,94],[10,95],[10,96],[2,97],[2,98],[2,99],[3,100],[3,101],[3,102],[31,103],[31,104],[31,105],[0,114],[114,106],[114,107],[114,108],[114,109],[114,110],[114,111],[114,112],[114,113]],"vp":[0.0,0.0,1326.0,1477.0]}} Sample balloon-drawing of + * a large tree obtained with default settings {@graph {"ann":{"s":[20,20],"d":1,"c":1},"n":[[302.82,325.51,70,70,[[323.15,369.86,29.35,18.7,"Root"]]],[467.87,433.16,35,35],[555.28,457.63,[[581.09,480.55,27.36,18.7,0.20775573281806076,-0.978180737635551,"Leaf"]]],[539.95,490.69,[[558.57,519.19,27.36,18.7,0.6124052098749311,-0.7905440271851036,"Leaf"]]],[511.78,513.79,[[521.49,544.2,27.36,18.7,0.8952174454926904,-0.4456295830457645,"Leaf"]]],[617.42,438.44,[[645.7,457.5,27.36,18.7,-0.01562900399598557,-0.9998778596579152,"Leaf"]]],[604.25,500.42,[[626.78,526.54,27.36,18.7,0.42067550054279435,-0.9072111789672069,"Leaf"]]],[168.96,426.6,35,35],[122.16,495.14,[[108.91,545.35,27.36,18.7,-0.7471310564613752,-0.6646767518658294,"Leaf"]]],[101.02,465.46,[[72.6,501.56,27.36,18.7,-0.38380727069642384,-0.9234132222144982,"Leaf"]]],[94.89,429.54,[[58.95,446.33,27.36,18.7,0.0558744858236695,-0.9984378006836183,"Leaf"]]],[108.08,558.63,[[104.38,613.01,27.36,18.7,-0.8765491095440469,-0.48131243341257923,"Leaf"]]],[60.74,516.51,[[39.11,560.52,27.36,18.7,-0.5800788870754927,-0.8145603014935467,"Leaf"]]],[472.4,260.75,35,35],[534.73,207.69,[[563.84,210.51,27.36,18.7,-0.7413022827299817,-0.6711713086979497,"Leaf"]]],[555.61,237.55,[[585.94,249.4,27.36,18.7,-0.3757344582282841,-0.9267273692407589,"Leaf"]]],[561.43,273.52,[[588.93,294.02,27.36,18.7,0.06458526120504259,-0.997912192547559,"Leaf"]]],[549.36,144.32,[[576.39,143.07,27.36,18.7,-0.8723155432038684,-0.48894334343044304,"Leaf"]]],[596.34,186.85,[[626.56,194.12,27.36,18.7,-0.5729485100623841,-0.8195913645331399,"Leaf"]]],[316.53,515.88,35,35],[349.51,601,[[356.29,631.15,27.36,18.7,0.9501038773669919,-0.3119336823945245,"Leaf"]]],[313.23,604.36,[[326.48,660.69,27.36,18.7,-0.9912225732921417,-0.1322036693745865,"Leaf"]]],[279.09,591.61,[[271.88,644.75,27.36,18.7,-0.8351387927609661,-0.5500392684397689,"Leaf"]]],[397.33,645.07,[[408.68,675.44,27.36,18.7,0.8566078613378385,-0.5159679950289693,"Leaf"]]],[337.13,664.84,[[339.49,693.76,27.36,18.7,0.9957417304784997,-0.09218680048511825,"Leaf"]]],[52.71,198.2,[[17.59,197.15,27.36,18.7,0.42857629306653433,-0.9035055954565794,"Leaf"]]],[39,260.06,[[3.57,279.73,27.36,18.7,-0.006902939255060647,-0.9999761744309916,"Leaf"]]],[145.3,185.63,[[126.97,158.82,27.36,18.7,0.8990721607310399,-0.43780046801987216,"Leaf"]]],[116.92,208.49,[[85.4,197.66,27.36,18.7,0.6192806018773118,-0.7851697498875478,"Leaf"]]],[101.3,241.41,[[64.86,250.7,27.36,18.7,0.21628395104715628,-0.9763305037329477,"Leaf"]]],[173.56,251.58,35,35],[321.26,36.12,[[318.14,1.56,27.36,18.7,0.9965082870714412,-0.08349391473599899,"Leaf"]]],[260.88,55.36,[[239.7,30.94,27.36,18.7,0.861077857359917,-0.5084731296385823,"Leaf"]]],[378.65,109.85,[[406.52,110,27.36,18.7,-0.8303070560332068,-0.557306192950939,"Leaf"]]],[344.63,96.81,[[366.44,90.16,27.36,18.7,-0.9900311505600138,-0.14084857443657478,"Leaf"]]],[308.31,99.85,[[295.59,69.34,27.36,18.7,0.9527898006751772,-0.30363068970273144,"Leaf"]]],[325.62,170.19,35,35],[620.15,245.57,[[649.55,261.91,27.36,18.7,-0.15959409597274285,-0.9871827209441234,"Leaf"]]],[565.45,550.51,[[579.72,580.47,27.36,18.7,0.7732871466592579,-0.6340559823955481,"Leaf"]]],[36.42,458,[[3.15,484.87,27.36,18.7,-0.1682027041762925,-0.9857524285071697,"Leaf"]]],[91.95,148.45,[[66.13,128.88,27.36,18.7,0.7787908142925284,-0.6272837217508362,"Leaf"]]],[383.99,45.04,[[409.22,41.45,27.36,18.7,-0.933684654259895,-0.3580963088326663,"Leaf"]]],[274.32,656.46,[[277.16,712.35,27.36,18.7,-0.9367740425600954,-0.34993484134280844,"Leaf"]]]],"e":[[0,1,[],[[405.66,401.96,61.37,18.7,0.5213485166954306,-0.8533438487148509,"Root-Edge"]]],[1,2],[1,3],[1,4],[1,5],[1,6],[0,7,[],[[268.23,398.95,61.37,18.7,0.4834440722369951,0.8753752504034548,"Root-Edge"]]],[7,8],[7,9],[7,10],[7,11],[7,12],[0,13,[],[[407.74,322.69,61.37,18.7,-0.4757866709710364,-0.8795607106540735,"Root-Edge"]]],[13,14],[13,15],[13,16],[13,17],[13,18],[0,19,[],[[336.08,439.99,61.37,18.7,0.999759704932882,0.02192104907427582,"Root-Edge"]]],[19,20],[19,21],[19,22],[19,23],[19,24],[0,30,[],[[270.35,318.48,61.37,18.7,-0.5287754007295448,0.8487617896579165,"Root-Edge"]]],[30,29],[30,28],[30,27],[30,26],[30,25],[0,36,[],[[340.26,281.05,61.37,18.7,-0.9995303423338449,-0.030644652942837143,"Root-Edge"]]],[36,35],[36,34],[36,33],[36,32],[36,31],[13,37],[1,38],[7,39],[30,40],[36,41],[19,42]],"vp":[-1.0,0.0,678.0,722.0]}} Sample balloon-drawing featuring interleaved child placement and ray-like + * node labels ConceptThe algorithm executes the following steps: + *

+ *
    + *
  1. Select a root node according to the specified {@link yfiles.tree.BalloonLayout#rootNodePolicy root policy}.
  2. + *
  3. Determine the placement of subtrees around the root using a bottom-up recursive approach (starting with leaf nodes).
  4. + *
  5. Assign the actual coordinates of nodes, again using a recursive approach (starting with the root node).
  6. + *
+ *

+ * Features + *

+ *

+ * The algorithm features integrated {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling edge labeling} as well as {@link yfiles.tree.BalloonLayout#integratedNodeLabeling node labeling}. Edge labels and node labels are placed + * automatically without generating overlaps with other labels or graph elements. There are different {@link yfiles.tree.BalloonLayout#nodeLabelingPolicy ways} to place node + * labels. Edge labeling will take the settings of {@link yfiles.layout.PreferredPlacementDescriptor} into account. + *

+ *

+ * Defining a {@link yfiles.tree.BalloonLayout#preferredChildWedge preferred wedge angle} has a great influence on the layout style. Subtrees rooted at a node get a certain + * amount of radial space to be placed around the parent node, such that a preferred angle close to 360 degrees will + * generate drawings where subtrees look like balloons, while an angle close to 180 degrees could be chosen to get drawings + * where subtrees look like semicircles. + *

+ *

+ * Since it is computationally not very complex, {@link yfiles.tree.BalloonLayout} is very well suited for large tree graphs. It + * performs well even for huge graphs. + *

+ *

+ * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} + * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. These edges + * will later be reinserted and routed separately. + *

+ * @class yfiles.tree.BalloonLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface BalloonLayout extends yfiles.layout.MultiStageLayout{} + export class BalloonLayout { + /** + * Creates a new {@link yfiles.tree.BalloonLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Calculates the wedge angle that has to be reserved for the subtree rooted at the given node scaling the {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} with + * the given scale factor. + *

+ * Given some {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} the {@link yfiles.tree.BalloonLayoutNodeInfo#upperAngle upper angle} and {@link yfiles.tree.BalloonLayoutNodeInfo#lowerAngle lower angle} of the wedge belonging to the subtree rooted at root will be + * calculated and stored in the {@link yfiles.tree.BalloonLayoutNodeInfo} instance associated with root + * ({@link yfiles.tree.BalloonLayout#getInfo}). + *

+ *

+ * This method may be overridden to perform a custom wedge angle assignment scheme. The method is called when + * {@link yfiles.tree.BalloonLayout#calculateChildArrangement arranging child nodes}. Large edge labels on the incoming edge to root need to be considered, if {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling integrated edge labeling} + * should still work properly. + *

+ * @param {yfiles.algorithms.Node} root the node for which the wedge angles are calculated + * @param {number} [scaleFactor=1.0] a factor to be applied to the {@link yfiles.tree.BalloonLayoutNodeInfo#dist distance} of root + * @returns {number} the sum of the upper and lower wedge angle of the subtree rooted at the given root node + * @see yfiles.tree.BalloonLayout#calculateChildArrangement + * @protected + */ + calculateAngles(root:yfiles.algorithms.Node,scaleFactor?:number):number; + /** + * Calculates a child node arrangement for a given root node of the tree. + *

+ * During the arrangement, child nodes of root will be {@link yfiles.tree.BalloonLayout#sortChildNodes sorted}. Furthermore, distances of the child nodes will be chosen + * such that the wedge of the subtree of root fits into the preferred wedge angle, which is either defined via {@link yfiles.tree.BalloonLayout#preferredRootWedge} or {@link yfiles.tree.BalloonLayout#preferredChildWedge}. + * Calculated distances are stored in {@link yfiles.tree.BalloonLayoutNodeInfo#dist}. + *

+ *

+ * The angle values - upper and lower wedge angle - may also be updated during this process and stored in {@link yfiles.tree.BalloonLayoutNodeInfo#upperAngle} + * and + * {@link yfiles.tree.BalloonLayoutNodeInfo#lowerAngle}, respectively. To compute the angles of wedges, method CalculateAngles is + * used. + *

+ *

+ * This method may be overridden to perform a custom child node arrangement. If support for available features like {@link yfiles.tree.BalloonLayout#interleavedMode interleaving} + * should be maintained, then these features need to be carefully considered during the arrangement. + *

+ * @param {yfiles.algorithms.Node} root the node for whose children to compute an arrangement + * @protected + */ + calculateChildArrangement(root:yfiles.algorithms.Node):void; + /** + * Determines the root node of {@link yfiles.tree.BalloonLayout#graph} according to the chosen {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy}. + *

+ * This method may be overridden to implement some other strategy for choosing the root node of the input graph. It is + * called before the rest of the layout process within {@link yfiles.tree.BalloonLayout#applyLayoutCore}. + *

+ * @returns {yfiles.algorithms.Node} the root node of {@link yfiles.tree.BalloonLayout#graph} + * @see yfiles.tree.BalloonLayout#rootNodePolicy + * @protected + */ + determineRoot():yfiles.algorithms.Node; + /** + * Returns the {@link yfiles.tree.BalloonLayoutNodeInfo} object associated with the given node while the layout algorithm is + * active. + *

+ * The returned object contains detailed information describing the placement of a node in the layout being computed, e.g., + * a node's distance to its parent or the wedge angle of the subtree rooted at a node. + *

+ *

+ * Subclasses may want to override this method to realize another node information setup. This method is called throughout + * the algorithm, each time some information associated with a node needs to be retrieved or stored. + *

+ * @param {yfiles.algorithms.Node} node the node whose information object should be retrieved + * @returns {yfiles.tree.BalloonLayoutNodeInfo} the {@link yfiles.tree.BalloonLayoutNodeInfo} instance associated to the given node + * @see yfiles.tree.BalloonLayoutNodeInfo + */ + getInfo(node:yfiles.algorithms.Node):yfiles.tree.BalloonLayoutNodeInfo; + /** + * Returns the preferred radial amount (wedge) in degrees that child nodes may in total occupy around the given node. + *

+ * The wedge angle controls the degree to which the child nodes may radiate from the center of layout. A value close to 360 + * means that the child nodes may radiate in (almost) any direction from their parent node, edge lengths can in consequence + * stay rather small. On the other hand, a small value means that children are restricted to a small angle; thus, edges + * lengths (and drawings) may become large. + *

+ *

+ * This method returns the {@link yfiles.tree.BalloonLayout#preferredRootWedge preferred root wedge} if node root was selected as global root node ({@link yfiles.tree.BalloonLayout#rootNodePolicy}). Otherwise, it either + * returns {@link yfiles.tree.BalloonLayout#preferredChildWedge} or if the given node has an outdegree equal to 2, it returns the minimum of {@link yfiles.tree.BalloonLayout#preferredChildWedge} and 180. + *

+ *

+ * This method may be overridden to provide a custom child wedge function. + *

+ * @param {yfiles.algorithms.Node} root the node to get the preferred wedge angle for + * @returns {number} the preferred wedge angle for root in degrees + * @see yfiles.tree.BalloonLayout#preferredChildWedge + * @see yfiles.tree.BalloonLayout#preferredRootWedge + * @protected + */ + getPreferredChildWedge(root:yfiles.algorithms.Node):number; + /** + * Sorts the child nodes (successors) of the given node. + *

+ * This implementation uses the original node coordinates if {@link yfiles.tree.BalloonLayout#fromSketchMode From Sketch mode} is enabled. Otherwise it uses {@link yfiles.tree.BalloonLayout#comparer the specified comparator} + * to sort the outgoing edges and thus the children of root. If there is no such comparator, then the sorting depends on + * whether or not the child nodes are placed in an {@link yfiles.tree.BalloonLayout#interleavedMode interleaved} fashion: + *

+ *
    + *
  • Normal: Children are sorted according to the chosen {@link yfiles.tree.BalloonLayout#childOrderingPolicy child ordering policy}.
  • + *
  • + * Interleaved: Children are sorted such that the resulting interleaved node placement is compact, while children inducing + * larger subgraphs are placed next to smaller ones. + *
  • + *
+ *

+ * This method may be overridden to realize a custom child node ordering. It gets called in method {@link yfiles.tree.BalloonLayout#calculateChildArrangement} + * before coordinates are assigned and just after the wedge sizes for all subtrees rooted at root are determined. + *

+ * @param {yfiles.algorithms.Node} root the node whose child nodes will be sorted + * @protected + */ + sortChildNodes(root:yfiles.algorithms.Node):void; + /** + * Data provider key for marking nodes whose child nodes should be placed in an interleaved fashion + *

+ * This {@link yfiles.algorithms.IDataProvider} allows to individually configure the interleaving feature for each node in the + * graph. + *

+ * @see yfiles.tree.BalloonLayout#interleavedMode + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static INTERLEAVED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for marking the node that will be used as root node of the tree. + * @see yfiles.tree.BalloonLayout#rootNodePolicy + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * The layout graph being acted upon. + * @protected + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + /** + * Gets or sets the {@link yfiles.collections.IComparer.} instance that determines the order of the outgoing edges for each node of the tree. + *

+ * If no {@link yfiles.collections.IComparer.} is specified (i.e. the {@link yfiles.collections.IComparer.} is null), the outgoing edges will be sorted according to the current + * {@link yfiles.tree.BalloonLayout#childOrderingPolicy child ordering policy}. + *

+ * @see yfiles.tree.BalloonLayout#childOrderingPolicy + * @see yfiles.tree.BalloonLayout#fromSketchMode + * @type {yfiles.collections.IComparer.} + */ + comparer:yfiles.collections.IComparer; + /** + * Gets or sets the child ordering policy for sorting the child nodes around their parents. + *

+ * The sorting policy can affect the compactness of drawings. Advantageous orderings allow adjacent subtrees to be close + * together and can thus make the whole layout more compact. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown ordering policy is given + * @see yfiles.tree.BalloonLayout#fromSketchMode + * @see yfiles.tree.BalloonLayout#comparer + * @type {yfiles.tree.ChildOrderingPolicy} + */ + childOrderingPolicy:yfiles.tree.ChildOrderingPolicy; + /** + * Gets or sets the minimum distance to be kept between the nodes in the tree. + *

+ * The distance needs to be a non-negative integer value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative + * @see yfiles.tree.BalloonLayout#allowOverlaps + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets whether or not to consider the given coordinates of the input diagram when arranging the tree. + *

+ * Enabling this feature, the original circular order of child nodes around their parent nodes will be maintained according + * to the initial coordinates when determining the order of the child nodes. + *

+ * @type {boolean} + */ + fromSketchMode:boolean; + /** + * Gets or sets the root node selection policy of this layout algorithm. + *

+ * The policy determines which node is chosen as (virtual) tree root during the layout process. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown root node policy is given + * @type {yfiles.tree.RootNodePolicy} + */ + rootNodePolicy:yfiles.tree.RootNodePolicy; + /** + * Gets or sets the preferred radial amount (wedge) in degrees that child nodes may in total occupy around their parent + * node. + *

+ * The wedge angle controls the degree to which the child nodes may radiate from the center of layout. A value close to 360 + * means that the child nodes may radiate in (almost) any direction from their parent node, edge lengths can in consequence + * stay rather small. On the other hand, a small value means that children are restricted to a small angle; thus, edge + * lengths (and drawings) may become large. + *

+ *

+ * The minimum allowed wedge angle is 1 and the maximum allowed value is 359. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given angle is smaller than 1 or larger than 359 + * @see yfiles.tree.BalloonLayout#preferredRootWedge + * @type {number} + */ + preferredChildWedge:number; + /** + * Gets or sets the preferred radial amount (wedge) in degrees that child nodes may in total occupy around the global + * root. + *

+ * This property allows to separately control the wedge angle for the designated root node of the tree, while {@link yfiles.tree.BalloonLayout#preferredChildWedge} controls the + * angles of all child nodes. The root node will be determined depending on the {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy}. + *

+ *

+ * The minimum allowed root wedge angle is 1 and the maximum allowed value is 360. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given angle is smaller than 1 or larger than 360 + * @see yfiles.tree.BalloonLayout#preferredChildWedge + * @type {number} + */ + preferredRootWedge:number; + /** + * Gets or sets whether or not (partially) overlapping nodes are allowed. + *

+ * If overlaps are allowed, the resulting layouts can become significantly more compact. Overlaps will mostly occur at the + * borders of nodes. Nodes will not be totally covered by other nodes. + *

+ * @type {boolean} + */ + allowOverlaps:boolean; + /** + * Gets or sets the factor defining how compact layout results will potentially be, where a smaller factor produces + * potentially more compact layouts. + *

+ * The algorithm tries to optimize the child node arrangement around each tree node such that each subtree is as close to + * its root as possible, while still fitting into the {@link yfiles.tree.BalloonLayout#preferredChildWedge preferred wedge angle} and not overlapping with adjacent subtrees. + *

+ *

+ * High compactness factor values induce the optimization procedure to be less strict and accept less optimal results, + * while low factor values mean that the optimization will only stop when being nearly optimal. Thus, lower values lead to + * a potentially higher runtime. + *

+ *

+ * The minimum factor value is 0.05 and the maximum is 1.0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the factor is smaller than 0.05 or greater than 1.0 + * @type {number} + */ + compactnessFactor:number; + /** + * Gets or sets the minimum length that this layout algorithm assigns to edges of the graph. + *

+ * A lower minimum edge length allows generally more compact layouts. It has the highest effect if most nodes of the graph + * have a low degree, as the minimum can potentially be met for such graphs. + *

+ *

+ * The minimum length must be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given length is negative + * @type {number} + */ + minimumEdgeLength:number; + /** + * Gets or sets whether or not the layout algorithm reserves space for node labels. + *

+ * The size of nodes will temporarily be adjusted such that the label is included. Therefore, result drawings may get + * significantly larger if this feature is enabled. + *

+ * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets the mode for child node arrangement. + *

+ * Child nodes are either placed interleaved or on a single layer around their parent node. Interleaved placement means + * that child nodes are placed around their common parent in two different layers in an alternating fashion. For example, + * the first child is on the inner layer, the second child on the outer layer, the third one again on the inner layer, + * etc. + *

+ *

+ * Independent of this mode, the alignment of child nodes on the same layer is still defined by the {@link yfiles.tree.BalloonLayout#childAlignmentPolicy alignment policy}. + * However, {@link yfiles.tree.ChildAlignmentPolicy#SMART} is only supported for non-interleaved arrangement. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode for interleaved arrangement is given + * @see yfiles.tree.BalloonLayout#childAlignmentPolicy + * @type {yfiles.tree.InterleavedMode} + */ + interleavedMode:yfiles.tree.InterleavedMode; + /** + * Gets or sets the child alignment policy for this layout algorithm. + *

+ * This policy influences the distance of child nodes to their parent nodes and the alignment of children with the same + * parent. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given + * @type {yfiles.tree.ChildAlignmentPolicy} + */ + childAlignmentPolicy:yfiles.tree.ChildAlignmentPolicy; + /** + * Gets or sets whether or not the layout algorithm automatically places node labels. + *

+ * If enabled, this layout algorithm will calculate the positions for the node labels assuring that no overlaps occur. + *

+ *

+ * Different labeling strategies may be selected using {@link yfiles.tree.BalloonLayout#nodeLabelingPolicy}. + *

+ * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy + * @type {boolean} + */ + integratedNodeLabeling:boolean; + /** + * Gets or sets whether or not the layout algorithm automatically places edge labels. + *

+ * If enabled, this layout algorithm will calculate the positions for the edge labels assuring that no overlaps occur. + *

+ * @type {boolean} + */ + integratedEdgeLabeling:boolean; + /** + * Gets or sets the policy defining how node labels are placed by the integrated node labeling mechanism (for example, the + * desired label orientation). + * @throws {Stubs.Exceptions.ArgumentError} if an unknown labeling policy is given + * @see yfiles.tree.BalloonLayout#integratedNodeLabeling + * @type {yfiles.tree.NodeLabelingPolicy} + */ + nodeLabelingPolicy:yfiles.tree.NodeLabelingPolicy; + /** + * Gets or sets the distance between node labels belonging to the same node. + *

+ * It also defines the distance between labels and the node they belong to in case of label placement outside of the node + * (e.g. for {@link yfiles.tree.NodeLabelingPolicy#RAY_LIKE ray-like label placement}). + *

+ *

+ * The spacing must have a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given spacing value is negative + * @see yfiles.tree.BalloonLayout#integratedNodeLabeling + * @type {number} + */ + nodeLabelSpacing:number; + /** + * Gets or sets the distance between edge labels belonging to the same edge as well as the distance of the edge labels to + * the target node of the edge. + *

+ * The spacing must have a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given label spacing value is negative + * @see yfiles.tree.BalloonLayout#integratedEdgeLabeling + * @type {number} + */ + edgeLabelSpacing:number; + /** + * Gets or sets whether or not chains are drawn straight or not. + *

+ * A chain is defined as a tree node with exactly one child node. If this feature is enabled, then the incoming edge and + * outgoing edge of the chain will have the same orientation, i.e., the whole chain looks straight. + *

+ *

+ * Straightening all chains can lead to smoother, more symmetric results. + *

+ * @type {boolean} + */ + chainStraighteningMode:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @see yfiles.layout.MultiStageLayout#hideGroupsStage + * @see yfiles.layout.HideGroupsStage + * @type {boolean} + */ + hideGroupsStageEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter + * @see yfiles.router.ParallelEdgeRouter + * @type {boolean} + */ + parallelEdgeRouterEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + static $class:yfiles.lang.Class; + } + export enum FillStyle{ + /** + * Style specifier which defines that rows/columns are aligned with their leading side. + * @see yfiles.tree.AspectRatioNodePlacer#fillStyle + */ + LEADING, + /** + * Style specifier which defines that rows/columns are aligned with their center. + * @see yfiles.tree.AspectRatioNodePlacer#fillStyle + */ + CENTERED, + /** + * Style specifier which defines that rows/columns are justified to have the same width/height. + * @see yfiles.tree.AspectRatioNodePlacer#fillStyle + */ + JUSTIFY, + /** + * Style specifier which defines that rows/columns are aligned with their trailing side. + * @see yfiles.tree.AspectRatioNodePlacer#fillStyle + */ + TRAILING + } + export enum RootPlacement{ + /** + * A root placement specifier for placing the root centered above its subtree, depending on the actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. + * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY + */ + TOP, + /** + * A root placement specifier for placing the root in the upper left corner of the subtree bounds with respect to the + * actual {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}. + *

+ * Whether the root is placed entirely beside the subtree with no horizontal overlaps or entirely above the subtree without + * vertical overlaps will be determined by the layout of the subtree. The layout algorithm tries to minimize the bounds of + * the subtree. + *

+ * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY + * @see yfiles.tree.RootPlacement#CORNER_TOP + * @see yfiles.tree.RootPlacement#CORNER_SIDE + */ + CORNER, + /** + * A root placement specifier for placing the root in the upper left corner of the subtree bounds with respect to the + * actual {@link yfiles.layout.MultiStageLayout#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 yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY + */ + CORNER_SIDE, + /** + * A root placement specifier for placing the root of a subtree in the upper left corner of the subtree bounds with respect + * to the actual {@link yfiles.layout.MultiStageLayout#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 yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY + */ + CORNER_TOP + } + export enum SubtreeArrangement{ + /** + * A direction specifier for placing the child nodes next to each other in direction of the actual + * {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}, with the edges connecting in the direction of flow. + * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY + */ + HORIZONTAL, + /** + * A direction specifier for placing the child nodes above each other in direction of the actual + * {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation}, with the edges connecting orthogonally to the direction of flow. + * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY + */ + VERTICAL + } + export enum InterleavedMode{ + /** + * A child placement mode where all child nodes are placed around their parent with equal distances. + * @see yfiles.tree.BalloonLayout#interleavedMode + */ + OFF, + /** + * A child placement mode where nodes are placed in an interleaved fashion, that is, with two different, alternating + * distances to the parent node. + * @see yfiles.tree.BalloonLayout#interleavedMode + */ + ALL_NODES, + /** + * A child placement mode where child nodes of selected nodes are placed in an interleaved fashion, that is, with two + * different, alternating distances to the parent node. + *

+ * All other nodes are placed without interleaving. The node selection can be specified by registering an appropriate {@link yfiles.algorithms.IDataProvider} + * for key {@link yfiles.tree.BalloonLayout#INTERLEAVED_NODES_DP_KEY}. + *

+ * @see yfiles.tree.BalloonLayout#interleavedMode + */ + MARKED_NODES + } + export enum NodeLabelingPolicy{ + /** + * Node labeling policy for ray-like label placement at nodes with zero or one child node. + *

+ * Labels belonging to leaf nodes and nodes with exactly one successor (thus forming a sort of chain) will not be oriented + * horizontal but ray-like; they get the same orientation as their nodes' incoming edge. The labels of the other nodes will + * be oriented horizontally and placed at the center of the corresponding node. + *

+ * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy + */ + RAY_LIKE, + /** + * Node labeling policy for ray-like label placement at leaf nodes. + *

+ * Labels corresponding to leaf nodes get the same orientation as their nodes' incoming edge and are placed outside the + * node (without overlaps). The labels of the other nodes will be oriented horizontally and placed at the center of the + * corresponding node. + *

+ * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy + */ + RAY_LIKE_LEAVES, + /** + * Node labeling policy for horizontal label placement at all nodes. + *

+ * The node labels are placed at the center of the corresponding node. + *

+ * @see yfiles.tree.BalloonLayout#nodeLabelingPolicy + */ + HORIZONTAL + } + export enum ChildAlignmentPolicy{ + /** + * Alignment policy to align child nodes rooted at the same parent such that the border of their convex hull has the same + * distance to the parent node's center. + * @see yfiles.tree.BalloonLayout#childAlignmentPolicy + */ + PLAIN, + /** + * Alignment policy to align child nodes rooted at the same parent such that each child has the same center-to-center + * distance to the parent node. + *

+ * All nodes will be placed on a common radius around their parent, respective to their center coordinates. + *

+ * @see yfiles.tree.BalloonLayout#childAlignmentPolicy + */ + SAME_CENTER, + /** + * Alignment policy for aligning child nodes such that the distances to their parent are kept short and drawings can + * potentially become more compact. + *

+ * This policy realizes the exact same child alignment as {@link yfiles.tree.ChildAlignmentPolicy#PLAIN} if there are no edge + * labels associated with edges going to child nodes or if {@link yfiles.tree.BalloonLayout#integratedEdgeLabeling integrated edge labeling} is disabled. + *

+ *

+ * If edge labels need to be considered, edge labels will be added to the convex hull of the child node to which the edge + * connects. This means that child nodes connected with a labeled edge will be aligned at the border where the edge label + * begins. In consequence, edge labels will be aligned with neighboring edge labels as well as neighboring child nodes if a + * child node has no edge label at its incoming edge. + *

+ *

+ * This alignment strategy is especially effective if large edge labels need to be considered while drawings should still + * be compact and distances from parent to child nodes short. + *

+ * @see yfiles.tree.BalloonLayout#childAlignmentPolicy + */ + COMPACT, + /** + * Alignment policy to align child nodes rooted at the same parent using a mixture of the other policies and aiming to + * achieve symmetry and compactness at the same time. + *

+ * Similar to + * {@link yfiles.tree.ChildAlignmentPolicy#SAME_CENTER}, this policy aims to achieve alignments featuring equal distances between + * parent and child node centers. However, a much larger distance for all child nodes caused by single large subtrees is + * avoided by this policy. In such cases, the smaller subtrees may be placed on a common radius and the large subtrees are + * placed with different distances. + *

+ * @see yfiles.tree.BalloonLayout#childAlignmentPolicy + */ + SMART + } + export enum ChildOrderingPolicy{ + /** + * Child ordering policy which orders child nodes depending on their subtree size such that large subtrees are placed next + * to small ones in order to save space. + *

+ * The actual area of a subtree is used as the subtree size. The smallest subtree is placed next to the largest subtree, + * followed by the second smallest subtree and so on. This way, drawings can become more compact, because the adjacent + * placement of large subtrees is avoided (which would require edges to become longer for subtrees to fit next to each + * other). + *

+ * @see yfiles.tree.BalloonLayout#childOrderingPolicy + */ + COMPACT, + /** + * Child ordering policy which sorts the child nodes according to their wedge angles. + *

+ * The node with the greatest angle gets median position in the sorting order. The smaller the wedges, the farther away a + * node will be placed from the median position. Using this policy, the produced results are often more symmetric. + *

+ * @see yfiles.tree.BalloonLayout#childOrderingPolicy + */ + SYMMETRIC + } + export enum RootNodePolicy{ + /** + * Root node policy for choosing a node with indegree 0 as root node of the tree. + *

+ * The selection of the root node will happen according to {@link yfiles.algorithms.Trees#getRoot}. + *

+ * @see yfiles.tree.BalloonLayout#rootNodePolicy + * @see yfiles.algorithms.Trees#getRoot + */ + DIRECTED_ROOT, + /** + * Root node policy for choosing the center node as root node of the tree. + *

+ * A {@link yfiles.algorithms.Trees#getCenterRoot center node} induces a minimum depth tree when being used as the root of that tree. + *

+ * @see yfiles.tree.BalloonLayout#rootNodePolicy + * @see yfiles.algorithms.Trees#getCenterRoot + */ + CENTER_ROOT, + /** + * Root node policy for choosing a weighted center node as root node of the tree. + *

+ * A weighted center node is a node which is part of the greatest number of all undirected paths in a graph. + *

+ * @see yfiles.tree.BalloonLayout#rootNodePolicy + */ + WEIGHTED_CENTER_ROOT, + /** + * Root node policy for choosing a custom node as the root node of the tree. + *

+ * The root node is specified using a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.tree.BalloonLayout#SELECTED_ROOT_DP_KEY}. + *

+ * @see yfiles.tree.BalloonLayout#rootNodePolicy + */ + SELECTED_ROOT + } + export enum ChildPlacement{ + /** + * Placement specifier which defines that subtrees are placed one below the other and left of the root node. + * @see yfiles.tree.DefaultNodePlacer#childPlacement + */ + VERTICAL_TO_LEFT, + /** + * Placement specifier which defines that subtrees are placed one below the other and right of the root node. + * @see yfiles.tree.DefaultNodePlacer#childPlacement + */ + VERTICAL_TO_RIGHT, + /** + * Placement specifier which defines that subtrees are placed horizontally next to each other and above the root node. + * @see yfiles.tree.DefaultNodePlacer#childPlacement + */ + HORIZONTAL_UPWARD, + /** + * Placement specifier which defines that subtrees are placed horizontally next to each other and below the root node. + * @see yfiles.tree.DefaultNodePlacer#childPlacement + */ + HORIZONTAL_DOWNWARD + } + export enum RootAlignment{ + /** + * Alignment specifier which defines that the root node is placed ahead of all its child subtrees. + *

+ * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed ahead (e.g. + * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) of the combined bounding box of all subtrees without labels. + *

+ * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + LEADING_OFFSET, + /** + * Alignment specifier which defines that the root node is placed aligned with its first subtree. + *

+ * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed aligned with the bounding box of its first (e.g. + * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) subtree. + *

+ * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + LEADING, + /** + * Alignment specifier which defines that the root node is placed aligned with the center of its subtrees. + * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + CENTER, + /** + * Alignment specifier which defines that the root node is placed at the median of the connection points to its subtrees. + * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + MEDIAN, + /** + * Alignment specifier which defines that the root node is placed aligned with its last subtree. + *

+ * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed aligned with the bounding box of its last (e.g. + * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) subtree. + *

+ * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + TRAILING, + /** + * Alignment specifier which defines that the root is placed after all its subtree. + *

+ * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed after (e.g. + * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) of the combined bounding box of all subtrees without labels. + *

+ * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + TRAILING_OFFSET, + /** + * Alignment specifier which defines that the root is placed after all its subtrees, centered on the bus. + *

+ * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed after (e.g. + * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: right) of the combined bounding box of all subtrees without labels. The + * bus leaves directly from the root node. + *

+ * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + TRAILING_ON_BUS, + /** + * Alignment specifier which defines that the root is placed ahead of all its subtrees, centered on the bus. + *

+ * Depending on the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, the root node is placed ahead (e.g. + * {@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}: left) of the combined bounding box of all subtrees without labels. The + * bus leaves directly from the root node. + *

+ * @see yfiles.tree.DefaultNodePlacer#rootAlignment + */ + LEADING_ON_BUS + } + export enum RoutingStyle{ + /** + * Routing style specifier which defines that edge paths are routed orthogonally with the bends located in the channel + * between the root node and the child nodes. + * @see yfiles.tree.DefaultNodePlacer#routingStyle + */ + FORK, + /** + * Routing style specifier which defines that edge paths are routed orthogonally with just one bend. + *

+ * Edges will leave the root node at its sides and bend exactly above the according child node. If the child node is placed + * directly below the root node, the edge will bend inside of the root node and leave it at the bottom. + *

+ * @see yfiles.tree.DefaultNodePlacer#routingStyle + */ + FORK_AT_ROOT, + /** + * Routing style specifier which defines that edge paths are routed with a straight segment to the center of the child + * nodes. + * @see yfiles.tree.DefaultNodePlacer#routingStyle + */ + STRAIGHT, + /** + * Routing style constant which defines that edge paths are routed with a straight segment to the connector of the {@link yfiles.tree.SubtreeShape} + * of the child nodes. + * @see yfiles.tree.DefaultNodePlacer#routingStyle + */ + POLYLINE + } + export enum PortAssignmentMode{ + /** + * A port assignment specifier that defines that + * {@link yfiles.layout.PortConstraint}s are considered. Ports are placed using the following rules: + *
    + *
  • edges without a {@link yfiles.layout.PortConstraint} are anchored at the center of the node
  • + *
  • edges with a weak {@link yfiles.layout.PortConstraint} are anchored at the center of their specified side
  • + *
  • edges with a strong {@link yfiles.layout.PortConstraint} are anchored at their initial coordinates
  • + *
+ *

+ * If edges with + * {@link yfiles.layout.PortConstraint}s are grouped, all edges in the same group will use the port coordinates of the first edge + * in the group. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + PORT_CONSTRAINT, + /** + * A port assignment specifier which defines that 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 yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + DISTRIBUTED_NORTH, + /** + * A port assignment specifier which defines that 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 yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + DISTRIBUTED_SOUTH, + /** + * A port assignment specifier which defines that 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 yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + DISTRIBUTED_EAST, + /** + * A port assignment specifier which defines that 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 yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + DISTRIBUTED_WEST, + /** + * A port assignment specifier which defines that all ports are reset to the center of their nodes. + */ + NONE + } + export enum ConnectorDirection{ + /** + * A direction constant that describes that the last connector segment points up. The edge from the parent will connect to + * the north of the {@link yfiles.tree.SubtreeShape}. + * @see yfiles.tree.SubtreeShape#connectorDirection + */ + NORTH, + /** + * A direction constant that describes that the last connector segment points to the right. The edge from the parent will + * connect to the east of the {@link yfiles.tree.SubtreeShape}. + * @see yfiles.tree.SubtreeShape#connectorDirection + */ + EAST, + /** + * A direction constant that describes that the last connector segment points down. The edge from the parent will connect + * to the south of the {@link yfiles.tree.SubtreeShape}. + * @see yfiles.tree.SubtreeShape#connectorDirection + */ + SOUTH, + /** + * A direction constant that describes that the last connector segment points to the left. The edge from the parent will + * connect to the west of the {@link yfiles.tree.SubtreeShape}. + * @see yfiles.tree.SubtreeShape#connectorDirection + */ + WEST + } + export enum BorderLineSide{ + /** + * Side constant that defines the index of the northern border line. + * @see yfiles.tree.SubtreeShape#getBorderLine + */ + NORTH, + /** + * Side constant that defines the index of the eastern border line. + * @see yfiles.tree.SubtreeShape#getBorderLine + */ + EAST, + /** + * Side constant that defines the index of the southern border line. + * @see yfiles.tree.SubtreeShape#getBorderLine + */ + SOUTH, + /** + * Side constant that defines the index of the western border line. + * @see yfiles.tree.SubtreeShape#getBorderLine + */ + WEST + } + export enum LayeredRoutingStyle{ + /** + * Routing style specifier which defines that edges consist of one straight segment. + * @see yfiles.tree.LayeredNodePlacer#routingStyle + */ + STRAIGHT, + /** + * Routing style specifier which defines that edges are routed in an orthogonal, bus-like fashion. + * @see yfiles.tree.LayeredNodePlacer#routingStyle + */ + ORTHOGONAL + } + export enum MultiParentRoutingStyle{ + /** + * Routing style for routing non-shared edge segments in a polyline fashion. + *

+ * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. + * This style only applies to the part of the edges where they split to connect to different multi-parents. + *

+ * @see yfiles.tree.MultiParentDescriptor#edgeStyle + */ + POLYLINE, + /** + * Routing style for routing non-shared edge segments in an orthogonal fashion. + *

+ * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. + * This style only applies to the part of the edges where they split to connect to different multi-parents. + *

+ * @see yfiles.tree.MultiParentDescriptor#edgeStyle + */ + ORTHOGONAL, + /** + * Routing style for routing non-shared edge segments straight. 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. + *

+ * The edges connected to a multi-parent structure will share their paths until shortly above/below the multi-parent nodes. + * This style only applies to the part of the edges where they split to connect to different multi-parents. + *

+ * @see yfiles.tree.MultiParentDescriptor#edgeStyle + */ + STRAIGHT + } + export enum ParentConnectorDirection{ + /** + * Direction specifier which indicates that no connector should be calculated. + * @see yfiles.tree.INodePlacer#placeSubtree + */ + NONE, + /** + * Direction specifier which indicates that any direction can be used for the connector to the parent node. + * @see yfiles.tree.INodePlacer#placeSubtree + */ + ANY, + /** + * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended + * by a segment that goes north. + * @see yfiles.tree.INodePlacer#placeSubtree + */ + NORTH, + /** + * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended + * by a segment that goes east. + * @see yfiles.tree.INodePlacer#placeSubtree + */ + EAST, + /** + * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended + * by a segment that goes south. + * @see yfiles.tree.INodePlacer#placeSubtree + */ + SOUTH, + /** + * Direction specifier which indicates that the connector to the parent node should end in a segment that can be extended + * by a segment that goes west. + * @see yfiles.tree.INodePlacer#placeSubtree + */ + WEST + } + export enum PortStyle{ + /** + * A constant defining that ports are placed at the center of the nodes. + *

+ * This constant uses (0,0) as port offset. + *

+ * @see yfiles.tree.ClassicTreeLayout#portStyle + */ + NODE_CENTER, + /** + * A constant defining that ports are placed at the center of the border of the nodes. + * @see yfiles.tree.ClassicTreeLayout#portStyle + */ + BORDER_CENTER, + /** + * A constant defining that ports are evenly distributed along the border of the nodes. + * @see yfiles.tree.ClassicTreeLayout#portStyle + */ + BORDER_DISTRIBUTED, + /** + * A constant defining that ports are assigned based on given {@link yfiles.layout.PortConstraint port constraints}. + * @see yfiles.tree.ClassicTreeLayout#portStyle + */ + PORT_CONSTRAINTS_AWARE + } + export enum EdgeRoutingStyle{ + /** + * A constant for routing the edges as straight-line segments. + * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle + */ + PLAIN, + /** + * A constant for routing the edges orthogonally in a bus-like fashion. + * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle + */ + ORTHOGONAL + } + export enum LeafPlacement{ + /** + * A policy for placing the leaf nodes in a stack-like fashion with balanced stack heights. + *

+ * In this context, a stack-like fashion means that leaf nodes that connect to the same parent node are placed one upon the + * other, resulting in horizontally compact layouts. + *

+ *

+ * This policy tries to balance stack heights, i.e., for each subtree that consists only of leaf nodes, {@link yfiles.tree.LeafPlacement#LEAVES_STACKED_RIGHT} + * or {@link yfiles.tree.LeafPlacement#LEAVES_STACKED_LEFT_AND_RIGHT} will be used depending on the number of leaves in the + * subtree. + *

+ * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + */ + LEAVES_STACKED, + /** + * A policy for placing the leaf nodes in a stack-like fashion using a single stack left. + *

+ * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the + * other, resulting in horizontally compact layouts. + *

+ *

+ * This policy uses a single stack that lies to the left relative to the center of the parent node. + *

+ * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + */ + LEAVES_STACKED_LEFT, + /** + * A policy for placing the leaf nodes in a stack-like fashion using a single stack right. + *

+ * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the + * other, resulting in horizontally compact layouts. + *

+ *

+ * This policy uses a single stack that lies to the right relative to the center of the parent node. + *

+ * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + */ + LEAVES_STACKED_RIGHT, + /** + * A policy for placing the leaf nodes in a stack-like fashion using two stacks. + *

+ * In this context, a stack-like fashion means that leaf nodes that connect to the same root node are placed one upon the + * other, resulting in horizontally compact layouts. + *

+ *

+ * This policy distributes leaf nodes among two stacks, one to the left and one to the right relative to the center of the + * parent node. + *

+ * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + */ + LEAVES_STACKED_LEFT_AND_RIGHT, + /** + * A policy for placing the leaf nodes in a Dendrogram-like fashion. + *

+ * According to this policy, all leaf nodes are placed in one layer (i.e. all leaves are placed on one horizontal line in a + * top-to-bottom or in a bottom-to-top layout). + *

+ * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + */ + ALL_LEAVES_ON_SAME_LAYER, + /** + * A policy for placing the leaf nodes with the same parent in the same layer. + *

+ * For example, siblings are being placed on a horizontal line in a top-to-bottom or in a bottom-to-top layout. + *

+ *

+ * This policy produces vertically compact layouts. + *

+ * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + */ + SIBLINGS_ON_SAME_LAYER + } + /** + * This {@link yfiles.tree.INodePlacer} places the subtrees such that the overall aspect ratio of the arranged subtree will be + * close to a preferred aspect ratio. + *

+ * Layout Style The aspect ratio describes the relation between width and height of the subtree. To achieve the desired aspect ratio, + * this {@link yfiles.tree.INodePlacer} divides the child {@link yfiles.tree.SubtreeShape}s into as much rows as needed. The edges are + * either routed along the rows or along the columns. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[280,70],[70,140],[140,140],[210,140],[280,140],[70,210],[140,210],[210,210],[280,210],[70,280],[140,280],[210,280],[280,280]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[260,15,260,85]],[0,5,[50,15,50,155]],[0,6,[120,15,120,155]],[0,7,[190,15,190,155]],[0,8,[260,15,260,155]],[0,9,[50,15,50,225]],[0,10,[120,15,120,225]],[0,11,[190,15,190,225]],[0,12,[260,15,260,225]],[0,13,[50,15,50,295]],[0,14,[120,15,120,295]],[0,15,[190,15,190,295]],[0,16,[260,15,260,295]]],"vp":[0.0,0.0,310.0,310.0]}} + *

+ *

+ * Aspect ratio 1 + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[70,140],[140,140],[210,140],[70,210],[140,210],[210,210],[70,280],[140,280],[210,280],[70,350],[140,350],[210,350],[70,420]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[50,15,50,155]],[0,5,[120,15,120,155]],[0,6,[190,15,190,155]],[0,7,[50,15,50,225]],[0,8,[120,15,120,225]],[0,9,[190,15,190,225]],[0,10,[50,15,50,295]],[0,11,[120,15,120,295]],[0,12,[190,15,190,295]],[0,13,[50,15,50,365]],[0,14,[120,15,120,365]],[0,15,[190,15,190,365]],[0,16,[50,15,50,435]]],"vp":[0.0,0.0,240.0,450.0]}} + *

+ *

+ * Aspect ratio 0.5 + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[70,70],[140,70],[210,70],[280,70],[350,70],[420,70],[490,70],[560,70],[70,140],[140,140],[210,140],[280,140],[350,140],[420,140],[490,140],[560,140]],"e":[[0,1,[50,15,50,85]],[0,2,[120,15,120,85]],[0,3,[190,15,190,85]],[0,4,[260,15,260,85]],[0,5,[330,15,330,85]],[0,6,[400,15,400,85]],[0,7,[470,15,470,85]],[0,8,[540,15,540,85]],[0,9,[50,15,50,155]],[0,10,[120,15,120,155]],[0,11,[190,15,190,155]],[0,12,[260,15,260,155]],[0,13,[330,15,330,155]],[0,14,[400,15,400,155]],[0,15,[470,15,470,155]],[0,16,[540,15,540,155]]],"vp":[0.0,0.0,590.0,170.0]}} + *

+ *

+ * Aspect ratio 2 + *

+ * @class yfiles.tree.AspectRatioNodePlacer + * @extends {yfiles.tree.NodePlacerBase} + * @implements {yfiles.tree.IFromSketchNodePlacer} + */ + export interface AspectRatioNodePlacer extends yfiles.tree.NodePlacerBase,yfiles.tree.IFromSketchNodePlacer{} + export class AspectRatioNodePlacer { + /** + * Creates a new instance of {@link yfiles.tree.AspectRatioNodePlacer} with default settings. + * @constructor + */ + constructor(); + /** + * Creates an {@link yfiles.collections.IComparer. edge comparator} which takes the initial coordinates of the nodes into account. + *

+ * This {@link yfiles.collections.IComparer.} defines the order of the outgoing edges of a node before the actual placement of the node's subtree is calculated. + * It also considers whether or not the rows are placed {@link yfiles.tree.AspectRatioNodePlacer#horizontal horiontally}. + *

+ * @returns {yfiles.collections.IComparer.} the {@link yfiles.collections.IComparer.} for the edges + */ + createFromSketchComparer():yfiles.collections.IComparer; + /** + * Gets or sets whether child nodes are distributed in horizontal rows or vertical columns. + * @type {boolean} + */ + horizontal:boolean; + /** + * Gets or sets the vertical distance between the {@link yfiles.tree.SubtreeShape}s. + *

+ * The nodes will be placed below each other, keeping this distance. + *

+ *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + verticalDistance:number; + /** + * Gets or sets the horizontal distance between the {@link yfiles.tree.SubtreeShape}s. + *

+ * The nodes will be placed next to each other, keeping this distance. + *

+ *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + horizontalDistance:number; + /** + * Gets or sets the preferred aspect ratio (width/height) for the subtrees. + *

+ * This ratio determines among how many rows/columns the nodes will be distributed. + *

+ *

+ * The aspect ratio needs to be positive. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified aspect ratio is 0 or negative + * @type {number} + */ + aspectRatio:number; + /** + * Gets or sets how rows/columns are aligned with each other. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown fill style is specified + * @type {yfiles.tree.FillStyle} + */ + fillStyle:yfiles.tree.FillStyle; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.AspectRatioTreeLayout} arranges tree graphs in a compact fashion. + *

+ * Layout Style This layout algorithm tries to generate compact tree layouts with a certain preferred aspect ratio. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[40,740],[360,740],[480,810],[400,810],[240,810],[80,810],[160,810],[560,810],[200,880],[200,940],[200,1000],[200,1060],[200,1120],[120,880],[120,940],[120,1000],[120,1060],[120,1120],[280,880],[280,940],[320,880],[320,940],[600,880],[600,940],[600,1000],[520,880],[520,940],[520,1000],[440,880],[440,940],[440,1000],[440,1060],[440,1120],[40,70],[390,70],[80,450],[80,640],[200,140],[200,450],[80,140],[150,680],[190,680],[240,210],[240,270],[240,330],[120,520],[120,580],[160,520],[160,580],[270,490],[270,550],[310,490],[310,550],[350,490],[350,550],[120,210],[120,270],[120,330],[120,390],[160,210],[160,270],[160,330],[430,610],[580,510],[430,510],[430,140],[510,140],[590,140],[470,610],[650,550],[500,550],[540,550],[630,210],[630,270],[630,330],[470,210],[470,270],[470,330],[470,390],[470,450],[550,210],[550,270],[550,330],[550,390],[550,450]],"e":[[0,1,-10,0,0,0,[5,50,5,720,55,720]],[0,2,-10,0,0,0,[5,50,5,720,375,720]],[2,3,-10,0,0,0,[365,790,495,790]],[2,4,-10,0,0,0,[365,790,415,790]],[1,5,-10,0,0,0,[45,790,255,790]],[1,6,-10,0,0,0,[45,790,95,790]],[1,7,-10,0,0,0,[45,790,175,790]],[2,8,-10,0,0,0,[365,790,575,790]],[7,9,-10,0,0,0,[165,860,215,860]],[7,10,-10,0,0,0,[165,860,165,920,215,920]],[7,11,-10,0,0,0,[165,860,165,980,215,980]],[7,12,-10,0,0,0,[165,860,165,1040,215,1040]],[7,13,-10,0,0,0,[165,860,165,1100,215,1100]],[6,14,-10,0,0,0,[85,860,135,860]],[6,15,-10,0,0,0,[85,860,85,920,135,920]],[6,16,-10,0,0,0,[85,860,85,980,135,980]],[6,17,-10,0,0,0,[85,860,85,1040,135,1040]],[6,18,-10,0,0,0,[85,860,85,1100,135,1100]],[5,19,-10,0,0,0,[245,860,295,860]],[5,20,-10,0,0,0,[245,860,245,920,295,920]],[5,21,-10,0,0,0,[245,860,335,860]],[5,22,-10,0,0,0,[245,860,245,920,335,920]],[8,23,-10,0,0,0,[565,860,615,860]],[8,24,-10,0,0,0,[565,860,565,920,615,920]],[8,25,-10,0,0,0,[565,860,565,980,615,980]],[3,26,-10,0,0,0,[485,860,535,860]],[3,27,-10,0,0,0,[485,860,485,920,535,920]],[3,28,-10,0,0,0,[485,860,485,980,535,980]],[4,29,-10,0,0,0,[405,860,455,860]],[4,30,-10,0,0,0,[405,860,405,920,455,920]],[4,31,-10,0,0,0,[405,860,405,980,455,980]],[4,32,-10,0,0,0,[405,860,405,1040,455,1040]],[4,33,-10,0,0,0,[405,860,405,1100,455,1100]],[0,34,-10,0,0,0,[5,50,55,50]],[0,35,-10,0,0,0,[5,50,405,50]],[34,36,-10,0,0,0,[45,120,45,430,95,430]],[34,37,-10,0,0,0,[45,120,45,620,95,620]],[34,38,-10,0,0,0,[45,120,215,120]],[34,39,-10,0,0,0,[45,120,45,430,215,430]],[34,40,-10,0,0,0,[45,120,95,120]],[37,41,0,-10,0,0,[130,645,130,660,165,660]],[37,42,0,-10,0,0,[130,645,130,660,205,660]],[38,43,-10,0,0,0,[205,190,255,190]],[38,44,-10,0,0,0,[205,190,205,250,255,250]],[38,45,-10,0,0,0,[205,190,205,310,255,310]],[36,46,-10,0,0,0,[85,500,135,500]],[36,47,-10,0,0,0,[85,500,85,560,135,560]],[36,48,-10,0,0,0,[85,500,175,500]],[36,49,-10,0,0,0,[85,500,85,560,175,560]],[39,50,0,-10,0,0,[250,455,250,470,285,470]],[39,51,0,-10,0,0,[250,455,250,530,285,530]],[39,52,0,-10,0,0,[250,455,250,470,325,470]],[39,53,0,-10,0,0,[250,455,250,530,325,530]],[39,54,0,-10,0,0,[250,455,250,470,365,470]],[39,55,0,-10,0,0,[250,455,250,530,365,530]],[40,56,-10,0,0,0,[85,190,135,190]],[40,57,-10,0,0,0,[85,190,85,250,135,250]],[40,58,-10,0,0,0,[85,190,85,310,135,310]],[40,59,-10,0,0,0,[85,190,85,370,135,370]],[40,60,-10,0,0,0,[85,190,175,190]],[40,61,-10,0,0,0,[85,190,85,250,175,250]],[40,62,-10,0,0,0,[85,190,85,310,175,310]],[35,63,-10,0,0,0,[395,120,395,590,445,590]],[35,64,-10,0,0,0,[395,120,395,490,595,490]],[35,65,-10,0,0,0,[395,120,395,490,445,490]],[35,66,-10,0,0,0,[395,120,445,120]],[35,67,-10,0,0,0,[395,120,525,120]],[35,68,-10,0,0,0,[395,120,605,120]],[35,69,-10,0,0,0,[395,120,395,590,485,590]],[64,70,0,-10,0,0,[630,515,630,530,665,530]],[65,71,0,-10,0,0,[480,515,480,530,515,530]],[65,72,0,-10,0,0,[480,515,480,530,555,530]],[68,73,-10,0,0,0,[595,190,645,190]],[68,74,-10,0,0,0,[595,190,595,250,645,250]],[68,75,-10,0,0,0,[595,190,595,310,645,310]],[66,76,-10,0,0,0,[435,190,485,190]],[66,77,-10,0,0,0,[435,190,435,250,485,250]],[66,78,-10,0,0,0,[435,190,435,310,485,310]],[66,79,-10,0,0,0,[435,190,435,370,485,370]],[66,80,-10,0,0,0,[435,190,435,430,485,430]],[67,81,-10,0,0,0,[515,190,565,190]],[67,82,-10,0,0,0,[515,190,515,250,565,250]],[67,83,-10,0,0,0,[515,190,515,310,565,310]],[67,84,-10,0,0,0,[515,190,515,370,565,370]],[67,85,-10,0,0,0,[515,190,515,430,565,430]]],"vp":[0.0,0.0,680.0,1150.0]}} + *

+ *

+ * Example layout with an aspect ratio of 0.5 + *

+ *

+ * Concept + *

+ *

+ * The layout algorithm starts from the root and recursively assigns coordinates to all tree nodes. In this manner, leaf + * nodes will be placed first, while each parent node is placed centered above its child nodes. + *

+ *

+ * Features + *

+ *

+ * The aspect ratio of each subtree can be specified individually. A {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY} + * returns the aspect ratio for each local root node. + *

+ *

+ * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with + * key {@link yfiles.tree.AspectRatioTreeLayout#SELECTED_ROOT_DP_KEY}. + *

+ * @class yfiles.tree.AspectRatioTreeLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface AspectRatioTreeLayout extends yfiles.layout.MultiStageLayout{} + export class AspectRatioTreeLayout { + /** + * Creates a new {@link yfiles.tree.AspectRatioTreeLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Adds bends to the given {@link yfiles.layout.IEdgeLayout}. + *

+ * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} for each edge, after the nodes are placed, to + * route the path of the edges. It may be overridden to apply a custom routing style. + *

+ * @param {yfiles.layout.IEdgeLayout} edgeLayout the layout of the edge that is routed + * @param {yfiles.algorithms.Node} localRoot the local root of the subtree + * @param {yfiles.algorithms.Node} child the child connected to the local root with the given edge + * @param {yfiles.tree.RootPlacement} rootPlacement the placement specifier of the local root + * @param {yfiles.tree.SubtreeArrangement} routingPolicy the direction specifier for the routing + * @protected + */ + createBends(edgeLayout:yfiles.layout.IEdgeLayout,localRoot:yfiles.algorithms.Node,child:yfiles.algorithms.Node,rootPlacement:yfiles.tree.RootPlacement,routingPolicy:yfiles.tree.SubtreeArrangement):void; + /** + * Retrieves the aspect ratio for the subtree that is rooted at the given node. + *

+ * If there is an individual aspect ratio for the subtree provided by a {@link yfiles.algorithms.IDataProvider} registered with key + * {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY}, that ratio will be returned. Otherwise, the {@link yfiles.tree.AspectRatioTreeLayout#aspectRatio default aspect ratio} + * will be returned. + *

+ *

+ * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} before a subtree is arranged. It may be + * overridden to use another approach to define the aspect ratio for subtrees. + *

+ * @param {yfiles.algorithms.Node} localRoot the root node of the subtree + * @returns {number} the aspect ratio of the subtree rooted at the local root node + * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY + * @see yfiles.tree.AspectRatioTreeLayout#aspectRatio + * @protected + */ + getAspectRatio(localRoot:yfiles.algorithms.Node):number; + /** + * Retrieves the root placement for the subtree that is rooted at the given node. + *

+ * Either an individual root placement for the subtree (defined via a {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY}), or if there is none, the {@link yfiles.tree.AspectRatioTreeLayout#rootPlacement default root placement} is returned. + *

+ *

+ * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} after a subtree is arranged to align the + * local root node. It may be overridden to use another approach to define the root placement for a subtree. + *

+ * @param {Object} localRoot the root of the subtree + * @returns {yfiles.tree.RootPlacement} the root placement of the subtree + * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY + * @see yfiles.tree.AspectRatioTreeLayout#rootPlacement + * @protected + */ + getRootPlacement(localRoot:Object):yfiles.tree.RootPlacement; + /** + * Retrieves the routing for the subtree that is rooted at the given node. + *

+ * Either an individual routing for the subtree (defined via a {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY}), or if there is none, the {@link yfiles.tree.AspectRatioTreeLayout#subtreeArrangement default routing} is returned. + *

+ *

+ * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} to determine the direction of the subtrees. + * It may be overridden to use another approach to define the routing for a subtree. + *

+ * @param {Object} localRoot the root of the subtree + * @returns {yfiles.tree.SubtreeArrangement} the routing policy for the subtree + * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY + * @see yfiles.tree.AspectRatioTreeLayout#subtreeArrangement + * @protected + */ + getSubtreeArrangement(localRoot:Object):yfiles.tree.SubtreeArrangement; + /** + * Retrieves all children of the given local root. + *

+ * This method is called by {@link yfiles.tree.AspectRatioTreeLayout#applyLayoutCore} to arrange the subtrees below the local + * root. + *

+ * @param {yfiles.algorithms.Node} localRoot the root of a subtree + * @returns {yfiles.algorithms.INodeCursor} all successors of the given node + * @protected + */ + getSuccessors(localRoot:yfiles.algorithms.Node):yfiles.algorithms.INodeCursor; + /** + * Data provider key for specifying a target aspect ratio for each subtree + *

+ * 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: the height of the layout should be greater than its width
  • + *
  • aspect ratio greater than 1: the width of the layout should be greater than its height
  • + *
+ *

+ * If no specific ratio is defined for a subtree, the layout algorithm falls back to the default {@link yfiles.tree.AspectRatioTreeLayout#aspectRatio aspect ratio}. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SUBTREE_ASPECT_RATIO_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for specifying the placement of each subtree root + *

+ * If no root placement is specified for one of the subtree roots, the default {@link yfiles.tree.AspectRatioTreeLayout#rootPlacement root placement} will be used. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static ROOT_PLACEMENT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for specifying the routing direction for each subtree root + *

+ * The children in a subtree are arranged either horizontally or vertically. The edges are routed to the top of the child + * nodes or at the side, respectively. Directions depend on the {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation} and refer to {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} + * for this description. + *

+ *

+ * If no specific routing policy is specified for a subtree root, the layout algorithm uses the default {@link yfiles.tree.AspectRatioTreeLayout#subtreeArrangement routing direction}. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SUBTREE_ROUTING_POLICY_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for marking the node that will be used as root node of the tree. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * The input graph this algorithm is handling. + * @protected + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + /** + * Gets or sets the horizontal distance between adjacent nodes. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + horizontalDistance:number; + /** + * Gets or sets the vertical distance between adjacent nodes. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + verticalDistance:number; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @see yfiles.layout.MultiStageLayout#hideGroupsStage + * @see yfiles.layout.HideGroupsStage + * @type {boolean} + */ + hideGroupsStageEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter + * @see yfiles.router.ParallelEdgeRouter + * @type {boolean} + */ + parallelEdgeRouterEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + /** + * Gets or sets the {@link yfiles.collections.IComparer.} that will be used for sorting the {@link yfiles.algorithms.Node#sortOutEdges outgoing edges} of each local root in the tree before they are being + * arranged. + * @type {yfiles.collections.IComparer.} + */ + comparer:yfiles.collections.IComparer; + /** + * Gets or sets the default aspect ratio for this {@link yfiles.tree.AspectRatioTreeLayout}. + *

+ * This aspect ratio is used for all subtrees for which there is no specific aspect ratio defined in a {@link yfiles.algorithms.IDataProvider} + * registered with {@link yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY}. + *

+ *

+ * The aspect ratio needs to have a positive value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified aspect ratio is 0 or negative + * @type {number} + */ + aspectRatio:number; + /** + * Gets or sets the desired placement of the tree's root node. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown placement specifiers is set + * @type {yfiles.tree.RootPlacement} + */ + rootPlacement:yfiles.tree.RootPlacement; + /** + * Gets or sets how the children of a local root are arranged and how the edges between them are routed. + * @throws {Stubs.Exceptions.ArgumentError} if the specified routing policy is unknown + * @type {yfiles.tree.SubtreeArrangement} + */ + subtreeArrangement:yfiles.tree.SubtreeArrangement; + /** + * Gets or sets 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. + *

+ *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + bendDistance:number; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.AssistantNodePlacer} places nodes that are marked as assistants left and right of their parents and all + * other nodes below the assistant nodes. + *

+ * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[75,0],[100,171],[50,171],[0,171],[150,171],[110,50,1],[40,100,1],[40,50,1]],"e":[[0,1,[90,150.5,115,150.5]],[0,2,[90,150.5,65,150.5]],[0,3,[90,150.5,15,150.5]],[0,4,[90,150.5,165,150.5]],[0,5,[90,65]],[0,6,[90,115]],[0,7,[90,65]]],"vp":[0.0,0.0,180.0,201.0]}} + *

+ *

+ * Assistants are marked + *

+ *

+ * Concept This {@link yfiles.tree.INodePlacer} delegates the placement of all assistant nodes to an instance of + * {@link yfiles.tree.LeftRightNodePlacer}. The non-assistant nodes are handled by another {@link yfiles.tree.AssistantNodePlacer#childNodePlacer node placer}. To be able to do this, {@link yfiles.tree.AssistantNodePlacer} + * uses a {@link yfiles.tree.IProcessor} which prepares the graph for node placing. + *

+ *

+ * A {@link yfiles.algorithms.IDataProvider} that is registered using {@link yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY} returns + * true for assistant nodes and false for all other nodes. + *

+ * @class yfiles.tree.AssistantNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface AssistantNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class AssistantNodePlacer { + /** + * Creates a new {@link yfiles.tree.AssistantNodePlacer} instance that uses the transformation defined by the given matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); + /** + * Creates a new {@link yfiles.tree.AssistantNodePlacer} instance with default settings. + * @constructor + */ + constructor(); + /** + * Creates a {@link yfiles.collections.IComparer.} that compares outgoing edges connecting to assistant nodes and edges connecting to non-assistant nodes + * separately. + * @param {yfiles.collections.IComparer.} assistantComparer the {@link yfiles.collections.IComparer.} for edges connecting to assistant nodes + * @param {yfiles.collections.IComparer.} childComparer the {@link yfiles.collections.IComparer.} for edges connecting to non-assistant nodes + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that compares edges to assistant nodes separately from edges to non-assistant nodes + * @static + */ + static createCompoundComparer(assistantComparer:yfiles.collections.IComparer,childComparer:yfiles.collections.IComparer):yfiles.collections.IComparer; + /** + * Data provider key for marking which nodes are placed as assistants + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static ASSISTANT_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the spacing between subtrees for the delegate {@link yfiles.tree.INodePlacer}. + *

+ * The spacing needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative + * @type {number} + */ + spacing:number; + /** + * Gets or sets the {@link yfiles.tree.INodePlacer} instance that places the non-assistant children. + *

+ * These non-assistant child nodes will be placed below the assistant child nodes and are arranged by the given + * {@link yfiles.tree.INodePlacer}. Non-assistant child nodes are the ones that are not marked in the {@link yfiles.algorithms.IDataProvider} + * registered with {@link yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY}. + *

+ * @see yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY + * @type {yfiles.tree.INodePlacer} + */ + childNodePlacer:yfiles.tree.INodePlacer; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.BusNodePlacer} creates a bus to which all child nodes and the local root node are connected. + *

+ * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[40,0],[140,0],[190,0],[50,70],[0,70],[100,70],[150,70],[90,0,1]],"e":[[7,0,[105,50,55,50]],[7,1,[105,50,155,50]],[7,2,[105,50,205,50]],[7,3,[105,50,65,50]],[7,4,[105,50,15,50]],[7,5,[105,50,115,50]],[7,6,[105,50,165,50]]],"vp":[0.0,0.0,220.0,100.0]}} + *

+ *

+ * The root node is marked + *

+ * @class yfiles.tree.BusNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface BusNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class BusNodePlacer { + /** + * Creates a new {@link yfiles.tree.BusNodePlacer} instance that uses the transformation defined by the given matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); + /** + * Creates a new instance of {@link yfiles.tree.BusNodePlacer} with default settings. + * @constructor + */ + constructor(); + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm arranges graphs with a tree structure. + *

+ * Layout Style {@link yfiles.tree.ClassicTreeLayout} is designed to arrange directed and undirected trees that have a unique root node. All + * children are placed below their parent in relation to the main layout direction. The edges of the graph are routed as + * straight-line segments or in an orthogonal bus-like fashion. + *

+ *

+ * Tree layout algorithms are commonly used for visualizing relational data and for producing diagrams of high quality that + * are able to reveal possible hierarchic properties of the graph. More precisely, they find applications in dataflow + * analysis, software engineering, bioinformatics and business administration. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[215.62,70],[365.62,0],[706.25,210],[25,140],[331.25,140],[100,280],[512.5,210],[325,280],[762.5,280],[200,210],[150,350],[400,350],[825,350],[350,350],[25,210],[900,420],[700,420],[100,350],[575,280],[575,350],[600,420],[200,280],[150,420],[25,280],[550,420],[300,420],[850,420],[800,420],[400,420],[200,350],[350,420],[50,350],[500,420],[100,420],[750,420],[450,420],[0,420],[50,420],[200,420],[650,280],[250,420],[650,420],[650,350]],"e":[[1,0,0,15,0,-15,[230.62,50]],[1,2,0,15,0,-15,[721.25,50]],[1,3,0,15,0,-15,[40,50]],[0,4,0,15,0,-15,[346.25,120]],[0,5,0,15,0,-15,[115,120]],[4,6,0,15,0,-15,[527.5,190]],[4,7,0,15,0,-15,[340,190]],[2,8,0,15,0,-15,[777.5,260]],[4,9,0,15,0,-15,[215,190]],[4,10,0,15,0,-15,[165,190]],[7,11,0,15,0,-15,[415,330]],[8,12,0,15,0,-15,[840,330]],[7,13,0,15,0,-15,[365,330]],[3,14,0,15,0,-15],[12,15,0,15,0,-15,[915,400]],[8,16,0,15,0,-15,[715,330]],[5,17,0,15,0,-15],[6,18,0,15,0,-15,[590,260]],[18,19,0,15,0,-15],[19,20,0,15,0,-15,[615,400]],[9,21,0,15,0,-15],[10,22,0,15,0,-15],[14,23,0,15,0,-15],[19,24,0,15,0,-15,[565,400]],[7,25,0,15,0,-15,[315,330]],[12,26,0,15,0,-15,[865,400]],[12,27,0,15,0,-15,[815,400]],[11,28,0,15,0,-15],[21,29,0,15,0,-15],[13,30,0,15,0,-15],[23,31,0,15,0,-15,[65,330]],[6,32,0,15,0,-15,[515,260]],[17,33,0,15,0,-15],[12,34,0,15,0,-15,[765,400]],[6,35,0,15,0,-15,[465,260]],[23,36,0,15,0,-15,[15,330]],[31,37,0,15,0,-15],[29,38,0,15,0,-15],[2,39,0,15,0,-15,[665,260]],[7,40,0,15,0,-15,[265,330]],[39,42,0,15,0,-15],[42,41,0,15,0,-15]],"vp":[0.0,0.0,930.0,450.0]}} A Dendrogram {@graph {"ann":{"s":[30,30],"d":1},"n":[[983.12,0],[495,85],[495,170],[151.25,170],[495,240],[42.5,255],[85,325],[0,325],[520,310],[470,310],[520,380],[135,395],[470,380],[85,395],[520,450],[35,395],[185,240,265,270,2],[260,255],[320,325],[405,395],[320,395],[370,465],[320,465],[235,395],[270,465],[200,325],[570,155,560,510,2],[670,170],[1060,240],[670,240],[1060,310],[670,325],[585,240],[1085,380],[670,395],[670,465],[620,325],[1035,380],[720,310,295,340,2],[810,325],[920,395],[835,395],[920,465],[785,395],[835,465],[970,535],[920,535],[735,395],[735,465],[870,535],[920,605],[1150,70,440,495,2],[1471.25,85],[1545,155],[1397.5,155],[1510,240],[1435,240],[1460,310],[1360,240],[1460,380],[1485,450],[1410,310],[1360,310],[1435,450],[1510,310],[1360,380],[1435,520],[1165,225,175,230,2],[1230,240],[1280,310],[1230,310],[1180,310],[1265,380,60,60,2],[1280,395]],"e":[[0,1,[998.12,50,510,50]],[1,2],[1,3,[510,135,166.25,135]],[2,4],[3,5,[166.25,220,57.5,220]],[5,6,[57.5,305,100,305]],[5,7,[57.5,305,15,305]],[4,8,[510,290,535,290]],[4,9,[510,290,485,290]],[8,10],[6,11,[100,375,150,375]],[9,12],[6,13],[10,14],[6,15,[100,375,50,375]],[3,17,[166.25,220,275,220]],[17,18,[275,305,335,305]],[18,19,[335,375,420,375]],[18,20],[20,21,[335,445,385,445]],[20,22],[18,23,[335,375,250,375]],[20,24,[335,445,285,445]],[17,25,[275,305,215,305]],[1,27,[510,135,685,135]],[27,28,[685,220,1075,220]],[27,29],[28,30],[29,31],[27,32,[685,220,600,220]],[30,33,[1075,360,1100,360]],[31,34],[34,35],[29,36,[685,290,635,290]],[30,37,[1075,360,1050,360]],[29,39,[685,290,825,290]],[39,40,[825,375,935,375]],[39,41,[825,375,850,375]],[40,42],[39,43,[825,375,800,375]],[41,44],[42,45,[935,515,985,515]],[42,46],[39,47,[825,375,750,375]],[47,48],[42,49,[935,515,885,515]],[46,50],[0,52,[998.12,50,1486.25,50]],[52,53,[1486.25,135,1560,135]],[52,54,[1486.25,135,1412.5,135]],[54,55,[1412.5,205,1525,205]],[54,56,[1412.5,205,1450,205]],[56,57,[1450,290,1475,290]],[54,58,[1412.5,205,1375,205]],[57,59],[59,60,[1475,430,1500,430]],[56,61,[1450,290,1425,290]],[58,62],[59,63,[1475,430,1450,430]],[55,64],[62,65],[63,66],[54,68,[1412.5,205,1245,205]],[68,69,[1245,290,1295,290]],[68,70],[68,71,[1245,290,1195,290]],[69,73]],"vp":[0.0,0.0,1590.0,665.0]}} A graph containing group nodes {@graph {"ann":{"s":[30,30],"d":1},"n":[[4.33,440.22],[74.33,418.34,73.78,73.78],[188.11,41,48,48],[197.11,417.95],[298,245.33],[298,445.67],[389.89,393.78,73.78,73.78],[411.78,146.89],[298,25],[411.78,243.78],[411.78,293.78],[298,590.56],[503.67,100,73.78,73.78],[197.11,708.56],[188.11,821.45,48,48],[525.56,415.67],[525.56,243.78],[399.84,13.06,53.88,53.88],[276.11,661.67,73.78,73.78],[411.78,343.78],[411.78,497.56],[402.78,547.56,48,48],[402.78,615.56,48,48],[298,755.45],[525.56,472.56],[525.56,293.78],[629.39,243.78],[525.56,0],[525.56,50],[525.56,522.56],[298,805.45],[617.45,485.62,53.88,53.88],[629.39,50],[411.78,755.45],[711.33,38.06,53.88,53.88],[629.39,559.5],[298,75],[411.78,683.56],[525.56,599.56],[411.78,805.45],[723.27,559.5],[629.39,293.78],[525.56,193.78],[723.27,497.56],[298,855.45],[525.56,649.56]],"e":[[0,1],[1,2,[168.11,455.22,168.11,65]],[1,3,[168.11,455.22,168.11,432.95]],[3,4,[256.11,432.95,256.11,260.33]],[3,5,[256.11,432.95,256.11,460.67]],[5,6,[369.89,460.67,369.89,430.67]],[4,7,[369.89,260.33,369.89,161.89]],[2,8,[256.11,65,256.11,40]],[4,9,[369.89,260.33,369.89,258.78]],[4,10,[369.89,260.33,369.89,308.78]],[3,11,[256.11,432.95,256.11,605.56]],[7,12,[483.67,161.89,483.67,136.89]],[1,13,[168.11,455.22,168.11,723.56]],[1,14,[168.11,455.22,168.11,845.45]],[6,15],[9,16],[8,17],[13,18,[256.11,723.56,256.11,698.56]],[4,19,[369.89,260.33,369.89,358.78]],[5,20,[369.89,460.67,369.89,512.56]],[11,21,[369.89,605.56,369.89,571.56]],[11,22,[369.89,605.56,369.89,639.56]],[13,23,[256.11,723.56,256.11,770.45]],[20,24,[483.67,512.56,483.67,487.56]],[10,25],[16,26],[17,27,[483.67,40,483.67,15]],[17,28,[483.67,40,483.67,65]],[20,29,[483.67,512.56,483.67,537.56]],[14,30,[256.11,845.45,256.11,820.45]],[29,31,[597.45,537.56,597.45,512.56]],[28,32],[23,33],[32,34],[29,35,[597.45,537.56,597.45,574.5]],[2,36,[256.11,65,256.11,90]],[18,37],[22,38,[483.67,639.56,483.67,614.56]],[30,39],[35,40],[25,41],[7,42,[483.67,161.89,483.67,208.78]],[31,43],[14,44,[256.11,845.45,256.11,870.45]],[22,45,[483.67,639.56,483.67,664.56]]],"vp":[4.0,0.0,762.0,886.0]}} Left-to-right layout with global layeringConcept + *

+ *

+ * The layout algorithm starts from the root and recursively assigns coordinates to all tree nodes. In this manner, leaf + * nodes will be placed first, while each parent node is placed centered above its children. + *

+ *

+ * Features + *

+ *

+ * The layout algorithm supports custom sorting of sibling nodes by using a specific {@link yfiles.tree.NodeOrderComparer}. Each + * tree node may have an individual {@link yfiles.tree.NodeOrderComparer} that is stored in a {@link yfiles.algorithms.IDataProvider} + * registered with the graph with {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY}. If this {@link yfiles.tree.NodeOrderComparer} + * uses the initial coordinates of the nodes, it allows the incremental insertion of child nodes while keeping the relative + * locations of the other nodes. + *

+ *

+ * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with + * key {@link yfiles.tree.ClassicTreeLayout#SELECTED_ROOT_DP_KEY}. + *

+ *

+ * {@link yfiles.tree.ClassicTreeLayout} can be configured to {@link yfiles.tree.ClassicTreeLayout#considerNodeLabels reserve space for node labels}. It can also {@link yfiles.tree.ClassicTreeLayout#integratedEdgeLabeling place edge labels along edges} + * such that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored + * in a {@link yfiles.layout.PreferredPlacementDescriptor} instance. However, the placement along the edge will only affect the + * order of multiple labels at the same edge. The algorithm will always place the labels close to the target node. + *

+ *

+ * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole + * subtree. Otherwise, the group nodes may overlap with each other or with other nodes. Furthermore, the user may specify + * minimum size constraints for each group node using {@link yfiles.algorithms.IDataProvider} key + * {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. + *

+ *

+ * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} + * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. After the + * layout calculation, the stage will reinsert the edges that were removed and route them separately. + *

+ * @class yfiles.tree.ClassicTreeLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface ClassicTreeLayout extends yfiles.layout.MultiStageLayout{} + export class ClassicTreeLayout { + /** + * Creates a new {@link yfiles.tree.ClassicTreeLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Data provider key for marking the node that will be used as root node of the tree. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets whether or not a global layering is enforced, that is, each node spans exactly one layer. + *

+ * If it is enabled, the algorithm ensures that nodes never span more than one layer. Otherwise, nodes with larger size + * might span two or more layers such that a more compact layout is produced. + *

+ *

+ * This setting can be advantageous, if the hierarchical structure of the tree should be emphasized. + *

+ * @see yfiles.tree.ClassicTreeLayout#verticalAlignment + * @see yfiles.tree.ClassicTreeLayout#verticalAlignment + * @type {boolean} + */ + enforceGlobalLayering:boolean; + /** + * Gets or sets the layout policy for leaf nodes. + * @throws {Stubs.Exceptions.ArgumentError} if the specified policy is unknown + * @type {yfiles.tree.LeafPlacement} + */ + leafPlacement:yfiles.tree.LeafPlacement; + /** + * Gets or sets whether or not group nodes are handled by the layout algorithm. + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @type {boolean} + */ + groupingSupported:boolean; + /** + * Gets or sets the {@link yfiles.collections.IComparer.} instance that is used for sorting the outgoing edges of each node of the tree. + *

+ * This comparator defines the relative order of the child nodes in the layout. + *

+ * @type {yfiles.collections.IComparer.} + */ + comparer:yfiles.collections.IComparer; + /** + * Gets or sets the port assignment policy that will be applied. + * @type {yfiles.tree.PortStyle} + */ + portStyle:yfiles.tree.PortStyle; + /** + * Gets or sets the edge routing style used by this layout algorithm. + *

+ * If {@link yfiles.tree.EdgeRoutingStyle#PLAIN} is set, the edges will be routed as straight-line segments. If {@link yfiles.tree.EdgeRoutingStyle#ORTHOGONAL} + * is set, all edges will be routed orthogonally in a bus-like fashion. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an invalid layout style is provided + * @type {yfiles.tree.EdgeRoutingStyle} + */ + edgeRoutingStyle:yfiles.tree.EdgeRoutingStyle; + /** + * Gets or sets the minimum horizontal distance between adjacent nodes within the same layer. + * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets the minimum distance between two adjacent layers. + * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative + * @type {number} + */ + minimumLayerDistance:number; + /** + * Gets or sets whether or not the layout algorithm reserves space for node labels. + * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets whether or not the layout algorithm reserves space for edge labels and places them. + *

+ * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on + * {@link yfiles.layout.IEdgeLabelLayout}. + *

+ *

+ * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} + * and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to true. + *

+ * @type {boolean} + */ + integratedEdgeLabeling:boolean; + /** + * Gets or sets the vertical bus alignment for orthogonally routed edge buses. + *

+ * The bus alignment determines the relative position of an edge bus between two subsequent layers. The value of this + * property must lie within the interval [0,1] where: + *

+ *
    + *
  • A value of 0 places the bus at the top, directly below the parent node.
  • + *
  • A value of 0.5 places the bus in the middle between parent and child nodes.
  • + *
  • A value of 1 places the bus at the bottom, directly above the child nodes.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if busAlignment is not in [0,1] + * @see yfiles.tree.ClassicTreeLayout#edgeRoutingStyle + * @see yfiles.tree.ClassicTreeLayout#enforceGlobalLayering + * @see yfiles.tree.ClassicTreeLayout#leafPlacement + * @type {number} + */ + busAlignment:number; + /** + * Gets or sets the vertical alignment of the nodes within their corresponding layers. + *

+ * The value for the vertical alignment is considered as relative to the height of the corresponding layer, which is + * determined by the maximum height of the nodes that belong to the particular layer. + *

+ *

+ * The value of this property must lie within the interval [0,1], where: + *

+ *
    + *
  • A value of 0 corresponds to top-alignment.
  • + *
  • A value of 0.5 corresponds to center-alignment.
  • + *
  • A value of 1 corresponds to bottom-alignment.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if vertical alignment value does not lie within [0,1] + * @see yfiles.tree.ClassicTreeLayout#enforceGlobalLayering + * @type {number} + */ + verticalAlignment:number; + /** + * Gets or sets the modification matrix used for rotating / mirroring the layout. + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter + * @see yfiles.router.ParallelEdgeRouter + * @type {boolean} + */ + parallelEdgeRouterEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.tree.DefaultNodePlacer} is the default implementation of interface {@link yfiles.tree.INodePlacer}. + *

+ * Layout Style The layout style can be customized in several ways. Subtrees sharing the same local root node are either placed above + * or below each other. {@graph {"ann":{"s":[30,30],"d":1},"n":[[135,0],[0,70],[70,70],[120,149],[170,149],[220,149],[270,149],[70,199],[120,278],[170,278],[220,278],[270,278]],"e":[[0,1,0,15,0,0,[150,50,15,50]],[1,2],[2,3,-11.25,15,0,0,[73.75,116,135,133]],[2,4,-3.75,15,0,0,[81.25,116,185,133]],[2,5,3.75,15,0,0,[88.75,116,235,133]],[2,6,11.25,15,0,0,[96.25,116,285,133]],[1,7,[50,85,50,214]],[7,8,-11.25,15,0,0,[73.75,245,135,262]],[7,9,-3.75,15,0,0,[81.25,245,185,262]],[7,10,3.75,15,0,0,[88.75,245,235,262]],[7,11,11.25,15,0,0,[96.25,245,285,262]]],"vp":[0.0,0.0,300.0,308.0]}} + *

+ *

+ * Each layer in the tree uses different configurations of {@link yfiles.tree.DefaultNodePlacer} + *

+ *

+ * Features + *

+ *

+ * {@link yfiles.tree.SubtreeShape}s can be arranged in each main direction specified in + * {@link yfiles.tree.DefaultNodePlacer#childPlacement}. That way, the subtrees of the same graph can have different directions. + *

+ *

+ * This node placer aligns the local root node according to a chosen {@link yfiles.tree.DefaultNodePlacer#rootAlignment alignment}. + *

+ *

+ * There are various {@link yfiles.tree.DefaultNodePlacer#routingStyle routing styles} that result in different edge routes. + *

+ * @class yfiles.tree.DefaultNodePlacer + * @extends {yfiles.tree.NodePlacerBase} + * @implements {yfiles.tree.IFromSketchNodePlacer} + * @implements {yfiles.lang.ICloneable} + */ + export interface DefaultNodePlacer extends yfiles.tree.NodePlacerBase,yfiles.tree.IFromSketchNodePlacer,yfiles.lang.ICloneable{} + export class DefaultNodePlacer { + /** + * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with custom settings. + * @param {yfiles.tree.ChildPlacement} childPlacement the child placement specifier describing the style of the arrangement + * @param {yfiles.tree.RootAlignment} rootAlignment the alignment specifier describing how the root node is aligned with its child nodes + * @param {yfiles.tree.RoutingStyle} routingStyle the routing style specifier + * @param {number} verticalDistance the vertical distance between the {@link yfiles.tree.SubtreeShape}s + * @param {number} horizontalDistance the horizontal distance between the {@link yfiles.tree.SubtreeShape}s + * @param {number} minFirstSegmentLength the minimum length of the first edge segment (connected to the root node) + * @param {number} minLastSegmentLength the minimum length of the last edge segment (connected to the child node) + * @param {number} minSlope the minimum slope between the root node and the {@link yfiles.tree.SubtreeShape}s + * @param {number} minSlopeHeight the minimum vertical height of sloped edge segments + * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment or the routing style is unknown or if the horizontal/vertical distance + * or the minimum first/last segment length or the minimum slope or the minimum vertical height is negative + * @see yfiles.tree.DefaultNodePlacer#childPlacement + * @see yfiles.tree.DefaultNodePlacer#rootAlignment + * @see yfiles.tree.DefaultNodePlacer#routingStyle + * @see yfiles.tree.DefaultNodePlacer#verticalDistance + * @see yfiles.tree.DefaultNodePlacer#horizontalDistance + * @see yfiles.tree.DefaultNodePlacer#minimumFirstSegmentLength + * @see yfiles.tree.DefaultNodePlacer#minimumLastSegmentLength + * @see yfiles.tree.DefaultNodePlacer#minimumSlope + * @see yfiles.tree.DefaultNodePlacer#minimumSlopeHeight + * @constructor + */ + constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number,minFirstSegmentLength:number,minLastSegmentLength:number,minSlope:number,minSlopeHeight:number); + /** + * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#rootAlignment root alignment}, {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} + * and {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. + * @param {yfiles.tree.ChildPlacement} childPlacement the child placement specifier describing the style of the arrangement + * @param {yfiles.tree.RootAlignment} rootAlignment the alignment specifier describing how the root node is aligned with its child nodes + * @param {yfiles.tree.RoutingStyle} routingStyle the routing style specifier + * @param {number} verticalDistance the vertical distance between the {@link yfiles.tree.SubtreeShape}s + * @param {number} horizontalDistance the horizontal distance between the {@link yfiles.tree.SubtreeShape}s + * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment or the routing style is unknown or if the horizontal/vertical distance + * is negative + * @see yfiles.tree.DefaultNodePlacer#childPlacement + * @see yfiles.tree.DefaultNodePlacer#rootAlignment + * @see yfiles.tree.DefaultNodePlacer#routingStyle + * @see yfiles.tree.DefaultNodePlacer#verticalDistance + * @see yfiles.tree.DefaultNodePlacer#horizontalDistance + * @constructor + */ + constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number); + /** + * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#rootAlignment root alignment}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} and + * {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. + * @param {yfiles.tree.ChildPlacement} childPlacement the child placement specifier describing the style of the arrangement + * @param {yfiles.tree.RootAlignment} rootAlignment the alignment specifier describing how the root node is aligned with its child nodes + * @param {number} verticalDistance the vertical distance between the {@link yfiles.tree.SubtreeShape}s + * @param {number} horizontalDistance the horizontal distance between the {@link yfiles.tree.SubtreeShape}s + * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier or the root alignment specifier is unknown or if the horizontal/vertical distance is + * negative + * @see yfiles.tree.DefaultNodePlacer#childPlacement + * @see yfiles.tree.DefaultNodePlacer#rootAlignment + * @see yfiles.tree.DefaultNodePlacer#verticalDistance + * @see yfiles.tree.DefaultNodePlacer#horizontalDistance + * @constructor + */ + constructor(childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,verticalDistance:number,horizontalDistance:number); + /** + * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with customized {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}, {@link yfiles.tree.DefaultNodePlacer#verticalDistance vertical} and {@link yfiles.tree.DefaultNodePlacer#horizontalDistance horizontal distance}. + * @param {yfiles.tree.ChildPlacement} childPlacement the child placement specifier describing the style of the arrangement + * @param {number} verticalDistance the vertical distance between the {@link yfiles.tree.SubtreeShape}s + * @param {number} horizontalDistance the horizontal distance between the {@link yfiles.tree.SubtreeShape}s + * @throws {Stubs.Exceptions.ArgumentError} if the placement specifier is unknown or if the horizontal/vertical distance is negative + * @see yfiles.tree.DefaultNodePlacer#childPlacement + * @see yfiles.tree.DefaultNodePlacer#verticalDistance + * @see yfiles.tree.DefaultNodePlacer#horizontalDistance + * @constructor + */ + constructor(childPlacement:yfiles.tree.ChildPlacement,verticalDistance:number,horizontalDistance:number); + /** + * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with default settings. + * @constructor + */ + constructor(); + /** + * Calculates the bends for the connector to the parent node. + *

+ * This implementation adds bends to the connector for edges that route the edges around the child node in case there are + * {@link yfiles.layout.PortConstraint}s that conflict with the direction of the {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}. + *

+ *

+ * This method is called in {@link yfiles.tree.DefaultNodePlacer#placeSubtreeOfNode} to route the edges after the + * {@link yfiles.tree.SubtreeShape}s are arranged. It may be overridden to customize the routing style. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the local root node whose connector is calculated and stored in the given subtree shape + * @param {yfiles.layout.INodeLayout} rootLayout the {@link yfiles.layout.INodeLayout} of the root node + * @param {yfiles.tree.SubtreeShape} subtreeShape the shape of the whole subtree of the local root + * @param {yfiles.algorithms.Edge} parentEdge the incoming edge of the local root node that will be the connector for the given subtree shape + * @param {yfiles.layout.IEdgeLayout} parentEdgeLayout the current {@link yfiles.layout.IEdgeLayout} of the connector edge + * @param {number} direction the direction specifier as defined in the {@link yfiles.tree.INodePlacer} interface which should be used for the connector + * @see yfiles.tree.NodePlacerBase#determineChildConnectors + * @protected + */ + calculateParentConnector(graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,rootLayout:yfiles.layout.INodeLayout,subtreeShape:yfiles.tree.SubtreeShape,parentEdge:yfiles.algorithms.Edge,parentEdgeLayout:yfiles.layout.IEdgeLayout,direction:number):void; + /** + * Calculates the routing of the source side of the edge to the given child node. + *

+ * This method delegates to {@link yfiles.tree.DefaultNodePlacer#calculateSourceEdgeLayout} if the {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style} is not + * {@link yfiles.tree.RoutingStyle#FORK}. It may be overridden to implement a custom routing style. + *

+ * @param {yfiles.layout.INodeLayout} rootLayout the {@link yfiles.layout.INodeLayout} of the local root node + * @param {yfiles.tree.SubtreeShape} childShape the {@link yfiles.tree.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, the x-coordinate otherwise + * @param {number} childForkCoordinate the y-coordinate of the second (= last) bend of the edge if the placement is horizontal, the x-coordinate otherwise + * @protected + */ + calculateSlopedSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge,childForkCoordinate:number,rootForkCoordinate:number):void; + /** + * Calculates the routing of the source side of the edge to the given child node. + *

+ * This implementation adds bends to the {@link yfiles.layout.IEdgeLayout} of the given edge according to the specified {@link yfiles.tree.DefaultNodePlacer#routingStyle routing style} + * and {@link yfiles.tree.DefaultNodePlacer#childPlacement child placement}. It also updates the target points in the {@link yfiles.tree.SubtreeShape}. + *

+ *

+ * This method is called by {@link yfiles.tree.DefaultNodePlacer#calculateSlopedSourceEdgeLayout} to route the edges. It may be + * overridden to implement a custom edge routing style. + *

+ * @param {yfiles.layout.INodeLayout} rootLayout the {@link yfiles.layout.INodeLayout} of the local root node + * @param {yfiles.tree.SubtreeShape} childShape the {@link yfiles.tree.SubtreeShape} of the child's subtree that is connected through the given edge + * @param {yfiles.algorithms.Edge} edge the edge + * @protected + */ + calculateSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge):void; + /** + * Calculates the routing of the target side of the edge to the given child node. + *

+ * This implementation just resets the current {@link yfiles.layout.IEdgeLayout}. + *

+ *

+ * This method is called by {@link yfiles.tree.DefaultNodePlacer#placeSubtreeOfNode} after the {@link yfiles.tree.SubtreeShape shapes} of the local root's children + * are placed. It may be overridden to add some {@link yfiles.tree.SubtreeShape#addTargetPoint target points} to the edge. + *

+ * @param {yfiles.layout.INodeLayout} rootLayout the {@link yfiles.layout.INodeLayout} of the local root node + * @param {yfiles.tree.SubtreeShape} childShape the {@link yfiles.tree.SubtreeShape} of the child's subtree that is connected through the given edge + * @param {yfiles.algorithms.Edge} edge the edge + * @protected + */ + calculateTargetEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.SubtreeShape,edge:yfiles.algorithms.Edge):void; + /** + * Creates a {@link yfiles.collections.IComparer.} for outgoing edges which takes the initial coordinates of the edges' targets into account. + *

+ * Child nodes are sorted in a way that the layout will resemble the current arrangement of the nodes. This is especially + * useful for interactive or incremental layout calculation. + *

+ * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} that considers the initial coordinates of the nodes + */ + createComparer():yfiles.collections.IComparer; + /** + * Delegates to {@link yfiles.tree.DefaultNodePlacer#createComparer}. + * @returns {yfiles.collections.IComparer.} the From Sketch {@link yfiles.collections.IComparer.} + * @see yfiles.tree.DefaultNodePlacer#createComparer + */ + createFromSketchComparer():yfiles.collections.IComparer; + /** + * Gets or sets the direction in which the child nodes are placed with respect to their parent node. + *

+ * Subtrees can be placed below, above, left or right of their roots. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown placement specifier is set + * @type {yfiles.tree.ChildPlacement} + */ + childPlacement:yfiles.tree.ChildPlacement; + /** + * Gets or sets how the root node is aligned with its children and their {@link yfiles.tree.SubtreeShape}s. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown root alignment specifier is set + * @type {yfiles.tree.RootAlignment} + */ + rootAlignment:yfiles.tree.RootAlignment; + /** + * Gets or sets the relative vertical alignment of nodes with the same parent. + *

+ * All values between 0 and 1 result in a valid alignment. + *

+ *
    + *
  • 0 - nodes are top-aligned
  • + *
  • 0.5 - nodes are center-aligned
  • + *
  • 1 - nodes are bottom-aligned
  • + *
+ *

+ * Values outside the interval [0,1] will result in a more compact node placement with unaligned nodes. + *

+ * @type {number} + */ + verticalAlignment:number; + /** + * Gets or sets the style in which edge paths are routed. + * @throws {Stubs.Exceptions.ArgumentError} if the specified routing style is unknown + * @type {yfiles.tree.RoutingStyle} + */ + routingStyle:yfiles.tree.RoutingStyle; + /** + * Gets or sets the vertical distance between nodes or {@link yfiles.tree.SubtreeShape}s. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + verticalDistance:number; + /** + * Gets or sets the minimum length for the first segment of an edge. + *

+ * During layout calculation, the edges of the tree are directed. Hence, the first segment is always the segment that is + * attached to the source, which is the local root node. + *

+ *

+ * The length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum segment length is negative + * @type {number} + */ + minimumFirstSegmentLength:number; + /** + * Gets or sets the minimum length for the last segment of an edge. + *

+ * During layout calculation, the edges of the tree are directed. Hence, the last segment is always the segment that is + * attached to the target, which is a child node. + *

+ *

+ * The length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum segment length is negative + * @type {number} + */ + minimumLastSegmentLength:number; + /** + * Gets or sets the minimum slope of the edge segments. + *

+ * These sloped segments are between the vertical first and last segment of the edge. + *

+ *

+ * The segments may become steeper but they will have at least the specified slope. Negative minimum slopes can lead to + * edge routes looking like spider legs. + *

+ * @see yfiles.tree.DefaultNodePlacer#minimumSlopeHeight + * @type {number} + */ + minimumSlope:number; + /** + * Gets or sets the minimum height for sloped edge segments. + *

+ * These sloped segments are between the vertical first and last segment of the edge. + *

+ *

+ * The segments may become steeper to reach the specified height. + *

+ * @see yfiles.tree.DefaultNodePlacer#minimumSlope + * @type {number} + */ + minimumSlopeHeight:number; + /** + * Gets or sets the horizontal distance between nodes or {@link yfiles.tree.SubtreeShape}s. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + horizontalDistance:number; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.DefaultPortAssignment} provides some simple {@link yfiles.tree.DefaultPortAssignment#mode port assignment styles}. + *

+ * Ports are either {@link yfiles.tree.PortAssignmentMode#NONE centered} on the node, distributed at one side of the node or placed considering + * {@link yfiles.layout.PortConstraint}s. + *

+ * @class yfiles.tree.DefaultPortAssignment + * @implements {yfiles.tree.IPortAssignment} + */ + export interface DefaultPortAssignment extends Object,yfiles.tree.IPortAssignment{} + export class DefaultPortAssignment { + /** + * Creates a new {@link yfiles.tree.DefaultPortAssignment} instance using the given port assignment mode and ratio between the + * border and the ports and the gap between the ports themselves. + * @param {yfiles.tree.PortAssignmentMode} mode one of the predefined port assignment specifiers + * @param {number} [ratio=0.5] the ratio of the distance between outer ports and the border to the distance between any two ports + * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified or if the specified ratio is negative + * @constructor + */ + constructor(mode:yfiles.tree.PortAssignmentMode,ratio?:number); + /** + * Creates a new {@link yfiles.tree.DefaultPortAssignment} instance with default settings. + * @constructor + */ + constructor(); + /** + * Assigns relative coordinates to the source port of the outgoing edge to a child of the given node. + *

+ * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignPorts} for each outgoing edge of the given node. It may + * be overridden to assign a custom location to the source port of outgoing edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.Edge} edge the edge to the child node + * @param {number} index the zero-based index of the child edge + * @see yfiles.layout.IEdgeLayout#sourcePoint + * @protected + */ + assignChildEdgeSourcePort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,index:number):void; + /** + * Assigns relative coordinates to the target port of the incoming edge from the parent of the given node. + *

+ * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignPorts} if the given node has a parent node. It may be + * overridden to assign a custom location to the target port of the incoming edge. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.Edge} edge the edge from the parent node + * @see yfiles.layout.IEdgeLayout#targetPoint + * @protected + */ + assignParentEdgeTargetPort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):void; + /** + * Places the ports of edges connecting to the given node according to the {@link yfiles.tree.DefaultPortAssignment#mode port assignment mode}. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be placed + * @see yfiles.tree.DefaultPortAssignment#mode + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + /** + * Determines the distance between the outer ports and the border of the node. + *

+ * This implementation calculates the gap according to the number of edges at one side of the node. It also includes the + * {@link yfiles.tree.DefaultPortAssignment#borderGapToPortGapRatio ratio between border gap and port gap}. + *

+ *

+ * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} to calculate the location of the + * first port. It may be overridden to implement a different distribution of ports on the node's side. + *

+ * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges that connect to this side + * @returns {number} the absolute gap to be used on both sides of the ports + * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort + * @see yfiles.tree.DefaultPortAssignment#borderGapToPortGapRatio + * @protected + */ + getPortBorderGap(sideLength:number,edgeCount:number):number; + /** + * Determines the distance between two adjacent ports. + *

+ * This implementation calculates the gap according to the number of edges at one side of the node. The edges are + * distributed keeping the given gap to the border of the node. + *

+ *

+ * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} to calculate the distance between + * two ports. It may be overridden to implement a different distribution of ports on the node's side. + *

+ * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/ports that connect to this side + * @param {number} portBorderGap the port border gap (i.e. calculated by {@link yfiles.tree.DefaultPortAssignment#getPortBorderGap}) + * @returns {number} the absolute distance to be used between two adjacent ports + * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort + * @see yfiles.tree.DefaultPortAssignment#getPortBorderGap + * @protected + */ + getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; + /** + * Retrieves the source {@link yfiles.layout.PortConstraint} for the given edge. + *

+ * This implementation accesses the {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. + *

+ *

+ * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort} in + * {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the edge + * @param {number} index the index of the child that is the target of the given edge + * @returns {yfiles.layout.PortConstraint} the source {@link yfiles.layout.PortConstraint} or null if no source {@link yfiles.layout.PortConstraint} is specified + * @see yfiles.layout.PortConstraint + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @see yfiles.tree.DefaultPortAssignment#assignChildEdgeSourcePort + * @protected + */ + getSourcePortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,index:number):yfiles.layout.PortConstraint; + /** + * Retrieves the target {@link yfiles.layout.PortConstraint} for the given edge. + *

+ * This implementation accesses the {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. + *

+ *

+ * This method is called by {@link yfiles.tree.DefaultPortAssignment#assignParentEdgeTargetPort} in + * {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the edge + * @returns {yfiles.layout.PortConstraint} the target {@link yfiles.layout.PortConstraint} or null if no target {@link yfiles.layout.PortConstraint} is specified + * @see yfiles.layout.PortConstraint + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @see yfiles.tree.DefaultPortAssignment#assignParentEdgeTargetPort + * @protected + */ + getTargetPortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; + /** + * Gets or sets the mode that describes how ports are placed. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified + * @type {yfiles.tree.PortAssignmentMode} + */ + mode:yfiles.tree.PortAssignmentMode; + /** + * Gets or sets the ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent + * ports). + *

+ * The ratio must have a positive value. When the ratio is 0 the ports will be distributed along the whole side of the node + * without a gap between the last port and the corner. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is negative + * @type {number} + */ + borderGapToPortGapRatio:number; + /** + * Gets or sets whether or not the port assignment should reverse the order of the ports. + *

+ * The normal order is from left to right and from top to bottom. It will be reversed if this option is enabled. + *

+ * @type {boolean} + */ + reversedPortOrder:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.tree.DelegatingNodePlacer} delegates the arrangement of the children to two different {@link yfiles.tree.INodePlacer}s. + *

+ * Layout Style This {@link yfiles.tree.INodePlacer} can, for example, be used for creating mind maps or a playing schedule of a sports + * competition. {@graph {"ann":{"s":[130,30],"d":1},"n":[[662,400,[[669.97,424.35,114.05,18.7]]],[662,175,[[669.97,199.35,114.05,18.7]]],[662,625,[[685.65,649.35,82.7,18.7]]],[812,175,[[829.98,199.35,94.04,18.7]]],[982,275,[[999.98,299.35,94.04,18.7]]],[812,625,[[835.65,649.35,82.7,18.7]]],[512,175,[[519.97,199.35,114.05,18.7]]],[982,725,[[1010.64,749.35,72.71,18.7]]],[1152,775,[[1180.64,799.35,72.71,18.7]]],[1322,800,[[1341.97,824.35,90.05,18.7]]],[982,75,[[1004.32,99.35,85.37,18.7]]],[1152,675,[[1163.65,699.35,106.71,18.7]]],[1152,325,[[1177.32,349.35,79.36,18.7]]],[982,525,[[1005.65,549.35,82.7,18.7]]],[1152,125,[[1190.32,149.35,53.37,18.7]]],[1152,575,[[1175.65,599.35,82.7,18.7]]],[1322,350,[[1347.32,374.35,79.36,18.7]]],[1322,150,[[1343.65,174.35,86.7,18.7]]],[1322,300,[[1347.32,324.35,79.36,18.7]]],[1152,225,[[1169.98,249.35,94.04,18.7]]],[1152,25,[[1174.32,49.35,85.37,18.7]]],[342,75,[[372.66,99.35,68.69,18.7]]],[1152,475,[[1165.65,499.35,102.7,18.7]]],[1322,500,[[1326,524.35,122.06,18.7]]],[1322,250,[[1339.98,274.35,94.04,18.7]]],[1322,600,[[1330.31,624.35,113.38,18.7]]],[172,25,[[188.64,49.35,96.72,18.7]]],[342,275,[[349.97,299.35,114.05,18.7]]],[2,0,[[26.32,24.35,81.36,18.7]]],[1322,550,[[1345.65,574.35,82.7,18.7]]],[172,125,[[202.66,149.35,68.69,18.7]]],[1322,200,[[1344.32,224.35,85.36,18.7]]],[2,100,[[32.32,124.35,69.37,18.7]]],[1322,450,[[1335.65,474.35,102.7,18.7]]],[1322,750,[[1350.64,774.35,72.71,18.7]]],[512,625,[[532.65,649.35,88.69,18.7]]],[172,225,[[179.97,249.35,114.05,18.7]]],[1322,700,[[1329.63,724.35,114.74,18.7]]],[172,325,[[200.98,349.35,72.03,18.7]]],[1322,50,[[1344.32,74.35,85.37,18.7]]],[2,300,[[4.98,324.35,124.05,18.7]]],[2,50,[[18.64,74.35,96.72,18.7]]],[2,150,[[32.66,174.35,68.69,18.7]]],[1322,650,[[1333.65,674.35,106.71,18.7]]],[1322,0,[[1356.66,24.35,60.69,18.7]]],[1322,100,[[1360.32,124.35,53.37,18.7]]],[342,525,[[347.31,549.35,119.39,18.7]]],[172,475,[[171.97,499.35,130.06,18.7]]],[2,350,[[30.98,374.35,72.03,18.7]]],[2,450,[[1.97,474.35,130.06,18.7]]],[342,725,[[362.65,749.35,88.69,18.7]]],[2,200,[[25.31,224.35,83.37,18.7]]],[172,575,[[177.31,599.35,119.39,18.7]]],[172,675,[[197.32,699.35,79.35,18.7]]],[2,500,[[15.98,524.35,102.04,18.7]]],[2,550,[[14.63,574.35,104.73,18.7]]],[2,600,[[7.31,624.35,119.39,18.7]]],[2,250,[[9.97,274.35,114.05,18.7]]],[172,775,[[192.65,799.35,88.69,18.7]]],[2,750,[[22.65,774.35,88.69,18.7]]],[2,800,[[16.64,824.35,100.72,18.7]]],[2,650,[[11.97,674.35,110.07,18.7]]],[2,700,[[27.32,724.35,79.35,18.7]]]],"e":[[0,1],[0,2],[1,3],[3,4,[954,190,954,290]],[2,5],[1,6],[5,7,[954,640,954,740]],[7,8,[1124,740,1124,790]],[8,9,[1294,790,1294,815]],[3,10,[954,190,954,90]],[7,11,[1124,740,1124,690]],[4,12,[1124,290,1124,340]],[5,13,[954,640,954,540]],[10,14,[1124,90,1124,140]],[13,15,[1124,540,1124,590]],[12,16,[1294,340,1294,365]],[14,17,[1294,140,1294,165]],[12,18,[1294,340,1294,315]],[4,19,[1124,290,1124,240]],[10,20,[1124,90,1124,40]],[6,21,[500,190,500,90]],[13,22,[1124,540,1124,490]],[22,23,[1294,490,1294,515]],[19,24,[1294,240,1294,265]],[15,25,[1294,590,1294,615]],[21,26,[330,90,330,40]],[6,27,[500,190,500,290]],[26,28,[160,40,160,15]],[15,29,[1294,590,1294,565]],[21,30,[330,90,330,140]],[19,31,[1294,240,1294,215]],[30,32,[160,140,160,115]],[22,33,[1294,490,1294,465]],[8,34,[1294,790,1294,765]],[2,35],[27,36,[330,290,330,240]],[11,37,[1294,690,1294,715]],[27,38,[330,290,330,340]],[20,39,[1294,40,1294,65]],[38,40,[160,340,160,315]],[26,41,[160,40,160,65]],[30,42,[160,140,160,165]],[11,43,[1294,690,1294,665]],[20,44,[1294,40,1294,15]],[14,45,[1294,140,1294,115]],[35,46,[500,640,500,540]],[46,47,[330,540,330,490]],[38,48,[160,340,160,365]],[47,49,[160,490,160,465]],[35,50,[500,640,500,740]],[36,51,[160,240,160,215]],[46,52,[330,540,330,590]],[50,53,[330,740,330,690]],[47,54,[160,490,160,515]],[52,55,[160,590,160,565]],[52,56,[160,590,160,615]],[36,57,[160,240,160,265]],[50,58,[330,740,330,790]],[58,59,[160,790,160,765]],[58,60,[160,790,160,815]],[53,61,[160,690,160,665]],[53,62,[160,690,160,715]]],"vp":[1.0,0.0,1451.0,830.0]}} + *

+ *

+ * There are two subtrees that are placed above and below the root; Both subtrees consist of two subtrees that are placed + * left and right of their local root + *

+ * @class yfiles.tree.DelegatingNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface DelegatingNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class DelegatingNodePlacer { + /** + * Creates a new {@link yfiles.tree.DefaultNodePlacer} instance with default settings using the given modification matrix and the + * given node placers as delegates. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix + * @param {yfiles.tree.INodePlacer} placerUpperLeft the first delegate {@link yfiles.tree.INodePlacer} which places the left subtrees + * @param {yfiles.tree.INodePlacer} placerLowerRight the second delegate {@link yfiles.tree.INodePlacer} which places the right subtrees + * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,placerUpperLeft:yfiles.tree.INodePlacer,placerLowerRight:yfiles.tree.INodePlacer); + /** + * Returns all upper-left children of the local root node. + *

+ * Which children belong to this list is determined using the {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY}. If no such {@link yfiles.algorithms.IDataProvider} is registered, the + * first half of the children is returned. + *

+ *

+ * These children are placed using the {@link yfiles.tree.INodePlacer} returned by {@link yfiles.tree.DelegatingNodePlacer#primaryPlacer}. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.algorithms.NodeList} the list of upper-left child {@link yfiles.algorithms.Node}s + * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY + */ + primaryChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; + /** + * Returns all lower-right children of the local root node. + *

+ * Which children belong to this list is determined using the {@link yfiles.algorithms.IDataProvider} registered with + * {@link yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY}. If no such {@link yfiles.algorithms.IDataProvider} is registered, the + * second half of the children is returned. + *

+ *

+ * These children are placed using the {@link yfiles.tree.INodePlacer} returned by {@link yfiles.tree.DelegatingNodePlacer#secondaryPlacer}. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.algorithms.NodeList} the list of lower-right child {@link yfiles.algorithms.Node}s + * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY + */ + secondaryChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; + /** + * Data provider key for dividing the children into two sets + *

+ * If there is no {@link yfiles.algorithms.IDataProvider} registered with this key, half of the nodes are placed left of the root + * and the remaining nodes are placed right of the root. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static PRIMARY_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets the {@link yfiles.tree.INodePlacer} instance that will arrange the lower-right part of the graph. + * @see yfiles.tree.DelegatingNodePlacer#primaryPlacer + * @see yfiles.tree.DelegatingNodePlacer#secondaryChildren + * @type {yfiles.tree.INodePlacer} + */ + secondaryPlacer:yfiles.tree.INodePlacer; + /** + * Gets the {@link yfiles.tree.INodePlacer} instance that will arrange the upper-left part of the graph. + * @see yfiles.tree.DelegatingNodePlacer#secondaryPlacer + * @see yfiles.tree.DelegatingNodePlacer#primaryChildren + * @type {yfiles.tree.INodePlacer} + */ + primaryPlacer:yfiles.tree.INodePlacer; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.DendrogramNodePlacer} arranges subtrees as dendrograms. + *

+ * Layout Style This {@link yfiles.tree.INodePlacer} arranges nodes from top to bottom. It arranges subtrees in such a way that all subtrees of + * a single local root are aligned with their bottom border. {@graph {"ann":{"s":[30,30],"d":1},"n":[[212.5,0],[400,70],[450,140],[300,210],[400,210],[450,210],[150,140],[25,70],[200,280],[150,280],[50,210],[450,280],[350,280],[25,140],[100,210],[400,280],[0,280],[300,280],[50,280],[100,280],[250,280]],"e":[[0,1,[227.5,50,415,50]],[1,2,[415,120,465,120]],[0,3,[227.5,50,315,50]],[1,4],[2,5],[0,6,[227.5,50,165,50]],[0,7,[227.5,50,40,50]],[6,8,[165,190,215,190]],[6,9],[5,11],[1,12,[415,120,365,120]],[7,13],[13,10,[40,190,65,190]],[6,14,[165,190,115,190]],[4,15],[13,16,[40,190,15,190]],[3,17],[10,18],[14,19],[0,20,[227.5,50,265,50]]],"vp":[0.0,0.0,480.0,310.0]}} + *

+ *

+ * Note: This implementation does not support {@link yfiles.layout.PortConstraint}s. + *

+ * @class yfiles.tree.DendrogramNodePlacer + * @implements {yfiles.tree.IFromSketchNodePlacer} + */ + export interface DendrogramNodePlacer extends Object,yfiles.tree.IFromSketchNodePlacer{} + export class DendrogramNodePlacer { + /** + * Creates a new {@link yfiles.tree.DendrogramNodePlacer} instance with default settings. + * @constructor + */ + constructor(); + /** + * Creates a {@link yfiles.collections.IComparer.} that sorts outgoing edges according to the x-coordinate of their target nodes. + *

+ * This {@link yfiles.collections.IComparer.} can be used for achieving a From Sketch layout. + *

+ * @returns {yfiles.collections.IComparer.} the {@link yfiles.collections.IComparer.} + * @see yfiles.tree.DendrogramNodePlacer#createFromSketchComparer + */ + createComparer():yfiles.collections.IComparer; + /** + * Creates a {@link yfiles.collections.IComparer.} for the edges which takes the initial x-coordinates of the nodes into account. + *

+ * This implementation delegates to {@link yfiles.tree.DendrogramNodePlacer#createComparer}. + *

+ * @returns {yfiles.collections.IComparer.} the {@link yfiles.collections.IComparer.} for the edges + * @see yfiles.tree.DendrogramNodePlacer#createComparer + */ + createFromSketchComparer():yfiles.collections.IComparer; + /** + * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. + *

+ * This implementation returns null. Hence, no pre- or post-processing is done. + *

+ * @param {yfiles.tree.TreeLayout} layouter the current {@link yfiles.tree.TreeLayout} instance + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} currentRoot the root node handled by this {@link yfiles.tree.INodePlacer} + * @returns {yfiles.tree.IProcessor} null + */ + createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Provides {@link yfiles.tree.ParentConnectorDirection#NORTH} for all children. + *

+ * Edges will always connect to the top of the child nodes. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that is used for storing the direction specifiers of the child nodes + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Arranges the {@link yfiles.tree.SubtreeShape SubtreeShapes} of the local root and its children as a dendrogram. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider the {@link yfiles.algorithms.IDataProvider} for obtaining an initial shape of the root node + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider the {@link yfiles.algorithms.IDataProvider} for accessing the pre-calculated shapes of the subtrees + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be arranged by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.SubtreeShape} the combined shape of the whole subtree rooted at the given local root node + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; + /** + * Gets or sets the minimum distance between the {@link yfiles.tree.SubtreeShape} of a root node and the bus connecting to all of + * its children. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + minimumRootDistance:number; + /** + * Gets or sets the minimum horizontal distance between adjacent {@link yfiles.tree.SubtreeShape SubtreeShapes}. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + minimumSubtreeDistance:number; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.DoubleLineNodePlacer} arranges the children of a local root alternating in two lines. + *

+ * Layout Style This {@link yfiles.tree.INodePlacer} arranges nodes from top to bottom. It places the subtrees in two horizontal lines below + * the root. They are distributed in an alternating fashion, i.e., adjacent subtrees are in different lines. + *

+ *

+ * This node placer is especially useful for leaves with a large width. + *

+ *

+ * {@graph {"ann":{"s":[141.67,30],"d":1},"n":[[298.33,0,60,30],[0,60],[85.83,99.9],[171.67,60],[257.5,99.9],[343.33,60],[429.17,99.9],[515,60]],"e":[[0,1,[70.83,15]],[0,2,[156.67,15]],[0,3,[242.5,15]],[0,4],[0,5,[414.17,15]],[0,6,[500,15]],[0,7,[585.83,15]]],"vp":[0.0,0.0,657.0,130.0]}} + *

+ * @class yfiles.tree.DoubleLineNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface DoubleLineNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class DoubleLineNodePlacer { + /** + * Creates a new {@link yfiles.tree.DoubleLineNodePlacer} instance whose direction is specified by the given modification matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); + /** + * Creates a new {@link yfiles.tree.DoubleLineNodePlacer} instance with the default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. + * @type {yfiles.tree.RootNodeAlignment} + */ + rootAlignment:yfiles.tree.RootNodeAlignment; + /** + * Gets or sets the ratio of the {@link yfiles.tree.RotatableNodePlacerBase#spacing spacing} between the root and the children in the upper line and the spacing between the + * two lines of subtrees. + * @type {number} + */ + doubleLineSpacingRatio:number; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.tree.FreeNodePlacer} is a simple pseudo-placer. + *

+ * The children of local root nodes are not moved. The {@link yfiles.tree.INodePlacer} just merges their rotated shapes and routes + * the edges. + *

+ *

+ * This {@link yfiles.tree.INodePlacer} may be useful if a local root node does not have any children or you want to place them + * manually. + *

+ * @class yfiles.tree.FreeNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface FreeNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class FreeNodePlacer { + /** + * Creates a new instance of {@link yfiles.tree.FreeNodePlacer} with default settings. + * @constructor + */ + constructor(); + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.GridNodePlacer} arranges the shapes of the children of a local root in a grid. + *

+ * Layout Style The grid consists of a number of rows. The subtrees are assigned to the rows using a {@link yfiles.algorithms.IDataProvider} + * that is registered with the graph with {@link yfiles.tree.GridNodePlacer#ROW_INDEX_DP_KEY}. {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[50,140],[50,210],[50,70],[100,140],[100,210],[100,70],[150,140],[150,210],[150,70],[200,140],[200,210],[200,70]],"e":[[0,1,[40,15,40,120,65,120]],[0,2,[40,15,40,190,65,190]],[0,3,[40,15,40,50,65,50]],[0,4,[40,15,40,120,115,120]],[0,5,[40,15,40,190,115,190]],[0,6,[40,15,40,50,115,50]],[0,7,[40,15,40,120,165,120]],[0,8,[40,15,40,190,165,190]],[0,9,[40,15,40,50,165,50]],[0,10,[40,15,40,120,215,120]],[0,11,[40,15,40,190,215,190]],[0,12,[40,15,40,50,215,50]]],"vp":[0.0,0.0,230.0,240.0]}} + *

+ *

+ * Child nodes placed in a grid using three rows and four columns + *

+ * @class yfiles.tree.GridNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface GridNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class GridNodePlacer { + /** + * Creates a new {@link yfiles.tree.GridNodePlacer} instance with the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} and {@link yfiles.tree.GridNodePlacer#rootAlignment root alignment}. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @param {yfiles.tree.RootNodeAlignment} rootAlignment the alignment of the local root with its subtrees + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,rootAlignment:yfiles.tree.RootNodeAlignment); + /** + * Creates a new {@link yfiles.tree.GridNodePlacer} instance whose direction is specified by the given modification matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); + /** + * Creates a new {@link yfiles.tree.GridNodePlacer} with default settings. + * @constructor + */ + constructor(); + /** + * Data provider key for assigning nodes to the rows in the grid + *

+ * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all nodes will be placed in the same row. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static ROW_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. + * @type {yfiles.tree.RootNodeAlignment} + */ + rootAlignment:yfiles.tree.RootNodeAlignment; + static $class:yfiles.lang.Class; + } + /** + * This {@link yfiles.tree.INodePlacer} places the children of a local root in groups. + *

+ * The groups are determined by the grouping of the edges that connect the children to its root. 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 {@link yfiles.tree.INodePlacer}. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[70.15,0,91.19,30],[0,91],[111,91],[201.5,91],[0,141],[111,141],[201.5,141]],"e":[[0,1,-30,15,0,0,[85.75,50,50,50,50,106]],[0,2,0,15,0,0,[115.75,50,91,50,91,106]],[0,3,30,15,0,0,[145.75,50,181.5,50,181.5,106]],[0,4,-30,15,0,0,[85.75,50,50,50,50,156]],[0,5,0,15,0,0,[115.75,50,91,50,91,156]],[0,6,30,15,0,0,[145.75,50,181.5,50,181.5,156]]],"vp":[0.0,0.0,232.0,171.0]}} There are three edge groups whose target nodes are placed above each other + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @class yfiles.tree.GroupedNodePlacer + * @implements {yfiles.tree.INodePlacer} + */ + export interface GroupedNodePlacer extends Object,yfiles.tree.INodePlacer{} + export class GroupedNodePlacer { + /** + * Creates a new {@link yfiles.tree.GroupedNodePlacer} instance. + * @param {yfiles.tree.INodePlacer} groupPlacer the {@link yfiles.tree.INodePlacer} which places the child groups + * @param {yfiles.tree.INodePlacer} childPlacer the {@link yfiles.tree.INodePlacer} which places the children within their group + * @constructor + */ + constructor(groupPlacer:yfiles.tree.INodePlacer,childPlacer:yfiles.tree.INodePlacer); + /** + * Creates a {@link yfiles.tree.IProcessor} that prepares the graph for edge grouping. + *

+ * In a pre-processing step, the {@link yfiles.tree.IProcessor} inserts a dummy node for each edge group and connects it to the + * local root and the edges of the according group. The child node placer is assigned to those dummy nodes and will arrange + * them during the layout calculation. + *

+ *

+ * The changes to the graph are restored in a post-processing step. + *

+ * @param {yfiles.tree.TreeLayout} layouter the current {@link yfiles.tree.TreeLayout} instance + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} currentRoot the root node handled by this {@link yfiles.tree.INodePlacer} + * @returns {yfiles.tree.IProcessor} the {@link yfiles.tree.IProcessor} responsible for preparing the graph + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Delegates to the {@link yfiles.tree.INodePlacer} responsible for arranging the nodes in one group. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map used for storing the direction specifiers of the child nodes + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Places the groups of {@link yfiles.tree.SubtreeShape}s according to their group IDs. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider the {@link yfiles.algorithms.IDataProvider} for obtaining an initial shape of the root node + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider the {@link yfiles.algorithms.IDataProvider} for accessing the pre-calculated shapes of the subtrees + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be arranged by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.SubtreeShape} the merged {@link yfiles.tree.SubtreeShape}s of the local root and its children + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.tree.IFromSketchNodePlacer} arranges the subtrees while taking the initial locations of the nodes into account. + *

+ * It provides a {@link yfiles.collections.IComparer.} which sorts the outgoing edges of a node according to the initial coordinates of their target nodes. + * Keeping the original order of nodes, this {@link yfiles.collections.IComparer.} allows to incrementally add new nodes to the graph. + *

+ * @interface + * @implements {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; + * Creates an {@link yfiles.collections.IComparer. edge comparator} which takes the initial coordinates of the nodes into account. + *

+ * This {@link yfiles.collections.IComparer.} defines the order of the outgoing edges of a node before the actual placement of the node's subtree is + * calculated. + *

+ * @returns {yfiles.collections.IComparer.} the {@link yfiles.collections.IComparer.} for the edges + * @abstract + */ + createFromSketchComparer():yfiles.collections.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. - */ + * A {@link yfiles.tree.INodePlacer} is responsible for the arrangement of a local root node and all of its subtrees. + *

+ * Subtrees are represented as {@link yfiles.tree.SubtreeShape SubtreeShape}s with a connecting edge to the root of the subtree. + *

+ *

+ * Implementations of this interface have to: + *

+ *
    + *
  • + * arrange the {@link yfiles.tree.SubtreeShape SubtreeShapes} and the root node (only the relative position matters, shapes can be placed at any absolute + * location, {@link yfiles.tree.TreeLayout} 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 + * {@link yfiles.tree.SubtreeShape SubtreeShapes} + *
  • + *
  • calculate the union of the {@link yfiles.tree.SubtreeShape SubtreeShapes} and the shape of the root node as well as any added edges
  • + *
  • initialize the connector of the root node with respect to the preferred connection direction
  • + *
  • return the {@link yfiles.tree.SubtreeShape SubtreeShape} for the subtree including the local root
  • + *
+ * @interface + */ 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}. - */ + * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. + *

+ * This method is called by {@link yfiles.tree.TreeLayout} before arranging the {@link yfiles.tree.SubtreeShape SubtreeShapes}. If no pre- or post-processing is + * needed, this method may return null. + *

+ * @param {yfiles.tree.TreeLayout} layouter the current {@link yfiles.tree.TreeLayout} instance + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} currentRoot the root node handled by this {@link yfiles.tree.INodePlacer} + * @returns {yfiles.tree.IProcessor} a {@link yfiles.tree.IProcessor} instance or null + * @abstract + */ + createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. + *

+ * This method is called by {@link yfiles.tree.TreeLayout} before the {@link yfiles.tree.SubtreeShape SubtreeShapes} for the children of the local root node are + * calculated. The direction specifiers are stored in the given map for all child nodes of the local root. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that must be used for storing the direction specifiers of the child nodes + * @abstract + */ 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; + * Arranges the {@link yfiles.tree.SubtreeShape SubtreeShapes} of the local root and its children and routes the edges that connect them. + *

+ * This method is the main method of the tree layout algorithm. It is called by {@link yfiles.tree.TreeLayout} in each recursion + * step to place the local root in relation to its children. Their shapes will be merged into one + * {@link yfiles.tree.SubtreeShape SubtreeShape}, which is returned by this method. + *

+ *

+ * The {@link yfiles.tree.SubtreeShape SubtreeShape} for the local root can be obtained from the nodeShapeProvider. subtreeShapeProvider contains the {@link yfiles.tree.SubtreeShape SubtreeShapes} + * assigned to the child nodes. + *

+ *

+ * Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this + * method the {@link yfiles.tree.SubtreeShape SubtreeShape} of every descendant node has already been calculated. + *

+ * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider the {@link yfiles.algorithms.IDataProvider} for obtaining an initial shape of the root node + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider the {@link yfiles.algorithms.IDataProvider} for accessing the pre-calculated shapes of the subtrees + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be arranged by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.SubtreeShape} the combined shape of the whole subtree + * @abstract + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; } 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. - */ + * A {@link yfiles.tree.IPortAssignment} places the ports of edges connecting to the same node. + *

+ * Classes implementing this interface are responsible for the assignment of the edges' ports. {@link yfiles.tree.INodePlacer} + * instances need to obey the currently set ports. + *

+ * @interface + */ 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}. - */ + * Places the ports of edges connecting to the given node. + *

+ * This method is called by {@link yfiles.tree.TreeLayout} before the actual layout calculation takes place. It assigns both the + * single incoming edge's target port as well as all source ports of all outgoing child edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be set + * @abstract + */ assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; } var IPortAssignment:{ @@ -131246,3246 +97847,19048 @@ declare module yfiles{ 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. - */ + * A {@link yfiles.tree.IProcessor} provides the possibility for each {@link yfiles.tree.INodePlacer} to prepare (and clean up) the graph + * for the children of the local root. + *

+ * It is created by {@link yfiles.tree.INodePlacer#createProcessor} and called by the {@link yfiles.tree.TreeLayout} before and after the + * actual arrangement of the nodes. + *

+ *

+ * A {@link yfiles.tree.IProcessor} may change values within the + * {@link yfiles.algorithms.IDataMap}s for its children. It can also temporarily change the graph by hiding nodes or adding dummy + * nodes. + *

+ * @interface + */ 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}. - */ + * This method is called by the {@link yfiles.tree.TreeLayout} after the layout has finished. + *

+ * It can be used for cleanup tasks. + *

+ *

+ * Changes on the graph structure that have been made in {@link yfiles.tree.IProcessor#preProcess} can be undone here. + *

+ * @abstract + */ postProcess():void; + /** + * Performs preparations for the actual tree layout in a pre-processing step. + *

+ * This method is called by {@link yfiles.tree.TreeLayout} before the {@link yfiles.tree.INodePlacer}s are called recursively. A {@link yfiles.tree.IProcessor} + * may change some settings within this method. This can be used for specifying values for the children of the local root, + * manipulate the graph structure or do anything else that needs to be done. + *

+ * @param {yfiles.algorithms.IDataMap} nodePlacerDataProvider the map that stores a {@link yfiles.tree.INodePlacer} instance for each node + * @param {yfiles.algorithms.IDataMap} portAssignmentDataProvider The map that stores a {@link yfiles.tree.IPortAssignment} instance for each node + * @param {yfiles.algorithms.IDataMap} childComparatorProvider the map that stores a {@link yfiles.collections.IComparer.} instance for each node + * @abstract + */ + preProcess(nodePlacerDataProvider:yfiles.algorithms.IDataMap,portAssignmentDataProvider:yfiles.algorithms.IDataMap,childComparatorProvider:yfiles.algorithms.IDataMap):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{ + * A {@link yfiles.tree.LayeredNodePlacer} arranges the nodes of a subtree respecting layers. + *

+ * Layout Style Nodes that have the same depth in the tree will be placed in the same horizontal layer. They will be vertically + * {@link yfiles.tree.LayeredNodePlacer#verticalAlignment aligned}. {@graph {"ann":{"s":[30,30],"d":1},"n":[[245.52,0],[69.46,77.5],[7.5,162.5],[181.42,240,45,45],[57.5,155,45,45],[0,240,45,45],[246.42,77.5],[406.58,70,45,45],[181.42,155,45,45],[246.42,155,45,45],[375.88,247.5],[7.5,332.5],[122.5,158.04,38.92,38.92],[409.62,158.04,38.92,38.92],[311.42,162.5],[65,247.5],[443.38,243.04,38.92,38.92],[138.92,332.5],[338.92,325,45,45],[311.42,247.5],[403.92,328.04,38.92,38.92],[188.92,332.5],[238.92,332.5]],"e":[[0,1,[260.52,42,84.46,42]],[1,2,[84.46,127,22.5,127]],[1,4,[84.46,127,80,127]],[2,5],[0,6,[260.52,42,261.42,42]],[0,7,[260.52,42,429.08,42]],[6,8,[261.42,127,203.92,127]],[8,3],[6,9,[261.42,127,268.92,127]],[5,11],[1,12,[84.46,127,141.96,127]],[7,13],[13,10,[429.08,212,390.88,212]],[6,14,[261.42,127,326.42,127]],[4,15],[13,16,[429.08,212,462.83,212]],[3,17,[203.92,297,153.92,297]],[10,18,[390.88,297,361.42,297]],[14,19],[10,20,[390.88,297,423.38,297]],[3,21],[3,22,[203.92,297,253.92,297]]],"vp":[0.0,0.0,483.0,370.0]}} + *

+ * @class yfiles.tree.LayeredNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface LayeredNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class LayeredNodePlacer { + /** + * Creates a new {@link yfiles.tree.LayeredNodePlacer} instance whose direction is specified by the given modification matrix. + *

+ * The given ID identifies different {@link yfiles.tree.LayeredNodePlacer} instances that share the same layer heights. + *

+ * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @param {Object} id the {@link yfiles.tree.LayeredNodePlacer} ID + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,id:Object); + /** + * Creates a new {@link yfiles.tree.LayeredNodePlacer} instance with the default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets whether or not the layering is done dendrogram-like. + *

+ * When enabled, leaves are placed in the same layer and remaining tree nodes are assigned to a layer as close to their + * children as possible. + *

+ * @type {boolean} + */ 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; + * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlginment} that defines how the root node is aligned with its children and their shapes. + * @type {yfiles.tree.RootNodeAlignment} + */ + rootAlignment:yfiles.tree.RootNodeAlignment; /** - * 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. - *

- */ + * Gets or sets the relative vertical alignment of nodes within their respective layers. + *

+ * A value of 0 means that nodes are top-aligned; a value of 0.5 means that nodes are center-aligned; a value of 1 means + * that nodes are bottom-aligned; + *

+ *

+ * Values for a valid vertical alignment are in the range [0..1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is outside [0..1] + * @type {number} + */ 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. - */ + * Gets the ID of this {@link yfiles.tree.LayeredNodePlacer}. + *

+ * The ID is used for identifying + * {@link yfiles.tree.LayeredNodePlacer}s that share information about the layer height. Using different IDs allows aligned layouts + * within different subtrees. + *

+ * @type {Object} + */ id:Object; /** - * The spacing between two layers. - */ + * Gets or sets the distance between two adjacent layers. + *

+ * The spacing needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing is negative + * @type {number} + */ layerSpacing:number; /** - * The routing style. - * The possible values are:
  • {@link yfiles.tree.LayeredRoutingStyle#ORTHOGONAL}
  • {@link yfiles.tree.LayeredRoutingStyle#PLAIN}
- */ + * Gets or sets the routing style for the edges in the subtree. + * @throws {Stubs.Exceptions.ArgumentError} if the specified routing style specifier is unknown + * @type {yfiles.tree.LayeredRoutingStyle} + */ 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. - *

- */ + * Gets or sets the vertical bus alignment for orthogonally routed edges. + *

+ * The bus alignment determines the relative position of an edge bus in between two subsequent layers of nodes. + *

+ *

+ * Values for a valid vertical alignment are in the range [0..1], such that: + *

+ *
    + *
  • A value of 0.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.
  • + *
  • A value of 1.0 places the bus at the bottom, right above the child nodes.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is outside [0..1] + * @type {number} + */ 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; + * Gets or sets whether or not straight edges are extended to avoid label overlaps. + *

+ * If enabled, polyline connectors between the parent and its children are added to the according subtree shape. Node or + * edge labels will not be crossed. + *

+ * @type {boolean} + */ + polylineLabeling:boolean; + static $class:yfiles.lang.Class; } - 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{ + * A {@link yfiles.tree.LeafNodePlacer} creates a {@link yfiles.tree.SubtreeShape SubtreeShape} for a leaf node and routes its incoming edge at the target side. + * @class yfiles.tree.LeafNodePlacer + * @implements {yfiles.tree.INodePlacer} + */ + export interface LeafNodePlacer extends Object,yfiles.tree.INodePlacer{} + export class LeafNodePlacer { /** - * the graph this layout is running on. - */ - graph:yfiles.layout.LayoutGraph; + * Creates a new {@link yfiles.tree.LeafNodePlacer} instance with default settings. + * @constructor + */ + constructor(); /** - * 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; + * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. + *

+ * This implementation returns null. Hence, no pre- or post-processing is done. + *

+ * @param {yfiles.tree.TreeLayout} layouter the current {@link yfiles.tree.TreeLayout} instance + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} currentRoot the root node handled by this {@link yfiles.tree.INodePlacer} + * @returns {yfiles.tree.IProcessor} null + */ + createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; /** - * Subclasses have to provide information whether or not they - * can layout the given graph. - */ - canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + * Does nothing because leaf nodes don't have children so there are no child connectors. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that must be used for storing the direction specifiers of the child nodes + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; /** - * 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; + * Creates a {@link yfiles.tree.SubtreeShape} for the local root node (a leaf node in this case) and adds target points to the + * incoming edge. + *

+ * The incoming edge is routed according to possibly assigned {@link yfiles.layout.PortConstraint}s. + *

+ * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider the {@link yfiles.algorithms.IDataProvider} for obtaining an initial shape of the root node + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider the {@link yfiles.algorithms.IDataProvider} for accessing the pre-calculated shapes of the subtrees + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be arranged by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.SubtreeShape} the {@link yfiles.tree.SubtreeShape} of the leaf node including the connector + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; + static $class:yfiles.lang.Class; } - 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{ + * The {@link yfiles.tree.LeftRightNodePlacer} arranges the children in a subtree on the left and the right of a vertical bus. + *

+ * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[35,0],[0,50],[70,50],[0,100],[70,100],[0,150],[70,150],[0,200],[70,200],[35,250]],"e":[[0,1,[50,65]],[0,2,[50,65]],[0,3,[50,115]],[0,4,[50,115]],[0,5,[50,165]],[0,6,[50,165]],[0,7,[50,215]],[0,8,[50,215]],[0,9]],"vp":[0.0,0.0,100.0,280.0]}} + *

+ * @class yfiles.tree.LeftRightNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface LeftRightNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class LeftRightNodePlacer { /** - * 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; + * Creates a new {@link yfiles.tree.LeftRightNodePlacer} instance using the given modification matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); /** - * 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; + * Creates a new {@link yfiles.tree.LeftRightNodePlacer} instance with default settings. + * @constructor + */ + constructor(); /** - * Specifies whether this instance is configured to create horizontal - * rows of child nodes. - */ - horizontal:boolean; + * Creates a special {@link yfiles.algorithms.IDataProvider} that determines whether a given node is placed left or right of the + * parent node. + *

+ * This {@link yfiles.algorithms.IDataProvider} can be registered with the graph with key + * {@link yfiles.tree.LeftRightNodePlacer#LEFT_RIGHT_DP_KEY}. It calculates the side with respect to the initial coordinates of the + * nodes in the graph, considering the orientation of the subtree. + *

+ *

+ * If a node is assigned to the left side, this {@link yfiles.algorithms.IDataProvider} will return true. For the right side, it + * will return false. + *

+ * @param {yfiles.algorithms.IDataProvider} nodePlacerMap a {@link yfiles.algorithms.IDataProvider} containing the corresponding {@link yfiles.tree.INodePlacer}s for the node + * @returns {yfiles.algorithms.IDataProvider} + * @static + */ + static createLeftRightDataProvider(nodePlacerMap:yfiles.algorithms.IDataProvider):yfiles.algorithms.IDataProvider; /** - * The vertical distance this NodePlacer should use for the - * arrangement of the elements. - */ - verticalDistance:number; + * Data provider key for assigning nodes to the left or the right side of the bus + *

+ * If no {@link yfiles.algorithms.IDataProvider} is specified using this key, the nodes will be placed alternating from left to + * right. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static LEFT_RIGHT_DP_KEY:yfiles.algorithms.NodeDpKey; /** - * The horizontal distance this NodePlacer should use for the - * arrangement of the elements. - */ + * Gets or sets the horizontal distance between nodes or subtrees. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ horizontalDistance:number; /** - * The preferred aspect ratio. - */ - aspectRatio:number; + * Gets or sets the vertical distance between nodes or subtrees. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + verticalDistance: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. - */ + * Sets a uniform horizontal and vertical spacing between subtrees. + *

+ * This method sets the given distance value for the {@link yfiles.tree.LeftRightNodePlacer#horizontalDistance horizontal spacing} and for the {@link yfiles.tree.LeftRightNodePlacer#verticalDistance vertical spacing}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing value is negative + * @see yfiles.tree.LeftRightNodePlacer#horizontalDistance + * @see yfiles.tree.LeftRightNodePlacer#verticalDistance + * @type {number} + */ 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; + * Gets or sets whether or not the last child is placed centered, aligned with the bus and below the other child nodes. + *

+ * When enabled, the last child will always be centered independent of the number of siblings. + *

+ * @type {boolean} + */ + placeLastOnBottom:boolean; + static $class:yfiles.lang.Class; } - 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. - *

- */ + * The {@link yfiles.tree.MultiParentDescriptor} provides style information for multi-parent structures. + *

+ * This class is used by {@link yfiles.tree.TreeLayout} 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. + *

+ *

+ * {@graph {"ann":{"s":[40,40],"d":1},"n":[[411.25,0],[682.5,85],[210,155],[612.5,165],[35,225],[577.5,235],[385,320.5],[682.5,155,40,60],[70,305],[210,85],[0,295,40,60],[0,385],[210,225],[700,320.5],[175,295],[245,295],[315,225],[752.5,165],[420,405.5],[647.5,235],[752.5,235],[770,406],[140,380.5,40,60],[210,390.5],[315,295,40,60],[490,405.5],[175,485.5],[455,320.5],[481.25,0],[700,406],[560,406],[630,406],[560,491],[630,491],[525,320.5],[280,380.5,40,60],[70,390.5]],"e":[[0,1,[431.25,55.5,466.25,55.5,466.25,70,702.5,70]],[1,3,[702.5,140,632.5,140]],[2,4,[230,210,55,210]],[3,5,[632.5,220,597.5,220]],[5,6,[597.5,290,475,290,475,305,405,305]],[1,7],[4,8,[55,280,90,280]],[0,9,[431.25,55.5,466.25,55.5,466.25,70,230,70]],[9,2],[4,10,[55,280,20,280]],[10,11],[2,12],[5,13,[597.5,290,720,290]],[12,14,[230,280,195,280]],[12,15,[230,280,265,280]],[2,16,[230,210,335,210]],[1,17,[702.5,140,772.5,140]],[6,18,[405,376,475,376,475,390.5,440,390.5]],[3,19,[632.5,220,667.5,220]],[17,20],[13,21,[720,375.5,790,375.5]],[14,22,[195,365,160,365]],[14,23,[195,365,230,365]],[16,24],[6,25,[405,376,475,376,475,390.5,510,390.5]],[22,26,[160,456,195,456]],[23,26,[230,456,195,456]],[5,27,[597.5,290,475,290]],[27,18,[475,390.5,440,390.5]],[27,25,[475,390.5,510,390.5]],[28,9,[501.25,55.5,466.25,55.5,466.25,70,230,70]],[28,1,[501.25,55.5,466.25,55.5,466.25,70,702.5,70]],[13,29],[13,30,[720,375.5,615,375.5,615,390.5,580,390.5]],[13,31,[720,375.5,615,375.5,615,390.5,650,390.5]],[30,32,[580,461.5,615,461.5,615,476,580,476]],[31,32,[650,461.5,615,461.5,615,476,580,476]],[30,33,[580,461.5,615,461.5,615,476,650,476]],[31,33,[650,461.5,615,461.5,615,476,650,476]],[5,34,[597.5,290,475,290,475,305,545,305]],[34,18,[545,376,475,376,475,390.5,440,390.5]],[34,25,[545,376,475,376,475,390.5,510,390.5]],[14,35,[195,365,300,365]],[35,26,[300,456,195,456]],[14,36,[195,365,90,365]],[36,26,[90,456,195,456]]],"vp":[0.0,0.0,810.0,531.0]}} + *

+ *

+ * A tree graph containing multi-parent structures + *

+ * @see yfiles.tree.TreeLayout#MULTI_PARENT_DESCRIPTOR_DP_KEY + * @class yfiles.tree.MultiParentDescriptor + */ + export interface MultiParentDescriptor extends Object{} + export class MultiParentDescriptor { + /** + * Creates a new {@link yfiles.tree.MultiParentDescriptor} instance with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the minimum distance between two nodes belonging to the same multi-parent structure. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given node distance is negative + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets the minimum distance between the nodes of a multi-parent structure and the bus connecting these nodes. + *

+ * In case the edge style is not orthogonal, the bus only consists of a common point. + *

+ *

+ * The minimum distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given bus distance is negative + * @type {number} + */ + minimumBusDistance:number; + /** + * Gets or sets the relative vertical alignment of nodes belonging to the same multi-parent structure. + *

+ * A value of 0 means that nodes are top-aligned; a value of 1 means that nodes are bottom-aligned; a value of 0.5 means + * that nodes are center-aligned. + *

+ *

+ * Values outside the interval [0,1] will result in a compact node placement with unaligned nodes, especially when labels + * are considered. + *

+ * @type {number} + */ 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; + * Gets or sets the routing style for edges that connect to nodes which constitute a multi-parent structure. + * @throws {Stubs.Exceptions.ArgumentError} if the given routing style is unknown + * @type {yfiles.tree.MultiParentRoutingStyle} + */ + edgeStyle:yfiles.tree.MultiParentRoutingStyle; + static $class:yfiles.lang.Class; } - var DefaultNodePlacer:{ + /** + * The {@link yfiles.tree.NodeOrderComparer} compares edges according to a specified order. + *

+ * It obtains the order from a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY}. + *

+ *

+ * Various tree layout algorithms can use this {@link yfiles.collections.IComparer.} to influence the resulting layout. To achieve this, use this comparator and + * assign it to the comparator property of the layout algorithm classes. + *

+ * @see yfiles.tree.ClassicTreeLayout#comparer + * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer + * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY + * @see yfiles.tree.BalloonLayout#comparer + * @see yfiles.tree.AspectRatioTreeLayout#comparer + * @see yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY + * @class yfiles.tree.NodeOrderComparer + * @implements {yfiles.collections.IComparer.} + */ + export interface NodeOrderComparer extends Object,yfiles.collections.IComparer{} + export class NodeOrderComparer { + /** + * Creates a new {@link yfiles.tree.NodeOrderComparer} instance. + * @constructor + */ + constructor(); + /** + * Compares two edges according to their index in the order specified using a {@link yfiles.algorithms.IDataProvider}. + *

+ * Target nodes for which the {@link yfiles.algorithms.IDataProvider} registered with {@link yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY} + * returns null or an {@link Object} that does not implement {@link yfiles.lang.IComparable} are treated as being smaller than other target + * nodes. + *

+ * @param {Object} edge1 the first edge + * @param {Object} edge2 the second edge + * @returns {number} + * @see yfiles.tree.NodeOrderComparer#NODE_ORDER_COMPARABLE_DP_KEY + */ + compare(edge1:Object,edge2:Object):number; + /** + * Data provider key for registering an order for each node in the graph + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_ORDER_COMPARABLE_DP_KEY:yfiles.algorithms.NodeDpKey; + static $class:yfiles.lang.Class; + } + /** + * Abstract base class for implementations of the {@link yfiles.tree.INodePlacer} interface. + *

+ * This class provides convenience methods for sub-tasks that are often used during the arrangement of a local root and its + * children. It also offers prepared implementations for the methods of the {@link yfiles.tree.INodePlacer} interface. + *

+ *

+ * Subclasses just need to override the following two abstract methods: {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} and + * {@link yfiles.tree.NodePlacerBase#determineChildConnectors}. + *

+ * @class yfiles.tree.NodePlacerBase + * @implements {yfiles.tree.INodePlacer} + * @implements {yfiles.lang.ICloneable} + */ + export interface NodePlacerBase extends Object,yfiles.tree.INodePlacer,yfiles.lang.ICloneable{} + export class NodePlacerBase { + /** + * Creates a new instance of {@link yfiles.tree.NodePlacerBase}. + * @constructor + */ + constructor(); + /** + * Returns a clone of this {@link yfiles.tree.INodePlacer} instance. + * @returns {Object} an exact copy of this {@link yfiles.tree.INodePlacer} instance + */ + clone():Object; + /** + * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. + *

+ * This implementation returns null. Hence, no pre- or post-processing will be done. + *

+ * @param {yfiles.tree.TreeLayout} layouter the current {@link yfiles.tree.TreeLayout} instance + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} currentRoot the root node handled by this {@link yfiles.tree.INodePlacer} + * @returns {yfiles.tree.IProcessor} null + */ + createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Determines a connector direction for the given child node. + *

+ * This method is used in {@link yfiles.tree.NodePlacerBase#determineChildConnectors} and must be implemented by subclasses. + *

+ * @param {yfiles.algorithms.Node} child the child node + * @returns {yfiles.tree.ParentConnectorDirection} a direction specifier as defined in the {@link yfiles.tree.INodePlacer} interface + * @protected + * @abstract + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. + *

+ * This implementation uses {@link yfiles.tree.NodePlacerBase#determineChildConnector} to retrieve the direction for the + * connectors. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that must be used for storing the direction specifiers of the child nodes + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Returns the {@link yfiles.tree.SubtreeShape} for the given node. + *

+ * This is a convenience method that retrieves a {@link yfiles.tree.SubtreeShape} for a single node from the corresponding + * {@link yfiles.algorithms.IDataProvider}. + *

+ *

+ * This method is used in {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} for retrieving the {@link yfiles.tree.SubtreeShape}s for + * the local root nodes. It may be overridden to return a custom implementation of {@link yfiles.tree.SubtreeShape}. + *

+ * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.tree.SubtreeShape} the {@link yfiles.tree.SubtreeShape} for the given node + * @protected + */ + getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; + /** + * Returns the {@link yfiles.tree.SubtreeShape} for the subtree rooted at the given node. + *

+ * This is a convenience method that retrieves a {@link yfiles.tree.SubtreeShape} of a complete subtree from the corresponding + * {@link yfiles.algorithms.IDataProvider}. + *

+ *

+ * This method is used in {@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode} for retrieving the {@link yfiles.tree.SubtreeShape}s for + * the subtrees that are arranged. It may be overridden to return a custom implementation of {@link yfiles.tree.SubtreeShape}. + *

+ * @param {yfiles.algorithms.Node} node the local root node + * @returns {yfiles.tree.SubtreeShape} the {@link yfiles.tree.SubtreeShape} of the subtree rooted at the given local root node + * @protected + */ + getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; + /** + * Initializes the local data structures and then delegates the work to the abstract variant of this method + * ({@link yfiles.tree.NodePlacerBase#placeSubtreeOfNode}) + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider the {@link yfiles.algorithms.IDataProvider} for obtaining an initial shape of the root node + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider the {@link yfiles.algorithms.IDataProvider} for accessing the pre-calculated shapes of the subtrees + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be arranged by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.SubtreeShape} the merged {@link yfiles.tree.SubtreeShape} for the subtree rooted at the local root node + * @see yfiles.tree.NodePlacerBase#placeSubtreeOfNode + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; + /** + * Arranges the local root relative to the {@link yfiles.tree.SubtreeShape} of its children. + *

+ * This is the main method that must be implemented by subclasses. It is called by + * {@link yfiles.tree.NodePlacerBase#placeSubtree}. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector + * @returns {yfiles.tree.SubtreeShape} a {@link yfiles.tree.SubtreeShape} instance that describes the shape of the whole subtree rooted at the given local root + * @protected + * @abstract + */ + placeSubtreeOfNode(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; + /** + * The graph instance this class is working on. + * @protected + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.tree.RootNodeAlignment} describes how a local root node is arranged in relation to its children. + *

+ * The actual placement depends on the orientation of the subtree rooted at the current local root node. All descriptions + * of the provided alignments refer to the top-to-bottom orientation described by + * {@link yfiles.tree.RotatableNodePlacerMatrix#DEFAULT}. In this case, the subtrees are placed below the local root and the local + * root is aligned horizontally above them. + *

+ * @class yfiles.tree.RootNodeAlignment + */ + export interface RootNodeAlignment extends Object{} + export class RootNodeAlignment { + /** + * Calculates the common bounds of the given subtree shapes. + *

+ * This method can be used when placing the local root above its subtrees in method + * {@link yfiles.tree.RootNodeAlignment#placeParentHorizontal}. + *

+ * @param {yfiles.collections.IList.} shapes a list of rotated subtree shapes + * @returns {yfiles.algorithms.Rectangle2D} the rectangle describing the bounds containing all given shapes + * @protected + * @static + */ + static getBounds(shapes:yfiles.collections.IList):yfiles.algorithms.Rectangle2D; + /** + * Moves the shape of the local root to a suitable position relative to the children's shapes. + *

+ * The movement should only be done on the x-axis (horizontally). + *

+ *

+ * This method is called by {@link yfiles.tree.RotatableNodePlacerBase}s when they {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode place the subtrees}. + *

+ * @param {yfiles.tree.RotatedSubtreeShape} rootShape the shape of the local root node that will be moved + * @param {yfiles.collections.IList.} shapes a list of rotated subtree shapes, representing the shapes of the child nodes + * @param {yfiles.algorithms.Rectangle2D} shapeBounds accumulated bounds of the shapes of all child nodes + * @param {number} spacing the spacing value that should be used + * @protected + * @abstract + */ + placeParentHorizontal(rootShape:yfiles.tree.RotatedSubtreeShape,shapes:yfiles.collections.IList,shapeBounds:yfiles.algorithms.Rectangle2D,spacing:number):void; + /** + * Horizontal {@link yfiles.tree.RootNodeAlignment} at the center of the subtrees. + *

+ * The root node is placed centered above its whole subgraph. To determine the alignment, only {@link yfiles.layout.INodeLayout}s + * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static CENTER:yfiles.tree.RootNodeAlignment; + /** + * Horizontal {@link yfiles.tree.RootNodeAlignment} at the median child node. + *

+ * The root node is placed above the median of its children. To determine the alignment, only {@link yfiles.layout.INodeLayout}s + * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static MEDIAN:yfiles.tree.RootNodeAlignment; + /** + * Horizontal {@link yfiles.tree.RootNodeAlignment} left of the children. + *

+ * The local root node leaves a distance specified by the given spacing to the leftmost child. To determine the alignment, + * only {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in + * {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static LEADING:yfiles.tree.RootNodeAlignment; + /** + * Horizontal {@link yfiles.tree.RootNodeAlignment} right of the children. + *

+ * The root node leaves a distance specified by the given spacing to the rightmost child. To determine the alignment, only + * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in + * {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static TRAILING:yfiles.tree.RootNodeAlignment; + /** + * Horizontal {@link yfiles.tree.RootNodeAlignment} at the left side. + *

+ * The root node is placed left aligned with its leftmost child. To determine the alignment, only + * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in + * {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static LEFT:yfiles.tree.RootNodeAlignment; + /** + * Horizontal {@link yfiles.tree.RootNodeAlignment} at the right side. + *

+ * The root node is placed right aligned with its rightmost child. To determine the alignment, only + * {@link yfiles.layout.INodeLayout}s are considered. Node labels are not included although they are also contained in + * {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static RIGHT:yfiles.tree.RootNodeAlignment; + /** + * Horizontal alignment at the center of the children. + *

+ * The root node is placed centered over its direct children. To determine the alignment, only {@link yfiles.layout.INodeLayout}s + * are considered. Node labels are not included although they are also contained in {@link yfiles.tree.SubtreeShape}s. + *

+ * @const + * @static + * @type {yfiles.tree.RootNodeAlignment} + */ + static CENTER_OVER_CHILDREN:yfiles.tree.RootNodeAlignment; + /** + * An array containing all supported {@link yfiles.tree.RootNodeAlignment}s. + * @const + * @static + * @type {Array.} + */ + static ALL:yfiles.tree.RootNodeAlignment[]; + static $class:yfiles.lang.Class; + } + /** + * A matrix describes the rotation of the subtree handled by {@link yfiles.tree.RotatableNodePlacerBase}. + *

+ * Subtrees may be rotated or mirrored. Also, matrices offering a combination of rotation and mirroring are provided. + *

+ * @class yfiles.tree.RotatableNodePlacerMatrix + */ + export interface RotatableNodePlacerMatrix extends Object{} + export class RotatableNodePlacerMatrix { + /** + * Compares the values of the current {@link yfiles.tree.RotatableNodePlacerMatrix} with the values of the given + * {@link yfiles.tree.RotatableNodePlacerMatrix}. + * @param {yfiles.tree.RotatableNodePlacerMatrix} other the matrix + * @returns {boolean} true if this matrix and the given other matrix contain the same values, false otherwise + */ + equalValues(other:yfiles.tree.RotatableNodePlacerMatrix):boolean; + /** + * Multiplies this {@link yfiles.tree.RotatableNodePlacerMatrix} with the given other {@link yfiles.tree.RotatableNodePlacerMatrix}. + * @param {yfiles.tree.RotatableNodePlacerMatrix} other the other matrix + * @returns {yfiles.tree.RotatableNodePlacerMatrix} the product of both matrices + */ + multiply(other:yfiles.tree.RotatableNodePlacerMatrix):yfiles.tree.RotatableNodePlacerMatrix; + /** + * The identity matrix which does not apply any rotation or mirroring. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static DEFAULT:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a counter-clockwise rotation by 90 degrees. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static ROT90:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a rotation by 180 degrees. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static ROT180:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a counter-clockwise rotation by 270 degrees. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static ROT270:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a horizontal mirroring. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static MIR_HOR:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a vertical mirroring. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static MIR_VERT:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a horizontal mirroring and a counter-clockwise rotation by 90 degrees. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static MIR_HOR_ROT90:yfiles.tree.RotatableNodePlacerMatrix; + /** + * A matrix which applies a vertical mirroring and a counter-clockwise rotation by 90 degrees. + * @const + * @static + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + static MIR_VERT_ROT90:yfiles.tree.RotatableNodePlacerMatrix; + static $class:yfiles.lang.Class; + } + /** + * Abstract base class for {@link yfiles.tree.INodePlacer}s that support rotations of the subtrees. + *

+ * The direction specified in this {@link yfiles.tree.RotatableNodePlacerBase} (defined by a + * {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix transformation matrix}) rotates the subtree that is placed. This is the final direction of this subtree. Rotations are + * not accumulated. + *

+ *

+ * {@link yfiles.tree.INodePlacer}s of this type will only implement the default direction (i.e. top-to-bottom). The other + * directions are calculated using the specified modification {@link yfiles.tree.RotatableNodePlacerMatrix}. The direction used by + * the implementing + * {@link yfiles.tree.INodePlacer}s is called the model direction while the actual direction in the graph is the real direction. + *

+ *

+ * Note that using rotatable {@link yfiles.tree.INodePlacer}s has some pitfalls. Calculations must be aware of the rotations. + * Especially operations on {@link yfiles.algorithms.BorderLine}s should not be called directly (e.g. + * {@link yfiles.algorithms.BorderLine#mergeWithMin}, {@link yfiles.algorithms.BorderLine#mergeWithMax}). The corresponding methods of {@link yfiles.tree.RotatableNodePlacerBase} + * already support the different directions. + *

+ *

+ * Subclasses just need to override the following two abstract methods: {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} + * and {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors}. + *

+ * @class yfiles.tree.RotatableNodePlacerBase + * @implements {yfiles.tree.IFromSketchNodePlacer} + */ + export interface RotatableNodePlacerBase extends Object,yfiles.tree.IFromSketchNodePlacer{} + export class RotatableNodePlacerBase { + /** + * Creates a new instance of {@link yfiles.tree.RotatableNodePlacerBase} whose direction is specified by the given modification + * matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for the {@link yfiles.tree.INodePlacer} + * @protected + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); + /** + * Creates a {@link yfiles.collections.IComparer.} for outgoing edges that takes the rotation into account. + * @returns {yfiles.collections.IComparer.} the {@link yfiles.collections.IComparer.} that considers the rotation + */ + createComparer():yfiles.collections.IComparer; + /** + * Delegates to {@link yfiles.tree.RotatableNodePlacerBase#createComparer}. + * @returns {yfiles.collections.IComparer.} the From Sketch {@link yfiles.collections.IComparer.} + * @see yfiles.tree.RotatableNodePlacerBase#createComparer + */ + createFromSketchComparer():yfiles.collections.IComparer; + /** + * Creates an optional {@link yfiles.tree.IProcessor} for pre- and post-processing. + *

+ * This implementation returns null. Hence, no pre- or post-processing is done. + *

+ * @param {yfiles.tree.TreeLayout} layouter the current {@link yfiles.tree.TreeLayout} instance + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} currentRoot the root node handled by this {@link yfiles.tree.INodePlacer} + * @returns {yfiles.tree.IProcessor} null + */ + createProcessor(layouter:yfiles.tree.TreeLayout,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Determines a connector direction for the given child node. + *

+ * This method is called by {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors} and must be implemented by + * subclasses. Implementations can assume the default direction (top-to-bottom) for their arrangement. + *

+ * @param {yfiles.algorithms.Node} child the child node + * @returns {yfiles.tree.ParentConnectorDirection} a direction specifier as defined in the {@link yfiles.tree.INodePlacer} interface + * @protected + * @abstract + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Provides the direction of the connector to the {@link yfiles.tree.SubtreeShape SubtreeShape} for each child node. + *

+ * This implementation uses {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnector} and the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} to + * retrieve the direction for the connectors. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root + * @param {yfiles.algorithms.IDataMap} connectorMap the map that must be used for storing the direction specifiers of the child nodes + * @see yfiles.tree.RotatableNodePlacerBase#determineChildConnector + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Returns the rotated subtree shape for the given node. + *

+ * This is a convenience method that retrieves a rotated subtree shape for a single node from the corresponding + * {@link yfiles.algorithms.IDataProvider}. This shape may be modified and returned by + * {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}. + *

+ * @param {yfiles.algorithms.Node} node the node + * @returns {yfiles.tree.RotatedSubtreeShape} the subtree shape for the given node + * @protected + */ + getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.RotatedSubtreeShape; + /** + * Returns the target {@link yfiles.layout.PortConstraint} for the local root's incoming edge. + *

+ * This method translates the {@link yfiles.layout.PortConstraint} according to the rotation described by the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. + * It should be used instead of {@link yfiles.layout.PortConstraint#getTPC}. + *

+ *

+ * This method may be used in {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} to route the edges to the according + * port. It may be overridden to provide constant {@link yfiles.layout.PortConstraint}s for each node. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root + * @returns {yfiles.layout.PortConstraint} the {@link yfiles.layout.PortConstraint} for the incoming edge of the local root or {@link yfiles.layout.PortSide#ANY} if no {@link yfiles.layout.PortConstraint} + * is assigned for that edge + * @protected + */ + getPortConstraint(localRoot:yfiles.algorithms.Node):yfiles.layout.PortConstraint; + /** + * Returns the absolute source point of the given edge depending on the rotation of this {@link yfiles.tree.INodePlacer}. + *

+ * This method translates the source point according to the rotation described by the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. It should be + * used instead of {@link yfiles.layout.LayoutGraph#getSourcePointAbs}. + *

+ *

+ * It can be used in an implementation of {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}. + *

+ * @param {yfiles.algorithms.Edge} edge the edge whose absolute source point should be calculated + * @returns {yfiles.algorithms.YPoint} the translated absolute source point for the given edge and current modification matrix + * @protected + */ + getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the rotated subtree shape for the subtree rooted at the given node. + *

+ * This is a convenience method that retrieves a subtree shape of a complete subtree from the corresponding + * {@link yfiles.algorithms.IDataProvider}. + *

+ * @param {yfiles.algorithms.Node} node the local root node + * @returns {yfiles.tree.RotatedSubtreeShape} the rotated subtree shape of the subtree rooted at the given local root node + * @protected + */ + getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.RotatedSubtreeShape; + /** + * Initializes the local data structures and then delegates the work to the abstract variant of this method + * ({@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode}). + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider the {@link yfiles.algorithms.IDataProvider} for obtaining an initial shape of the root node + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider the {@link yfiles.algorithms.IDataProvider} for accessing the pre-calculated shapes of the subtrees + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be arranged by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.SubtreeShape} the merged {@link yfiles.tree.SubtreeShape} for the subtree rooted at the local root node + * @see yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShape; + /** + * Arranges the local root relative to the rotated subtree shapes of its children. + *

+ * This is the main method that must be implemented by subclasses. For calculations and locations subclasses should use the + * corresponding methods of {@link yfiles.tree.RotatableNodePlacerBase} which already consider the {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. + *

+ * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction specifier for the connector of the local root node to its parent node + * @returns {yfiles.tree.RotatedSubtreeShape} the merged subtree shape that contains the local root node and all its children + * @protected + * @abstract + */ + placeSubtreeOfNode(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.RotatedSubtreeShape; + /** + * Translates the given real direction of the resulting layout to the model direction of this + * {@link yfiles.tree.RotatableNodePlacerBase}. + *

+ * This method is used in {@link yfiles.tree.RotatableNodePlacerBase#placeSubtreeOfNode} to be able to retrieve the model direction + * for the connector + *

+ * @param {yfiles.tree.ParentConnectorDirection} realDirection the real direction + * @returns {number} the model direction + * @throws {Stubs.Exceptions.ArgumentError} if translation for the given real direction is not implemented + * @protected + */ + translateDirectionToModel(realDirection:yfiles.tree.ParentConnectorDirection):number; + /** + * Translates the given model direction to the real direction in the resulting layout. + *

+ * This method is used in {@link yfiles.tree.RotatableNodePlacerBase#determineChildConnectors} to be able to return the real + * connector direction. + *

+ * @param {yfiles.tree.ParentConnectorDirection} modelDirection the model direction + * @returns {number} the real direction + * @throws {Stubs.Exceptions.ArgumentError} if translation for the given model direction is not implemented + * @protected + */ + translateDirectionToReal(modelDirection:yfiles.tree.ParentConnectorDirection):number; + /** + * Translates a point from the real layout direction to the model direction using the given modification matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the modification matrix to use for the translation + * @param {yfiles.algorithms.YPoint} realWorldPoint the point with coordinates from the real world + * @returns {yfiles.algorithms.YPoint} the translated point with coordinates from the model + * @static + */ + static translatePoint(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,realWorldPoint:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * The graph instance this {@link yfiles.tree.INodePlacer} is working on. + * @protected + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + /** + * The provider of {@link yfiles.tree.SubtreeShape}s for whole subtrees. + * @protected + * @type {yfiles.algorithms.IDataProvider} + */ + subtreeShapeProvider:yfiles.algorithms.IDataProvider; + /** + * The provider of {@link yfiles.tree.SubtreeShape}s for single nodes. + * @protected + * @type {yfiles.algorithms.IDataProvider} + */ + nodeShapeProvider:yfiles.algorithms.IDataProvider; + /** + * The list containing the created children. + * @protected + * @type {yfiles.collections.IList.} + */ + createdChildren:yfiles.collections.IList; + /** + * Gets the modification matrix that defines the direction of the subtree. + * @type {yfiles.tree.RotatableNodePlacerMatrix} + */ + modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix; + /** + * Gets or sets the spacing between subtrees. + *

+ * The spacing needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative + * @type {number} + */ + spacing:number; + static $class:yfiles.lang.Class; + } + /** + * Decorates a SubtreeShape and provides rotated access on it. + * @class yfiles.tree.RotatedSubtreeShape + */ + export interface RotatedSubtreeShape extends Object{} + export class RotatedSubtreeShape { + /** + * For testing purposes only + * @protected + * @constructor + */ + constructor(); + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.SimpleNodePlacer} arranges all children of a local root in a single row. + *

+ * Layout Style {@graph {"ann":{"s":[30,30],"d":1},"n":[[0,0],[50,50],[235,50],[370,50],[720,50],[100,100],[770,100],[285,100],[420,50],[520,50],[570,100],[670,100],[150,150],[720,150],[470,100],[335,100],[620,150],[820,150],[520,150],[185,100]],"e":[[0,1,[65,15]],[0,2,[250,15]],[0,3,[385,15]],[0,4,[735,15]],[1,5,[115,65]],[4,6,[785,65]],[2,7,[300,65]],[0,8,[435,15]],[0,9,[535,15]],[9,10,[585,65]],[9,11,[685,65]],[5,12,[165,115]],[11,13,[735,115]],[8,14,[485,65]],[2,15,[350,65]],[10,16,[635,115]],[6,17,[835,115]],[14,18,[535,115]],[1,19,[200,65]]],"vp":[0.0,0.0,850.0,180.0]}} + *

+ * @class yfiles.tree.SimpleNodePlacer + * @extends {yfiles.tree.RotatableNodePlacerBase} + */ + export interface SimpleNodePlacer extends yfiles.tree.RotatableNodePlacerBase{} + export class SimpleNodePlacer { + /** + * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance that uses the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix} and {@link yfiles.tree.SimpleNodePlacer#rootAlignment root alignment}. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @param {yfiles.tree.RootNodeAlignment} rootAlignment the alignment for the local root in relation to its subtrees + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix,rootAlignment:yfiles.tree.RootNodeAlignment); + /** + * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance that uses the given {@link yfiles.tree.RotatableNodePlacerBase#modificationMatrix modification matrix}. + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the transformation matrix for this {@link yfiles.tree.RotatableNodePlacerBase} + * @constructor + */ + constructor(modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix); + /** + * Creates a new {@link yfiles.tree.SimpleNodePlacer} instance with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the {@link yfiles.tree.RootNodeAlignment RootAlignment} that defines how the root node is aligned with its children and their shapes. + * @type {yfiles.tree.RootNodeAlignment} + */ + rootAlignment:yfiles.tree.RootNodeAlignment; + /** + * Gets or sets the relative vertical alignment of nodes with the same parent. + *

+ * All values between 0 and 1 result in a valid alignment. + *

+ *
    + *
  • 0 - nodes are top-aligned
  • + *
  • 0.5 - nodes are center-aligned
  • + *
  • 1 - nodes are bottom-aligned
  • + *
+ *

+ * Values outside the interval [0,1] may result in a more compact node placement with unaligned nodes, especially when + * labels are considered. + *

+ * @type {number} + */ + verticalAlignment:number; + /** + * Gets or sets whether or not a bus is created in the space between the parent and its children. + * @type {boolean} + */ + createBus:boolean; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.TreeComponentLayout} arranges tree-like subgraph structures in a mixed layout style. + *

+ * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[-18.75,231.25],[56.25,231.25],[131.25,231.25],[-18.75,631.25],[631.25,231.25],[631.25,631.25],[131.25,631.25],[-18.75,-18.75],[631.25,-18.75],[631.25,131.25],[631.25,56.25],[131.25,406.25],[131.25,556.25],[447.5,75,1],[560,162.5,1],[497.5,162.5,1],[391.25,343.75,1],[328.75,343.75,1],[247.5,500,1],[247.5,587.5,1],[310,500,1],[310,587.5,1],[266.25,343.75,1],[272.5,75,1],[385,162.5,1],[322.5,162.5,1],[97.5,75,1],[210,162.5,1],[147.5,162.5,1]],"e":[[0,1,18.75,-0,-18.75,-0],[1,2,18.75,-0,-18.75,-0],[0,3,-0,18.75,-0,-18.75],[2,4,18.75,-0,-18.75,-0],[4,5,-0,18.75,-0,-18.75],[5,6,-18.75,-0,18.75,-0],[6,3,-18.75,-0,18.75,-0],[0,7,-0,-18.75,-0,18.75],[7,8,18.75,-0,-18.75,-0],[4,9,-0,-18.75,-0,18.75],[8,10,-0,18.75,-0,-18.75],[10,9,-0,18.75,-0,-18.75],[11,2,-0,-18.75,-0,18.75],[11,12,-0,18.75,-0,-18.75],[6,12,-0,-18.75,-0,18.75],[7,13,18.75,12.5,0,0,[52.5,12.5,52.5,50,466.25,50]],[13,14,-13.75,0,-0,-0,[452.5,137.5,578.75,137.5]],[13,15,-13.75,0,-0,-0,[452.5,137.5,516.25,137.5]],[2,16,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,410,318.75]],[2,17,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,347.5,318.75]],[11,18,18.75,-0,0,0,[202.5,425,202.5,475,266.25,475]],[11,19,18.75,-0,0,0,[202.5,425,202.5,562.5,266.25,562.5]],[11,20,18.75,-0,0,0,[202.5,425,202.5,475,328.75,475]],[11,21,18.75,-0,0,0,[202.5,425,202.5,562.5,328.75,562.5]],[2,22,18.75,12.5,0,0,[221.25,262.5,221.25,318.75,285,318.75]],[7,23,18.75,12.5,0,0,[52.5,12.5,52.5,50,291.25,50]],[23,24,-13.75,0,-0,-0,[277.5,137.5,403.75,137.5]],[23,25,-13.75,0,-0,-0,[277.5,137.5,341.25,137.5]],[7,26,18.75,12.5,0,0,[52.5,12.5,52.5,50,116.25,50]],[26,27,-13.75,0,-0,-0,[102.5,137.5,228.75,137.5]],[26,28,-13.75,0,-0,-0,[102.5,137.5,166.25,137.5]]],"vp":[-19.0,-19.0,688.0,688.0]}} + *

+ *

+ * The tree components are marked + *

+ * @class yfiles.tree.TreeComponentLayout + * @implements {yfiles.layout.ILayoutStage} + */ + export interface TreeComponentLayout extends Object,yfiles.layout.ILayoutStage{} + export class TreeComponentLayout { + /** + * Creates a new {@link yfiles.tree.TreeComponentLayout} instance using the specified layouter for arranging the subtrees. + * @param {yfiles.layout.ILayoutAlgorithm} treeCoreLayouter the layout algorithm used for arranging the tree components + * @throws {Stubs.Exceptions.ArgumentError} if the specified layout algorithm is null + * @constructor + */ + constructor(treeCoreLayouter:yfiles.layout.ILayoutAlgorithm); + /** + * Finds the tree components inside the given graph and applies a {@link yfiles.tree.TreeComponentLayout#treeComponentCoreLayout tree layout} to them. + * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Delegates the layout calculation to the {@link yfiles.tree.TreeComponentLayout#coreLayout core layout algorithm} and handles the dummy nodes. + *

+ * The dummy nodes are marked using the given {@link yfiles.algorithms.IDataProvider}. + *

+ *

+ * This implementation just registers the dummy node {@link yfiles.algorithms.IDataProvider} with the graph with key + * {@link yfiles.tree.TreeComponentLayout#DUMMY_NODE_DP_KEY}, executes the core layout algorithm and finally removes the data + * provider again. + *

+ *

+ * This method is called by {@link yfiles.tree.TreeComponentLayout#applyLayout} to invoke the core layout algorithm. It may be + * overridden to customize the handling of the dummy nodes. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} dummyDp the {@link yfiles.algorithms.IDataProvider} which marks the dummy nodes + * @protected + */ + applyLayoutUsingDummies(graph:yfiles.layout.LayoutGraph,dummyDp:yfiles.algorithms.IDataProvider):void; + /** + * Data provider key for identifying dummy nodes during the layout calculation + *

+ * This {@link yfiles.algorithms.IDataProvider} is registered and also removed in + * {@link yfiles.tree.TreeComponentLayout#applyLayoutUsingDummies}. + *

+ * @see yfiles.tree.TreeComponentLayout#applyLayoutUsingDummies + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static DUMMY_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the layout algorithm that is applied to tree components. + * @type {yfiles.layout.ILayoutAlgorithm} + */ + treeComponentCoreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets whether or not tree component arrangement is improved by changing the orientation of components. + * @type {boolean} + */ + optimizeOrientation:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.tree.SubtreeShape} represents the position and the borders of a subtree. + *

+ * {@link yfiles.tree.INodePlacer}s will move {@link yfiles.tree.SubtreeShape}s and use the borders to calculate distances between the + * subtrees. When two subtrees are placed in relation to their common root, their + * {@link yfiles.tree.SubtreeShape}s are merged to represent the new subtree. + *

+ *

+ * The borders on each side of the {@link yfiles.tree.SubtreeShape} are modeled with + * {@link yfiles.algorithms.BorderLine}s. The resulting area includes the borders of each node and edge in the corresponding + * subtree. It can also contain the bounds of labels belonging to those nodes and edges. + *

+ *

+ * The {@link yfiles.tree.SubtreeShape} also describes a connector defining the location to which the edge from its parent is + * attached. It is possible to add some bends (target points) at the end of this edge and include them in the + * {@link yfiles.tree.SubtreeShape}. During layout calculation, the last target point is the connection point for the edge. + *

+ * @see yfiles.tree.SubtreeShape#getBorderLine + * @see yfiles.tree.SubtreeShape#connectorX + * @see yfiles.tree.SubtreeShape#connectorY + * @see yfiles.tree.SubtreeShape#addBoundsToShape + * @see yfiles.tree.SubtreeShape#addTargetPoint + * @class yfiles.tree.SubtreeShape + * @final + */ + export interface SubtreeShape extends Object{} + export class SubtreeShape { + /** + * Extends this {@link yfiles.tree.SubtreeShape} instance by the given rectangle. + *

+ * The border lines are updated with this segment. + *

+ * @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 + * @see yfiles.tree.SubtreeShape#getBorderLine + */ + addBoundsToShape(x:number,y:number,width:number,height:number):void; + /** + * Adds all edge segments of the given edge to this {@link yfiles.tree.SubtreeShape} instance. + *

+ * The border lines are updated. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the given edge + * @see yfiles.tree.SubtreeShape#getBorderLine + * @see yfiles.tree.SubtreeShape#addLineSegment + */ + addEdgeSegments(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Extends this {@link yfiles.tree.SubtreeShape} instance by the given segment. + *

+ * The border lines are updated with this segment. + *

+ * @param {number} x1 the x-coordinate of the first point of the segment + * @param {number} y1 the y-coordinate of the first point of the segment + * @param {number} x2 the x-coordinate of the second point of the segment + * @param {number} y2 the y-coordinate of the second point of the segment + * @see yfiles.tree.SubtreeShape#getBorderLine + * @see yfiles.tree.SubtreeShape#addEdgeSegments + * @see yfiles.tree.SubtreeShape#updateConnectorShape + */ + addLineSegment(x1:number,y1:number,x2:number,y2:number):void; + /** + * Adds another point to the connector. + *

+ * The points will appear as bend of the incoming edge. Points are added in reverse direction of the edge. Hence, the last + * target point is further away from the target node than the points before. + *

+ * @param {number} x the current x-coordinate of the point + * @param {number} y the current y-coordinate of the point + */ + addTargetPoint(x:number,y:number):void; + /** + * Appends all target points that have previously been added to this shape to the given {@link yfiles.layout.IEdgeLayout} + * instance. + *

+ * This method is used by {@link yfiles.tree.INodePlacer} instances for the final edge paths. + *

+ * @param {yfiles.layout.IEdgeLayout} edgeLayout the {@link yfiles.layout.IEdgeLayout} that will be modified + * @see yfiles.tree.SubtreeShape#addTargetPoint + */ + appendTargetPoints(edgeLayout:yfiles.layout.IEdgeLayout):void; + /** + * Copies the state of this {@link yfiles.tree.SubtreeShape} instance to the given shape applying a modification matrix. + * @param {yfiles.tree.SubtreeShape} toShape the given shape that gets the assigned values + * @param {yfiles.tree.RotatableNodePlacerMatrix} modificationMatrix the matrix that may add geometrical modifications + */ + assignValuesTo(toShape:yfiles.tree.SubtreeShape,modificationMatrix:yfiles.tree.RotatableNodePlacerMatrix):void; + /** + * Creates a clone of this {@link yfiles.tree.SubtreeShape} instance, modifying it using the provided modification matrix. + * @param {yfiles.tree.RotatableNodePlacerMatrix} matrix the matrix that defines the modification for the new instance + * @returns {yfiles.tree.SubtreeShape} the clone of this {@link yfiles.tree.SubtreeShape} instance + * @see yfiles.tree.RotatableNodePlacerMatrix#DEFAULT + */ + createCopy(matrix:yfiles.tree.RotatableNodePlacerMatrix):yfiles.tree.SubtreeShape; + /** + * Returns the {@link yfiles.algorithms.BorderLine} instance that describes the {@link yfiles.tree.SubtreeShape} at the given side. + * @param {number} index one of the predefined borderline directions + * @returns {yfiles.algorithms.BorderLine} the {@link yfiles.algorithms.BorderLine} instance for the given side + * @throws {Stubs.Exceptions.ArgumentError} if the given index is invalid + */ + getBorderLine(index:number):yfiles.algorithms.BorderLine; + /** + * Merges the given {@link yfiles.tree.SubtreeShape} instance with this {@link yfiles.tree.SubtreeShape} instance. + *

+ * The border lines are updated. + *

+ * @param {yfiles.tree.SubtreeShape} other the {@link yfiles.tree.SubtreeShape} to be merged with this {@link yfiles.tree.SubtreeShape} + */ + mergeWith(other:yfiles.tree.SubtreeShape):void; + /** + * Moves this {@link yfiles.tree.SubtreeShape} instance and its connector by the given offsets. + *

+ * Border lines are updated. + *

+ * @param {number} dx the delta x-offset by which this shape will be moved + * @param {number} dy the delta y-offset by which this shape will be moved + */ + move(dx:number,dy:number):void; + /** + * Adds the line segments of the connector to the bounds of this {@link yfiles.tree.SubtreeShape} instance. + *

+ * The line segments result from the target points. + *

+ * @see yfiles.tree.SubtreeShape#addTargetPoint + */ + updateConnectorShape():void; + /** + * Gets the bounds of the {@link yfiles.layout.INodeLayout} of the root node of this {@link yfiles.tree.SubtreeShape} instance. + * @type {yfiles.algorithms.Rectangle2D} + */ + coreBounds:yfiles.algorithms.Rectangle2D; + /** + * Gets the current bounds of this {@link yfiles.tree.SubtreeShape} instance. + * @type {yfiles.algorithms.Rectangle2D} + */ + bounds:yfiles.algorithms.Rectangle2D; + /** + * Gets the current x-coordinate of the connection point to which the layout algorithm connects the ingoing edge. + *

+ * The connection point can change when target points are added to the {@link yfiles.tree.SubtreeShape} instance. + *

+ * @see yfiles.tree.SubtreeShape#addTargetPoint + * @see yfiles.tree.SubtreeShape#appendTargetPoints + * @type {number} + */ + connectorX:number; + /** + * Gets the current y-coordinate of the connection point to which the layout algorithm connects the ingoing edge. + *

+ * The connection point can change when target points are added to the {@link yfiles.tree.SubtreeShape} instance. + *

+ * @see yfiles.tree.SubtreeShape#addTargetPoint + * @see yfiles.tree.SubtreeShape#appendTargetPoints + * @type {number} + */ + connectorY:number; + /** + * Gets the direction of the last connector segment. + * @type {yfiles.tree.ConnectorDirection} + */ + connectorDirection:yfiles.tree.ConnectorDirection; + /** + * Gets the current minimum x-coordinate of this {@link yfiles.tree.SubtreeShape} instance. + * @type {number} + */ + minX:number; + /** + * Gets the current minimum y-coordinate of this {@link yfiles.tree.SubtreeShape} instance. + * @type {number} + */ + minY:number; + /** + * Gets the current maximum x-coordinate of this {@link yfiles.tree.SubtreeShape} instance. + * @type {number} + */ + maxX:number; + /** + * Gets the current maximum y-coordinate of this {@link yfiles.tree.SubtreeShape} instance. + * @type {number} + */ + maxY:number; + /** + * Gets the current x-coordinate of the origin of this {@link yfiles.tree.SubtreeShape} instance. + *

+ * The origin is defined as the upper left corner of the {@link yfiles.layout.INodeLayout} of the local root of this shape. + *

+ * @type {number} + */ + originX:number; + /** + * Gets the current y-coordinate of the origin of this {@link yfiles.tree.SubtreeShape} instance. + *

+ * The origin is defined as the upper left corner of the {@link yfiles.layout.INodeLayout} of the local root of this shape. + *

+ * @type {number} + */ + originY:number; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm arranges graphs with a tree structure. + *

+ * Layout Style {@link yfiles.tree.TreeLayout} provides multiple different arrangements of trees and subtrees. It is easy to customize the + * {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY order of edges}, the {@link yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY port assignment} and the {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY arrangement of the nodes} for each subtree. + *

+ *

+ * Tree layout algorithms are commonly applied to visualize relational data and produce diagrams of high quality that are + * able to reveal possible hierarchic properties of the graph. More precisely, they find applications in dataflow analysis, + * software engineering, bioinformatics and business administration. + *

+ *

+ * {@graph {"ann": {"s": [37.5,37.5], "d": 1},"n": [[209.96,0], [71.88,77.5], [348.04,77.5], [348.04,155], [202.77,232.5], [172.5,310], [71.88,232.5], [115,387.5], [115,310], [233.04,310], [71.88,155], [348.04,232.5], [319.29,310], [376.79,310], [463.04,232.5], [491.79,310], [434.29,310], [28.75,310], [57.5,387.5], [0,387.5], [376.79,387.5], [261.79,387.5], [204.29,387.5]], "e": [[0,1], [0,2], [2,3], [3,4], [4,5], [6,8], [8,7], [4,9], [1,10], [10,6], [3,11], [11,12], [11,13], [3,14], [14,15], [14,16], [6,17], [17,18], [17,19], [13,20], [9,21], [9,22]], "vp": [0.0,0.0,530.0,425.0]}} Example graph with a layout calculated by {@link yfiles.tree.TreeLayout} using default settings {@graph {"ann": {"s": [60,30], "d": 1},"n": [[1190,0], [0,50], [160,120], [80,120], [240,120], [120,190], [200,190], [280,190], [160,310], [80,310], [240,310], [120,240], [200,240], [280,240], [330,50], [460,256.6], [410,306.6], [510,306.6], [410,356.6], [510,356.6], [460,406.6], [650,441.6], [410,491.6], [490,491.6], [570,491.6], [710,50], [790,100], [870,170], [950,170], [1030,170], [1110,170], [1190,170], [870,240], [950,240], [1030,240], [1110,240], [1190,240], [870,310], [950,310], [1030,310], [1110,310], [1190,310], [870,380], [950,380], [1030,380], [1110,380], [1190,380], [430,120], [500,170], [540,206.6], [580,170], [620,206.6], [660,170], [80,520], [160,430], [160,480], [226.6,405], [226.6,455], [160,380], [790,465], [870,430], [950,430], [950,500], [1030,465], [870,500]], "e": [[0,1,[30,15]], [1,2,[30,100,190,100]], [2,3,[190,170,110,170]], [2,4,[190,170,270,170]], [2,5,[190,170,150,170]], [2,6,[190,170,230,170]], [2,7,[190,170,310,170]], [1,8,[30,360,190,360]], [8,9,[190,290,110,290]], [8,10,[190,290,270,290]], [8,11,[190,290,150,290]], [8,12,[190,290,230,290]], [8,13,[190,290,310,290]], [0,14,[360,15]], [14,15,[360,271.6]], [15,16,[490,321.6]], [15,17,[490,321.6]], [15,18,[490,371.6]], [15,19,[490,371.6]], [15,20], [14,21,[360,456.6]], [21,22,[440,456.6]], [21,23,[520,456.6]], [21,24,[600,456.6]], [0,25,[740,15]], [25,26,[740,115]], [26,27,[860,115,860,150,900,150]], [26,28,[860,115,860,150,980,150]], [26,29,[860,115,860,150,1060,150]], [26,30,[860,115,860,150,1140,150]], [26,31,[860,115,860,150,1220,150]], [26,32,[860,115,860,220,900,220]], [26,33,[860,115,860,220,980,220]], [26,34,[860,115,860,220,1060,220]], [26,35,[860,115,860,220,1140,220]], [26,36,[860,115,860,220,1220,220]], [26,37,[860,115,860,290,900,290]], [26,38,[860,115,860,290,980,290]], [26,39,[860,115,860,290,1060,290]], [26,40,[860,115,860,290,1140,290]], [26,41,[860,115,860,290,1220,290]], [26,42,[860,115,860,360,900,360]], [26,43,[860,115,860,360,980,360]], [26,44,[860,115,860,360,1060,360]], [26,45,[860,115,860,360,1140,360]], [26,46,[860,115,860,360,1220,360]], [14,47,[360,100,410,100,410,135]], [47,48,[530,135]], [47,49,[570,135]], [47,50,[610,135]], [47,51,[650,135]], [47,52,[690,135]], [1,53,[30,535]], [53,54,[110,445]], [53,55,[110,495]], [53,56,[110,420]], [53,57,[110,470]], [53,58,[110,395]], [25,59,[740,480]], [59,60,[900,480]], [59,61,[980,480]], [59,62,[980,480]], [59,63], [59,64,[900,480]]], "vp": [0.0,0.0,1250.0,550.0]}} Tree layout using different + * {@link yfiles.tree.INodePlacer}s and rotationsConcept + *

+ *

+ * The layout algorithm starts from the leaves and continues with their parents, then with the parents of the parents and + * so on. When a node is processed, the algorithm will use the corresponding {@link yfiles.tree.INodePlacer} instance to move its + * children (along with their subtrees) to a suitable position and to route the outgoing edges of this node. Then, the next + * local root node will be processed. + *

+ *

+ * To avoid moving all nodes several times and to know the area that the subtrees occupy, the layout algorithm uses + * {@link yfiles.tree.SubtreeShape}s. These {@link yfiles.tree.SubtreeShape}s are moved and merged during layout calculation. + *

+ *

+ * Features + *

+ *

+ * Each subtree can have a different style of node placement. {@link yfiles.tree.INodePlacer}s are responsible for arranging + * subtrees and their common root node. They can be specified separately for each local root with a {@link yfiles.algorithms.IDataProvider} + * registered with the graph using key {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY}. + *

+ *

+ * A custom node can be defined as root of the tree using a {@link yfiles.algorithms.IDataProvider} registered with the graph with + * key {@link yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY}. + *

+ *

+ * The layout algorithm can be configured to reserve space for node labels and place the edge labels along edges such that + * the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a {@link yfiles.layout.PreferredPlacementDescriptor} + * instance. However, the placement along the edge will only affect the order of multiple labels at the same edge. The + * algorithm will always place the labels close to the target node. + *

+ *

+ * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole + * subtree. Otherwise, the group nodes may overlap with each other or with other nodes. Furthermore, the user may specify + * minimum size constraints for each group node using {@link yfiles.algorithms.IDataProvider} key + * {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. + *

+ *

+ * {@link yfiles.tree.TreeLayout} supports custom sorting of the outgoing edges of a node. For example, a {@link yfiles.tree.INodePlacer} + * instance that implements {@link yfiles.tree.IFromSketchNodePlacer} provides a comparator that keeps the current order of + * siblings, allowing to extend the graph incrementally. + *

+ *

+ * This layout algorithm can only handle graphs with a tree structure. To apply it to a general graph, a {@link yfiles.tree.TreeReductionStage} + * can be appended. This stage will temporarily remove some edges of the input graph until a tree is obtained. After the + * layout calculation, the stage will reinsert the edges that were removed and route them separately. + *

+ * @class yfiles.tree.TreeLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface TreeLayout extends yfiles.layout.MultiStageLayout{} + export class TreeLayout { + /** + * Creates a new {@link yfiles.tree.TreeLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Creates a {@link yfiles.tree.SubtreeShape} for the given node that consists only of the bounds of this particular node. + *

+ * It may also include node labels or {@link yfiles.layout.NodeHalo}s. + *

+ *

+ * This method may be overridden to return a custom {@link yfiles.tree.SubtreeShape} for the given node. + *

+ * @param {yfiles.algorithms.Node} node the given node + * @returns {yfiles.tree.SubtreeShape} a {@link yfiles.tree.SubtreeShape} instance + */ + createNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; + /** + * Returns a list of edges that need to be reversed in order to obtain a valid rooted and directed tree from the input + * graph. + *

+ * The root node of the tree is either a node marked by a {@link yfiles.algorithms.IDataProvider} registered with the graph with + * key {@link yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY} or is defined according to {@link yfiles.algorithms.Trees#getRoot}. + *

+ *

+ * This method is called initially to calculate a rooted tree from the input graph. It may be overridden to apply a custom + * algorithm that determines which edges need to be reversed. + *

+ * @returns {yfiles.algorithms.EdgeList} a list of edges that need to be reversed + * @see yfiles.tree.TreeLayout#reverseEdges + * @protected + */ + directTree():yfiles.algorithms.EdgeList; + /** + * Returns the {@link yfiles.tree.INodePlacer} instance that is used for the placement of the local root node and the + * {@link yfiles.tree.SubtreeShape}s. + *

+ * The method may be overridden to return custom {@link yfiles.tree.INodePlacer} instances. It is possible to return a shared + * instance for multiple different nodes because the instances are not used after subsequent calls to this method. + *

+ *

+ * The current implementation returns the {@link yfiles.tree.INodePlacer} defined by the {@link yfiles.algorithms.IDataProvider} registered + * with key {@link yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY}. It falls back to the default {@link yfiles.tree.INodePlacer} if there is no + * specific {@link yfiles.tree.INodePlacer} for the given node. + *

+ * @param {yfiles.algorithms.Node} localRoot the root of the local subtree + * @returns {yfiles.tree.INodePlacer} the {@link yfiles.tree.INodePlacer} instance that places the subtree below the given local root node + * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY + * @see yfiles.tree.TreeLayout#defaultNodePlacer + * @protected + */ + getNodePlacer(localRoot:yfiles.algorithms.Node):yfiles.tree.INodePlacer; + /** + * Returns the {@link yfiles.collections.IComparer.} instance that will sort the outgoing edges connecting to the given node. + *

+ * The {@link yfiles.collections.IComparer.} can be null in case the initial edge order shall be used. + *

+ *

+ * The method may be overridden to return custom {@link yfiles.collections.IComparer.} instances. It is possible to return a shared instance for multiple + * different nodes because the instances are not used after subsequent calls to this method. + *

+ *

+ * The current implementation returns the {@link yfiles.collections.IComparer.} defined in the {@link yfiles.algorithms.IDataProvider} registered with key + * {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY}. It falls back to the default {@link yfiles.collections.IComparer.} if there is no specific {@link yfiles.collections.IComparer.} for the given + * node. + *

+ * @param {yfiles.algorithms.Node} localRoot the root of the local subtree + * @returns {yfiles.collections.IComparer.} the {@link yfiles.collections.IComparer.} or null that sorts the outgoing edges of the given node + * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY + * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer + */ + getOutEdgeComparer(localRoot:yfiles.algorithms.Node):yfiles.collections.IComparer; + /** + * Returns the {@link yfiles.tree.IPortAssignment} instance that places the ports of the connecting edges of the given node. + *

+ * The method may be overridden to return customized {@link yfiles.tree.IPortAssignment} instances. It is possible to return a + * shared instance for multiple different nodes because the instances are not used after subsequent calls to this method. + *

+ *

+ * The current implementation returns the {@link yfiles.tree.IPortAssignment} defined by the {@link yfiles.algorithms.IDataProvider} + * registered with key {@link yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY}. It falls back to the default {@link yfiles.tree.IPortAssignment} + * if there is no specific {@link yfiles.tree.IPortAssignment} for the given node. + *

+ * @param {yfiles.algorithms.Node} localRoot the root of the local subtree + * @returns {yfiles.tree.IPortAssignment} the {@link yfiles.tree.IPortAssignment} instance that assigns the ports of the edges at the given node + * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY + * @see yfiles.tree.TreeLayout#defaultPortAssignment + * @protected + */ + getPortAssignment(localRoot:yfiles.algorithms.Node):yfiles.tree.IPortAssignment; + /** + * Returns an array of the nodes that will be laid out. + *

+ * The given node will be considered as the root of the tree. The order of the elements ensures that no parent is processed + * before one of its successors. + *

+ *

+ * This method may be overridden to change the order in which the nodes (and their subtrees) are handled. However, it is + * important to keep the parents after the successors. Only siblings can change places. + *

+ * @param {yfiles.algorithms.Node} root the node to be considered as root of the tree + * @returns {Array.} an array of nodes that will be laid out + * @protected + */ + getRootsArray(root:yfiles.algorithms.Node):yfiles.algorithms.Node[]; + /** + * Provides access to the {@link yfiles.tree.SubtreeShape} for the given node. + *

+ * The {@link yfiles.tree.SubtreeShape} contains information about the current extent and location of the subtree rooted at the + * node. It should only be modified during the layout of the parent node. Also, it won't be initialized before the layout + * of the corresponding subtree is calculated. + *

+ *

+ * This method updates the {@link yfiles.tree.SubtreeShape} in {@link yfiles.tree.TreeLayout#layoutRoot}. + *

+ * @param {yfiles.algorithms.Node} localRoot the root of the subtree + * @returns {yfiles.tree.SubtreeShape} the {@link yfiles.tree.SubtreeShape} instance if it has already been calculated, null otherwise + * @protected + */ + getSubtreeShape(localRoot:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; + /** + * Calculates the layout for the given root node and its subtrees. + *

+ * This method is invoked for each node in the tree exactly once. Thus, children are always handled before their parents. + * In this manner, the subtrees already have a layout and can be arranged with their parent. + *

+ *

+ * To retrieve the shapes of the subtrees of all children of the local root, this method uses + * {@link yfiles.tree.TreeLayout#getSubtreeShape}. + *

+ *

+ * The method may be overridden to add configuration code. + *

+ * @param {yfiles.algorithms.Node} localRoot the root of the subtree that whose layout is calculated + * @returns {yfiles.tree.SubtreeShape} the combined {@link yfiles.tree.SubtreeShape} of the local root node and all of its children and connecting edges + * @protected + */ + layoutRoot(localRoot:yfiles.algorithms.Node):yfiles.tree.SubtreeShape; + /** + * Reverses the direction of given edges. + *

+ * This method will be called initially after the {@link yfiles.tree.TreeLayout#directTree} method and finally after the layout has + * been calculated. It may be overridden to additionally reverse data that depends on the direction of the edges. + *

+ * @param {yfiles.algorithms.EdgeList} reversedEdges the edges that will be reversed + * @protected + */ + reverseEdges(reversedEdges:yfiles.algorithms.EdgeList):void; + /** + * Data provider key for specifying a child node placer for each node. + * @see yfiles.tree.TreeLayout#defaultNodePlacer + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_PLACER_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for assigning ports to nodes. + * @see yfiles.tree.TreeLayout#defaultPortAssignment + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static PORT_ASSIGNMENT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for specifying the comparator for the outgoing edges. + * @see yfiles.tree.TreeLayout#defaultOutEdgeComparer + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.>} + */ + static OUT_EDGE_COMPARER_DP_KEY:yfiles.algorithms.NodeDpKey>; + /** + * Data provider key for defining the priority of critical edges. + *

+ * The layout algorithm tries to align each node pair that is connected by a critical edge (integer value > + * 0). This feature can, for example, be used for highlighting different edge paths that are important 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 replacing the current root alignment of the + * {@link yfiles.tree.INodePlacer}. + *

+ *

+ * The critical edge may not be straight if subtrees are rotated or port constraints are assigned. + *

+ *

+ * This feature is only supported by the following {@link yfiles.tree.INodePlacer}s: + *

+ *
    + *
  • {@link yfiles.tree.DefaultNodePlacer}
  • + *
  • {@link yfiles.tree.SimpleNodePlacer}
  • + *
  • {@link yfiles.tree.LayeredNodePlacer}
  • + *
  • {@link yfiles.tree.DoubleLineNodePlacer}
  • + *
  • {@link yfiles.tree.DendrogramNodePlacer}
  • + *
+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static CRITICAL_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for retrieving descriptors for nodes in multi-parent structures. + *

+ * The returned descriptor affects the layout of the multi-parent structure. + *

+ * @see yfiles.tree.TreeLayout#multiParentAllowed + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static MULTI_PARENT_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for marking the node that will be used as root node of the tree. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SELECTED_ROOT_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * The input graph for which a layout is calculated. + * @protected + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + /** + * Gets or sets whether or not group nodes are handled by the layout algorithm. + * @type {boolean} + */ + groupingSupported:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter + * @see yfiles.router.ParallelEdgeRouter + * @type {boolean} + */ + parallelEdgeRouterEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + /** + * Gets a {@link yfiles.algorithms.IDataAcceptor} that can overwrite the source {@link yfiles.layout.PortConstraint port contraint} temporarily used during the layout. + *

+ * This method sets temporary source {@link yfiles.layout.PortConstraint}s, e.g., after edge reversal. It may be overridden to + * handle those {@link yfiles.layout.PortConstraint}s separately. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.algorithms.IDataAcceptor} + */ + sourcePortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * Gets a {@link yfiles.algorithms.IDataAcceptor} that can overwrite the target {@link yfiles.layout.PortConstraint port contraint} temporarily used during the layout. + *

+ * This method sets temporary target {@link yfiles.layout.PortConstraint}s, e.g., after edge reversal. It may be overridden to + * handle those {@link yfiles.layout.PortConstraint}s separately. + *

+ * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @protected + * @type {yfiles.algorithms.IDataAcceptor} + */ + targetPortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * Gets a {@link yfiles.algorithms.IDataAcceptor} that can be used for temporarily overwriting the source group information used + * during the layout. + *

+ * This method may be overridden to handle those edge groups separately. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @protected + * @type {yfiles.algorithms.IDataAcceptor} + */ + sourceGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * Gets a {@link yfiles.algorithms.IDataAcceptor} that can be used for temporarily overwriting the target group information used + * during the layout. + *

+ * This method may be overridden to handle those edge groups separately. + *

+ * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @protected + * @type {yfiles.algorithms.IDataAcceptor} + */ + targetGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * Gets or sets the default {@link yfiles.tree.INodePlacer} instance that arranges all subtrees that do not have a specific {@link yfiles.tree.INodePlacer} + * assigned using a {@link yfiles.algorithms.IDataProvider}. + * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.INodePlacer} is set to null + * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY + * @type {yfiles.tree.INodePlacer} + */ + defaultNodePlacer:yfiles.tree.INodePlacer; + /** + * Gets or sets the default {@link yfiles.tree.INodePlacer} instance that places the leaf nodes of the tree. + * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.INodePlacer} is set to null + * @see yfiles.tree.TreeLayout#defaultNodePlacer + * @type {yfiles.tree.INodePlacer} + */ + defaultLeafPlacer:yfiles.tree.INodePlacer; + /** + * Gets or sets the default {@link yfiles.tree.IPortAssignment} instance for all subtrees that do not have a specific {@link yfiles.tree.IPortAssignment} + * assigned using a {@link yfiles.algorithms.IDataProvider}. + * @throws {Stubs.Exceptions.ArgumentError} if the default {@link yfiles.tree.IPortAssignment} is set to null + * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY + * @type {yfiles.tree.IPortAssignment} + */ + defaultPortAssignment:yfiles.tree.IPortAssignment; + /** + * Gets or sets the default {@link yfiles.collections.IComparer.} instance that sorts the outgoing edges in all subtrees that do not have a specific {@link yfiles.collections.IComparer.} assigned + * using a {@link yfiles.algorithms.IDataProvider}. + * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY + * @type {yfiles.collections.IComparer.} + */ + defaultOutEdgeComparer:yfiles.collections.IComparer; + /** + * Gets or sets whether or not the layout algorithm reserves space for node labels. + *

+ * If this feature is enabled, the {@link yfiles.tree.SubtreeShape} of the nodes will also hold the shapes of its labels. + *

+ * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets whether or not edge labels are placed by the layout algorithm. + *

+ * If this is enabled, the {@link yfiles.tree.SubtreeShape}s of the subtrees are extended by the edge labels. + *

+ *

+ * The layout algorithm uses the information of {@link yfiles.layout.PreferredPlacementDescriptor} for an edge label to determine + * the corresponding placement. However, edge labels are always placed at the target side of the edge. The placement along + * the edge only affects the order of the edge labels at the same edge. + *

+ * @type {boolean} + */ + integratedEdgeLabeling:boolean; + /** + * Gets or sets 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 manner. + *

+ * @type {boolean} + */ + multiParentAllowed:boolean; + static $class:yfiles.lang.Class; + } + /** + * The {@link yfiles.tree.TreeReductionStage} temporarily reduces general graphs to trees. + *

+ * Layout Style + *

+ *

+ * This stage prepares a non-tree graph such that it can be processed by a tree layout algorithm. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[150,0],[260,70],[210,70],[260,140],[310,210],[335,280],[75,70],[285,280],[25,70],[25,140],[75,140],[150,70],[25,210],[185,280],[175,140],[50,280],[0,280],[210,210],[235,280],[125,140]],"e":[[0,1,[165,50,275,50]],[0,2,[165,50,225,50]],[1,3],[3,4,[275,190,325,190]],[4,5,[325,260,350,260]],[0,6,[165,50,90,50]],[4,7,[325,260,300,260]],[0,8,[165,50,40,50]],[8,9],[6,10],[0,11],[9,12],[11,14,[165,120,190,120]],[12,15,[40,260,65,260]],[12,16,[40,260,15,260]],[3,17,[275,190,225,190]],[17,13,[225,260,200,260]],[17,18,[225,260,250,260]],[11,19,[165,120,140,120]],[2,11,1],[12,13,1],[17,14,1]],"vp":[0.0,0.0,365.0,310.0]}} + *

+ *

+ * The non-tree edges are marked + *

+ *

+ * Concept This {@link yfiles.layout.ILayoutStage} works in three steps: + *

+ *
    + *
  1. Remove some edges to get a tree or forest from the graph
  2. + *
  3. Invoke the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} which supports tree graph handling
  4. + *
  5. Reinsert all previously removed edges
  6. + *
  7. + * Optionally route these edges using the non-tree edge router and place their labels using the non-tree edge labeling + * algorithm. + *
  8. + *
+ *

+ * Features + *

+ *

+ * The routing of the temporarily hidden non-tree edges can be customized by specifying an {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter edge routing algorithm} for those + * edges. Similarly, the placement of edge labels of non-tree edges can be delegated to a custom + * {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm edge labeling algorithm}. As default, both custom algorithms are not specified and, thus, non-tree edges are not routed + * and edge labels not placed. + *

+ *

+ * This 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 {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} supports + * multi-parent structures (see {@link yfiles.tree.TreeLayout#multiParentAllowed}) and option {@link yfiles.tree.TreeReductionStage#multiParentAllowed} is enabled, this stage does not hide such structures, i.e., the multi-parent + * structures are passed to the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ *

+ * Non-tree edges can also be bundled together such that their common parts are to some degree merged into a bundled part. + * The edge bundling can be specified by means of method {@link yfiles.tree.TreeReductionStage#edgeBundling}. + *

+ * @class yfiles.tree.TreeReductionStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface TreeReductionStage extends yfiles.layout.LayoutStageBase{} + export class TreeReductionStage { + /** + * Creates a new {@link yfiles.tree.TreeReductionStage} instance with the given core layout algorithm and default settings. + * @param {yfiles.layout.ILayoutAlgorithm} core the core layout algorithm + * @constructor + */ + constructor(core:yfiles.layout.ILayoutAlgorithm); + /** + * Creates a new {@link yfiles.tree.TreeReductionStage} instance with default settings. + * @constructor + */ + constructor(); + /** + * Creates a routing algorithm that routes edges as a single straight segment. + *

+ * The created instance can be used for {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter routing non-tree edges}. + *

+ * @returns {yfiles.layout.ILayoutAlgorithm} an edge routing algorithm that produces straight-line edges + * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter + */ + createStraightLineRouter():yfiles.layout.ILayoutAlgorithm; + /** + * Routes all edges that do not belong to the chosen spanning tree. + *

+ * This method is called by {@link yfiles.tree.TreeReductionStage#applyLayout} after the tree was arranged by the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to apply custom edge routes. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph containing tree and non-tree edges + * @param {yfiles.algorithms.IEdgeMap} nonTreeEdgeMap the {@link yfiles.algorithms.IEdgeMap} that marks all non-tree edges in the graph + * @protected + */ + routeNonTreeEdges(graph:yfiles.layout.LayoutGraph,nonTreeEdgeMap:yfiles.algorithms.IEdgeMap):void; + /** + * Data provider key for explicitly marking (some) edges that should not be considered for the tree + * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static NON_TREE_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets 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 {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can handle multi-parent structures + * (see {@link yfiles.tree.TreeLayout#multiParentAllowed}), this stage does not hide such structures, but the multi-parent structures are passed on to the {@link yfiles.layout.LayoutStageBase#coreLayout} core layout + * algorithm}. + *

+ * @type {boolean} + */ + multiParentAllowed:boolean; + /** + * Gets or sets the edge routing algorithm that is applied to all non-tree edges. + * @see yfiles.tree.TreeReductionStage#nonTreeEdgeSelectionKey + * @type {yfiles.layout.ILayoutAlgorithm} + */ + nonTreeEdgeRouter:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that will be used by the {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter non-tree edge routing algorithm} + * to determine the edges that need to be routed. + * @see yfiles.tree.TreeReductionStage#nonTreeEdgeRouter + * @type {Object} + */ + nonTreeEdgeSelectionKey:Object; + /** + * Gets or sets the labeling algorithm that is applied to all edge labels that belong to non-tree edges. + *

+ * It is required that a suitable {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelSelectionKey edge label selection key} is set. Otherwise, the edge labeling algorithm might also place + * labels of tree edges. + *

+ * @see yfiles.tree.TreeReductionStage#nonTreeEdgeLabelSelectionKey + * @type {yfiles.layout.ILayoutAlgorithm} + */ + nonTreeEdgeLabelingAlgorithm:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used by the {@link yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm non-tree edge labeling algorithm} + * to determine which edge labels it should place. + * @see yfiles.tree.TreeReductionStage#nonTreeEdgeLabelingAlgorithm + * @type {Object} + */ + nonTreeEdgeLabelSelectionKey:Object; + /** + * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. + *

+ * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be + * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered + * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. To enable bundling for all non-tree edges, set a {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default bundle descriptor} + * which has {@link yfiles.layout.EdgeBundleDescriptor#bundled bundling} enabled. + *

+ *

+ * If the graph contains self-loops that belong to the set of non-tree edges, the stage will invoke the router defined for + * the non-tree edges in order to route them. In the case where this is not desired, the user has to hide them from the + * stage and route them afterwards as desired. + *

+ * @type {yfiles.layout.EdgeBundling} + */ + edgeBundling:yfiles.layout.EdgeBundling; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.tree.AspectRatioTreeLayout}. + * @class yfiles.tree.AspectRatioTreeLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface AspectRatioTreeLayoutData extends yfiles.layout.LayoutData{} + export class AspectRatioTreeLayoutData { + constructor(); + /** + * Gets or sets the mapping from nodes to the aspect ratio of their sub tree. + * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ASPECT_RATIO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + subtreeAspectRatios:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes with sub trees to their placements. + * @see yfiles.tree.AspectRatioTreeLayout#ROOT_PLACEMENT_DP_KEY + * @see yfiles.tree.AspectRatioTreeLayout#getRootPlacement + * @type {yfiles.layout.ItemMapping.} + */ + rootPlacements:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to the routing policies of their sub trees. + * @see yfiles.tree.AspectRatioTreeLayout#SUBTREE_ROUTING_POLICY_DP_KEY + * @see yfiles.tree.AspectRatioTreeLayout#getSubtreeArrangement + * @type {yfiles.layout.ItemMapping.} + */ + subtreeRoutingPolicies:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.tree.BalloonLayout}. + * @class yfiles.tree.BalloonLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface BalloonLayoutData extends yfiles.layout.LayoutData{} + export class BalloonLayoutData { + constructor(); + /** + * Gets or sets the collection of nodes that should be arranged in an interleaved fashion. + * @see yfiles.tree.BalloonLayout#INTERLEAVED_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + interleavedNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the mapping for marking the node that will be used as root node of the tree. + *

+ * The custom root node selection induced by this property is only considered if the {@link yfiles.tree.BalloonLayout#rootNodePolicy root node policy} is set to + * {@link yfiles.tree.RootNodePolicy#SELECTED_ROOT}. + *

+ * @see yfiles.tree.BalloonLayout#SELECTED_ROOT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + treeRoot:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.tree.TreeLayout}. + * @class yfiles.tree.TreeLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface TreeLayoutData extends yfiles.layout.LayoutData{} + export class TreeLayoutData { + constructor(); + /** + * Gets or sets the mapping from nodes to their {@link yfiles.tree.INodePlacer}. + * @see yfiles.tree.TreeLayout#NODE_PLACER_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodePlacers:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.tree.IPortAssignment}. + * @see yfiles.tree.TreeLayout#PORT_ASSIGNMENT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + portAssignments:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to comparison functions used to sort the nodes' outgoing edges. + * @see yfiles.tree.TreeLayout#OUT_EDGE_COMPARER_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + outEdgeComparers:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets the collection of nodes the {@link yfiles.tree.AssistantNodePlacer} considers as assistants. + *

+ * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.AssistantNodePlacer} . + *

+ * @see yfiles.tree.AssistantNodePlacer#ASSISTANT_NODE_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + assistantNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets the collection of nodes the {@link yfiles.tree.DelegatingNodePlacer} places with its {@link yfiles.tree.DelegatingNodePlacer#primaryPlacer}. + *

+ * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.DelegatingNodePlacer} . + *

+ * @see yfiles.tree.DelegatingNodePlacer#PRIMARY_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + delegatingNodePlacersPrimaryNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets a mapping from nodes to a boolean value that specifies whether a node should be placed left of the bus + * (true) or right of the bus (false). + *

+ * This mapping is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns a {@link yfiles.tree.LeftRightNodePlacer} . + *

+ * @see yfiles.tree.LeftRightNodePlacer#LEFT_RIGHT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + leftRightPlacersLeftNodes:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to the index of the row the {@link yfiles.tree.GridNodePlacer} shall place the node in. + *

+ * This collection is only considered if {@link yfiles.tree.TreeLayoutData#nodePlacers} returns any {@link yfiles.tree.GridNodePlacer} . + *

+ * @see yfiles.tree.GridNodePlacer#ROW_INDEX_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + gridNodePlacerRowIndices:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the mapping for marking the node that will be used as root node of the tree. + * @see yfiles.tree.TreeLayout#SELECTED_ROOT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + treeRoot:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.tree.TreeReductionStage}. + * @class yfiles.tree.TreeReductionStageData + * @extends {yfiles.layout.LayoutData} + */ + export interface TreeReductionStageData extends yfiles.layout.LayoutData{} + export class TreeReductionStageData { + constructor(); + /** + * Gets or sets the collection of edges explicitly marked as not belonging to a tree. + * @see yfiles.tree.TreeReductionStage#NON_TREE_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + nonTreeEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. + *

+ * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the + * source and target point, the edges are again clearly split. + *

+ *

+ * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. + *

+ * @see yfiles.layout.EdgeBundleDescriptor + * @see yfiles.tree.TreeReductionStage#edgeBundling + * @type {yfiles.layout.ItemMapping.} + */ + edgeBundleDescriptors:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace hierarchic{ + /** + * This interface describes a layering constraint. + *

+ * Such constraints can be given as additional input to the {@link yfiles.hierarchic.HierarchicLayout}. + *

+ * @see yfiles.hierarchic.ILayerConstraintFactory + * @interface + */ + export interface ILayerConstraint extends Object{ + /** + * Gets or sets the priority of a constraint. + *

+ * This value is used for resolving conflicting constraints. A constraint with a higher priority is more likely to be + * considered. + *

+ *

+ * The priority has to be greater than 0. + *

+ * @abstract + * @type {number} + */ + priority:number; + } + var ILayerConstraint:{ $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; - }; + isInstance(o:Object):boolean; }; /** - * This class provides simple default port assignment strategies. - */ - export interface DefaultPortAssignment extends Object,yfiles.tree.IPortAssignment{ + * This interface provides methods for creating layering constraints. + * @interface + */ + export interface ILayerConstraintFactory 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; + * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID aboveId to lie at least minDistance layers above the {@link yfiles.algorithms.Node} + * with ID referenceId with a given weight penalty for larger layer differences. + *

+ * The minimum distance includes potentially empty layers that are removed by the {@link yfiles.hierarchic.ILayerer} instance. In + * that case, the actual layer difference may be smaller than the minimum distance. + *

+ * @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 minimum layer distance between the node and its reference node + * @param {number} [weight=0] the weight penalty for larger layer differences + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeAboveConstraint(referenceId:Object,aboveId:Object,minDistance:number,weight?:number):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID aboveId to lie above the {@link yfiles.algorithms.Node} with ID + * referenceId. + * @param {Object} referenceId the ID of the reference node + * @param {Object} aboveId the ID of the node that should lie above + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeAboveConstraint(referenceId:Object,aboveId:Object):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Adds a constraint that places a {@link yfiles.algorithms.Node} on the bottom layer. + * @param {Object} nodeId the ID of the node that should lie on the bottom layer + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeAtBottomConstraint(nodeId:Object):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Adds a constraint that places a {@link yfiles.algorithms.Node} on the topmost layer. + * @param {Object} nodeId the ID of the node that should lie on the top layer + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeAtTopConstraint(nodeId:Object):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID belowId to lie at least minDistance layers below the {@link yfiles.algorithms.Node} + * with ID referenceId with a given weight penalty for larger layer differences. + *

+ * The minimum distance includes potentially empty layers that are removed by the {@link yfiles.hierarchic.ILayerer} instance. In + * that case, the actual layer difference may be smaller than the minimum distance. + *

+ * @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 minimum layer distance between the node and its reference node + * @param {number} [weight=0] the weight penalty for larger layer differences + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeBelowConstraint(referenceId:Object,belowId:Object,minDistance:number,weight?:number):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Adds a constraint that forces a {@link yfiles.algorithms.Node} with ID belowId to lie below the {@link yfiles.algorithms.Node} with ID + * referenceId. + * @param {Object} referenceId the ID of the reference node + * @param {Object} belowId the ID of the node that should lie below + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeBelowConstraint(referenceId:Object,belowId:Object):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Adds a constraint that forces the {@link yfiles.algorithms.Node} with ID sameLayerId to lie in the same layer as the {@link yfiles.algorithms.Node} + * with ID referenceId. + * @param {Object} referenceId the ID of the reference node + * @param {Object} sameLayerId the ID of the node that should lie in the same layer + * @returns {yfiles.hierarchic.ILayerConstraint} a {@link yfiles.hierarchic.ILayerConstraint} object that represents the constraint + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + addPlaceNodeInSameLayerConstraint(referenceId:Object,sameLayerId:Object):yfiles.hierarchic.ILayerConstraint; /** - * 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; + * Disposes this factory. + *

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

+ * @abstract + */ + dispose():void; /** - * 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; + * Clears all constraints for a given {@link yfiles.algorithms.Node}. + * @param {Object} nodeId the ID of the node for which all constraints should be cleared + * @see yfiles.hierarchic.ILayerConstraint + * @abstract + */ + removeConstraints(nodeId:Object):void; /** - * 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; + * Gets 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 + * this factory to a graph instance after creation. See the factory methods that create instances of this interface for a + * description. + *

+ * @see yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory + * @abstract + * @type {Object} + */ + memento:Object; } - var DefaultPortAssignment:{ + var ILayerConstraintFactory:{ $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; - }; + isInstance(o:Object):boolean; }; + /** + * This interface specifies the general contract for factory classes that can be used to associate sequence constraints + * with a graph. + *

+ * Sequence constraints affect the sequence of nodes within a {@link yfiles.hierarchic.ILayer layer}. + *

+ *

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

+ * @interface + */ + export interface ISequenceConstraintFactory extends Object{ + /** + * Adds a constraint that forces the {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} with id after to lie after the {@link yfiles.algorithms.Node} + * or {@link yfiles.algorithms.Edge} with id reference. + * @param {Object} referenceId the ID of the reference node or edge + * @param {Object} afterId the ID of the node or edge that should be placed after the reference element + * @abstract + */ + addPlaceAfterConstraint(referenceId:Object,afterId:Object):void; + /** + * Adds a constraint that places a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} at the start of the sequence. + * @param {Object} id the ID of the node or edge that should be placed at the start + * @abstract + */ + addPlaceAtHeadConstraint(id:Object):void; + /** + * Adds a constraint that places a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} at the end of the sequence. + * @param {Object} id the ID of the node or edge that should be placed at the end + * @abstract + */ + addPlaceAtTailConstraint(id:Object):void; + /** + * Adds a constraint that forces the {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} with id before to lie before the {@link yfiles.algorithms.Node} + * or {@link yfiles.algorithms.Edge} with id reference. + * @param {Object} referenceId the ID of the reference node or edge + * @param {Object} beforeId the ID of the node or edge that should be placed before the reference element + * @abstract + */ + addPlaceBeforeConstraint(referenceId:Object,beforeId:Object):void; + /** + * Disposes of the {@link yfiles.hierarchic.ISequenceConstraintFactory}. + *

+ * 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. + *

+ * @abstract + */ + dispose():void; + /** + * Gets 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 + * this factory to a graph instance after creation. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#createSequenceConstraintFactory + * @abstract + * @type {Object} + */ + memento:Object; + } + var ISequenceConstraintFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.hierarchic.AsIsLayerer} assigns nodes to layers by analyzing already existing node coordinates. + *

+ * Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer. To influence to which + * amount the boxes need to overlap, the nodes can temporarily be + * {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor scaled}. Alternatively, a minimum and maximum size or a halo can be specified for the nodes. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[1.64,133.62,[[11.31,157.97,10.67,18.7,"1"]]],[51.6,4.78,[[61.27,29.13,10.67,18.7,"2"]]],[190,14.75,[[199.66,39.1,10.67,18.7,"3"]]],[226.76,148.06,[[236.42,172.41,10.67,18.7,"4"]]],[108.72,221.62,[[118.38,245.97,10.67,18.7,"5"]]]],"e":[[0,1],[1,2],[3,2],[0,4],[4,3]],"vp":[1.0,4.0,256.0,248.0]}} + *

+ *

+ * Initial graph + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[20,50,[[29.66,74.35,10.67,18.7,"1"]]],[20,0,[[29.66,24.35,10.67,18.7,"2"]]],[100,0,[[109.66,24.35,10.67,18.7,"3"]]],[100,50,[[109.66,74.35,10.67,18.7,"4"]]],[60,110,[[69.66,134.35,10.67,18.7,"5"]]]],"e":[[0,1,0,-15,0,15],[1,2,15,0,-15,0],[3,2,0,-15,0,15],[0,4,0,15,-7.5,-15,[35,95,67.5,95]],[4,3,7.5,-15,0,15,[82.5,95,115,95]]],"vp":[20.0,0.0,110.0,140.0]}} + *

+ *

+ * Hierarchic layout when the initial drawing is used as sketch + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[50,0,[[59.66,24.35,10.67,18.7,"1"]]],[20,60,[[29.66,84.35,10.67,18.7,"2"]]],[27.5,170,[[37.16,194.35,10.67,18.7,"3"]]],[80,110,[[89.66,134.35,10.67,18.7,"4"]]],[80,60,[[89.66,84.35,10.67,18.7,"5"]]]],"e":[[0,1,-7.5,15,0,-15,[57.5,45,35,45]],[1,2,0,15,-7.5,-15],[3,2,0,15,7.5,-15,[95,155,50,155]],[0,4,7.5,15,0,-15,[72.5,45,95,45]],[4,3,0,15,0,-15]],"vp":[20.0,0.0,90.0,200.0]}} + *

+ *

+ * Hierarchic layout when the initial drawing is not used as sketch + *

+ * @class yfiles.hierarchic.AsIsLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface AsIsLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class AsIsLayerer { + /** + * Creates an instance of {@link yfiles.hierarchic.AsIsLayerer} with default settings. + * @constructor + */ + constructor(); + /** + * Assigns all nodes of the graph to layers by analyzing already existing node coordinates and adds them to the {@link yfiles.hierarchic.ILayers} + * instance. + *

+ * Nodes whose bounding boxes overlap in the main layout direction are assigned to the same layer. To influence to which + * amount the boxes need to overlap, the nodes can temporarily be {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor scaled}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Callback used for calculating the lower (max) value of a given node. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the lower (max) of a given node + * @protected + */ + getMax(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + /** + * Callback used for calculating the upper (min) value of a given node. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Node} node the node + * @returns {number} the upper (min) value of a given node + * @protected + */ + getMin(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + /** + * Gets or sets the scaling factor used for scaling the size of the nodes. + *

+ * Nodes are being scaled from their center. This can be used for more fuzzy layering. + *

+ *

+ * The scaling factor can take positive values. Factors smaller than 1 only consider large overlaps of the nodes' bounding + * boxes in the main layout direction. Factors larger than 1 also combine nodes with some distance between them. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 + * @see yfiles.hierarchic.AsIsLayerer#minimumNodeSize + * @see yfiles.hierarchic.AsIsLayerer#maximumNodeSize + * @see yfiles.hierarchic.AsIsLayerer#nodeHalo + * @type {number} + */ + nodeScalingFactor:number; + /** + * Gets or sets the maximum size of a node used for calculating layer overlaps. + *

+ * This can be used for more fuzzy layering. + *

+ *

+ * The maximum size can take positive values. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 + * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor + * @see yfiles.hierarchic.AsIsLayerer#nodeHalo + * @type {number} + */ + maximumNodeSize:number; + /** + * Gets or sets the minimum size of a node used for calculating layer overlaps. + *

+ * This can be used for more fuzzy layering. + *

+ *

+ * The minimum size can take positive values. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0 + * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor + * @see yfiles.hierarchic.AsIsLayerer#nodeHalo + * @type {number} + */ + minimumNodeSize:number; + /** + * Gets or sets the size of the halo around a node, that means the insets that are used for calculating layer overlaps. + *

+ * If the value of the halo is positive, it specifies a border around a node. In case it is negative, it is considered as + * an inset that defines a smaller area inside the node. + *

+ *

+ * This can be used for more fuzzy layering. + *

+ * @see yfiles.hierarchic.AsIsLayerer#nodeScalingFactor + * @see yfiles.hierarchic.AsIsLayerer#minimumNodeSize + * @see yfiles.hierarchic.AsIsLayerer#maximumNodeSize + * @type {number} + */ + nodeHalo:number; + static $class:yfiles.lang.Class; + } + /** + * This class calculates the sequence of the nodes within each layer using the nodes' coordinates. + *

+ * For {@link yfiles.layout.MultiStageLayout#layoutOrientation layout orientation} + * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}, the order corresponds to that obtain when sorting the nodes according to + * their x-coordinate. + *

+ *

+ * An instance of this class can be set to {@link yfiles.hierarchic.HierarchicLayout} using method {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} and {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} respectively. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[111.8,0,[[121.47,24.35,10.67,18.7,"1"]]],[0,36.33,[[9.66,60.68,10.67,18.7,"2"]]],[180.9,95.11,[[190.56,119.46,10.67,18.7,"3"]]],[0,153.88,[[9.66,178.23,10.67,18.7,"4"]]],[111.8,190.21,[[121.47,214.56,10.67,18.7,"5"]]]],"e":[[0,1],[0,3],[1,3],[0,2],[2,4],[4,3]],"vp":[0.0,0.0,211.0,221.0]}} Initial graph that will be used as sketch {@graph {"ann":{"s":[30,30],"d":1},"n":[[50,0,[[59.66,24.35,10.67,18.7,"1"]]],[20,60,[[29.66,84.35,10.67,18.7,"2"]]],[80,100,[[89.66,124.35,10.67,18.7,"3"]]],[42.5,145,[[52.16,169.35,10.67,18.7,"4"]]],[72.5,205,[[82.16,229.35,10.67,18.7,"5"]]]],"e":[[0,1,-10,15,0,-15,[55,45,35,45]],[0,3,0,15,7.5,-15],[1,3,0,15,-7.5,-15,[35,130,50,130]],[0,2,10,15,0,-15,[75,45,95,45]],[2,4,0,15,7.5,-15],[4,3,-7.5,-15,0,15,[80,190,57.5,190]]],"vp":[20.0,0.0,90.0,235.0]}} Hierarchic layout when the initial graph is used as sketch + *

+ * @class yfiles.hierarchic.AsIsSequencer + * @implements {yfiles.hierarchic.ISequencer} + */ + export interface AsIsSequencer extends Object,yfiles.hierarchic.ISequencer{} + export class AsIsSequencer { + /** + * Creates a new {@link yfiles.hierarchic.AsIsSequencer} instance. + * @constructor + */ + constructor(); + /** + * Calculates the sequence of the nodes within each layer using the nodes' coordinates. + *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} and finally writes back the calculated sequence using + * method {@link yfiles.hierarchic.ILayer#setNodeOrder}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance that defines the layering structure + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} used for creating and destroying helper structures + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + static $class:yfiles.lang.Class; + } + /** + * This class is a wrapper {@link yfiles.hierarchic.ILayerer} implementation that delegates the actual layering to a delegate {@link yfiles.hierarchic.ILayerer} + * object. + *

+ * If the graph consists of multiple components, they will be identified and each of the components will be layered + * separately using the delegate {@link yfiles.hierarchic.ILayerer} instance. After that they will all be merged such that the + * desired aspect ratio is fulfilled best. + *

+ *

+ * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ccccff"}},"n":[[110,160],[20,160],[20,220],[110,220],[20,280],[252.5,160,6],[305,220,6],[380,280,6],[200,220,6],[290,280,6],[290,330,6],[380,330,6],[200,280,6],[27.5,0,180,80],[87.5,100]],"e":[[14,0,15,15,0,-15,[132.5,145,140,145]],[14,1,-15,15,0,-15,[102.5,145,50,145]],[1,2,0,15,0,-15],[0,3,0,15,0,-15],[2,4,0,15,0,-15],[5,6,15,15,0,-15,[297.5,205,335,205]],[6,7,15,15,0,-15,[350,265,410,265]],[5,8,-15,15,0,-15,[267.5,205,230,205]],[6,9,-15,15,0,-15],[9,10,0,15,0,-15],[7,11,0,15,0,-15],[8,12,0,15,0,-15],[13,14,0,40,0,-15]],"vp":[20.0,0.0,420.0,360.0]}} Sample output of {@link yfiles.hierarchic.AspectRatioComponentLayerer} with default settings on a graph with two connected + * components. + *

+ * @see yfiles.hierarchic.AspectRatioComponentLayerer#desiredAspectRatio + * @see yfiles.hierarchic.MultiComponentLayerer + * @class yfiles.hierarchic.AspectRatioComponentLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface AspectRatioComponentLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class AspectRatioComponentLayerer { + /** + * Creates a new instance of {@link yfiles.hierarchic.AspectRatioComponentLayerer} using the given delegate {@link yfiles.hierarchic.ILayerer} + * instance. + * @param {yfiles.hierarchic.ILayerer} singleComponentLayerer + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null + * @constructor + */ + constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer); + /** + * Assigns all nodes of the graph to layers and registers them to the {@link yfiles.hierarchic.ILayers} instance based on the given + * 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 {@link yfiles.hierarchic.ILayerer} instance. After that, they will all be merged such that the + * desired aspect ratio is best fulfilled. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for query information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Gets or sets the delegate {@link yfiles.hierarchic.ILayerer} instance. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null + * @type {yfiles.hierarchic.ILayerer} + */ + singleComponentLayerer:yfiles.hierarchic.ILayerer; + /** + * Gets or sets whether or not the size of the nodes 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. + *

+ * @type {boolean} + */ + considerNodeSize:boolean; + /** + * Gets or sets 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 {@link yfiles.hierarchic.ILayerer} instance. After that, they will all be merged such that the + * desired aspect ratio is best fulfilled. + *

+ *

+ * The given aspect ratio should be greater or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the aspect ratio is negative + * @type {number} + */ + desiredAspectRatio:number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.hierarchic.BFSLayerer} uses a breadth first search for assigning layers to the nodes. + *

+ * The nodes of the first layer can be freely selected (see + * {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}). The nodes that belong 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. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[46.17,0,[[55.83,24.35,10.67,18.7,"1"]]],[100,70,[[109.66,94.35,10.67,18.7,"2"]]],[0,70,[[9.66,94.35,10.67,18.7,"3"]]],[211.77,0,[[221.43,24.35,10.67,18.7,"6"]]],[211.77,70,[[221.43,94.35,10.67,18.7,"7"]]],[100,0,[[109.66,24.35,10.67,18.7,"8"]]],[50,70,[[56.33,94.35,17.35,18.7,"12"]]],[3.17,140,[[12.83,164.35,10.67,18.7,"8"]]],[113.17,140,[[122.83,164.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,7.5,-15,[115,50,122.5,50]],[0,1,10,15,-7.5,-15,[71.17,50,107.5,50]],[0,2,-10,15,0,-15,[51.17,50,15,50]],[4,1,-15,0,15,0],[3,4,0,15,0,-15],[0,6,-0,15,0,-15,[61.17,50,65,50]],[6,7,-7.5,15,7.5,-15,[57.5,120,25.67,120]],[6,8,7.5,15,0,-15,[72.5,120,128.17,120]],[8,7,-15,0,15,0],[2,7,0,15,-7.5,-15,[15,120,10.67,120]]],"vp":[0.0,0.0,242.0,170.0]}} + *

+ * @class yfiles.hierarchic.BFSLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface BFSLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class BFSLayerer { + /** + * Creates an instance of {@link yfiles.hierarchic.BFSLayerer}. + * @constructor + */ + constructor(); + /** + * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for query information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Data provider key for identifying the core nodes of the BFS layering. + *

+ * The {@link yfiles.algorithms.IDataProvider} registered with this key should provide boolean values for the nodes of the graph. + * The boolean value determines whether or not a node is to be placed in the first layer. If there are no nodes marked as + * core nodes, then nodes with in-degree 0 are considered to be the core nodes. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static CORE_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + static $class:yfiles.lang.Class; + } + /** + * This class is a {@link yfiles.hierarchic.ILayerer} implementation that observes relative and absolute layering constraints + * defined by the {@link yfiles.hierarchic.ILayerConstraintFactory layer constraint factory}. + *

+ * Furthermore, it can handle the edge directedness as specified by {@link yfiles.algorithms.IDataProvider} key + * {@link yfiles.hierarchic.HierarchicLayout#EDGE_DIRECTEDNESS_DP_KEY}. + *

+ *

+ * For a given graph instance, the layer constraint factory can be created using method + * {@link yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory}. The {@link yfiles.hierarchic.ILayerer} can be used for both + * common layering and layering of incremental nodes. + *

+ *

+ * {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#ff0000"},"7":{"f":"#0099ff"}, "8":{"f":"#00cc66"}},"n":[[120,0,6,[[144.66,24.35,10.67,18.7,"1"]]],[10,50,7,[[34.66,74.35,10.67,18.7,"2"]]],[120,50,7,[[144.66,74.35,10.67,18.7,"3"]]],[280,125,8,[[304.66,149.35,10.67,18.7,"7"]]],[10,125,8,[[34.66,149.35,10.67,18.7,"4"]]],[100,125,8,[[124.66,149.35,10.67,18.7,"5"]]],[190,125,8,[[214.66,149.35,10.67,18.7,"6"]]]],"e":[[2,0,0,-15,0,15],[2,1,-30,0,30,0],[3,2,0,-15,22.5,15,[310,95,172.5,95]],[2,4,-22.5,15,0,-15,[127.5,90,40,90]],[2,5,-7.5,15,0,-15,[142.5,100,130,100]],[2,6,7.5,15,0,-15,[157.5,105,220,105]]],"vp":[10.0,0.0,330.0,155.0]}} Sample output of applying {@link yfiles.hierarchic.ConstraintIncrementalLayerer}. The red colored node should reside in the + * topmost layer, blue nodes in the medium layer while green nodes in the bottommost layer. {@graph {"ann":{"s":[60,30],"d":1},"styles":{"6":{"f":"#0099ff"},"7":{"f":"#e3e3ff", "s":"#e3e3ff"}, "8":{"f":"#00cc66"}},"n":[[330,136.5,380,67,7],[330,206.5,380,127,7],[330,337,380,80,7],[490,156.5,[[514.66,180.85,10.67,18.7,"1"]]],[350,226.5,6,[[374.66,250.85,10.67,18.7,"2"]]],[440,226.5,6,[[464.66,250.85,10.67,18.7,"3"]]],[450,286.5,6,[[474.66,310.85,10.67,18.7,"4"]]],[415,346.5,8,[[439.66,370.85,10.67,18.7,"5"]]],[505,346.5,8,[[529.66,370.85,10.67,18.7,"6"]]],[595,346.5,8,[[619.66,370.85,10.67,18.7,"7"]]]],"e":[[3,4,-25,15,0,-15,[495,196.5,380,196.5]],[3,5,-15,15,0,-15,[505,206.5,470,206.5]],[3,6,-5,15,15,-15,[515,266.5,495,266.5]],[5,6,0,15,-15,-15,[470,266.5,465,266.5]],[3,7,5,15,0,-15,[525,326.5,445,326.5]],[3,8,15,15,0,-15],[3,9,25,15,0,-15,[545,196.5,625,196.5]]],"vp":[330.0,136.0,380.0,281.0]}} Sample output of applying {@link yfiles.hierarchic.ConstraintIncrementalLayerer} + * on a graph with a + * {@link yfiles.layout.PartitionGrid}. Same colors represent nodes that belong to the same partition grid cell and should be + * layered with respect to the partition grid cell to which they belong. + *

+ * @see yfiles.hierarchic.ILayerConstraintFactory + * @see yfiles.hierarchic.HierarchicLayout + * @class yfiles.hierarchic.ConstraintIncrementalLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface ConstraintIncrementalLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class ConstraintIncrementalLayerer { + /** + * Creates a new {@link yfiles.hierarchic.ConstraintIncrementalLayerer} with the given {@link yfiles.hierarchic.ILayerer} instance. + * @param {yfiles.hierarchic.ILayerer} coreLayerer the given {@link yfiles.hierarchic.ILayerer} instance + * @constructor + */ + constructor(coreLayerer:yfiles.hierarchic.ILayerer); + /** + * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance based on relative and + * absolute layering constraints defined by the given layering constraints. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for query information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Checks if the current setting of constraints is consistent (i.e. + *

+ * the induced constraint graph has no cycles). + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the constraint graph is inconsistent + * @protected + */ + checkConstraints():void; + /** + * Data provider key for assigning additional edge weights + *

+ * The {@link yfiles.hierarchic.ILayerer} tries to maintain edges with higher weights short. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static ADDITIONAL_EDGE_WEIGHT_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets whether or not same-layer edges can be created by this {@link yfiles.hierarchic.ILayerer} 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). + *

+ * @type {boolean} + */ + allowSameLayerEdges:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class is a default {@link yfiles.hierarchic.IDrawingDistanceCalculator} implementation that is used by {@link yfiles.hierarchic.HierarchicLayoutCore} + * to configure the {@link yfiles.hierarchic.INodePlacer}. + * @class yfiles.hierarchic.DefaultDrawingDistanceCalculator + * @implements {yfiles.hierarchic.IDrawingDistanceCalculator} + */ + export interface DefaultDrawingDistanceCalculator extends Object,yfiles.hierarchic.IDrawingDistanceCalculator{} + export class DefaultDrawingDistanceCalculator { + /** + * Creates a new instance of {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} with default settings. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayers} layers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + */ + dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Determines the minimum distance between two {@link yfiles.algorithms.Node}s of the same layer. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayer} layer the {@link yfiles.hierarchic.ILayer} object that will be used during subsequent calls + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying information + * @param {yfiles.algorithms.Node} left the left of the two {@link yfiles.algorithms.Node}s whose minimum distance is to be determined or null if only the left border + * of the right {@link yfiles.algorithms.Node} is of interest + * @param {yfiles.algorithms.Node} right the right of the two {@link yfiles.algorithms.Node}s whose minimum distance is to be determined or null if only the right border + * of the left {@link yfiles.algorithms.Node} is of interest + * @returns {number} the minimum distances between {@link yfiles.algorithms.Node}s of same layer + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayers} layers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + */ + initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Gets or sets whether or not an adaptive minimum edge distance is used. + *

+ * If this option is enabled the minimum distance between two adjacent edges is the minimum of the current minimum edge + * distance and the distance of the edges' source/target points. + *

+ * @type {boolean} + */ + adaptiveMinimumEdgeDistanceEnabled:boolean; + /** + * Gets or sets whether or not the compaction option is enabled. + * @type {boolean} + */ + compaction:boolean; + /** + * Gets or sets the minimum distance between two {@link yfiles.algorithms.Node}s. + *

+ * Minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + nodeToNodeDistance:number; + /** + * Gets or sets the minimum distance between a {@link yfiles.algorithms.Node} and an (non-adjacent) {@link yfiles.algorithms.Edge}. + *

+ * Minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + nodeToEdgeDistance:number; + /** + * Gets or sets the minimum distance between two edges. + *

+ * Minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + edgeToEdgeDistance:number; + /** + * Gets or sets whether or not to use an optimized minimum distance calculation for swimlane layouts. + *

+ * If set to true this instance will report 0.0d as the minimum distance between two nodes if they belong to different + * swimlanes. This avoids unwanted feedback between different swimlanes during node placement. + *

+ * @type {boolean} + */ + optimizeSwimlaneDistances:boolean; + static $class:yfiles.lang.Class; + } + /** + * A default implementation of a {@link yfiles.hierarchic.ILayeredComponentsMerger} that provides simple default behaviors. + *

+ * Instances of this class are used internally by {@link yfiles.hierarchic.HierarchicLayoutCore} and {@link yfiles.hierarchic.MultiComponentLayerer} + * when e.g. the graph is grouped or it consists of more than one connected component. + *

+ * @class yfiles.hierarchic.DefaultLayeredComponentsMerger + * @implements {yfiles.hierarchic.ILayeredComponentsMerger} + */ + export interface DefaultLayeredComponentsMerger extends Object,yfiles.hierarchic.ILayeredComponentsMerger{} + export class DefaultLayeredComponentsMerger { + /** + * Creates a new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} using the given merging policy. + * @param {yfiles.hierarchic.MergingPolicy} policy one of the predefined merging constants + * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given + * @constructor + */ + constructor(policy:yfiles.hierarchic.MergingPolicy); + /** + * Creates a new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} with default settings. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + * @param {yfiles.hierarchic.ILayers} srcLayers + * @param {yfiles.hierarchic.ILayers} targetLayers + */ + merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,srcLayers:yfiles.hierarchic.ILayers,targetLayers:yfiles.hierarchic.ILayers):void; + /** + * Gets or sets the merging policy constant as defined in {@link yfiles.hierarchic.DefaultLayeredComponentsMerger}. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown policy is given + * @type {yfiles.hierarchic.MergingPolicy} + */ + policy:yfiles.hierarchic.MergingPolicy; + static $class:yfiles.lang.Class; + } + /** + * This class is a {@link yfiles.hierarchic.ISequencer} implementation that performs the second phase of the Sugiyama algorithm. + *

+ * It minimizes the crossings in the diagram by using either the barycentric or median heuristic. + *

+ * @class yfiles.hierarchic.DefaultLayerSequencer + * @implements {yfiles.hierarchic.ISequencer} + */ + export interface DefaultLayerSequencer extends Object,yfiles.hierarchic.ISequencer{} + export class DefaultLayerSequencer { + /** + * Creates a new instance of {@link yfiles.hierarchic.DefaultLayerSequencer}. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayers} glayers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + * @param {yfiles.hierarchic.IItemFactory} itemFactory + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,glayers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Gets or sets whether or not to apply an additional crossing minimization heuristic. + *

+ * Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the + * running time. + *

+ * @type {boolean} + */ + transposition:boolean; + /** + * Gets or sets whether or not an additional crossing minimization heuristic should be used in the presence of grouped + * graphs. + *

+ * Activating this heuristic can reduce the overall number of edge crossings in grouped graphs. On the other hand, it may + * increase running time. + *

+ * @type {boolean} + */ + groupTransposition:boolean; + /** + * Gets or sets the weight heuristic that should be used. + * @throws {Stubs.Exceptions.ArgumentError} if the constant is unknown + * @type {yfiles.hierarchic.WeightHeuristic} + */ + weightHeuristic:yfiles.hierarchic.WeightHeuristic; + /** + * Gets or sets the time limit (in milliseconds) set for this sequencer per execution. + *

+ * Values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative. + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the number of randomized rounds that this algorithm performs, if there was no optimal solution. + *

+ * Values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if a negative value is given + * @type {number} + */ + randomizationRounds:number; + static $class:yfiles.lang.Class; + } + /** + * This class is a default {@link yfiles.hierarchic.IPortAllocator} implementation. + *

+ * It is used by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. + *

+ * @class yfiles.hierarchic.DefaultPortAllocator + * @implements {yfiles.hierarchic.IPortAllocator} + */ + export interface DefaultPortAllocator extends Object,yfiles.hierarchic.IPortAllocator{} + export class DefaultPortAllocator { + /** + * Creates a new instance of {@link yfiles.hierarchic.DefaultPortAllocator} with default settings. + * @see yfiles.hierarchic.DefaultPortAllocator#defaultPortBorderGapRatio + * @constructor + */ + constructor(); + /** + * Assigns source and target port coordinates to each edge of the graph. + *

+ * This method assigns: + *

+ *
    + *
  • {@link yfiles.layout.PortSide#ANY} ports to appropriate sides.
  • + *
  • {@link yfiles.layout.PortConstraint#strong Weak} ports to appropriate positions between strong ones.
  • + *
+ *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the layering structure + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} used for creating and destroying helper structures + */ + assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Callback method used for determining the port border gap for each node and side. + *

+ * It may be overridden for a custom calculation of port border gap on a given node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @param {yfiles.algorithms.Node} node the given 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/ports that connect to this side + * @returns {number} the absolute gap on both sides of the ports + * @see yfiles.hierarchic.DefaultPortAllocator#getPortDistanceDelta + * @protected + */ + getPortBorderGap(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; + /** + * Callback method used for determining the port border gap ratio. + *

+ * See {@link yfiles.hierarchic.DefaultPortAllocator#defaultPortBorderGapRatio} for an explanation. + *

+ *

+ * It may be overridden for a custom calculation of port border gap ratio on a given node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @param {yfiles.algorithms.Node} node the given 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/ports that connect to this side + * @returns {number} the border gap ratio + * @protected + */ + getPortBorderGapRatio(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; + /** + * Callback method used for determining the distance between two adjacent ports. + *

+ * It may be overridden for a custom calculation of the distance between two adjacent ports.. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @param {yfiles.algorithms.Node} node the given 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/ports that connect to this side + * @param {number} portBorderGap the previously calculated port border gap + * @returns {number} the absolute distance between two adjacent ports + * @protected + */ + getPortDistanceDelta(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number,portBorderGap:number):number; + /** + * Gets or sets the border gap ratio for the default port. + *

+ * This ratio determines the gap between a corner of the node and the first assigned port. + *

+ *

+ * The ratio should be greater than 0. + *

+ *

+ * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). + *

+ *

+ * A 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. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative + * @type {number} + */ + defaultPortBorderGapRatio:number; + static $class:yfiles.lang.Class; + } + /** + * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases to provide routing details for + * the edges of the graph. + *

+ * An {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance can be specified individually for single edges using a {@link yfiles.algorithms.IDataProvider} + * that returns an {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance for each edge of the graph, or null if no {@link yfiles.hierarchic.EdgeLayoutDescriptor} + * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ *

+ * This class is designed as a class to allow future additions of new getter methods. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @see yfiles.hierarchic.NodeLayoutDescriptor + * @class yfiles.hierarchic.EdgeLayoutDescriptor + */ + export interface EdgeLayoutDescriptor extends Object{} + export class EdgeLayoutDescriptor { + /** + * Creates a new instance of an {@link yfiles.hierarchic.EdgeLayoutDescriptor} with the default values. + * @constructor + */ + constructor(); + /** + * Creates a copy of this {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance. + * @returns {yfiles.hierarchic.EdgeLayoutDescriptor} a copy of this {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance + */ + createCopy():yfiles.hierarchic.EdgeLayoutDescriptor; + /** + * Gets or sets the minimum length of the first segment of the edge path (at the source node). + *

+ * The minimum length should be greater than 0. + *

+ *

+ * If the value is 0.0d the first segment does not need to be orthogonal. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative + * @type {number} + */ + minimumFirstSegmentLength:number; + /** + * Gets or sets the minimum length of the last segment of the edge path (at the target node). + *

+ * The minimum length should be greater than 0. + *

+ *

+ * If the value is 0.0d the last segment does not need to be orthogonal. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the last segment is negative + * @type {number} + */ + minimumLastSegmentLength:number; + /** + * Gets or sets the minimum length of an edge. + *

+ * If this is used for polyline routing, it describes the minimum vertical length of the mid segment. If it is used for + * orthogonal routing, it describes the minimum length of the whole edge. + *

+ *

+ * The minimum length should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative + * @type {number} + */ + minimumLength:number; + /** + * Gets or sets the preferred minimum distance to obstacles. + *

+ * The minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative + * @type {number} + */ + minimumDistance:number; + /** + * Gets or sets the minimum slope that the mid segments of this edge should have, if the edge is routed polyline in + * vertical layouts. + *

+ * The minimum slope should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum slope is negative + * @type {number} + */ + minimumSlope:number; + /** + * Gets or sets whether or not source port optimization is enabled. + *

+ * This means that the algorithm should try to find a better source {@link yfiles.layout.PortConstraint port constraint} if the current constraint is null or + * {@link yfiles.layout.PortSide#ANY}. + *

+ * @type {boolean} + */ + sourcePortOptimization:boolean; + /** + * Gets or sets whether or not target port optimization is enabled. + *

+ * This means that the algorithm should try to find a better target {@link yfiles.layout.PortConstraint port constraint} if the current constraint is null or + * {@link yfiles.layout.PortSide#ANY}. + *

+ * @type {boolean} + */ + targetPortOptimization:boolean; + /** + * Gets or sets the routing style for this edge. + * @see yfiles.hierarchic.RoutingStyle + * @type {yfiles.hierarchic.RoutingStyle} + */ + routingStyle:yfiles.hierarchic.RoutingStyle; + /** + * Gets or sets the minimum length of octilinear segments for this edge. + * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative + * @see yfiles.hierarchic.EdgeLayoutDescriptor#routingStyle + * @type {number} + */ + minimumOctilinearSegmentLength:number; + /** + * Gets or sets how edges in grouped graphs are routed between the content of different groups. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown style is specified + * @type {yfiles.hierarchic.RecursiveEdgeStyle} + */ + recursiveEdgeStyle:yfiles.hierarchic.RecursiveEdgeStyle; + /** + * Gets or sets whether or not this edge is routed directly to a group node's border if it connects the group node with one + * of its descendants. + *

+ * When enabled, the edge will connect to the inner side of the group node's border instead of leaving the group node and + * connect from outside. + *

+ * @type {boolean} + */ + directGroupContentEdgeRouting:boolean; + static $class:yfiles.lang.Class; + } + export enum WeightHeuristic{ + /** + * A weight assignment specifier based on a barycenter heuristic. + *

+ * The position of a node within a layer will be determined by the barycenter of its successor (downward pass) and + * predecessor (upward pass) nodes. + *

+ * @see yfiles.hierarchic.DefaultLayerSequencer#weightHeuristic + */ + BARYCENTER, + /** + * A weight assignment specifier based on a median heuristic. + *

+ * The position of a node within a layer will be determined by the median position of its successor (downward pass) and + * predecessor (upward pass) nodes. + *

+ * @see yfiles.hierarchic.DefaultLayerSequencer#weightHeuristic + */ + MEDIAN + } + export enum MergingPolicy{ + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} below the layers of the target {@link yfiles.hierarchic.ILayers layering}. + * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_BELOW, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} above the layers of the target {@link yfiles.hierarchic.ILayers layering}. + * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_ABOVE, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target layering. + *

+ * Both {@link yfiles.hierarchic.ILayers layering}s will become top-aligned before the merge. + *

+ * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_RIGHT_TOP_ALIGNED, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target {@link yfiles.hierarchic.ILayers layering}. + *

+ * Both {@link yfiles.hierarchic.ILayers layering}s will become bottom-aligned before the merge. + *

+ * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_RIGHT_BOTTOM_ALIGNED, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the right of the layers of the target {@link yfiles.hierarchic.ILayers layering}. + *

+ * Both {@link yfiles.hierarchic.ILayers layering}s will become center-aligned before the merge. + *

+ * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_RIGHT_CENTER_ALIGNED, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. + *

+ * Both {@link yfiles.hierarchic.ILayers layering}s will become top-aligned before the merge. + *

+ * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_LEFT_TOP_ALIGNED, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. + *

+ * Both {@link yfiles.hierarchic.ILayers layering}s will become bottom-aligned before the merge. + *

+ * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_LEFT_BOTTOM_ALIGNED, + /** + * A constant that adds the new layers of the source {@link yfiles.hierarchic.ILayers layering} to the left of the layers of the target {@link yfiles.hierarchic.ILayers layering}. + *

+ * Both {@link yfiles.hierarchic.ILayers layering}s will become center-aligned before the merge. + *

+ * @see yfiles.hierarchic.DefaultLayeredComponentsMerger#policy + */ + ADD_LEFT_CENTER_ALIGNED + } + export enum EdgeDataType{ + /** + * A constant describing a normal edge. + * @see yfiles.hierarchic.IEdgeData#type + */ + NORMAL, + /** + * A constant describing an edge that connects to a source group node. + * @see yfiles.hierarchic.IEdgeData#type + */ + SOURCE_GROUP_NODE_CONNECTOR, + /** + * A constant describing an edge that connects to a target group node. + * @see yfiles.hierarchic.IEdgeData#type + */ + TARGET_GROUP_NODE_CONNECTOR, + /** + * A constant describing an edge that connects two group nodes. + * @see yfiles.hierarchic.IEdgeData#type + */ + GROUP_NODE_INTERCONNECTOR, + /** + * A constant describing a same-layer edge that connects directly two neighboring nodes. + * @see yfiles.hierarchic.IEdgeData#type + */ + DIRECT_SAME_LAYER_EDGE, + /** + * A constant describing a same-layer edge that does not connect directly two neighboring nodes. + *

+ * This means that two nodes of the same layer are not connected directly with a straight-line edge, but with an edge + * consisting of polyline segments. + *

+ * @see yfiles.hierarchic.IEdgeData#type + */ + NON_DIRECT_SAME_LAYER_EDGE, + /** + * A constant describing an edge that connects group border nodes in adjacent layers. + * @see yfiles.hierarchic.IEdgeData#type + */ + BORDER_EDGE, + /** + * A constant describing an edge that has been added temporarily to replace an edge connected to a group node. + * @see yfiles.hierarchic.IEdgeData#type + */ + REDIRECTED_GROUP_EDGE + } + export enum RecursiveEdgeStyle{ + /** + * Routing specifier that routes edges between different group contents non-recursively. + * {@link yfiles.algorithms.Edge}s may leave and enter group nodes at the left and right side in order to connect as directly as + * possible. + * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle + */ + OFF, + /** + * Routing specifier that routes edges between different group contents recursively and directed. + * {@link yfiles.algorithms.Edge}s can only leave the groups at the bottom side and enter them at the top side. + * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle + */ + DIRECTED, + /** + * Routing specifier that routes edges between different group contents recursively and undirected. + * {@link yfiles.algorithms.Edge}s can leave the groups at the bottom or top side and enter them at the bottom or top side. This + * style is more compact than the directed edge style. + * @see yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle + */ + UNDIRECTED + } + export enum ComponentArrangementPolicy{ + /** + * A component arrangement policy that achieves a 1:1 aspect ratio for the graph. + *

+ * After layering the single components with the core layerer, the components will be merged such that an 1:1 aspect ratio + * is fulfilled best. + *

+ * @see yfiles.hierarchic.HierarchicLayout#componentArrangementPolicy + */ + COMPACT, + /** + * A component arrangement policy that aligns the components with their topmost layer. + *

+ * After layering the single components with the core layerer, the components are aligned with their topmost layer. + *

+ * @see yfiles.hierarchic.HierarchicLayout#componentArrangementPolicy + */ + TOPMOST + } + export enum LayoutMode{ + /** + * A layout mode that allows to keep some nodes fixed and insert the remaining nodes incrementally. + *

+ * Fixed elements will be handled by the {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer fixed elements sequencer} and {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer fixed elements layerer}. Incremental elements will be + * added during the layering or the sequencing phase. They are handled by {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer from scratch layerer} and {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer fixed elements layerer} + * respectively. + *

+ * @see yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint + * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer + */ + INCREMENTAL, + /** + * A layout mode that will recompute the complete layout from scratch. + *

+ * All elements will be handled by the same {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer layerer} and {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer sequencer}. + *

+ * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer + * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer + */ + FROM_SCRATCH + } + export enum LayeringStrategy{ + /** + * A layering strategy which places each node in the highest possible layer without passing its predecessor in the + * topological order of nodes. + *

+ * 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 yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + HIERARCHICAL_TOPMOST, + /** + * A layering strategy which places each node in the optimal layer to minimize the layer distances. + *

+ * The layer distance of an edge is the absolute difference between the layer numbers of its source and target node. The + * layer assignment will minimize the overall sum of the layer distances of all edges in the layout. + *

+ * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + HIERARCHICAL_OPTIMAL, + /** + * A layering strategy which applies a heuristic to approximate the {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL optimal layering}. + *

+ * The quality of the result may not be as good as with {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL optimal layering} but it is usually achieved faster. + *

+ * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + HIERARCHICAL_TIGHT_TREE, + /** + * A layering strategy which applies a fast heuristic that improves the layering done by {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TOPMOST} + * by shifting some nodes down. + *

+ * The quality of the result is usually worse than the one produced by + * {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TIGHT_TREE}. + *

+ * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + HIERARCHICAL_DOWNSHIFT, + /** + * A layering strategy 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 yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + BFS, + /** + * A layering strategy which derives the layers from the initial coordinates of the nodes. + *

+ * It tries to find a layering that is similar to the one in the input graph. The layout algorithm may place nodes in the + * same layer, even though they are connected by an edge. + *

+ *

+ * In a vertically oriented layout, nodes that overlap vertically are placed in the same layer. The same holds for a + * horizontally oriented layout in the case where the nodes overlap horizontally. + *

+ * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + FROM_SKETCH, + /** + * A layering strategy which uses a layer assignment specified by the user. + *

+ * The nodes' layer assignment must be provided by a data provider bound to the input graph using the key + * {@link yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY}. + *

+ *

+ * This layering strategy allows edges whose source and target share a layer. + *

+ * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + USER_DEFINED, + /** + * A dummy layering strategy which describes a strategy that is not part of the default strategies. + * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy + */ + UNKNOWN + } + export enum GroupAlignmentPolicy{ + /** + * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the top with + * respect to their inner layers. + * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy + * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering + */ + TOP, + /** + * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the center with + * respect to their inner layers. + * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy + * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering + */ + CENTER, + /** + * A group layering alignment strategy which aligns groups and normal nodes that occupy the same layer to the bottom with + * respect to their inner layers. + * @see yfiles.hierarchic.HierarchicLayout#groupAlignmentPolicy + * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering + */ + BOTTOM + } + export enum LayerType{ + /** + * A constant describing a normal layer consisting mainly of normal nodes. + */ + NORMAL, + /** + * A constant describing a layer consisting mainly of label nodes or dummy nodes. + */ + LABEL, + /** + * A constant describing a layer consisting of source group nodes and dummy nodes. + */ + SOURCE_GROUP_NODES, + /** + * A constant describing a layer consisting of target group nodes and dummy nodes. + */ + TARGET_GROUP_NODES, + /** + * Describes a layer above a group to store the connector proxies where edges connect to groups. + */ + UPPER_GROUP_CONNECTOR_NODES, + /** + * Describes a layer below a group to store the connector proxies where edges connect to groups. + */ + LOWER_GROUP_CONNECTOR_NODES + } + export enum NodeDataType{ + /** + * A constant describing a normal {@link yfiles.algorithms.Node}. + *

+ * A normal node may have any degree, any size and any number of connected same-layer edges. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + NORMAL, + /** + * A constant describing a bend {@link yfiles.algorithms.Node}. + *

+ * A bend node has degree 2, small size and no same-layer edges. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + BEND, + /** + * A constant describing a side proxy {@link yfiles.algorithms.Node}. + *

+ * 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 one of which this node is the proxy. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + SIDE_PROXY, + /** + * A constant describing a side proxy {@link yfiles.algorithms.Node} for drawing same-layer edges. + *

+ * A side proxy node for drawing same-layer edges has degree + * 0, small size and one same-layer edge. The associated node is the one of which this node is the proxy. The associated + * edge is the same-layer edge of which this node is the proxy. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + SAME_LAYER_SIDE_PROXY, + /** + * A constant describing a label {@link yfiles.algorithms.Node}. + *

+ * A label node has degree + * 2, size of the labels and no same-layer edges. The borders of this node describe the layout of the labels. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + LABEL, + /** + * A constant describing a group {@link yfiles.algorithms.Node} for nested graph layouts. + *

+ * This group node carries additional {@link yfiles.hierarchic.ILayers} information. + *

+ * @see yfiles.hierarchic.INodeData#type + * @see yfiles.hierarchic.INodeData#groupLayers + */ + GROUP, + /** + * A constant describing a source group {@link yfiles.algorithms.Node} for bus edges. + *

+ * This node serves as a dummy node in a {@link yfiles.hierarchic.LayerType#SOURCE_GROUP_NODES} layer. + *

+ * @see yfiles.hierarchic.INodeData#type + * @see yfiles.hierarchic.INodeData#groupId + */ + SOURCE_GROUP_NODE, + /** + * A constant describing a target group {@link yfiles.algorithms.Node} for bus edges. + *

+ * This node serves as a dummy node in a {@link yfiles.hierarchic.LayerType#TARGET_GROUP_NODES} layer. + *

+ * @see yfiles.hierarchic.INodeData#type + * @see yfiles.hierarchic.INodeData#groupId + */ + TARGET_GROUP_NODE, + /** + * A constant describing a back-loop proxy that belongs to the source of an edge. + *

+ * A back-loop proxy that belongs to the source of an edge has degree 2, small size and exactly one same-layer edge. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + SOURCE_BACK_LOOP_PROXY, + /** + * A constant describing a back-loop proxy that belongs to the target of an edge. + *

+ * A back-loop proxy that belongs to the target of an edge has degree 2, small size and exactly one same-layer edge. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + TARGET_BACK_LOOP_PROXY, + /** + * A constant describing a same-layer edge crossing dummy {@link yfiles.algorithms.Node}. + *

+ * A same-layer edge crossing dummy node has degree + * 2, small size and exactly two same-layer edges. It is used for marking the crossing of the layer, if source and target + * port are at opposite layer sides. + *

+ * @see yfiles.hierarchic.INodeData#type + */ + SAME_LAYER_CENTER_NODE, + /** + * A constant describing a {@link yfiles.algorithms.Node} used for the drawing phase to keep the distance between two nodes. + * @see yfiles.hierarchic.INodeData#type + */ + DISTANCE_NODE, + /** + * A constant describing a {@link yfiles.algorithms.Node} used during the drawing phase for marking the beginning of a node group + * interval. + * @see yfiles.hierarchic.INodeData#type + */ + GROUP_BEGIN, + /** + * A constant describing a {@link yfiles.algorithms.Node} used during the drawing phase for marking the ending of a node group + * interval. + * @see yfiles.hierarchic.INodeData#type + */ + GROUP_END, + /** + * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node + * inserted to guarantee that a group is non-empty on the layer on which it is defined. + * @see yfiles.hierarchic.INodeData#type + */ + GROUP_LAYER_DUMMY, + /** + * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node + * inserted as a legal endpoint of an edge connecting to a group node. + * @see yfiles.hierarchic.INodeData#type + */ + PROXY_FOR_EDGE_AT_GROUP, + /** + * A constant describing a {@link yfiles.algorithms.Node} used during the sequencing and drawing phase for marking a dummy node + * inserted as a legal endpoint of an edge connecting a descendant node to a group node. It has degree 0 or 1 depending on + * whether or not the opposite node of the edge is assigned to the same layer. This kind of proxy nodes is only used if + * there are edges that shall connect to the group node without backloops. + * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting + */ + PROXY_FOR_CONTENT_EDGE_AT_GROUP, + /** + * A constant describing a {@link yfiles.algorithms.Node} used during sequencing and drawing phase for routing an {@link yfiles.algorithms.Edge} + * recursively. An {@link yfiles.algorithms.Edge} that connects to the content of a group node has to leave the group node at the + * bottom side and enter it at the top side. + * @see yfiles.hierarchic.INodeData#type + */ + RECURSIVE_EDGE_DUMMY + } 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, + * A port assignment strategy that distributes ports evenly along the border of the node. + *

+ * This is the default port assignment strategy of {@link yfiles.hierarchic.HierarchicLayout}. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment + */ + DEFAULT, /** - * 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, + * A port assignment strategy that 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. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment + */ + ON_GRID, /** - * 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, + * A port assignment strategy that places all edges on grid lines or sub-grid lines. + *

+ * If there are not enough grid lines for each port, the grid gets subdivided with sub-grid lines until each edge has space + * for its port. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#portAssignment + */ + ON_SUBGRID + } + export enum NodeLabelMode{ /** - * 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, + * A constant that prevents node labels from being considered during the layout. + *

+ * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode + */ + NEVER, /** - * 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, + * A constant that makes the algorithm consider node labels for self-loops, node placement and routing. + *

+ * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode + */ + CONSIDER_FOR_SELF_LOOPS, /** - * Mode constant describing the strategy where all ports are reset to the center - * of their nodes. - */ - NONE + * A constant that makes the algorithm consider node labels for node placement and routing, but not for self-loops. + *

+ * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode + */ + CONSIDER_FOR_DRAWING, + /** + * A constant that makes the algorithm consider node labels during routing only. + *

+ * It is used by {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode} and {@link yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode}. + *

+ * @see yfiles.hierarchic.NodeLayoutDescriptor#nodeLabelMode + */ + CONSIDER_FOR_ROUTING + } + export enum EdgeRoutingStyle{ + /** + * A routing style constant specifying that the edges should be orthogonal. Orthogonal edges only consist of vertical and + * horizontal segments. + */ + ORTHOGONAL, + /** + * A routing style constant specifying that the edges should be octilinear. Octilinear edges consist of vertical and + * horizontal segments as well as segments with slope -1 and 1. + */ + OCTILINEAR, + /** + * A routing style constant specifying that the edges should be polyline. + */ + POLYLINE + } + export enum GroupCompactionPolicy{ + /** + * A strategy specifying no horizontal group compaction. + *

+ * This means that group node contents will occupy nearly the same horizontal positions as when not grouped at all. + *

+ * @see yfiles.hierarchic.SimplexNodePlacer#groupCompactionStrategy + */ + NONE, + /** + * A strategy specifying maximal horizontal group compaction. + *

+ * This means that the node placer will try to minimize the horizontally occupied space for a group node. + *

+ * @see yfiles.hierarchic.SimplexNodePlacer#groupCompactionStrategy + */ + MAXIMAL + } + export enum RankingPolicy{ + /** + * A ranking policy that specifies that nodes are not re-ranked after the initial topological layering step. + */ + NO_RERANKING, + /** + * A ranking policy that specifies that nodes are re-ranked by an inexpensive downshift rule. + */ + DOWN_SHIFT, + /** + * A ranking policy that specifies that nodes are re-ranked by finding a spanning tree that contains only tight (length + * 1) edges. + */ + TIGHT_TREE + } + /** + * This layering algorithm implementation assigns nodes to layers given a mapping of nodes to layer IDs. + *

+ * The layer IDs are given by a {@link yfiles.algorithms.IDataProvider} that returns the integer layer ID of each node of the + * graph. Nodes with the same ID are in the same layer while the layers are sorted according to their IDs such that the + * smallest ID represents the top layer. + *

+ * @class yfiles.hierarchic.GivenLayersLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface GivenLayersLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class GivenLayersLayerer { + /** + * Creates an instance of {@link yfiles.hierarchic.GivenLayersLayerer}. + * @constructor + */ + constructor(); + /** + * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Convenience method that removes empty layers and ensures that the smallest layer has value 0. + * @param {yfiles.algorithms.Graph} graph the graph + * @param {yfiles.algorithms.IDataProvider} layerId the {@link yfiles.algorithms.IDataProvider} that returns an integer value (layer) for each node; the first layer has the number + * 0 + * @param {yfiles.algorithms.IDataAcceptor} normalizedLayerId the {@link yfiles.algorithms.IDataAcceptor} that will be filled by the layout algorithm and holds an integer value (layer ID + * after normalization) for each node + * @returns {number} the number of layers after the removal of empty layers + */ + normalize(graph:yfiles.algorithms.Graph,layerId:yfiles.algorithms.IDataProvider,normalizedLayerId:yfiles.algorithms.IDataAcceptor):number; + /** + * Data provider key for storing the layer IDs. + *

+ * This {@link yfiles.algorithms.IDataProvider} stores for each node the layer ID to which it belongs. Nodes with the same ID are + * in the same layer while the layers are sorted according to their IDs such that the smallest ID represents the top + * layer. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static LAYER_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + static $class:yfiles.lang.Class; + } + /** + * This class is a {@link yfiles.hierarchic.ISequencer} implementation that determines the sequence of nodes of the same {@link yfiles.hierarchic.ILayer layer} + * based on a given {@link yfiles.collections.IComparer. comparator} constraint. + * @class yfiles.hierarchic.GivenSequenceSequencer + * @implements {yfiles.hierarchic.ISequencer} + */ + export interface GivenSequenceSequencer extends Object,yfiles.hierarchic.ISequencer{} + export class GivenSequenceSequencer { + /** + * Creates a new instance of {@link yfiles.hierarchic.GivenSequenceSequencer} using a given {@link yfiles.collections.IComparer.} for the sequencing. + * @param {yfiles.collections.IComparer.} [c=null] + * @constructor + */ + constructor(c?:yfiles.collections.IComparer); + /** + * Calculates the sequence of the nodes within a {@link yfiles.hierarchic.ILayers} instance based on the given {@link yfiles.collections.IComparer.} instance. + *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} during the sequencing phase and finally writes back the + * calculated sequence using the {@link yfiles.hierarchic.ILayer#setNodeOrder} method. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the elements of the layers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} used for creating and destroying helper structures + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Gets or sets the {@link yfiles.collections.IComparer.} used by this {@link yfiles.hierarchic.GivenSequenceSequencer} to determine the sequence of the nodes. + * @type {yfiles.collections.IComparer.} + */ + sequenceComparer:yfiles.collections.IComparer; + static $class:yfiles.lang.Class; + } + /** + * Visitor interface that can be used to traverse the descendants of a group node + * @interface + */ + export interface IVisitor extends Object{ + /** + * Visits the descendants of a group node. + * @param {yfiles.algorithms.Node} node A descandant of the group node. + * @param {yfiles.algorithms.Node} parentNode A group node. + * @abstract + */ + visit(node:yfiles.algorithms.Node,parentNode:yfiles.algorithms.Node):void; + } + var IVisitor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class is responsible for managing hierarchically grouped graphs. + *

+ * The grouping information is provided through {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys + * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY}, {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} and + * {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}. + *

+ * @see yfiles.layout.GroupingSupport + * @see yfiles.layout.GroupingKeys + * @class yfiles.hierarchic.GroupingSupport + */ + export interface GroupingSupport extends Object{} + export class GroupingSupport { + /** + * Assigns edge group nodes to groups based on a given {@link yfiles.hierarchic.ILayers} instance. + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the elements in the layering + * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE + * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE + */ + assignEdgeGroupNodesToGroups(layers:yfiles.hierarchic.ILayers):void; + /** + * Assigns label nodes to groups. + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the elements in the layering + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} used temporarily for modifying the graph instance + * @see yfiles.hierarchic.NodeDataType#LABEL + * @see yfiles.hierarchic.NodeDataType#BEND + * @see yfiles.hierarchic.NodeDataType#GROUP_BEGIN + * @see yfiles.hierarchic.NodeDataType#GROUP_END + */ + assignLabelNodesToGroups(layers:yfiles.hierarchic.ILayers,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Returns the direct children of the given group node. + * @param {yfiles.algorithms.Node} groupNode the given group node + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} of all direct children or null if {@link yfiles.hierarchic.GroupingSupport} {@link yfiles.hierarchic.GroupingSupport#active is not active} + */ + getChildren(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns the descendant {@link yfiles.algorithms.Node}s of the given group node. + *

+ * The descendants are all direct or indirect children of a group node. + *

+ * @param {yfiles.algorithms.Node} groupNode the given group node + * @returns {yfiles.algorithms.NodeList} a {@link yfiles.algorithms.NodeList} of all descendants or null if {@link yfiles.hierarchic.GroupingSupport} {@link yfiles.hierarchic.GroupingSupport#active is not active} + */ + getDescendants(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns the parent group node of the given {@link yfiles.algorithms.Node} or null if the given node is a top-level node. + * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @returns {yfiles.algorithms.Node} the parent group node or null if the given node is a top-level node or if {@link yfiles.hierarchic.GroupingSupport} + * {@link yfiles.hierarchic.GroupingSupport#active is not active} + */ + getParentNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Hides the group nodes and incident edges from the graph. + */ + hideGroupNodes():void; + /** + * Returns whether or not the given node is a descendant {@link yfiles.algorithms.Node} of the given group node. + *

+ * The descendants are all direct or indirect children of a group node. + *

+ * @param {yfiles.algorithms.Node} node the given node + * @param {yfiles.algorithms.Node} groupNode the given group node + * @returns {boolean} true if the given node is a descendant of the given group node, false otherwise + */ + isDescendant(node:yfiles.algorithms.Node,groupNode:yfiles.algorithms.Node):boolean; + /** + * Returns whether or not the given {@link yfiles.algorithms.Node} is a non-empty group node. + * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @returns {boolean} true if the given node is a non-empty group node, false otherwise + */ + isGroupNode(node:yfiles.algorithms.Node):boolean; + /** + * Removes the current assignment of source/target edge groups from a given {@link yfiles.hierarchic.ILayers} instance. + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the elements in the layering + * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE + * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE + */ + removeEdgeGroupAssignment(layers:yfiles.hierarchic.ILayers):void; + /** + * Un-hides all previously hidden group nodes and incident edges. + */ + unhideGroupNodes():void; + /** + * Visits all descendant {@link yfiles.algorithms.Node}s of the given group node. + *

+ * The descendants are all direct or indirect children of a group node. + *

+ * @param {yfiles.algorithms.Node} groupNode the given group node + * @param {yfiles.hierarchic.IVisitor} visitor a {@link yfiles.hierarchic.IVisitor} implementation + */ + visitDescendants(groupNode:yfiles.algorithms.Node,visitor:yfiles.hierarchic.IVisitor):void; + /** + * Gets or sets the minimum distance between group nodes. + *

+ * The minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + minimumGroupDistance:number; + /** + * Gets whether or not {@link yfiles.hierarchic.GroupingSupport} is active. + * @type {boolean} + */ + active:boolean; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm arranges graphs in a hierarchic fashion. + *

+ * Layout Style The nodes are distributed into layers so that most of the edges point to the main layout direction. The order of the + * nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge + * routing styles available. Edges can be orthogonal, polyline or octilinear. + *

+ *

+ * Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the + * identification of dependencies and relationships among the nodes of the graph. Possible application domains are the + * following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and + * network management. + *

+ *

+ * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[137.81,67.5],[137.81,135],[718.44,67.5],[147.19,202.5],[305.62,135],[296.25,202.5],[771.88,450],[354.38,285],[290,367.5],[366.88,367.5],[400.62,67.5],[709.06,135],[709.06,202.5],[366.88,450],[79.69,202.5],[492.5,285],[501.88,367.5],[627.5,285],[357.5,532.5],[363.75,202.5],[286.88,285],[425,532.5],[400.62,135],[569.38,450],[569.38,367.5],[155,450],[434.38,367.5],[636.88,367.5],[84.38,285],[151.88,285],[222.5,532.5],[290,532.5],[155,532.5],[87.5,532.5],[20,532.5],[219.38,285],[69.38,367.5],[713.75,285],[704.38,367.5],[771.88,367.5],[848.75,285],[906.88,367.5],[839.38,367.5],[400.62,0]],"e":[[0,1,0,18.75,0,-18.75],[1,3,9.38,18.75,0,-18.75],[0,4,12.5,18.75,0,-18.75,[169.06,120,324.38,120]],[4,5,-9.38,18.75,0,-18.75],[2,6,9.38,18.75,12.5,-18.75,[746.56,120,959.38,120,959.38,420,803.12,420]],[5,7,9.38,18.75,0,-18.75,[324.38,255,373.12,255]],[7,8,0,18.75,0,-18.75,[373.12,352.5,308.75,352.5]],[7,9,12.5,18.75,0,-18.75],[2,11,-9.38,18.75,0,-18.75],[11,12,0,18.75,0,-18.75],[9,13,0,18.75,0,-18.75],[1,14,-9.38,18.75,0,-18.75,[147.19,187.5,98.44,187.5]],[12,15,-14.06,18.75,0,-18.75,[713.75,255,511.25,255]],[15,16,9.38,18.75,0,-18.75],[12,17,-4.69,18.75,0,-18.75,[723.13,270,646.25,270]],[13,18,-9.38,18.75,0,-18.75],[4,19,9.38,18.75,0,-18.75,[333.75,187.5,382.5,187.5]],[5,20,-9.38,18.75,0,-18.75],[13,21,9.38,18.75,0,-18.75,[395,502.5,443.75,502.5]],[10,22,0,18.75,0,-18.75],[22,23,0,18.75,-12.5,-18.75,[419.38,420,575.62,420]],[17,24,-9.38,18.75,0,-18.75,[636.88,337.5,588.12,337.5]],[24,23,0,18.75,0,-18.75],[0,25,-12.5,18.75,-9.38,-18.75,[144.06,120,54.38,120,54.38,420,164.38,420]],[8,25,-9.38,18.75,9.38,-18.75,[299.38,420,183.12,420]],[15,26,-9.38,18.75,0,-18.75,[501.88,337.5,453.12,337.5]],[17,27,9.38,18.75,0,-18.75],[27,6,0,18.75,-12.5,-18.75,[655.62,420,778.12,420]],[3,28,-4.69,18.75,0,-18.75,[161.25,270,103.12,270]],[3,29,4.69,18.75,0,-18.75],[25,30,7.5,18.75,0,-18.75,[181.25,517.5,241.25,517.5]],[25,31,15,18.75,-9.38,-18.75,[188.75,502.5,299.38,502.5]],[8,31,9.38,18.75,9.38,-18.75],[25,32,0,18.75,0,-18.75],[25,33,-7.5,18.75,0,-18.75,[166.25,517.5,106.25,517.5]],[25,34,-15,18.75,0,-18.75,[158.75,502.5,38.75,502.5]],[3,35,14.06,18.75,0,-18.75,[180,255,238.12,255]],[3,36,-14.06,18.75,-9.38,-18.75,[151.88,255,69.38,255,69.38,337.5,78.75,337.5]],[7,36,-12.5,18.75,9.38,-18.75,[360.62,337.5,97.5,337.5]],[12,37,4.69,18.75,0,-18.75],[37,38,-9.38,18.75,0,-18.75],[38,23,0,18.75,12.5,-18.75,[723.12,435,600.62,435]],[37,39,9.38,18.75,0,-18.75,[741.88,337.5,790.62,337.5]],[39,6,0,18.75,0,-18.75],[12,40,14.06,18.75,0,-18.75,[741.88,255,867.5,255]],[40,41,9.38,18.75,0,-18.75,[876.88,337.5,925.62,337.5]],[40,42,-9.38,18.75,0,-18.75],[43,0,-12.5,18.75,0,-18.75,[406.88,52.5,156.56,52.5]],[43,2,12.5,18.75,0,-18.75,[431.88,52.5,737.19,52.5]],[43,10,0,18.75,0,-18.75]],"vp":[20.0,0.0,940.0,570.0]}} Hierarchic Layout obtained with default settingsConceptThe layout algorithm runs in three main phases: + *

+ *
    + *
  • + * Layering � The nodes are distributed into layers by means of {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer} or + * {@link yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer}, respectively. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the + * layers are ordered vertically top-to-bottom. + *
  • + *
  • + * Sequencing � The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To + * specify the sequencing algorithm, use {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer} or {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer}. + *
  • + *
  • Drawing � The layout algorithm assigns the final coordinates to all nodes and routes the edges.
  • + *
+ *

+ * Features + *

+ *

+ * This layout algorithm is able to 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 the layout mode to {@link yfiles.hierarchic.LayoutMode#INCREMENTAL}. Then register a + * {@link yfiles.algorithms.IDataProvider} (e.g. use {@link yfiles.algorithms.Maps#createHashedDataMap}) with the graph using the {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY} + * DataProvider key and associate the hints obtained from the {@link yfiles.hierarchic.IIncrementalHintsFactory} with the elements + * to be added incrementally. + *

+ *

+ * {@link yfiles.hierarchic.NodeLayoutDescriptor} and {@link yfiles.hierarchic.EdgeLayoutDescriptor} instances can be used for specifying + * individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound + * to the graph using {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + * or {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If there is no descriptor assigned to some + * nodes/edges, a default descriptor will be used. To set default descriptors use {@link yfiles.hierarchic.HierarchicLayout#nodeLayoutDescriptor} and {@link yfiles.hierarchic.HierarchicLayout#edgeLayoutDescriptor}. + *

+ *

+ * {@link yfiles.hierarchic.HierarchicLayout} 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 {@link yfiles.layout.PortCandidate}s connects to nodes with {@link yfiles.layout.PortCandidateSet}s, + * the layouter will try to match both collections to find an appropriate port. In case there is no matching port + * candidate, a {@link yfiles.layout.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 {@link yfiles.layout.PortConstraint}s and + * {@link yfiles.layout.PortCandidate}s in the same layout. + *

+ *

+ * The edge grouping feature of this layout algorithm is restricted to normal, hierarchic edges. Edges with {@link yfiles.hierarchic.EdgeLayoutDescriptor#recursiveEdgeStyle recursive edge style} + * {@link yfiles.hierarchic.RecursiveEdgeStyle#DIRECTED} or {@link yfiles.hierarchic.RecursiveEdgeStyle#UNDIRECTED} will not be grouped. + * They are also not grouped when enabling {@link yfiles.hierarchic.HierarchicLayout#automaticEdgeGrouping automatic edge grouping}. + *

+ * @class yfiles.hierarchic.HierarchicLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface HierarchicLayout extends yfiles.layout.MultiStageLayout{} + export class HierarchicLayout { + /** + * Creates a new {@link yfiles.hierarchic.HierarchicLayout} instance with the default settings. + * @constructor + */ + constructor(); + /** + * Configures the core layout algorithm with the settings of this {@link yfiles.hierarchic.HierarchicLayout} instance. + *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayout#applyLayoutCore} before the actual layout is calculated. It + * may be overridden in order to manually reconfigure the core layout algorithm. + *

+ *

+ * This implementation will temporarily set a {@link yfiles.hierarchic.PortCandidateOptimizer} if a {@link yfiles.algorithms.IDataProvider} + * is registered with {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY} and no {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} is assigned. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.HierarchicLayoutCore} coreLayouter the given core layout algorithm instance + * @protected + */ + configureCoreLayout(graph:yfiles.layout.LayoutGraph,coreLayouter:yfiles.hierarchic.HierarchicLayoutCore):void; + /** + * Returns a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance that will be used during the various phases of the layout + * algorithm to determine the drawing details of the edges of the graph. + *

+ * This method may be overridden to create a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance with different + * configuration settings. + *

+ * @returns {yfiles.hierarchic.EdgeLayoutDescriptor} a new {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance + * @protected + */ + createEdgeLayoutDescriptor():yfiles.hierarchic.EdgeLayoutDescriptor; + /** + * Returns a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance. + *

+ * This method may be overridden to create a new {@link yfiles.hierarchic.HierarchicLayoutCore} object with different configuration + * settings. + *

+ *

+ * This factory method provides the initial {@link yfiles.hierarchic.HierarchicLayoutCore} instance. + *

+ * @returns {yfiles.hierarchic.HierarchicLayoutCore} a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance + * @protected + */ + createHierarchicLayoutCore():yfiles.hierarchic.HierarchicLayoutCore; + /** + * Returns a {@link yfiles.hierarchic.IIncrementalHintsFactory} instance that must be used to obtain hints to be associated with + * graph elements that should be laid out incrementally. + *

+ * Use this factory and a {@link yfiles.algorithms.IDataProvider} that is registered to the graph using the {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY} + * key to associate appropriate hints with the graph elements that should be laid out incrementally by the algorithm. + *

+ * @returns {yfiles.hierarchic.IIncrementalHintsFactory} a new {@link yfiles.hierarchic.IIncrementalHintsFactory} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#createIncrementalHintsFactory + * @see yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY + * @see yfiles.algorithms.Graph#addDataProvider + * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @see yfiles.hierarchic.LayoutMode#INCREMENTAL + */ + createIncrementalHintsFactory():yfiles.hierarchic.IIncrementalHintsFactory; + /** + * Creates and registers an incremental layer constraint factory for an {@link yfiles.graph.IGraph}. + * @param {yfiles.graph.IGraph} graph The graph for which the factory is created + * @returns {yfiles.hierarchic.ILayerConstraintFactory} the sequence constraint factory + */ + createLayerConstraintFactory(graph:yfiles.graph.IGraph):yfiles.hierarchic.ILayerConstraintFactory; + /** + * Returns a {@link yfiles.hierarchic.ILayerConstraintFactory} instance that can be used for specifying layer constraints for the + * given graph. + *

+ * The instance is usually bound to {@link yfiles.algorithms.Graph} instance + * graph, i.e., if the input graph for the layerer changes, a new instance must be retrieved. This instance can be used for + * creating constraints for this graph instance. + *

+ *

+ * You can create an instance without binding it to a graph instance initially by passing a null parameter. In that case, + * you must bind the returned instance to the graph, see {@link yfiles.hierarchic.HierarchicLayout#LAYER_CONSTRAINTS_MEMENTO_DP_KEY} + * and {@link yfiles.hierarchic.ILayerConstraintFactory#memento}. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {yfiles.hierarchic.ILayerConstraintFactory} a new {@link yfiles.hierarchic.ILayerConstraintFactory} instance + */ + createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ILayerConstraintFactory; + /** + * Returns a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance that will be used during the various phases of the layout + * algorithm to determine the drawing details of the nodes of the graph. + *

+ * This method may be overridden to create a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance with different + * configuration settings. + *

+ * @returns {yfiles.hierarchic.NodeLayoutDescriptor} a new {@link yfiles.hierarchic.NodeLayoutDescriptor} instance + * @protected + */ + createNodeLayoutDescriptor():yfiles.hierarchic.NodeLayoutDescriptor; + /** + * Creates and registers a sequencer constraint factory for an {@link yfiles.graph.IGraph}. + * @param {yfiles.graph.IGraph} graph The graph. + * @returns {yfiles.hierarchic.ISequenceConstraintFactory} the sequence constraint factory + */ + createSequenceConstraintFactory(graph:yfiles.graph.IGraph):yfiles.hierarchic.ISequenceConstraintFactory; + /** + * Returns a {@link yfiles.hierarchic.ISequenceConstraintFactory} instance that can be used for specifying sequence constraints for + * the given graph. + *

+ * For these sequence constraints to have any effect, the {@link yfiles.hierarchic.ISequencer} that determines the in-layer node + * order (sequence) has to support constraints. Both, {@link yfiles.hierarchic.DefaultLayerSequencer DefaultLayerSequencer} and the incremental sequencer used internally support + * sequence constraints. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.hierarchic.ISequenceConstraintFactory} a {@link yfiles.hierarchic.ISequenceConstraintFactory} instance + * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer + */ + createSequenceConstraintFactory(graph:yfiles.layout.LayoutGraph):yfiles.hierarchic.ISequenceConstraintFactory; + /** + * Disposes of the core layout algorithm. + *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayout#applyLayoutCore} after the actual layout is calculated. It + * may be overridden in order to revert a custom configuration made in + * {@link yfiles.hierarchic.HierarchicLayout#configureCoreLayout}. + *

+ *

+ * This implementation will remove the {@link yfiles.hierarchic.PortCandidateOptimizer} that was created in case a {@link yfiles.algorithms.IDataProvider} + * is registered with {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY} and no {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} was initially assigned. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.HierarchicLayoutCore} coreLayouter the given core layout algorithm instance + * @protected + */ + disposeCoreLayout(graph:yfiles.layout.LayoutGraph,coreLayouter:yfiles.hierarchic.HierarchicLayoutCore):void; + /** + * Returns the mirror mask of the {@link yfiles.layout.MultiStageLayout#orientationLayout orientation layouter}. + *

+ * It may be overridden in order to configure a different mirror mask. + *

+ * @returns {yfiles.layout.MirrorModes} the mirror mask + * @protected + */ + getMirrorMode():yfiles.layout.MirrorModes; + /** + * Data provider key for specifying the directedness of edges. + *

+ * Generally, the hierarchic layout algorithm assigns nodes to layers such that most of the edges point in the + * {@link yfiles.layout.MultiStageLayout#layoutOrientation main layout direction}. The directedness of an edge specifies whether it should comply with this strategy. More + * precisely, a value of 1 means that the edge should fully comply, a value of -1 that it should comply inversely (the edge + * should point against the main layout direction), and a value of 0 means that the direction doesn't matter at all and the + * endpoints of the edges may be placed at the same layer. If there are conflicting preferences, edges with higher absolute + * values are more likely to point in the desired direction. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_DIRECTEDNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for defining the priority of critical edges. + *

+ * Critical edges highlight different edge paths that are relevant for a user. The layouter tries to vertically align each + * node pair that is connected by a critical edge. Conflicts between different critical edges are always resolved in favor + * of the higher priority. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static CRITICAL_EDGE_PRIORITY_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the thickness of the edges. + *

+ * The specified non-negative thickness is considered when calculating minimum distances so that there are no overlaps + * between edges and other graph elements. By default, each edge has thickness 0. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_THICKNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying incremental hints. + *

+ * Incremental hints are created using an {@link yfiles.hierarchic.HierarchicLayout#createIncrementalHintsFactory incremental hints factory}. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY + * @see yfiles.hierarchic.IIncrementalHintsFactory + * @const + * @static + * @type {yfiles.algorithms.GraphObjectDpKey.} + */ + static INCREMENTAL_HINTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey; + /** + * Data acceptor key for publishing the layer IDs for all nodes in the graph. + * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static LAYER_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data acceptor key for publishing the index inside their layer for all nodes in the graph. + * @see yfiles.hierarchic.HierarchicLayoutCore#SEQUENCE_INDEX_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SEQUENCE_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for defining swimlanes for the nodes. + *

+ * The layout algorithm will arrange nodes in swimlanes according to the registered descriptors. + *

+ *

+ * Layout information about the swimlanes is finally written back to the descriptor instances. Instances can be shared + * among multiple nodes in the same lane. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SWIMLANE_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for associating an alternative bounds with the collapsed/expanded group. + *

+ * When running in {@link yfiles.hierarchic.LayoutMode#INCREMENTAL incremental} + * {@link yfiles.hierarchic.HierarchicLayout#layoutMode layout mode}, the alternative bounds of the collapsed/expanded group will be used during the layering and sequencing + * phase of the algorithm. + *

+ * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_EDGE_PATH_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static ALTERNATIVE_GROUP_BOUNDS_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for associating alternative paths for edges connecting to groups, group content or folder nodes. + *

+ * When running in {@link yfiles.hierarchic.LayoutMode#INCREMENTAL incremental} + * {@link yfiles.hierarchic.HierarchicLayout#layoutMode layout mode}, the alternative edge paths are considered during the routing of fixed (i.e., non-incremental) edges. + *

+ *

+ * The alternative paths should be used in conjunction with {@link yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY alternative group bounds} to achieve more stable layout results + * when collapsing/expanding a group node as follows: + *

+ *
    + *
  1. + * Collapsing: edges adjacent to the group itself and edges where one of the endpoints (source/target) lies inside the + * group should get the path before collapsing the group as alternative path. If both endpoints are either inside or outside the + * group, no alternative path is required. + *
  2. + *
  3. + * Expanding: edges adjacent to the expanded folder node (which is now a group) should get the path before expanding as + * alternative path. + *
  4. + *
+ * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static ALTERNATIVE_EDGE_PATH_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for marking folder nodes. + *

+ * When using recursive edge styles in incremental mode, edges will also start at the bottom and end at the top of marked + * folder nodes. This will keep the edge routes more stable since the connection sides won't change. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FOLDER_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for storing the constraint graph + *

+ * A v1 before v2 constraint is represented as an edge between the representatives of v1 and v2 in the constraint graph. + *

+ * @const + * @static + * @type {yfiles.algorithms.GraphDpKey.} + */ + static SEQUENCE_CONSTRAINTS_MEMENTO_DP_KEY:yfiles.algorithms.GraphDpKey; + /** + * Data provider key for storing the constraint graph + * @const + * @static + * @type {yfiles.algorithms.GraphDpKey.} + */ + static LAYER_CONSTRAINTS_MEMENTO_DP_KEY:yfiles.algorithms.GraphDpKey; + /** + * Gets or sets the group layer alignment strategy used for recursive group layering. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown group alignment policy is given + * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering + * @type {yfiles.hierarchic.GroupAlignmentPolicy} + */ + groupAlignmentPolicy:yfiles.hierarchic.GroupAlignmentPolicy; + /** + * Gets or sets whether or not layer compaction for recursive group layering is active. + *

+ * The number of node layers is decreased if possible without reversing edge directions. The resulting layering tries to + * keep the layer span of a group node minimum while minimizing the overall vertical space. + *

+ * @see yfiles.hierarchic.HierarchicLayout#recursiveGroupLayering + * @type {boolean} + */ + compactGroups:boolean; + /** + * Gets or sets the policy that specifies how to arrange connected components. + * @throws {Stubs.Exceptions.ArgumentError} if the specified policy does not match a default component arrangement policy + * @type {yfiles.hierarchic.ComponentArrangementPolicy} + */ + componentArrangementPolicy:yfiles.hierarchic.ComponentArrangementPolicy; + /** + * Gets or sets the time limit (in milliseconds) set for the layout algorithm. + *

+ * Values have to be greater or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets whether or not groups are respected during the layering stage. + *

+ * If this option is 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 it is disabled, group information is ignored for the layering step. + *

+ *

+ * If the graph is flat, this setting is ignored. + *

+ * @see yfiles.hierarchic.HierarchicLayout#compactGroups + * @type {boolean} + */ + recursiveGroupLayering:boolean; + /** + * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. + *

+ * When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid + * spacing. + *

+ * @see yfiles.hierarchic.IIncrementalHintsFactory + * @type {number} + */ + gridSpacing:number; + /** + * Gets or sets whether or not reversed edges should be routed as back-loops. + *

+ * When this option is enabled, back-loops attach to the same node sides as the other edges, i.e., for layout orientation + * top-to-bottom, they leave their source at the bottom and enter their target at the top. + *

+ * @type {boolean} + */ + backLoopRouting:boolean; + /** + * Gets or sets whether or not self-loops should be routed in a similar manner as back-loops. + *

+ * Self-loops will start at the bottom of their attached nodes and end at the top of them. + *

+ * @see yfiles.hierarchic.HierarchicLayout#backLoopRouting + * @type {boolean} + */ + backLoopRoutingForSelfLoops:boolean; + /** + * Gets or sets whether or not edges are grouped automatically. + *

+ * 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. + *

+ * @type {boolean} + */ + automaticEdgeGrouping:boolean; + /** + * Gets or sets whether or not edges should be routed orthogonally. + *

+ * When orthogonal routing is enabled, all resulting edge paths will be composed of vertical and horizontal segments, + * only. + *

+ * @type {boolean} + */ + orthogonalRouting:boolean; + /** + * Gets or sets whether or not the layout algorithm reserves space for labels and places them. + *

+ * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on + * {@link yfiles.layout.IEdgeLabelLayout}. + *

+ *

+ * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} + * and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to true. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if integrated labeling should be enabled but the current {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is not of type + * {@link yfiles.layout.LabelLayoutTranslator} + * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though integrated labeling was enabled + * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). + * @type {boolean} + */ + integratedEdgeLabeling:boolean; + /** + * Gets or sets whether or not the layout algorithm considers node labels when calculating node positions to avoid + * overlaps. + *

+ * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} + * and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to true. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if this property should be enabled but the current {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is not of type + * {@link yfiles.layout.LabelLayoutTranslator} + * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though this property was enabled + * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). + * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets the minimum distance between two adjacent layers. + *

+ * The specified distance should have a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative + * @type {number} + */ + minimumLayerDistance:number; + /** + * Gets or sets whether or not to stop the layout algorithm after the layering step. + *

+ * By then, each node will be assigned to a layer. Since the sequencing and drawing phases are skipped, the order of the + * nodes within a layer matches the initial order of the nodes, edges won't be routed and the nodes won't get coordinates + * assigned. + *

+ *

+ * The calculated layering information can be retrieved from the {@link yfiles.algorithms.IDataProvider} registered with the key + * {@link yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY}. + *

+ * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY + * @type {boolean} + */ + stopAfterLayering:boolean; + /** + * Gets or sets whether or not to stop the layout algorithm after the sequencing step. + *

+ * By then, each node will be assigned to a layer and will have a place in the sequence of nodes in this layer. Since the + * drawing phase is skipped, edges won't be routed and the nodes won't get coordinates assigned. + *

+ *

+ * The calculated layering and sequencing information can be retrieved from the {@link yfiles.algorithms.IDataProvider}s registered + * with the keys {@link yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY} and + * {@link yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY}. + *

+ * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY + * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY + * @type {boolean} + */ + stopAfterSequencing:boolean; + /** + * Gets or sets the minimum distance between two adjacent nodes in one layer. + *

+ * All values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative + * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of + * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} + * @type {number} + */ + nodeToNodeDistance:number; + /** + * Gets or sets the minimum distance between an edge and an adjacent node in one layer. + *

+ * All values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative + * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of + * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} + * @type {number} + */ + nodeToEdgeDistance:number; + /** + * Gets or sets the minimum distance between two adjacent edges in one layer. + *

+ * All values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative + * @throws {Stubs.Exceptions.InvalidOperationError} if the current {@link yfiles.hierarchic.IDrawingDistanceCalculator} is not an instance of + * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} + * @type {number} + */ + edgeToEdgeDistance:number; + /** + * Gets or sets whether or not to separate layers. + *

+ * In case layers are not separated, nodes of a layer may extend into adjacent layers. Otherwise, nodes of different layers + * are strictly separated, i.e., layers are placed below each other. + *

+ * @type {boolean} + */ + separateLayers:boolean; + /** + * Gets the {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} that is registered with the layout algorithm by default. + * @throws {Stubs.Exceptions.InvalidOperationError} if the current instance returned by {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator} is not an instance of {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} + * @protected + * @type {yfiles.hierarchic.DefaultDrawingDistanceCalculator} + */ + defaultDrawingDistanceCalculator:yfiles.hierarchic.DefaultDrawingDistanceCalculator; + /** + * Gets the current layout algorithm instance. + *

+ * By default, this method will return a {@link yfiles.hierarchic.HierarchicLayoutCore} instance created with + * {@link yfiles.hierarchic.HierarchicLayout#createHierarchicLayoutCore}. + *

+ * @see yfiles.hierarchic.HierarchicLayout#createHierarchicLayoutCore + * @type {yfiles.hierarchic.HierarchicLayoutCore} + */ + hierarchicLayoutCore:yfiles.hierarchic.HierarchicLayoutCore; + /** + * Gets or sets a predefined layering strategy for the {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayerer from scratch} layerer. + *

+ * 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. + *

+ *

+ * 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 such that as much edges of the graph as possible will point to the main layout + * direction, i.e., the start nodes of the edges will be in a layer with a smaller number than the corresponding end nodes. + * Also, a hierarchical layering will never put two connected nodes in the same layer. + *

+ *

+ * This method wraps the internal implementations into a {@link yfiles.hierarchic.MultiComponentLayerer} instance so that it is + * possible to specify the behavior of the algorithm if the {@link yfiles.layout.MultiStageLayout#componentLayoutEnabled component layouter} is disabled. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown strategy is given + * @type {yfiles.hierarchic.LayeringStrategy} + */ + fromScratchLayeringStrategy:yfiles.hierarchic.LayeringStrategy; + /** + * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance that obtains the layering for the nodes if the layout algorithm + * runs in {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH From Scratch mode}. + *

+ * If the graph consists of multiple components, then the {@link yfiles.hierarchic.ILayerer} instance should be wrapped in + * {@link yfiles.hierarchic.MultiComponentLayerer}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ILayerer} is null + * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @type {yfiles.hierarchic.ILayerer} + */ + fromScratchLayerer:yfiles.hierarchic.ILayerer; + /** + * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance that calculates the node sequence if the layout algorithm runs in + * {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH From Scratch mode}. + * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ISequencer} is null + * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer + * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @type {yfiles.hierarchic.ISequencer} + */ + fromScratchSequencer:yfiles.hierarchic.ISequencer; + /** + * Gets or sets the {@link yfiles.hierarchic.INodePlacer} instance that will calculate the final node placement of the layout. + * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.INodePlacer} is null + * @type {yfiles.hierarchic.INodePlacer} + */ + nodePlacer:yfiles.hierarchic.INodePlacer; + /** + * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance that obtains the layering for fixed nodes during the incremental + * layout run. + * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.ILayerer} is null + * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @type {yfiles.hierarchic.ILayerer} + */ + fixedElementsLayerer:yfiles.hierarchic.ILayerer; + /** + * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance that calculates the sequence of the fixed nodes during the + * incremental layout run. + * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.hierarchic.ISequencer} is null + * @see yfiles.hierarchic.HierarchicLayout#layoutMode + * @type {yfiles.hierarchic.ISequencer} + */ + fixedElementsSequencer:yfiles.hierarchic.ISequencer; + /** + * Gets or sets the layout mode this layouter should use for upcoming layouts. + *

+ * Depending on the mode the layout algorithm will use different {@link yfiles.hierarchic.ILayerer} and {@link yfiles.hierarchic.ISequencer} + * implementations. + *
+ *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given layout mode is unknown + * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer + * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer + * @type {yfiles.hierarchic.LayoutMode} + */ + layoutMode:yfiles.hierarchic.LayoutMode; + /** + * Gets or sets the {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific + * layout descriptor assigned. + *

+ * By default, this method will return a {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance created with + * {@link yfiles.hierarchic.HierarchicLayout#createEdgeLayoutDescriptor}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the {@link yfiles.hierarchic.EdgeLayoutDescriptor} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.hierarchic.EdgeLayoutDescriptor} + */ + edgeLayoutDescriptor:yfiles.hierarchic.EdgeLayoutDescriptor; + /** + * Gets or sets the {@link yfiles.hierarchic.NodeLayoutDescriptor} instance used for all those nodes that do not have a specific + * layout descriptor assigned. + *

+ * By default, this method will return a {@link yfiles.hierarchic.NodeLayoutDescriptor} instance created with + * {@link yfiles.hierarchic.HierarchicLayout#createNodeLayoutDescriptor}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given {@link yfiles.hierarchic.NodeLayoutDescriptor} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY + * @see yfiles.hierarchic.HierarchicLayout#createNodeLayoutDescriptor + * @type {yfiles.hierarchic.NodeLayoutDescriptor} + */ + nodeLayoutDescriptor:yfiles.hierarchic.NodeLayoutDescriptor; + static $class:yfiles.lang.Class; + } + /** + * This class arranges graphs in a hierarchic/layered fashion and supports complete re-layout as well as incremental graph + * layout. + *

+ * Note that class {@link yfiles.hierarchic.HierarchicLayout} offers a facade to this class which is easier to use. Hence, we + * strongly recommend to not directly use class {@link yfiles.hierarchic.HierarchicLayoutCore}. + *

+ *

+ * Layout Style The nodes are distributed into layers such that most of the edges point to the main layout direction. The order of the + * nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge + * routing styles available. Edges can be orthogonal, polyline or octilinear. + *

+ *

+ * Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the + * identification of dependencies and relationships among the nodes of the graph. Possible application domains are the + * following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and + * network management. + *

+ *

+ * {@graph {"ann":{"s":[37.5,37.5],"d":1},"n":[[137.81,67.5],[137.81,135],[718.44,67.5],[147.19,202.5],[305.62,135],[296.25,202.5],[771.88,450],[354.38,285],[290,367.5],[366.88,367.5],[400.62,67.5],[709.06,135],[709.06,202.5],[366.88,450],[79.69,202.5],[492.5,285],[501.88,367.5],[627.5,285],[357.5,532.5],[363.75,202.5],[286.88,285],[425,532.5],[400.62,135],[569.38,450],[569.38,367.5],[155,450],[434.38,367.5],[636.88,367.5],[84.38,285],[151.88,285],[222.5,532.5],[290,532.5],[155,532.5],[87.5,532.5],[20,532.5],[219.38,285],[69.38,367.5],[713.75,285],[704.38,367.5],[771.88,367.5],[848.75,285],[906.88,367.5],[839.38,367.5],[400.62,0]],"e":[[0,1,0,18.75,0,-18.75],[1,3,9.38,18.75,0,-18.75],[0,4,12.5,18.75,0,-18.75,[169.06,120,324.38,120]],[4,5,-9.38,18.75,0,-18.75],[2,6,9.38,18.75,12.5,-18.75,[746.56,120,959.38,120,959.38,420,803.12,420]],[5,7,9.38,18.75,0,-18.75,[324.38,255,373.12,255]],[7,8,0,18.75,0,-18.75,[373.12,352.5,308.75,352.5]],[7,9,12.5,18.75,0,-18.75],[2,11,-9.38,18.75,0,-18.75],[11,12,0,18.75,0,-18.75],[9,13,0,18.75,0,-18.75],[1,14,-9.38,18.75,0,-18.75,[147.19,187.5,98.44,187.5]],[12,15,-14.06,18.75,0,-18.75,[713.75,255,511.25,255]],[15,16,9.38,18.75,0,-18.75],[12,17,-4.69,18.75,0,-18.75,[723.13,270,646.25,270]],[13,18,-9.38,18.75,0,-18.75],[4,19,9.38,18.75,0,-18.75,[333.75,187.5,382.5,187.5]],[5,20,-9.38,18.75,0,-18.75],[13,21,9.38,18.75,0,-18.75,[395,502.5,443.75,502.5]],[10,22,0,18.75,0,-18.75],[22,23,0,18.75,-12.5,-18.75,[419.38,420,575.62,420]],[17,24,-9.38,18.75,0,-18.75,[636.88,337.5,588.12,337.5]],[24,23,0,18.75,0,-18.75],[0,25,-12.5,18.75,-9.38,-18.75,[144.06,120,54.38,120,54.38,420,164.38,420]],[8,25,-9.38,18.75,9.38,-18.75,[299.38,420,183.12,420]],[15,26,-9.38,18.75,0,-18.75,[501.88,337.5,453.12,337.5]],[17,27,9.38,18.75,0,-18.75],[27,6,0,18.75,-12.5,-18.75,[655.62,420,778.12,420]],[3,28,-4.69,18.75,0,-18.75,[161.25,270,103.12,270]],[3,29,4.69,18.75,0,-18.75],[25,30,7.5,18.75,0,-18.75,[181.25,517.5,241.25,517.5]],[25,31,15,18.75,-9.38,-18.75,[188.75,502.5,299.38,502.5]],[8,31,9.38,18.75,9.38,-18.75],[25,32,0,18.75,0,-18.75],[25,33,-7.5,18.75,0,-18.75,[166.25,517.5,106.25,517.5]],[25,34,-15,18.75,0,-18.75,[158.75,502.5,38.75,502.5]],[3,35,14.06,18.75,0,-18.75,[180,255,238.12,255]],[3,36,-14.06,18.75,-9.38,-18.75,[151.88,255,69.38,255,69.38,337.5,78.75,337.5]],[7,36,-12.5,18.75,9.38,-18.75,[360.62,337.5,97.5,337.5]],[12,37,4.69,18.75,0,-18.75],[37,38,-9.38,18.75,0,-18.75],[38,23,0,18.75,12.5,-18.75,[723.12,435,600.62,435]],[37,39,9.38,18.75,0,-18.75,[741.88,337.5,790.62,337.5]],[39,6,0,18.75,0,-18.75],[12,40,14.06,18.75,0,-18.75,[741.88,255,867.5,255]],[40,41,9.38,18.75,0,-18.75,[876.88,337.5,925.62,337.5]],[40,42,-9.38,18.75,0,-18.75],[43,0,-12.5,18.75,0,-18.75,[406.88,52.5,156.56,52.5]],[43,2,12.5,18.75,0,-18.75,[431.88,52.5,737.19,52.5]],[43,10,0,18.75,0,-18.75]],"vp":[20.0,0.0,940.0,570.0]}} Hierarchic Layout obtained with default settingsConceptThe layout algorithm runs in three main phases: + *

+ *
    + *
  • + * Layering � The nodes are distributed into layers by means of + * {@link yfiles.hierarchic.HierarchicLayoutCore#layerer}. If the layout orientation is top-to-bottom, the nodes in each layer are arranged horizontally while the layers are + * ordered vertically top-to-bottom. + *
  • + *
  • + * Sequencing � The order of the nodes in each layer is determined such that the number of edge crossings is as small as possible. To + * specify the sequencing algorithm, use {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer}. + *
  • + *
  • Drawing � The layout algorithm assigns the final coordinates to all nodes and routes the edges.
  • + *
+ *

+ * Features + *

+ *

+ * In order to customize this layout algorithm, modify the {@link yfiles.hierarchic.HierarchicLayoutCore#layerer Layerer}, {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer Sequencer}, {@link yfiles.hierarchic.HierarchicLayoutCore#portAllocator PortAllocator}, {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator DrawingDistanceCalculator}, + * and {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer NodePlacer} instances. + *

+ *

+ * This layout algorithm is able to incrementally add new elements to an existing drawing of a graph. In order to add + * elements incrementally, register a {@link yfiles.algorithms.IDataProvider} with the graph using the {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY} + * DataProvider key and associate the hints obtained from the {@link yfiles.hierarchic.IIncrementalHintsFactory} with the elements + * to be added incrementally. + *

+ *

+ * {@link yfiles.hierarchic.NodeLayoutDescriptor} and {@link yfiles.hierarchic.EdgeLayoutDescriptor} instances can be used for specifying + * individual information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound + * to the graph using {@link yfiles.algorithms.IDataProvider}s registered with {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + * or {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ *

+ * {@link yfiles.hierarchic.HierarchicLayoutCore} 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 {@link yfiles.layout.PortCandidate}s connects to nodes with + * {@link yfiles.layout.PortCandidateSet}s, the layouter will try to match both collections to find an appropriate port. In case + * there is no matching port candidate, a {@link yfiles.layout.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 + * {@link yfiles.layout.PortConstraint}s and {@link yfiles.layout.PortCandidate}s in the same layout. + *

+ *

+ * This algorithm specifies a {@link yfiles.layout.LabelLayoutTranslator} instance as the current {@link yfiles.layout.MultiStageLayout#labeling} and configures it such that the + * node labels are passed to it 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. + *

+ *

+ * Moreover, this algorithm supports layer and sequence constraints. These constraints can be specified using a {@link yfiles.hierarchic.ILayerConstraintFactory} + * and {@link yfiles.hierarchic.ISequenceConstraintFactory}, respectively. + *

+ * @see yfiles.hierarchic.HierarchicLayout + * @see yfiles.hierarchic.ILayerer + * @see yfiles.hierarchic.ISequencer + * @see yfiles.hierarchic.IPortAllocator + * @see yfiles.hierarchic.IDrawingDistanceCalculator + * @see yfiles.hierarchic.INodePlacer + * @class yfiles.hierarchic.HierarchicLayoutCore + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface HierarchicLayoutCore extends yfiles.layout.MultiStageLayout{} + export class HierarchicLayoutCore { + /** + * Creates a new {@link yfiles.hierarchic.HierarchicLayoutCore} instance with the default settings. + * @see yfiles.hierarchic.HierarchicLayoutCore#createLayerer + * @see yfiles.hierarchic.HierarchicLayoutCore#createIncrementalLayerer + * @see yfiles.hierarchic.HierarchicLayoutCore#createSequencer + * @see yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator + * @see yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer + * @constructor + */ + constructor(); + /** + * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator} if the given {@link yfiles.hierarchic.IDrawingDistanceCalculator} + * instance is null. + *

+ * The default implementation returns a {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} instance. It may be overridden + * to return a custom {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator} instance. + *

+ * @returns {yfiles.hierarchic.IDrawingDistanceCalculator} a {@link yfiles.hierarchic.IDrawingDistanceCalculator} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#drawingDistanceCalculator + * @protected + */ + createDrawingDistanceCalculator():yfiles.hierarchic.IDrawingDistanceCalculator; + /** + * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and reates an appropriate {@link yfiles.hierarchic.IEdgeReverser} + * implementation. + *

+ * By default, a suitable private implementation of {@link yfiles.hierarchic.IEdgeReverser} is returned. It may be overridden to + * return a custom {@link yfiles.hierarchic.IEdgeReverser} implementation. + *

+ * @returns {yfiles.hierarchic.IEdgeReverser} an implementation + * @protected + */ + createEdgeReverser():yfiles.hierarchic.IEdgeReverser; + /** + * Factory method that is called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates a {@link yfiles.layout.GroupingSupport} + * instance in case of a grouped graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.layout.GroupingSupport} a {@link yfiles.layout.GroupingSupport} instance or null if the graph is not grouped + * @protected + */ + createGrouping(graph:yfiles.layout.LayoutGraph):yfiles.layout.GroupingSupport; + /** + * Creates an {@link yfiles.hierarchic.IIncrementalHintsFactory} implementation used for obtaining hint objects associated with + * nodes and edges of the graph prior to the invocation of the layout algorithm. + *

+ * Incremental hints can be obtained from a {@link yfiles.algorithms.IDataProvider} that is registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. + *

+ * @returns {yfiles.hierarchic.IIncrementalHintsFactory} an {@link yfiles.hierarchic.IIncrementalHintsFactory} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY + */ + createIncrementalHintsFactory():yfiles.hierarchic.IIncrementalHintsFactory; + /** + * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates an appropriate {@link yfiles.hierarchic.ILayerer} + * implementation. + *

+ * By default, a {@link yfiles.hierarchic.ConstraintIncrementalLayerer} instance with a {@link yfiles.hierarchic.TopologicalLayerer} + * instance as argument is returned. This method may be overridden to return a custom {@link yfiles.hierarchic.ILayerer} + * implementation. + *

+ * @returns {yfiles.hierarchic.ILayerer} a {@link yfiles.hierarchic.ILayerer} implementation + * @protected + */ + createIncrementalLayerer():yfiles.hierarchic.ILayerer; + /** + * Callback method that is called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore}, creates the {@link yfiles.hierarchic.INodeData} + * and {@link yfiles.hierarchic.IEdgeData} instances and binds them to the elements using the given {@link yfiles.hierarchic.IItemFactory itemFactory}. + * @param {yfiles.layout.LayoutGraph} g the input graph + * @param {yfiles.hierarchic.IItemFactory} itemFactory the given {@link yfiles.hierarchic.IItemFactory} instance + * @protected + */ + createItemData(g:yfiles.layout.LayoutGraph,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Creates a {@link yfiles.hierarchic.ILayerConstraintFactory layer constraint factory} that allows to create hints that affect the assignment of the nodes to layers. + *

+ * By default, a suitable private implementation of {@link yfiles.hierarchic.ILayerConstraintFactory} is returned. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {yfiles.hierarchic.ILayerConstraintFactory} a {@link yfiles.hierarchic.ILayerConstraintFactory} instance + */ + createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ILayerConstraintFactory; + /** + * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#layerer} if no {@link yfiles.hierarchic.ILayerer} instance is given as input. + *

+ * The default implementation returns a new MultiComponentLayerer(new WeightedLayerer()) instance. It may be overridden to + * return a custom {@link yfiles.hierarchic.ILayerer} instance. + *

+ * @returns {yfiles.hierarchic.ILayerer} a {@link yfiles.hierarchic.ILayerer} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#layerer + * @see yfiles.hierarchic.MultiComponentLayerer + * @see yfiles.hierarchic.WeightedLayerer + * @protected + */ + createLayerer():yfiles.hierarchic.ILayerer; + /** + * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates an appropriate {@link yfiles.hierarchic.ILayers} + * implementation using the given {@link yfiles.hierarchic.ILayoutDataProvider} instance. + *

+ * By default, a suitable private implementation of {@link yfiles.hierarchic.ILayers} is returned. It may be overridden to return + * custom implementations of the {@link yfiles.hierarchic.ILayers} interface. + *

+ * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the given {@link yfiles.hierarchic.ILayoutDataProvider} instance + * @returns {yfiles.hierarchic.ILayers} a {@link yfiles.hierarchic.ILayers} implementation + * @protected + */ + createLayers(ldp:yfiles.hierarchic.ILayoutDataProvider):yfiles.hierarchic.ILayers; + /** + * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer} if the given {@link yfiles.hierarchic.INodePlacer} instance is null. + *

+ * The default implementation returns a {@link yfiles.hierarchic.SimplexNodePlacer} instance. It may be overridden to return a + * custom {@link yfiles.hierarchic.INodePlacer} instance. + *

+ * @returns {yfiles.hierarchic.INodePlacer} a {@link yfiles.hierarchic.INodePlacer} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#nodePlacer + * @see yfiles.hierarchic.SimplexNodePlacer + * @protected + */ + createNodePlacer():yfiles.hierarchic.INodePlacer; + /** + * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#portAllocator} if the given {@link yfiles.hierarchic.IPortAllocator} instance is + * null. + *

+ * The default implementation returns a {@link yfiles.hierarchic.DefaultPortAllocator} instance. It may be overridden to return a + * custom {@link yfiles.hierarchic.IPortAllocator} instance. + *

+ * @returns {yfiles.hierarchic.IPortAllocator} a {@link yfiles.hierarchic.IPortAllocator} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#portAllocator + * @protected + */ + createPortAllocator():yfiles.hierarchic.IPortAllocator; + /** + * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer} if the given {@link yfiles.hierarchic.IPortConstraintOptimizer} + * instance is null. + *

+ * The default implementation returns null. It may be overridden to return a custom {@link yfiles.hierarchic.IPortConstraintOptimizer} + * instance. + *

+ * @returns {yfiles.hierarchic.IPortConstraintOptimizer} null + * @see yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer + * @protected + */ + createPortConstraintOptimizer():yfiles.hierarchic.IPortConstraintOptimizer; + /** + * Creates sequence constraints that affect the sequence of the nodes within each layer. + *

+ * By default, a suitable private implementation of {@link yfiles.hierarchic.ISequenceConstraintFactory} is returned. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph + * @returns {yfiles.hierarchic.ISequenceConstraintFactory} a {@link yfiles.hierarchic.ISequenceConstraintFactory} instance + */ + createSequenceConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.ISequenceConstraintFactory; + /** + * Factory method that is called lazily upon first usage by {@link yfiles.hierarchic.HierarchicLayoutCore#sequencer} if the given {@link yfiles.hierarchic.ISequencer} instance is null. + *

+ * The default implementation returns a {@link yfiles.hierarchic.DefaultLayerSequencer} instance. It may be overridden to return a + * custom {@link yfiles.hierarchic.ISequencer} instance. + *

+ * @returns {yfiles.hierarchic.ISequencer} a {@link yfiles.hierarchic.ISequencer} instance + * @see yfiles.hierarchic.HierarchicLayoutCore#sequencer + * @see yfiles.hierarchic.DefaultLayerSequencer + * @protected + */ + createSequencer():yfiles.hierarchic.ISequencer; + /** + * Factory method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and creates a {@link yfiles.hierarchic.ISequencer} + * implementation that can sequence subgraphs incrementally. + *

+ * By default, a suitable private implementation of {@link yfiles.hierarchic.ISequencer} is returned. It may be overridden to + * return custom implementations of the {@link yfiles.hierarchic.ISequencer} interface. + *

+ * @returns {yfiles.hierarchic.ISequencer} a {@link yfiles.hierarchic.ISequencer} implementation + * @protected + */ + createSubgraphLayerSequencer():yfiles.hierarchic.ISequencer; + /** + * Provides access to implementation specific properties of the algorithms used. + *

+ * Used for internal purposes. + *

+ * @param {Object} key the key to a property + * @returns {Object} the associated value or null + * @see yfiles.hierarchic.HierarchicLayoutCore#setAlgorithmProperty + */ + getAlgorithmProperty(key:Object):Object; + /** + * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} + * that holds the {@link yfiles.hierarchic.EdgeLayoutDescriptor} information. + *

+ * The {@link yfiles.algorithms.IDataProvider} holding the information about the node layout is registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.algorithms.IDataProvider} a {@link yfiles.algorithms.IDataProvider} instance or null + * @see yfiles.hierarchic.EdgeLayoutDescriptor + * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @protected + */ + getEdgeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} + * that holds the incremental hints information. + *

+ * The {@link yfiles.algorithms.IDataProvider} holding the information about incremental hints is registered with the graph using + * key {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.algorithms.IDataProvider} a {@link yfiles.algorithms.IDataProvider} instance or null + * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY + * @protected + */ + getIncrementalHints(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} + * that holds the {@link yfiles.hierarchic.NodeLayoutDescriptor} information. + *

+ * The {@link yfiles.algorithms.IDataProvider} holding the information about the node layout is registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.algorithms.IDataProvider} a {@link yfiles.algorithms.IDataProvider} instance or null + * @see yfiles.hierarchic.NodeLayoutDescriptor + * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY + * @protected + */ + getNodeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method called during {@link yfiles.hierarchic.HierarchicLayoutCore#applyLayoutCore} and returns a {@link yfiles.algorithms.IDataProvider} + * that holds the {@link yfiles.hierarchic.SwimlaneDescriptor} information. + *

+ * The {@link yfiles.algorithms.IDataProvider} holding the information about swimlanes is registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.algorithms.IDataProvider} a {@link yfiles.algorithms.IDataProvider} instance or null + * @see yfiles.hierarchic.SwimlaneDescriptor + * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY + * @protected + */ + getSwimLaneDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method that publishes the layering information. + *

+ * The layering information is stored in a {@link yfiles.algorithms.IDataProvider} registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} implementation that provides the layering information + * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY + * @protected + */ + publishLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers):void; + /** + * Callback method that publishes the sequencing information. + *

+ * The sequencing information is stored in a {@link yfiles.algorithms.IDataProvider} registered with the graph using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#SEQUENCE_INDEX_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} implementation that provides the layering information + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @see yfiles.hierarchic.HierarchicLayoutCore#LAYER_INDEX_DP_KEY + * @protected + */ + publishSequences(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Removes the bends which are obviously not necessary. + *

+ * By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on + * a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {number} bendReductionThreshold this method removes a bend, if its horizontal/vertical distance to the closest collinear bend is above this value + * @protected + */ + reduceBendCount(graph:yfiles.layout.LayoutGraph,bendReductionThreshold:number):void; + /** + * Removes the bends which are obviously not necessary. + *

+ * By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on + * a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @protected + */ + reduceBendCount(graph:yfiles.layout.LayoutGraph):void; + /** + * Provides access to implementation specific properties of the algorithms used. + *

+ * Used for internal purposes. + *

+ * @param {Object} key the key to a property + * @param {Object} value the value to associate with the key + * @see yfiles.hierarchic.HierarchicLayoutCore#setAlgorithmProperty + */ + setAlgorithmProperty(key:Object,value:Object):void; + /** + * Data provider key for specifying incremental hints + *

+ * Incremental hints are created using an {@link yfiles.hierarchic.HierarchicLayoutCore#createIncrementalHintsFactory incremental hints factory}. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY + * @see yfiles.hierarchic.IIncrementalHintsFactory + * @const + * @static + * @type {yfiles.algorithms.GraphObjectDpKey.} + */ + static INCREMENTAL_HINTS_DP_KEY:yfiles.algorithms.GraphObjectDpKey; + /** + * Data provider key for providing layout information for each edge + * @see yfiles.hierarchic.IEdgeData#edgeLayoutDescriptor + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for providing layout information for each node + * @see yfiles.hierarchic.INodeData#nodeLayoutDescriptor + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for providing information about swimlanes + *

+ * If this key is present during the layout, the layout algorithm will arrange nodes in swimlanes. The information about + * the swimlanes is finally written back to the descriptor instances. + *

+ *

+ * Instances can be shared among multiple nodes in the same lane, but don't have to be shared. + *

+ * @see yfiles.hierarchic.SwimlaneDescriptor + * @see yfiles.hierarchic.INodeData#swimLaneDescriptor + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SWIMLANE_DESCRIPTOR_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data acceptor key for publishing the layer IDs for all nodes in the graph. + * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static LAYER_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data acceptor key for publishing the index inside their layer for all nodes in the graph. + * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static SEQUENCE_INDEX_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for internal use only. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static INCREMENTAL_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Factory method called during the initialization of this {@link yfiles.hierarchic.HierarchicLayoutCore} instance that creates a + * {@link yfiles.layout.MultiStageLayout#labeling label layouter}. + *

+ * In order to use the integrated node label awareness feature one has to use a {@link yfiles.layout.LabelLayoutTranslator} + * instance and set {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} to true. Likewise, in order to make use of the integrated edge labeling {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} must be set to true and also + * {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels} must be set to true (which is the default). + *

+ * @protected + * @type {yfiles.layout.ILayoutStage} + */ + createLabelLayout:yfiles.layout.ILayoutStage; + /** + * Gets or sets whether or not the {@link yfiles.layout.ComponentLayout} should be enabled. + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Gets or sets the time limit (in milliseconds) set for the layout algorithm. + *

+ * Values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the {@link yfiles.hierarchic.ILayerer} instance responsible for generating the layer assignment (first phase of the + * layout algorithm). + *

+ * To set the default layerer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createLayerer}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#createLayerer + * @type {yfiles.hierarchic.ILayerer} + */ + layerer:yfiles.hierarchic.ILayerer; + /** + * Gets or sets the {@link yfiles.hierarchic.ISequencer} instance responsible for calculating the sequence of nodes within each + * layer (second phase of the layout algorithm). + *

+ * To set the default sequencer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createSequencer}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ISequencer} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#createSequencer + * @type {yfiles.hierarchic.ISequencer} + */ + sequencer:yfiles.hierarchic.ISequencer; + /** + * Gets or sets the {@link yfiles.hierarchic.INodePlacer} instance responsible for the assignment of the x-(sequence) and + * preliminary y-coordinates of the nodes. + *

+ * To set the default node placer, see {@link yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.INodePlacer} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#createNodePlacer + * @type {yfiles.hierarchic.INodePlacer} + */ + nodePlacer:yfiles.hierarchic.INodePlacer; + /** + * Gets or sets the {@link yfiles.hierarchic.IPortAllocator} instance responsible for assigning port coordinates to the adjacent + * edges of each node. + *

+ * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createPortAllocator}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.IPortAllocator} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#createPortAllocator + * @type {yfiles.hierarchic.IPortAllocator} + */ + portAllocator:yfiles.hierarchic.IPortAllocator; + /** + * Gets or sets the {@link yfiles.hierarchic.IPortConstraintOptimizer} instance responsible for optimizing the assignment of port + * constraints to the adjacent edges of each node. + *

+ * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createPortConstraintOptimizer}. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#createPortConstraintOptimizer + * @type {yfiles.hierarchic.IPortConstraintOptimizer} + */ + portConstraintOptimizer:yfiles.hierarchic.IPortConstraintOptimizer; + /** + * Gets or sets the {@link yfiles.hierarchic.IDrawingDistanceCalculator} instance responsible for determining the minimum distances + * between elements that belong to the same layer. + *

+ * To set the default port allocator, see {@link yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.IDrawingDistanceCalculator} is null + * @see yfiles.hierarchic.HierarchicLayoutCore#createDrawingDistanceCalculator + * @type {yfiles.hierarchic.IDrawingDistanceCalculator} + */ + drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator; + /** + * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. + *

+ * When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid + * spacing. + *

+ * @see yfiles.hierarchic.IIncrementalHintsFactory + * @type {number} + */ + gridSpacing:number; + static $class:yfiles.lang.Class; + } + /** + * This interface determines the minimum distances between elements that belong to the same layer. + *

+ * {@link yfiles.hierarchic.IDrawingDistanceCalculator} is implemented by a helper class used by {@link yfiles.hierarchic.HierarchicLayoutCore} + * during the phase of node placement (i.e. when the final coordinates for all nodes are calculated). {@link yfiles.hierarchic.INodePlacer} + * uses instances of this interface to determine the minimum distances between elements that belong to the same layer. + *

+ *

+ * Information about graph elements (i.e. nodes or edges) is given using a {@link yfiles.hierarchic.ILayoutDataProvider} while + * information about layers is given through {@link yfiles.hierarchic.ILayer} (describes a single layer of the hierarchic layout) + * or {@link yfiles.hierarchic.ILayers} (manages multiple {@link yfiles.hierarchic.ILayer layers} of the hierarchic layout). + *

+ *

+ * Implementations not needed any more should be {@link yfiles.hierarchic.IDrawingDistanceCalculator#dispose disposed of}. + *

+ *

+ * The default implementation used by the {@link yfiles.hierarchic.HierarchicLayoutCore} is + * {@link yfiles.hierarchic.DefaultDrawingDistanceCalculator}. + *

+ * @interface + */ + export interface IDrawingDistanceCalculator extends Object{ + /** + * Disposes of internal data structures. + *

+ * Implementations should release internally held data structures when they are not needed any more. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph that contains all elements that are used during the node placement + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} object that will be used during subsequent calls + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @see yfiles.hierarchic.IDrawingDistanceCalculator#initialize + * @abstract + */ + dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Main interface method called by {@link yfiles.hierarchic.INodePlacer} instances to determine the minimum distance between + * {@link yfiles.algorithms.Node}s of same layer. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayer} layer the {@link yfiles.hierarchic.ILayer} object that will be used during subsequent calls + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.algorithms.Node} left the left of the two {@link yfiles.algorithms.Node}s whose minimum distance is to be determined or null if only the left border + * of the right {@link yfiles.algorithms.Node} is of interest + * @param {yfiles.algorithms.Node} right the right of the two {@link yfiles.algorithms.Node}s whose minimum distance is to be determined or null if only the right border + * of the left {@link yfiles.algorithms.Node} is of interest + * @returns {number} the minimum distance between two {@link yfiles.algorithms.Node}s of the same layer + * @abstract + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; + /** + * Initializes internal data structures. + *

+ * Implementations may cache lengthy calculations in the initialization phase. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph that contains all elements that are used during the node placement + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} object that will be used during subsequent calls + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @see yfiles.hierarchic.IDrawingDistanceCalculator#dispose + * @abstract + */ + initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + } + var IDrawingDistanceCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface provides layout information about the edges of the graph during the layout. + *

+ * {@link yfiles.hierarchic.IEdgeData} is a multi-purpose edge descriptor for each edge, holding information about the {@link yfiles.hierarchic.IEdgeData#type type} of an + * edge, associated {@link yfiles.layout.PortConstraint port constraints}, {@link yfiles.layout.PortCandidate port candidates}, edge groups as well as the current edge state. + *

+ *

+ * It is used in all phases of the {@link yfiles.hierarchic.HierarchicLayoutCore} to store edge information. + *

+ * @interface + */ + export interface IEdgeData extends Object{ + /** + * Gets the type of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. + * @abstract + * @type {yfiles.hierarchic.EdgeDataType} + */ + type:yfiles.hierarchic.EdgeDataType; + /** + * Gets the {@link yfiles.algorithms.Node} associated with this {@link yfiles.hierarchic.IEdgeData} instance. + *

+ * If no {@link yfiles.algorithms.Node} is associated with this {@link yfiles.hierarchic.IEdgeData} instance, null should be returned. + *

+ * @abstract + * @type {yfiles.algorithms.Node} + */ + associatedNode:yfiles.algorithms.Node; + /** + * Gets the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. + *

+ * If no {@link yfiles.algorithms.Edge} is associated with this {@link yfiles.hierarchic.IEdgeData} instance, null should be returned. + *

+ * @abstract + * @type {yfiles.algorithms.Edge} + */ + associatedEdge:yfiles.algorithms.Edge; + /** + * Gets the {@link yfiles.layout.PortConstraint port constraints} for the source port of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance. + *

+ * {@link yfiles.layout.PortConstraint}s are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}. + *

+ * @abstract + * @type {yfiles.layout.PortConstraint} + */ + sourcePortConstraint:yfiles.layout.PortConstraint; + /** + * Gets the ID of the edge port group at the source node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance belongs (if any). + *

+ * Information about edge port grouping at the source node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with + * the graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_GROUP_ID_DP_KEY}. + *

+ * @abstract + * @type {Object} + */ + sourcePortGroup:Object; + /** + * Gets the {@link yfiles.collections.ICollection. collection} of {@link yfiles.layout.PortCandidate}s for the source port of the {@link yfiles.algorithms.Edge} associated with + * this {@link yfiles.hierarchic.IEdgeData} instance. + *

+ * {@link yfiles.layout.PortCandidate Source port candidates} are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY}. + *

+ * @abstract + * @type {yfiles.collections.ICollection.} + */ + sourcePortCandidates:yfiles.collections.ICollection; + /** + * Gets the {@link yfiles.layout.PortConstraint port constraints} for the target port of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance. + *

+ * {@link yfiles.layout.PortConstraint}s are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. + *

+ * @abstract + * @type {yfiles.layout.PortConstraint} + */ + targetPortConstraint:yfiles.layout.PortConstraint; + /** + * Gets the ID of the edge port group at the target node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance belongs (if any). + *

+ * Information about edge port grouping at the target node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with + * the graph with key {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_GROUP_ID_DP_KEY}. + *

+ * @abstract + * @type {Object} + */ + targetPortGroup:Object; + /** + * Gets the {@link yfiles.collections.ICollection. collection} of {@link yfiles.layout.PortCandidate}s for the target port of the {@link yfiles.algorithms.Edge} associated with + * this {@link yfiles.hierarchic.IEdgeData} instance. + *

+ * {@link yfiles.layout.PortCandidate Target port candidates} are obtained by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY}. + *

+ * @abstract + * @type {yfiles.collections.ICollection.} + */ + targetPortCandidates:yfiles.collections.ICollection; + /** + * Gets the ID of the edge group at the source node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance belongs (if any). + *

+ * Information about edge grouping at the source node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with the + * graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY}. + *

+ * @abstract + * @type {Object} + */ + sourceGroup:Object; + /** + * Gets the ID of the edge group at the target node to which the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance belongs (if any). + *

+ * Information about edge grouping at the target node is obtained by a {@link yfiles.algorithms.IDataProvider} registered with the + * graph with key {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. + *

+ * @abstract + * @type {Object} + */ + targetGroup:Object; + /** + * Gets the group that is represented by the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance. + * @abstract + * @type {Object} + */ + group:Object; + /** + * Gets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance has been + * reversed. + * @abstract + * @type {boolean} + */ + reversed:boolean; + /** + * Gets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance is an upper + * same-layer edge. + *

+ * An upper same-layer edge is an edge connecting two nodes of the same layer with polyline segments (not directly, with a + * straight-line) and is routed above the layer. + *

+ * @abstract + * @type {boolean} + */ + upperSameLayerEdge:boolean; + /** + * Gets the {@link yfiles.hierarchic.EdgeLayoutDescriptor} instance bound to the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} + * instance. + *

+ * If no {@link yfiles.hierarchic.EdgeLayoutDescriptor} is bound to the edge, null should be returned. + *

+ * @abstract + * @type {yfiles.hierarchic.EdgeLayoutDescriptor} + */ + edgeLayoutDescriptor:yfiles.hierarchic.EdgeLayoutDescriptor; + /** + * Gets or sets whether or not the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance should + * be an upper same-layer edge (if it is a same-layer edge). + *

+ * An upper same-layer edge is an edge connecting two nodes of the same layer with polyline segments (not directly, with a + * straight-line) and is routed above the layer. + *

+ *

+ * If enabled the edge will be routed above the layer, otherwise below it. + *

+ * @abstract + * @type {boolean} + */ + fallbackUpperSameLayerEdge:boolean; + /** + * Gets the thickness of the {@link yfiles.algorithms.Edge} associated with this {@link yfiles.hierarchic.IEdgeData} instance. + *

+ * The thickness is considered when calculating minimum distances so that there are no overlaps between edges and other + * graph elements. + *

+ *

+ * The thickness must have a non-negative value. + *

+ * @abstract + * @type {number} + */ + thickness:number; + } + var IEdgeData:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface handles edges that should be reversed during the hierarchic layout process. + *

+ * {@link yfiles.hierarchic.IEdgeReverser} contains methods for reversing all (or a given edge) that point to the wrong direction, + * i.e. the layer indices of the source nodes are greater than the layer indices of the target nodes. It also provides + * methods to restore the edges that have been reversed at the end of the layout algorithm. + *

+ *

+ * Implementations of this interface perform operations after the layering phase of the hierarchic layout algorithm. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore + * @interface + */ + export interface IEdgeReverser extends Object{ + /** + * Reverses all edges which point to the wrong direction. + *

+ * It is called after the layering phase of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. + *

+ *

+ * An edge is reversed if the layer index of its source node is greater than the layer index of its target node. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing layering information about the nodes and edges of the graph + * @see yfiles.hierarchic.ILayoutDataProvider#getNodeData + * @see yfiles.hierarchic.INodeData#layer + * @abstract + */ + normalizeEdges(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Restores the original direction of edges marked as reversed. + *

+ * It is called at the end of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the nodes and edges of the graph + * @abstract + */ + restoreEdgeDirections(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Reverses a given edge which points to the wrong direction. + *

+ * It may be called by the incremental parts of the {@link yfiles.hierarchic.HierarchicLayoutCore hierarchic layout algorithm}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing layering information about the nodes and edges of the graph + * @param {yfiles.algorithms.Edge} edge the edge to be reversed + * @see yfiles.hierarchic.ILayoutDataProvider#getNodeData + * @see yfiles.hierarchic.INodeData#layer + * @abstract + */ + reverse(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,edge:yfiles.algorithms.Edge):void; + } + var IEdgeReverser:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface provides factory methods for creating incremental hints for the hierarchic layout. + *

+ * Incremental hints can be used for specifying that a subset of nodes (called incremental nodes) should be added to an + * existing graph layout. A layer hint specifies that both, a node's layer and its position within the layer should be + * determined by the algorithm. A sequence hint specifies that the algorithm should consider the current layer of a node + * while its position within the layer should be freely determined by the algorithm. + *

+ *

+ * Information about incremental hints is provided by a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY}. + *

+ *

+ * An instance of a class implementing this interface can be obtained through method + * {@link yfiles.hierarchic.HierarchicLayout#createIncrementalHintsFactory}. + *

+ * @interface + */ + export interface IIncrementalHintsFactory extends Object{ + /** + * Creates a hint {@link Object} for a group {@link yfiles.algorithms.Node} that should be inserted incrementally during the layering phase. + *

+ * The group will be placed on a suitable position. The descendants of the group may be associated with hints created by + * methods {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint}, {@link yfiles.hierarchic.IIncrementalHintsFactory#createSequenceIncrementallyHint} + * or this method (if the descendant is an inner group). + *

+ *

+ * All hints of the descendants of a group are interpreted relative to the group node. Descendants without hints maintain + * their relative order within the group node (but not with elements outside the group). + *

+ *

+ * The positions of groups without incremental hints depend on the position of their descendants (i.e., the group is not + * interpreted as fixed - it is simply ignored). + *

+ * @param {Object} forItemId the group node to be inserted incrementally + * @returns {Object} an {@link Object} that can be interpreted as a hint by {@link yfiles.hierarchic.HierarchicLayoutCore} + * @abstract + */ + createIncrementalGroupHint(forItemId:Object):Object; + /** + * Creates a hint {@link Object} for a {@link yfiles.algorithms.Node} that should be inserted incrementally during the layering phase. + *

+ * This will place the node in a suitable layer, possibly creating new layers. + *

+ *

+ * Neighbors of this node may be also marked such that they are laid out incrementally. This makes it possible to + * incrementally add whole subgraphs to the current layout. + *

+ * @param {Object} forNodeId the node to be layered and sequenced incrementally + * @returns {Object} an {@link Object} that can be interpreted as a hint by {@link yfiles.hierarchic.HierarchicLayoutCore} + * @abstract + */ + createLayerIncrementallyHint(forNodeId:Object):Object; + /** + * Creates a hint {@link Object} for a {@link yfiles.algorithms.Node} or {@link yfiles.algorithms.Edge} that should be inserted incrementally during the + * sequencing phase. + *

+ * This will prevent the layering from being changed. + *

+ *

+ * The {@link yfiles.algorithms.Node} will be placed on an already existing {@link yfiles.hierarchic.ILayer layer} that is determined by the {@link yfiles.hierarchic.HierarchicLayoutCore#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 + * @returns {Object} an {@link Object} that can be interpreted as a hint by {@link yfiles.hierarchic.HierarchicLayoutCore} + * @abstract + */ + createSequenceIncrementallyHint(forItemId:Object):Object; + /** + * Creates a hint {@link Object} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current + * position. + *

+ * The node will be placed in an already existing {@link yfiles.hierarchic.ILayer layer} that is determined by the {@link yfiles.hierarchic.HierarchicLayoutCore#layerer layerer} implementation. The position + * within its layer will be determined by its current position. + *

+ * @param {Object} forNodeId the node to be placed on its exact current position + * @returns {Object} an {@link Object} that can be interpreted as a hint by {@link yfiles.hierarchic.HierarchicLayoutCore} + * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint + * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint + * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement + * @abstract + */ + createUseExactCoordinatesHint(forNodeId:Object):Object; + /** + * Creates a hint {@link Object} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current + * layer position. + *

+ * The node will be placed in an already existing {@link yfiles.hierarchic.ILayer layer} that is determined by the {@link yfiles.hierarchic.HierarchicLayoutCore#layerer layerer} on the position that it occupies + * initially. The position within its layer will be determined by a {@link yfiles.hierarchic.INodePlacer} instance. + *

+ * @param {Object} forNodeId the node to be placed on its exact current layer position + * @returns {Object} an {@link Object} that can be interpreted as a hint by {@link yfiles.hierarchic.HierarchicLayoutCore} + * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactCoordinatesHint + * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint + * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement + * @abstract + */ + createUseExactLayerCoordinatesHint(forNodeId:Object):Object; + /** + * Creates a hint {@link Object} for a {@link yfiles.algorithms.Node} that should be inserted incrementally into the graph on its exact current + * sequence position. + *

+ * The node will be placed in an already existing {@link yfiles.hierarchic.ILayer layer} that is determined by the {@link yfiles.hierarchic.HierarchicLayoutCore#layerer layerer} on the position that is + * considered best for its layer. The position within the sequence of its layer will be determined by its current + * coordinates. + *

+ * @param {Object} forNodeId the node to be placed on its exact current sequence position + * @returns {Object} an {@link Object} that can be interpreted as a hint by {@link yfiles.hierarchic.HierarchicLayoutCore} + * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactCoordinatesHint + * @see yfiles.hierarchic.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint + * @see yfiles.hierarchic.SimplexNodePlacer#exactPlacement + * @abstract + */ + createUseExactSequenceCoordinatesHint(forNodeId:Object):Object; + } + var IIncrementalHintsFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is a factory for creating and destroying helper structures used in the graph during layout. + *

+ * An implementation of this interface is provided by the {@link yfiles.hierarchic.HierarchicLayoutCore} during the layout for the + * different sub-modules. + *

+ * @interface + */ + export interface IItemFactory extends Object{ + /** + * Converts a given {@link yfiles.algorithms.Node} to a label node. + * @param {yfiles.algorithms.Node} dummyNode the given {@link yfiles.algorithms.Node} to be converted + * @abstract + */ + convertToLabelNode(dummyNode:yfiles.algorithms.Node):void; + /** + * Creates a bend {@link yfiles.algorithms.Node} for the given {@link yfiles.algorithms.Edge} in the given {@link yfiles.hierarchic.ILayer} and + * assigns it to the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance. + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} instance + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {yfiles.hierarchic.SwimlaneDescriptor} [laneDescriptor=null] a given {@link yfiles.hierarchic.SwimlaneDescriptor} instance + * @returns {yfiles.algorithms.Node} the new bend {@link yfiles.algorithms.Node} + * @abstract + */ + createBendNode(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; + /** + * Creates a {@link yfiles.hierarchic.INodeData} object for a bend {@link yfiles.algorithms.Node} and associates it with the + * {@link yfiles.algorithms.Node}. + *

+ * The bend is assigned to the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance. + *

+ * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {yfiles.hierarchic.SwimlaneDescriptor} [laneDescriptor=null] the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance + * @returns {yfiles.hierarchic.INodeData} a {@link yfiles.hierarchic.INodeData} object for the given bend {@link yfiles.algorithms.Node} + * @abstract + */ + createBendNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.hierarchic.INodeData; + /** + * Creates a dummy {@link yfiles.algorithms.Node} that mimics a connector to a group {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} groupNode the given group {@link yfiles.algorithms.Node} + * @param {Object} groupId the given group ID + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} instance + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.algorithms.Node} the new {@link yfiles.algorithms.Node} + * @abstract + */ + createConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:Object,layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; + /** + * Creates a dummy node that mimics a connector to a group node from a descendant. + * @param {yfiles.algorithms.Node} groupNode the group node to which the edge is connected + * @param {Object} groupId the id of the group node + * @param {yfiles.hierarchic.ILayer} layer the layer to which the dummy node will be assigned + * @param {yfiles.algorithms.Edge} e the edge that connects to the dummy node + * @returns {yfiles.algorithms.Node} the dummy node + * @abstract + */ + createContentConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:Object,layer:yfiles.hierarchic.ILayer,e:yfiles.algorithms.Edge):yfiles.algorithms.Node; + /** + * Creates a spacer {@link yfiles.algorithms.Node} for the drawing phase using the given bounds in the given + * {@link yfiles.hierarchic.ILayer}. + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} instance + * @param {yfiles.algorithms.Rectangle2D} size the given bounds + * @param {Array.} edges an array of {@link yfiles.algorithms.Edge}s + * @returns {yfiles.algorithms.Node} the new spacer {@link yfiles.algorithms.Node} + * @abstract + */ + createDistanceNode(layer:yfiles.hierarchic.ILayer,size:yfiles.algorithms.Rectangle2D,edges:yfiles.algorithms.Edge[]):yfiles.algorithms.Node; + /** + * Creates a dummy {@link yfiles.algorithms.Edge} using the given data. + * @param {yfiles.algorithms.Node} newSource the source node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Node} newTarget the target node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Edge} oldEdge the old {@link yfiles.algorithms.Edge} from which to retrieve the data + * @param {boolean} sourceEnd true if the source node of the edge is referred, false otherwise + * @param {boolean} targetEnd true if the target node of the edge is referred, false otherwise + * @returns {yfiles.algorithms.Edge} a new dummy {@link yfiles.algorithms.Edge} + * @abstract + */ + createDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; + /** + * Creates an edge group {@link yfiles.algorithms.Node} in the given {@link yfiles.hierarchic.ILayer}. + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} instance + * @param {Object} groupId the ID of the edge group + * @returns {yfiles.algorithms.Node} the new group {@link yfiles.algorithms.Node} + * @abstract + */ + createEdgeGroupNode(layer:yfiles.hierarchic.ILayer,groupId:Object):yfiles.algorithms.Node; + /** + * Creates a {@link yfiles.hierarchic.INodeData} object for an edge group {@link yfiles.algorithms.Node} and associates it with the + * {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @param {Object} groupId the given group ID + * @param {boolean} source true if the edge group is referred to the source node, false otherwise + * @returns {yfiles.hierarchic.INodeData} a {@link yfiles.hierarchic.INodeData} object for the given edge group {@link yfiles.algorithms.Node} + * @abstract + */ + createEdgeGroupNodeData(node:yfiles.algorithms.Node,groupId:Object,source:boolean):yfiles.hierarchic.INodeData; + /** + * Creates an {@link yfiles.algorithms.Edge} that connects two group border {@link yfiles.algorithms.Node}s. + * @param {yfiles.algorithms.Node} source the source {@link yfiles.algorithms.Node} + * @param {yfiles.algorithms.Node} target the target {@link yfiles.algorithms.Node} + * @returns {yfiles.algorithms.Edge} the new {@link yfiles.algorithms.Edge} connecting the two group {@link yfiles.algorithms.Node}s + * @abstract + */ + createGroupBorderEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Creates a group boundary {@link yfiles.algorithms.Node} for a group node in the given {@link yfiles.hierarchic.ILayer}. + * @param {yfiles.algorithms.Node} groupNode the given group {@link yfiles.algorithms.Node} + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} + * @param {yfiles.hierarchic.NodeDataType} type one of {@link yfiles.hierarchic.NodeDataType#GROUP_BEGIN} or {@link yfiles.hierarchic.NodeDataType#GROUP_END} + * @returns {yfiles.algorithms.Node} the new group boundary {@link yfiles.algorithms.Node} + * @abstract + */ + createGroupBorderNode(groupNode:yfiles.algorithms.Node,layer:yfiles.hierarchic.ILayer,type:yfiles.hierarchic.NodeDataType):yfiles.algorithms.Node; + /** + * Create a dummy {@link yfiles.algorithms.Node} for a group {@link yfiles.hierarchic.ILayer layer}. + * @returns {yfiles.algorithms.Node} a new dummy {@link yfiles.algorithms.Node} + * @abstract + */ + createGroupLayerDummyNode():yfiles.algorithms.Node; + /** + * Creates a group node connector {@link yfiles.algorithms.Edge} between two group {@link yfiles.algorithms.Node}s. + * @param {yfiles.algorithms.Node} groupNode1 the first group node + * @param {yfiles.algorithms.Node} groupNode2 the first group node + * @param {yfiles.algorithms.Edge} representative the given representative {@link yfiles.algorithms.Edge} + * @returns {yfiles.algorithms.Edge} a new connector {@link yfiles.algorithms.Edge} between two group {@link yfiles.algorithms.Node}s + * @abstract + */ + createGroupNodeConnectorEdge(groupNode1:yfiles.algorithms.Node,groupNode2:yfiles.algorithms.Node,representative:yfiles.algorithms.Edge):yfiles.algorithms.Edge; + /** + * Creates an {@link yfiles.hierarchic.IEdgeData} object for a normal {@link yfiles.algorithms.Edge} and associates it with the edge. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object for the given {@link yfiles.algorithms.Edge} + * @abstract + */ + createNormalEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; + /** + * Creates a {@link yfiles.hierarchic.INodeData} object for a normal {@link yfiles.algorithms.Node} and associates it with the + * {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @returns {yfiles.hierarchic.INodeData} a {@link yfiles.hierarchic.INodeData} object for the given {@link yfiles.algorithms.Node} + * @abstract + */ + createNormalNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.INodeData; + /** + * Creates a proxy {@link yfiles.algorithms.Node} for an {@link yfiles.algorithms.Edge} during the drawing phase, changing the {@link yfiles.algorithms.Edge} + * to end/start at the proxy and assigns it to a {@link yfiles.hierarchic.SwimlaneDescriptor} instance. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {boolean} source true if the node is the source node of the edge, false otherwise + * @param {yfiles.hierarchic.SwimlaneDescriptor} [laneDescriptor=null] a given {@link yfiles.hierarchic.SwimlaneDescriptor} instance + * @returns {yfiles.algorithms.Node} the new proxy {@link yfiles.algorithms.Node} + * @abstract + */ + createProxyNode(edge:yfiles.algorithms.Edge,source:boolean,laneDescriptor?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; + /** + * Creates a {@link yfiles.hierarchic.INodeData} object for a proxy {@link yfiles.algorithms.Node} and associates it with the proxy node. + * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @param {yfiles.algorithms.Node} proxy the given proxy node + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.hierarchic.INodeData} a {@link yfiles.hierarchic.INodeData} object for the given proxy node + * @abstract + */ + createProxyNodeData(node:yfiles.algorithms.Node,proxy:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.hierarchic.INodeData; + /** + * Creates a dummy edge that belongs to a recursive {@link yfiles.algorithms.Edge}. + * @param {yfiles.algorithms.Node} newSource the source node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Node} newTarget the target node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Edge} oldEdge the old {@link yfiles.algorithms.Edge} from which to retrieve the data + * @param {boolean} sourceEnd true if the source node of the edge is referred, false otherwise + * @param {boolean} targetEnd true if the target node of the edge is referred, false otherwise + * @returns {yfiles.algorithms.Edge} a new dummy {@link yfiles.algorithms.Edge} + * @abstract + */ + createRecursiveDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; + /** + * Creates a dummy {@link yfiles.algorithms.Node} that represents a bend node of a recursive {@link yfiles.algorithms.Edge}. + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} to which the dummy {@link yfiles.algorithms.Node} is assigned + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} to which the dummy {@link yfiles.algorithms.Node} belongs + * @param {yfiles.hierarchic.SwimlaneDescriptor} laneDescriptor the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance + * @returns {yfiles.algorithms.Node} the new {@link yfiles.algorithms.Node} + * @abstract + */ + createRecursiveEdgeDummy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; + /** + * Creates a {@link yfiles.hierarchic.INodeData} for a dummy {@link yfiles.algorithms.Node} of a recursive {@link yfiles.algorithms.Edge}. + * @param {yfiles.algorithms.Node} node the given {@link yfiles.algorithms.Node} + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} to which the dummy {@link yfiles.algorithms.Node} belongs + * @param {yfiles.hierarchic.SwimlaneDescriptor} laneDescriptor the given {@link yfiles.hierarchic.SwimlaneDescriptor} instance + * @returns {yfiles.hierarchic.INodeData} the new {@link yfiles.hierarchic.INodeData} instance + * @abstract + */ + createRecursiveEdgeNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.SwimlaneDescriptor):yfiles.hierarchic.INodeData; + /** + * Creates an {@link yfiles.hierarchic.IEdgeData} object for a same-layer recursive {@link yfiles.algorithms.Edge} and associates it with + * the edge. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {yfiles.hierarchic.IEdgeData} originalEdgeData the {@link yfiles.hierarchic.IEdgeData} object of the original edge + * @param {boolean} isUpper true is the recursive edge is an upper same layer edge, false otherwise + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object for the recursive same-layer {@link yfiles.algorithms.Edge} + * @abstract + */ + createRecursiveSameLayerEdgeData(edge:yfiles.algorithms.Edge,originalEdgeData:yfiles.hierarchic.IEdgeData,isUpper:boolean):yfiles.hierarchic.IEdgeData; + /** + * Creates a redirected {@link yfiles.algorithms.Edge} to replace an {@link yfiles.algorithms.Edge} connected to a group + * {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} newSource the source node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Node} newTarget the target node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Edge} groupEdge the given group {@link yfiles.algorithms.Edge} + * @returns {yfiles.algorithms.Edge} a new redirected {@link yfiles.algorithms.Edge} + * @abstract + */ + createRedirectedGroupEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,groupEdge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; + /** + * Creates a reversed dummy {@link yfiles.algorithms.Edge} using the given data. + * @param {yfiles.algorithms.Node} newSource the source node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Node} newTarget the target node of the {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Edge} oldEdge the old {@link yfiles.algorithms.Edge} from which to retrieve the data + * @param {boolean} sourceEnd true if the source node of the edge is referred, false otherwise + * @param {boolean} targetEnd true if the target node of the edge is referred, false otherwise + * @returns {yfiles.algorithms.Edge} a new reversed dummy {@link yfiles.algorithms.Edge} + * @abstract + */ + createReverseDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; + /** + * Creates an {@link yfiles.hierarchic.IEdgeData} object for a same-layer {@link yfiles.algorithms.Edge} and associates it with the edge. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object for the same-layer {@link yfiles.algorithms.Edge} + * @abstract + */ + createSameLayerEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; + /** + * Creates a same-layer {@link yfiles.algorithms.Edge} proxy connecting a newly created proxy {@link yfiles.algorithms.Node} and a given + * proxy {@link yfiles.algorithms.Node} in the given {@link yfiles.hierarchic.ILayer}. + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {yfiles.algorithms.Node} toProxy the given proxy {@link yfiles.algorithms.Node} + * @returns {yfiles.algorithms.Edge} a new redefined same-layer {@link yfiles.algorithms.Edge} + * @abstract + */ + createSameLayerProxy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge,toProxy:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Creates a proxy {@link yfiles.algorithms.Node} for a same-layer {@link yfiles.algorithms.Edge} during the drawing phase that ends at the + * side of a node. + * @param {yfiles.hierarchic.ILayer} inLayer the given {@link yfiles.hierarchic.ILayer} instance + * @param {yfiles.algorithms.Node} forNode the given {@link yfiles.algorithms.Node} + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {yfiles.hierarchic.SwimlaneDescriptor} [sld=null] a given {@link yfiles.hierarchic.SwimlaneDescriptor} instance + * @returns {yfiles.algorithms.Node} the new proxy {@link yfiles.algorithms.Node} + * @abstract + */ + createSameLayerSideProxy(inLayer:yfiles.hierarchic.ILayer,forNode:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,sld?:yfiles.hierarchic.SwimlaneDescriptor):yfiles.algorithms.Node; + /** + * Creates a same-layer switch proxy {@link yfiles.algorithms.Node} (switching between two same-layer + * {@link yfiles.algorithms.Edge}s on two different sides of the layer). + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.algorithms.Node} the new same-layer switch proxy {@link yfiles.algorithms.Node} + * @abstract + */ + createSameLayerSwitchProxy(layer:yfiles.hierarchic.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; + /** + * Creates an {@link yfiles.hierarchic.IEdgeData} object for a self-loop {@link yfiles.algorithms.Edge} and associates it with the edge. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object for a self-loop {@link yfiles.algorithms.Edge} + * @abstract + */ + createSelfLoopEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; + /** + * Destroys a spacer {@link yfiles.algorithms.Node} for the drawing phase created using + * {@link yfiles.hierarchic.IItemFactory#createDistanceNode}. + * @param {yfiles.algorithms.Node} distanceNode the {@link yfiles.algorithms.Node} to be destroyed + * @abstract + */ + destroyDistanceNode(distanceNode:yfiles.algorithms.Node):void; + /** + * Removes the given layer for proxies at groups to handle direct group content connector edges between a node in the + * first/last layer of the group node and the groups border. + * @param {yfiles.hierarchic.ILayer} layer the layer to destroy + * @param {boolean} useInEdges whether the incoming edges should be used as the resulting edges + * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting + * @abstract + */ + destroyGroupConnectorLayer(layer:yfiles.hierarchic.ILayer,useInEdges:boolean):void; + /** + * Destroys a previously created label layer + * @param {yfiles.hierarchic.ILayer} layer the layer to destroy + * @param {boolean} useInEdges whether the incoming edges should be used as the resulting edges + * @abstract + */ + destroyLabelNodeLayer(layer:yfiles.hierarchic.ILayer,useInEdges:boolean):void; + /** + * Destroys a proxy {@link yfiles.algorithms.Node} created using CreateProxyNode for the drawing phase. + * @param {yfiles.algorithms.Node} proxyNode the proxy {@link yfiles.algorithms.Node} to be destroyed + * @returns {yfiles.algorithms.Edge} + * @abstract + */ + destroyProxyNode(proxyNode:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Destroys a same-layer {@link yfiles.algorithms.Edge} proxy created using {@link yfiles.hierarchic.IItemFactory#createSameLayerProxy}. + * @param {yfiles.algorithms.Edge} edge the {@link yfiles.algorithms.Edge} whose proxy will be destroyed + * @returns {yfiles.algorithms.Edge} the redefined {@link yfiles.algorithms.Edge} after the removal of the proxy {@link yfiles.algorithms.Node} + * @abstract + */ + destroySameLayerProxy(edge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; + /** + * Destroys a proxy {@link yfiles.algorithms.Node} created using CreateProxyNode for the drawing phase. + * @param {yfiles.algorithms.Node} proxyNode the proxy {@link yfiles.algorithms.Node} to be destroyed + * @abstract + */ + destroySameLayerSideProxy(proxyNode:yfiles.algorithms.Node):void; + /** + * Destroys a same-layer switch proxy {@link yfiles.algorithms.Node} created using + * {@link yfiles.hierarchic.IItemFactory#createSameLayerSwitchProxy}. + * @param {yfiles.algorithms.Node} node the {@link yfiles.algorithms.Node} to be destroyed + * @returns {yfiles.algorithms.Edge} the redefined {@link yfiles.algorithms.Edge} after the removal of the same-layer switch proxy {@link yfiles.algorithms.Node} + * @abstract + */ + destroySameLayerSwitchProxy(node:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Inserts a same-layer {@link yfiles.algorithms.Edge} or an {@link yfiles.algorithms.Edge} that may span multiple layers into the data + * structure and returns the resulting list of + * {@link yfiles.algorithms.Edge}s that has been created if this edge spans multiple layers. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @returns {yfiles.algorithms.EdgeList} the resulting list of {@link yfiles.algorithms.Edge}s that has been created if this edge spans multiple layers + * @abstract + */ + insertEdge(edge:yfiles.algorithms.Edge):yfiles.algorithms.EdgeList; + /** + * Inserts a layer for proxies at groups to handle direct group content connector edges between a node in the first/last + * layer of the group node and the groups border. + * @param {boolean} top true if this layer is placed above a group nodes, false if placed below + * @param {number} index the index where the layer is inserted + * @returns {yfiles.hierarchic.ILayer} the new layer + * @see yfiles.hierarchic.EdgeLayoutDescriptor#directGroupContentEdgeRouting + * @abstract + */ + insertGroupConnectorLayer(top:boolean,index:number):yfiles.hierarchic.ILayer; + /** + * Inserts a {@link yfiles.hierarchic.ILayer layer} for group {@link yfiles.algorithms.Node}s. + * @param {boolean} source true if the group refers to the source node of an edge, false otherwise + * @param {number} index the index at which the specified {@link yfiles.hierarchic.ILayer layer} is to be inserted + * @returns {yfiles.hierarchic.ILayer} a {@link yfiles.hierarchic.ILayer layer} instance + * @abstract + */ + insertGroupNodeLayer(source:boolean,index:number):yfiles.hierarchic.ILayer; + /** + * Inserts a {@link yfiles.hierarchic.ILayer} for labels. + * @param {boolean} source true if the source node of the edge, false otherwise + * @param {number} index the index at which the specified {@link yfiles.hierarchic.ILayer} is to be inserted + * @returns {yfiles.hierarchic.ILayer} a {@link yfiles.hierarchic.ILayer layer} instance + * @abstract + */ + insertLabelNodeLayer(source:boolean,index:number):yfiles.hierarchic.ILayer; + /** + * Registers an {@link yfiles.algorithms.Edge} as a same-layer {@link yfiles.algorithms.Edge} appropriately into all data structures. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} to be registered + * @abstract + */ + registerSameLayerEdge(edge:yfiles.algorithms.Edge):void; + /** + * Converts a same-layer {@link yfiles.algorithms.Edge} to an {@link yfiles.algorithms.Edge} of type + * {@link yfiles.hierarchic.EdgeDataType#DIRECT_SAME_LAYER_EDGE}. + * @param {yfiles.algorithms.Edge} sameLayerEdge the given same-layer {@link yfiles.algorithms.Edge} + * @abstract + */ + setDirectlyConnectSameLayerEdge(sameLayerEdge:yfiles.algorithms.Edge):void; + /** + * Specifies an edge group constraint for an {@link yfiles.algorithms.Edge} and assigns it to an {@link yfiles.hierarchic.IEdgeData} + * object. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {Object} sgId the ID of the edge group at the source node + * @param {Object} tgId the ID of the edge group at the target node + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object + * @abstract + */ + setTemporaryEdgeGroups(edge:yfiles.algorithms.Edge,sgId:Object,tgId:Object):yfiles.hierarchic.IEdgeData; + /** + * Specifies the thickness for an {@link yfiles.algorithms.Edge} and defines it in an {@link yfiles.hierarchic.IEdgeData} object. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {number} thickness the new edge thickness + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object with an adjusted {@link yfiles.hierarchic.EdgeLayoutDescriptor} + * @abstract + */ + setTemporaryEdgeThickness(edge:yfiles.algorithms.Edge,thickness:number):yfiles.hierarchic.IEdgeData; + /** + * Specifies a port constraint for an {@link yfiles.algorithms.Edge} at the given side and assigns it to an {@link yfiles.hierarchic.IEdgeData} + * object. + * @param {yfiles.algorithms.Edge} edge the given {@link yfiles.algorithms.Edge} + * @param {boolean} source true of the port constraint is defined on the source node of the {@link yfiles.algorithms.Edge}, false otherwise + * @param {yfiles.layout.PortConstraint} pc the given {@link yfiles.layout.PortConstraint} instance + * @returns {yfiles.hierarchic.IEdgeData} an {@link yfiles.hierarchic.IEdgeData} object + * @abstract + */ + setTemporaryPortConstraint(edge:yfiles.algorithms.Edge,source:boolean,pc:yfiles.layout.PortConstraint):yfiles.hierarchic.IEdgeData; + /** + * Reverts a label node to the normal {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} labelNode the given label node to be converted + * @abstract + */ + unconvertToLabelNode(labelNode:yfiles.algorithms.Node):void; + } + var IItemFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface describes a single layer in a hierarchic layout. + *

+ * A layer consists of nodes along with the associated same-layer edges. Each layer has a {@link yfiles.hierarchic.ILayer#type type} and an index representing + * its order in the {@link yfiles.hierarchic.ILayers list of layers}. + *

+ * @see yfiles.hierarchic.ILayers + * @see yfiles.hierarchic.HierarchicLayoutCore + * @see yfiles.hierarchic.ILayerer + * @interface + */ + export interface ILayer extends Object{ + /** + * Adds a newly created {@link yfiles.algorithms.Node} to this {@link yfiles.hierarchic.ILayer} instance. + * @param {yfiles.algorithms.Node} node the {@link yfiles.algorithms.Node} to be added + * @abstract + */ + add(node:yfiles.algorithms.Node):void; + /** + * Adds a same-layer {@link yfiles.algorithms.Edge} to this {@link yfiles.hierarchic.ILayer} instance. + * @param {yfiles.algorithms.Edge} edge the same-layer {@link yfiles.algorithms.Edge} to be added + * @abstract + */ + addSameLayerEdge(edge:yfiles.algorithms.Edge):void; + /** + * Removes a {@link yfiles.algorithms.Node} from this {@link yfiles.hierarchic.ILayer} instance. + * @param {yfiles.algorithms.Node} node the {@link yfiles.algorithms.Node} to be removed + * @abstract + */ + remove(node:yfiles.algorithms.Node):void; + /** + * Removes the current layer from the {@link yfiles.hierarchic.ILayers list of layers}. + * @abstract + */ + remove():void; + /** + * Adjusts the order of the {@link yfiles.algorithms.Node}s of this {@link yfiles.hierarchic.ILayer} instance according to the given + * order. + * @param {yfiles.algorithms.YList} list the given list to be used + * @abstract + */ + setNodeOrder(list:yfiles.algorithms.YList):void; + /** + * Gets a list of all same-layer {@link yfiles.algorithms.Edge}s associated with this {@link yfiles.hierarchic.ILayer} instance. + * @abstract + * @type {yfiles.algorithms.YList} + */ + sameLayerEdges:yfiles.algorithms.YList; + /** + * Gets a list of the {@link yfiles.algorithms.Node}s associated with this {@link yfiles.hierarchic.ILayer} instance. + * @abstract + * @type {yfiles.algorithms.NodeList} + */ + list:yfiles.algorithms.NodeList; + /** + * Gets the type of this {@link yfiles.hierarchic.ILayer} instance. + * @abstract + * @type {yfiles.hierarchic.LayerType} + */ + type:yfiles.hierarchic.LayerType; + /** + * Gets the index of this {@link yfiles.hierarchic.ILayer} instance in the {@link yfiles.hierarchic.ILayers list of all layers}. + * @abstract + * @type {number} + */ + index:number; + /** + * Gets or sets the {@link yfiles.layout.RowDescriptor} associated with this {@link yfiles.hierarchic.ILayer} instance. + * @abstract + * @type {yfiles.layout.RowDescriptor} + */ + row:yfiles.layout.RowDescriptor; + } + var ILayer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface merges two {@link yfiles.hierarchic.ILayers} instances whose nodes reside in the same graph. + *

+ * Implementations of this interface may provide different strategies for merging. + *

+ *

+ * {@link yfiles.hierarchic.DefaultLayeredComponentsMerger Default implementations} of this interface are used internally by {@link yfiles.hierarchic.HierarchicLayoutCore} and {@link yfiles.hierarchic.MultiComponentLayerer} + * when e.g. the graph is grouped or it consists of more than one connected component. + *

+ * @interface + */ + export interface ILayeredComponentsMerger extends Object{ + /** + * Merges two {@link yfiles.hierarchic.ILayers} instances. + *

+ * All nodes that belong to the source and target {@link yfiles.hierarchic.ILayers} are part of the graph at the moment of + * invocation. + *

+ *

+ * The state of the source {@link yfiles.hierarchic.ILayers} instance is discarded after this call and does not need to be updated + * to reflect the changes. The target {@link yfiles.hierarchic.ILayers} instance must be updated accordingly. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph containing the nodes of source and target {@link yfiles.hierarchic.ILayers} instances + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying the layer indices + * @param {yfiles.hierarchic.ILayers} srcLayers the source {@link yfiles.hierarchic.ILayers} instance that will be merged into the target {@link yfiles.hierarchic.ILayers} instance + * @param {yfiles.hierarchic.ILayers} targetLayers the {@link yfiles.hierarchic.ILayers} instance that will be modified to contain the resulting layering + * @abstract + */ + merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,srcLayers:yfiles.hierarchic.ILayers,targetLayers:yfiles.hierarchic.ILayers):void; + } + var ILayeredComponentsMerger:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is used by classes capable of generating a layer assignment. + *

+ * Layer assignment takes place during the first part of the hierarchic layout algorithms. During this phase, each node of + * the graph is assigned to a {@link yfiles.hierarchic.ILayer layer}. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#layerer + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsLayerer + * @see yfiles.hierarchic.HierarchicLayout#fromScratchLayerer + * @interface + */ + export interface ILayerer extends Object{ + /** + * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. + *

+ * In order to create new layers, factory method {@link yfiles.hierarchic.ILayers#insert} has to be used. + *

+ *

+ * Information about the nodes is provided by a {@link yfiles.hierarchic.ILayoutDataProvider}. However, positional information (see + * {@link yfiles.hierarchic.INodeData#position} and {@link yfiles.hierarchic.INodeData#layer}) is not available during this phase. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying information about the nodes and edges + * @see yfiles.hierarchic.ILayers#insert + * @see yfiles.hierarchic.ILayer#add + * @abstract + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + } + var ILayerer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface manages multiple {@link yfiles.hierarchic.ILayer} instances. + *

+ * {@link yfiles.hierarchic.HierarchicLayoutCore} creates instances of this class and passes them to the instances that handle the + * various sub-tasks of the layout process during automatic layout. + *

+ *

+ * Method {@link yfiles.hierarchic.ILayers#createInstance} can be used as a factory method to obtain temporary {@link yfiles.hierarchic.ILayers} + * instances. + *

+ * @see yfiles.hierarchic.ILayer + * @interface + */ + export interface ILayers extends Object{ + /** + * Creates a new and empty {@link yfiles.hierarchic.ILayers} instance that can be used on the same graph instance for temporary + * results. + * @returns {yfiles.hierarchic.ILayers} a new and empty {@link yfiles.hierarchic.ILayers} instance + * @abstract + */ + createInstance():yfiles.hierarchic.ILayers; + /** + * Returns the {@link yfiles.hierarchic.ILayer layer} at the specified position in this {@link yfiles.hierarchic.ILayers list of layers}. + * @param {number} i the zero-based index of the {@link yfiles.hierarchic.ILayer layer} to return + * @returns {yfiles.hierarchic.ILayer} the {@link yfiles.hierarchic.ILayer layer} at the specified position + * @abstract + */ + getLayer(i:number):yfiles.hierarchic.ILayer; + /** + * Creates, inserts and returns a {@link yfiles.hierarchic.ILayer layer} of a given type associated with this {@link yfiles.hierarchic.ILayers list of layers}. + * @param {yfiles.hierarchic.LayerType} type one of the predefined layer types as defined in {@link yfiles.hierarchic.ILayer} interface + * @param {number} position the index at which the specified {@link yfiles.hierarchic.ILayer layer} is to be inserted + * @returns {yfiles.hierarchic.ILayer} a new {@link yfiles.hierarchic.ILayer} instance + * @abstract + */ + insert(type:yfiles.hierarchic.LayerType,position:number):yfiles.hierarchic.ILayer; + /** + * Removes the {@link yfiles.hierarchic.ILayer layer} at the specified position from this {@link yfiles.hierarchic.ILayers list of layers}. + * @param {number} index the zero-based index of the {@link yfiles.hierarchic.ILayer layer} to remove + * @abstract + */ + remove(index:number):void; + /** + * Returns the number of {@link yfiles.hierarchic.ILayer layers} associated with this {@link yfiles.hierarchic.ILayers} instance. + * @returns {number} the number of layers of this {@link yfiles.hierarchic.ILayers} instance + * @abstract + */ + size():number; + } + var ILayers:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface retrieves {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} instances for elements in the + * current layout graph. + *

+ * Instances of this interface are provided by {@link yfiles.hierarchic.HierarchicLayoutCore} for instances implementing sub-tasks + * during the layout. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore + * @interface + */ + export interface ILayoutDataProvider extends Object{ + /** + * Returns the {@link yfiles.hierarchic.IEdgeData} instance associated with the given {@link yfiles.algorithms.Edge}. + * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {yfiles.hierarchic.IEdgeData} the {@link yfiles.hierarchic.IEdgeData} instance associated with the edge + * @abstract + */ + getEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.IEdgeData; + /** + * Returns the {@link yfiles.hierarchic.INodeData} instance associated with the given {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} node the given node + * @returns {yfiles.hierarchic.INodeData} the {@link yfiles.hierarchic.INodeData} instance associated with the node + * @abstract + */ + getNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.INodeData; + } + var ILayoutDataProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface provides layout information about the nodes of the graph during the layout. + *

+ * {@link yfiles.hierarchic.INodeData} is a multi-purpose node descriptor for each node of 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.ILayoutDataProvider} + * interface. + *

+ *

+ * {@link yfiles.hierarchic.INodeData} typically carries the {@link yfiles.hierarchic.INodeData#type type} of the node and depending on the type an optional {@link yfiles.hierarchic.INodeData#associatedEdge associated edge} + * and + * {@link yfiles.hierarchic.INodeData#associatedNode associated node}. Optionally, it may carry a geometric description of the borders of the node and descriptors for various + * aspects of the layout. + *

+ * @interface + */ + export interface INodeData extends Object{ + /** + * Creates, stores and returns a {@link yfiles.algorithms.BorderLine} for the given side or returns the current {@link yfiles.algorithms.BorderLine} + * instance if it already exists. + *

+ * Not every {@link yfiles.hierarchic.INodeData#type type} of node supports this operation. {@link yfiles.hierarchic.NodeDataType#NORMAL} supports + * {@link yfiles.algorithms.BorderLine}s. + *

+ *

+ * Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side + * and 3 to the left side. + *

+ * @param {number} side an integer value from [0,3] interval + * @param {yfiles.layout.INodeLayout} nodeLayout the {@link yfiles.layout.INodeLayout} of the current node + * @returns {yfiles.algorithms.BorderLine} a {@link yfiles.algorithms.BorderLine} instance + * @throws {Stubs.Exceptions.NotSupportedError} if this {@link yfiles.hierarchic.INodeData#type type} of node does not support node borders + * @see yfiles.hierarchic.INodeData#getNormalizedBorderLine + * @abstract + */ + createBorderLine(side:number,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.BorderLine; + /** + * Returns a {@link yfiles.algorithms.BorderLine} for the given side which is treated as if the position of the node is at (0,0). + *

+ * Clients may modify this instance but should always reset it to the original position, since this is a shared instance. + *

+ *

+ * It may return null to indicate that the {@link yfiles.algorithms.BorderLine} can be determined through the {@link yfiles.layout.INodeLayout} + * instance. + *

+ *

+ * Side value must be inside [0,3] interval, where 0 corresponds to the top side, 1 to the right side, 2 to the bottom side + * and 3 to the left side. + *

+ * @param {number} side an integer value from [0,3] interval + * @returns {yfiles.algorithms.BorderLine} a {@link yfiles.algorithms.BorderLine} instance or null + * @see yfiles.hierarchic.INodeData#createBorderLine + * @abstract + */ + getNormalizedBorderLine(side:number):yfiles.algorithms.BorderLine; + /** + * Returns the number of same-layer edges associated with the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} + * instance. + * @returns {number} the number of same-layer edges associated with the node + * @abstract + */ + sameLayerEdgeCount():number; + /** + * Gets the group node this node belongs to. + * @abstract + * @type {yfiles.algorithms.Node} + */ + groupNode:yfiles.algorithms.Node; + /** + * Gets the first same-layer edge {@link yfiles.algorithms.ListCell} of all same-layer edges or null if there exists no same-layer + * edge. + * @abstract + * @type {yfiles.algorithms.ListCell} + */ + firstSameLayerEdgeCell:yfiles.algorithms.ListCell; + /** + * Gets the type constant for the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance. + * @abstract + * @type {yfiles.hierarchic.NodeDataType} + */ + type:yfiles.hierarchic.NodeDataType; + /** + * Gets the group ID of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance if it is a bus-group node. + * @see yfiles.hierarchic.NodeDataType#SOURCE_GROUP_NODE + * @see yfiles.hierarchic.NodeDataType#TARGET_GROUP_NODE + * @abstract + * @type {Object} + */ + groupId:Object; + /** + * Gets the associated {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance (in case of e.g. + *

+ * back-loop proxy and side proxy). + *

+ * @abstract + * @type {yfiles.algorithms.Node} + */ + associatedNode:yfiles.algorithms.Node; + /** + * Gets the associated {@link yfiles.algorithms.Edge} of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance + * (in case of e.g. + *

+ * bend or same-layer center node). + *

+ * @abstract + * @type {yfiles.algorithms.Edge} + */ + associatedEdge:yfiles.algorithms.Edge; + /** + * Gets the index of the {@link yfiles.hierarchic.ILayer} instance to which the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} + * instance belongs. + * @abstract + * @type {number} + */ + layer:number; + /** + * Gets the current position of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance within its layer. + * @abstract + * @type {number} + */ + position:number; + /** + * Gets the parent group node of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance (if any). + * @abstract + * @type {yfiles.algorithms.Node} + */ + parentGroupNode:yfiles.algorithms.Node; + /** + * Gets the inner layers of the group {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance. + *

+ * If this node is of type {@link yfiles.hierarchic.NodeDataType#GROUP}, this method returns the {@link yfiles.hierarchic.ILayers} object + * that describes the layering in the subgraph. + *

+ * @abstract + * @type {yfiles.hierarchic.ILayers} + */ + groupLayers:yfiles.hierarchic.ILayers; + /** + * Gets the hint of the incremental mode of the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} instance if this + * node is of type {@link yfiles.hierarchic.NodeDataType#NORMAL}. + *

+ * The corresponding hint has been set by a {@link yfiles.algorithms.IDataProvider} using key + * {@link yfiles.hierarchic.HierarchicLayoutCore#INCREMENTAL_HINTS_DP_KEY}. + *

+ * @abstract + * @type {Object} + */ + incrementalHint:Object; + /** + * Gets the {@link yfiles.hierarchic.NodeLayoutDescriptor} instance initially bound to the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} + * instance or null if no {@link yfiles.hierarchic.NodeLayoutDescriptor} has been registered. + * @abstract + * @type {yfiles.hierarchic.NodeLayoutDescriptor} + */ + nodeLayoutDescriptor:yfiles.hierarchic.NodeLayoutDescriptor; + /** + * Gets the {@link yfiles.hierarchic.SwimlaneDescriptor} instance initially bound to the {@link yfiles.algorithms.Node} of this {@link yfiles.hierarchic.INodeData} + * instance or null if no {@link yfiles.hierarchic.SwimlaneDescriptor} has been registered. + * @abstract + * @type {yfiles.hierarchic.SwimlaneDescriptor} + */ + swimLaneDescriptor:yfiles.hierarchic.SwimlaneDescriptor; + } + var INodeData:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is responsible for the assignment of the x-(sequence) and preliminary y-coordinates of the nodes in a + * hierarchic layout. + *

+ * Implementations of this interface are used during the drawing phase of + * {@link yfiles.hierarchic.HierarchicLayoutCore}. They determine preliminary y-coordinates (which may be adjusted during the final + * edge routing) and the resulting x-coordinates of all elements that are part of the graph during the node placement + * phase. + *

+ *

+ * The minimum distance between each pair of nodes of the graph is determined by a {@link yfiles.hierarchic.IDrawingDistanceCalculator} + * instance. + *

+ *

+ * The default implementation used by the {@link yfiles.hierarchic.HierarchicLayoutCore} is {@link yfiles.hierarchic.SimplexNodePlacer}. + * Custom implementations of {@link yfiles.hierarchic.INodePlacer} interface can be used for hierarchic layout algorithms using + * methods {@link yfiles.hierarchic.HierarchicLayoutCore#nodePlacer} or {@link yfiles.hierarchic.HierarchicLayout#nodePlacer}. + *

+ * @see yfiles.hierarchic.SimplexNodePlacer + * @see yfiles.hierarchic.IDrawingDistanceCalculator + * @see yfiles.hierarchic.HierarchicLayoutCore + * @see yfiles.hierarchic.HierarchicLayoutCore#nodePlacer + * @see yfiles.hierarchic.HierarchicLayout#nodePlacer + * @interface + */ + export interface INodePlacer extends Object{ + /** + * Assigns preliminary y-coordinates for each layer of a hierarchic layout. + *

+ * 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 input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} layoutDataProvider the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the elements + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be calculated by this method + * @abstract + */ + assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers):void; + /** + * Determines the resulting x-coordinates of a hierarchic layout. + *

+ * The minimum distance between each pair of nodes of the graph is determined by a {@link yfiles.hierarchic.IDrawingDistanceCalculator} + * instance. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} layoutDataProvider the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the elements + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be calculated by this method + * @param {yfiles.hierarchic.IDrawingDistanceCalculator} drawingDistanceCalculator the given {@link yfiles.hierarchic.IDrawingDistanceCalculator} instance + * @abstract + */ + assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers,drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator):void; + } + var INodePlacer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is responsible for assigning port coordinates to the adjacent edges of each node of the graph. + *

+ * {@link yfiles.hierarchic.IPortAllocator} is used by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore + * @interface + */ + export interface IPortAllocator extends Object{ + /** + * Assigns to each edge of the graph a source port and target port coordinate pair. + *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} after the sequencing phase. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the elements in the layering + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing layering information about the nodes and edges of the graph + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} used temporarily for modifying the graph instance + * @abstract + */ + assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + } + var IPortAllocator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface serves as a callback for {@link yfiles.hierarchic.HierarchicLayoutCore} after the layering and sequencing + * phases. + *

+ * Implementations of this interface may modify the {@link yfiles.layout.PortConstraint port constraint} information via + * {@link yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint}. + *

+ * @interface + */ + export interface IPortConstraintOptimizer extends Object{ + /** + * Assigns new temporary port constraints after the layering information has been determined. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the elements + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} to set the temporary port constraints with + * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint + * @abstract + */ + optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Assigns new temporary port constraints after the sequence of the nodes has been determined. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} containing information about the elements + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} to set the temporary port constraints with + * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint + * @abstract + */ + optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + } + var IPortConstraintOptimizer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is used by {@link yfiles.hierarchic.HierarchicLayoutCore} to calculate the order of the nodes within each {@link yfiles.hierarchic.ILayers layer}. + *

+ * Implementations are used during the second phase of the hierarchic layout process and can be set using method {@link yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer} or {@link yfiles.hierarchic.HierarchicLayout#fromScratchSequencer}). + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#sequencer + * @see yfiles.hierarchic.HierarchicLayout#fixedElementsSequencer + * @see yfiles.hierarchic.HierarchicLayout#fromScratchSequencer + * @interface + */ + export interface ISequencer extends Object{ + /** + * Calculates the sequence of the nodes within each {@link yfiles.hierarchic.ILayers layer}. + *

+ * This method is called by {@link yfiles.hierarchic.HierarchicLayoutCore} during the second phase and finally writes back the + * calculated sequence using the {@link yfiles.hierarchic.ILayer#setNodeOrder} method. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance containing the elements in the layering + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory} used temporarily for modifying the graph instance + * @abstract + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + } + var ISequencer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class is a wrapper {@link yfiles.hierarchic.ILayerer} implementation that delegates the actual layering to a delegate + * {@link yfiles.hierarchic.ILayerer}. + *

+ * 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 {@link yfiles.hierarchic.ILayerer} instance. After that they will all be merged using the + * specified {@link yfiles.hierarchic.ILayeredComponentsMerger} instance. + *

+ * @class yfiles.hierarchic.MultiComponentLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface MultiComponentLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class MultiComponentLayerer { + /** + * Creates a new instance of {@link yfiles.hierarchic.MultiComponentLayerer} using the given {@link yfiles.hierarchic.ILayeredComponentsMerger} + * and {@link yfiles.collections.IComparer.} instances. + * @param {yfiles.hierarchic.ILayerer} singleComponentLayerer + * @param {yfiles.hierarchic.ILayeredComponentsMerger} merger + * @param {yfiles.collections.IComparer.} componentComparer + * @throws {Stubs.Exceptions.ArgumentError} if the given layerer or merger is null + * @constructor + */ + constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer,merger:yfiles.hierarchic.ILayeredComponentsMerger,componentComparer:yfiles.collections.IComparer); + /** + * Creates a new instance of {@link yfiles.hierarchic.MultiComponentLayerer} using the given delegate {@link yfiles.hierarchic.ILayerer}. + *

+ * A new instance of {@link yfiles.hierarchic.DefaultLayeredComponentsMerger} will be used as merger while no component {@link yfiles.collections.IComparer.} will be + * used. + *

+ * @param {yfiles.hierarchic.ILayerer} singleComponentLayerer + * @throws {Stubs.Exceptions.ArgumentError} if the given layerer is null + * @constructor + */ + constructor(singleComponentLayerer:yfiles.hierarchic.ILayerer); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayers} layers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Sorts an array which consists of + * {@link yfiles.algorithms.NodeList}s each of which contains nodes that belong to the same component. + *

+ * It is called during {@link yfiles.hierarchic.MultiComponentLayerer#assignLayers}. + *

+ *

+ * By default this method uses the {@link yfiles.hierarchic.MultiComponentLayerer#componentComparer ComponentComparator} to sort the list and has no effect if the instance is null. + *

+ * @param {Array.} nodeLists the array of {@link yfiles.algorithms.NodeList}s each of which containing nodes that belong to the same component + * @param {yfiles.algorithms.IDataProvider} componentIndexProvider the {@link yfiles.algorithms.IDataProvider} that returns an object (the component index) for each node (this value can be either + * integer or object) + * @protected + */ + sort(nodeLists:yfiles.algorithms.NodeList[],componentIndexProvider:yfiles.algorithms.IDataProvider):void; + /** + * Gets or sets the delegate {@link yfiles.hierarchic.ILayerer} instance. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayerer} is null + * @type {yfiles.hierarchic.ILayerer} + */ + singleComponentLayerer:yfiles.hierarchic.ILayerer; + /** + * Gets or sets the {@link yfiles.hierarchic.ILayeredComponentsMerger merger} instance. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.hierarchic.ILayeredComponentsMerger} is null + * @type {yfiles.hierarchic.ILayeredComponentsMerger} + */ + merger:yfiles.hierarchic.ILayeredComponentsMerger; + /** + * Gets or sets the component {@link yfiles.collections.IComparer.} instance. + * @type {yfiles.collections.IComparer.} + */ + componentComparer:yfiles.collections.IComparer; + static $class:yfiles.lang.Class; + } + /** + * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases to provide the drawing details of + * the nodes of the graph. + *

+ * A {@link yfiles.hierarchic.NodeLayoutDescriptor} instance can be specified individually for single nodes using a {@link yfiles.algorithms.IDataProvider} + * that returns a {@link yfiles.hierarchic.NodeLayoutDescriptor} instance for each node of the graph, or null if no {@link yfiles.hierarchic.NodeLayoutDescriptor} + * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph with key + * {@link yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ *

+ * This class is designed as a class to allow future additions of new getter methods. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY + * @see yfiles.hierarchic.EdgeLayoutDescriptor + * @class yfiles.hierarchic.NodeLayoutDescriptor + */ + export interface NodeLayoutDescriptor extends Object{} + export class NodeLayoutDescriptor { + /** + * Creates a new instance of a {@link yfiles.hierarchic.NodeLayoutDescriptor} with the default values. + * @constructor + */ + constructor(); + /** + * Returns the port border gap ratio for the port distribution at a given side of the node. + *

+ * This ratio determines the gap between a corner of the node and the first assigned port. + *

+ *

+ * The ratio should be greater than 0. + *

+ *

+ * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). + *

+ *

+ * A 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. + *

+ * @param {number} side the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0) + * @returns {number} the border gap ratio of a given side + * @see yfiles.hierarchic.NodeLayoutDescriptor#portBorderGapRatios + * @see yfiles.hierarchic.NodeLayoutDescriptor#setPortBorderGapRatio + */ + getPortBorderGapRatio(side:number):number; + /** + * Specifies the port border gap ratio for the port distribution at a given side of the node. + *

+ * This ratio determines the gap between a corner of the node and the first assigned port. + *

+ *

+ * The ratio should be greater than 0. + *

+ *

+ * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). + *

+ *

+ * A 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. + *

+ * @param {number} side the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0) + * @param {number} ratio the given ratio + * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative + * @see yfiles.hierarchic.NodeLayoutDescriptor#portBorderGapRatios + */ + setPortBorderGapRatio(side:number,ratio:number):void; + /** + * Sets the port border gap ratio for the port distribution on all sides of the node. + *

+ * This ratio determines the gap between a corner of the node and the first assigned port. + *

+ *

+ * The ratio should be greater than 0. + *

+ *

+ * A value of 0.0d results in ports being placed directly on the corner of the node (if there is more than one port). + *

+ *

+ * A 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. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is negative + * @see yfiles.hierarchic.NodeLayoutDescriptor#setPortBorderGapRatio + * @type {number} + */ + portBorderGapRatios:number; + /** + * Gets or sets the alignment of the {@link yfiles.algorithms.Node node} of this {@link yfiles.hierarchic.NodeLayoutDescriptor} instance within its layer. + *
    + *
  • A value of 0.0d corresponds to top-alignment.
  • + *
  • A value of 0.5d corresponds to center-alignment.
  • + *
  • A value of 1.0d corresponds to bottom-alignment.
  • + *
+ *

+ * This value should be within [0,1] interval. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the alignment is not within [0.0d .. 1.0d] + * @type {number} + */ + layerAlignment:number; + /** + * Gets or sets the mode that determines how node labels are handled by the algorithm during the layout. + * @throws {Stubs.Exceptions.ArgumentError} if the constant is unknown. + * @see yfiles.hierarchic.HierarchicLayout#considerNodeLabels + * @type {yfiles.hierarchic.NodeLabelMode} + */ + nodeLabelMode:yfiles.hierarchic.NodeLabelMode; + /** + * Gets or sets the minimum height of the layer to which this node is assigned. + *

+ * Values should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum height is negative + * @type {number} + */ + minimumLayerHeight:number; + /** + * Gets or sets the preferred minimum distance to obstacles. + *

+ * The minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative + * @type {number} + */ + minimumDistance:number; + /** + * Gets or sets a reference point relative to the center of the node which will be placed on a grid coordinate. + * @type {yfiles.algorithms.YPoint} + */ + gridReference:yfiles.algorithms.YPoint; + /** + * Gets or sets the assignment strategy which distributes the ports along the node borders. + * @type {yfiles.hierarchic.PortAssignmentMode} + */ + portAssignment:yfiles.hierarchic.PortAssignmentMode; + static $class:yfiles.lang.Class; + } + /** + * This class implements a {@link yfiles.layout.ILayoutStage layout stage} that handles a given {@link yfiles.layout.PartitionGrid partition grid} structure. + *

+ * Information about the {@link yfiles.layout.PartitionGrid partition grid} structure are held by a {@link yfiles.algorithms.IDataProvider} registered with the graph + * with key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. + *

+ * @see yfiles.layout.PartitionGrid + * @see yfiles.hierarchic.HierarchicLayout + * @class yfiles.hierarchic.PartitionGridLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface PartitionGridLayoutStage extends yfiles.layout.LayoutStageBase{} + export class PartitionGridLayoutStage { + /** + * Creates a new instance of {@link yfiles.hierarchic.PartitionGridLayoutStage}. + * @constructor + */ + constructor(); + static $class:yfiles.lang.Class; + } + /** + * This class is an implementation of the {@link yfiles.hierarchic.IPortConstraintOptimizer} interface that tries to assign the + * edges of the graph to {@link yfiles.layout.PortConstraint ports} considering the specified {@link yfiles.layout.PortCandidate}s. + *

+ * Instances of this class can be set using property {@link yfiles.hierarchic.HierarchicLayoutCore#portConstraintOptimizer}. + *

+ *

+ * This implementation will query for {@link yfiles.algorithms.IDataProvider}s registered with the graph with keys + * {@link yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY}, {@link yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY} + * and {@link yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY}. It will try to assign each edge one of the matching + * {@link yfiles.layout.PortCandidate}s without introducing too many crossings and without violating the {@link yfiles.layout.PortCandidate#cost cost} or {@link yfiles.layout.PortCandidateSet#connectionCount capacity} + * constraints. + *

+ * @see yfiles.layout.PortCandidate#cost + * @see yfiles.layout.PortCandidateSet#entries + * @see yfiles.layout.PortCandidateSet#connectionCount + * @class yfiles.hierarchic.PortCandidateOptimizer + * @extends {yfiles.hierarchic.PortConstraintOptimizerBase} + */ + export interface PortCandidateOptimizer extends yfiles.hierarchic.PortConstraintOptimizerBase{} + export class PortCandidateOptimizer { + /** + * Creates a new instance of {@link yfiles.hierarchic.PortCandidateOptimizer} with the default settings. + * @constructor + */ + constructor(); + /** + * Returns the data provider that provides the port candidate sets for nodes. + * @param {yfiles.layout.LayoutGraph} graph The graph that stores the data provider + * @returns {yfiles.algorithms.IDataProvider} + * @protected + */ + getPortCandidateSetDataProvider(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Gets or sets whether or not this implementation uses a deterministic algorithm to assign the + * {@link yfiles.layout.PortCandidate}s. + * @type {boolean} + */ + deterministic:boolean; + /** + * Gets or sets the penalty cost associated with each back-loop. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the penalty cost is negative + * @type {number} + */ + backLoopPenalty:number; + /** + * Gets or sets the penalty cost associated with a crossing that would occur if a given combination of + * {@link yfiles.layout.PortCandidate}s would be chosen. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the crossing penalty is negative + * @type {number} + */ + crossingPenalty:number; + /** + * Gets or sets the penalty cost associated with each edge being assigned to a port which has already reached its + * {@link yfiles.layout.IPortCandidateSetEntry#connections capacity}. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the penalty cost is negative + * @see yfiles.layout.IPortCandidateSetEntry#connections + * @type {number} + */ + overUsagePenalty:number; + static $class:yfiles.lang.Class; + } + /** + * This static class provides information about the same-layer structures created by class + * {@link yfiles.hierarchic.PortConstraintOptimizerBase}. + * @class yfiles.hierarchic.PortConstraintOptimizerSameLayerData + */ + export interface PortConstraintOptimizerSameLayerData extends Object{} + export class PortConstraintOptimizerSameLayerData { + /** + * Creates a new {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance. + * @constructor + */ + constructor(); + /** + * Adds a given dummy {@link yfiles.algorithms.Node} to this {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance and + * associates it with the given original (same-layer) {@link yfiles.algorithms.Edge}. + * @param {yfiles.algorithms.Node} sameLayerDummy a dummy node + * @param {yfiles.algorithms.Edge} originalEdge the original (same-layer) edge + */ + addDummyNode(sameLayerDummy:yfiles.algorithms.Node,originalEdge:yfiles.algorithms.Edge):void; + /** + * Returns the original (same-layer) edge associated with the given dummy {@link yfiles.algorithms.Node}. + * @param {yfiles.algorithms.Node} sameLayerDummy a given dummy node + * @returns {yfiles.algorithms.Edge} the original (same-layer) edge associated with the given dummy node + */ + getOriginalEdge(sameLayerDummy:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Gets all dummy nodes of this {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance. + * @type {yfiles.algorithms.NodeList} + */ + dummyNodes:yfiles.algorithms.NodeList; + static $class:yfiles.lang.Class; + } + /** + * This class is an abstract implementation of the {@link yfiles.hierarchic.IPortConstraintOptimizer} interface that minimizes the + * effort required to modify the port assignment after the sequencing phase of hierarchic layout algorithm. + *

+ * The {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing callback method invoked after sequencing} performs the following three steps: + *

+ *
    + *
  1. + * Restores temporarily all same-layer edges which are not currently present in the layout graph at this time of the layout + * algorithm. + *
  2. + *
  3. Invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode the hook} in which the custom port assignment should be done.
  4. + *
  5. Restores the original state of the layout graph by removing the temporary same-layer edges added in Step 1.
  6. + *
+ * @class yfiles.hierarchic.PortConstraintOptimizerBase + * @implements {yfiles.hierarchic.IPortConstraintOptimizer} + */ + export interface PortConstraintOptimizerBase extends Object,yfiles.hierarchic.IPortConstraintOptimizer{} + export class PortConstraintOptimizerBase { + /** + * Creates a new {@link yfiles.hierarchic.PortConstraintOptimizerBase} instance with default settings. + * @protected + * @constructor + */ + constructor(); + /** + * Inserts a same-layer edge structure for each same-layer edge of the original graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance holding the layering information + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory factory} that sets the temporary port constraints + * @returns {yfiles.hierarchic.PortConstraintOptimizerSameLayerData} + * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint + * @protected + */ + insertSameLayerStructures(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):yfiles.hierarchic.PortConstraintOptimizerSameLayerData; + /** + * Assigns new temporary port constraints after the nodes have been assigned to layers. + *

+ * More precisely, it is called after the layering information has been determined. In this phase, it is possible to create + * back-loops by assigning incoming edges to the south (i.e. bottom) side or outgoing edges to the north (i.e. top) side, + * respectively. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance holding the layering information + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory factory} that sets the temporary port constraints + * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint + * @abstract + */ + optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Assigns new temporary port constraints after the order of the nodes in each layer has been determined. + *

+ * More precisely, it is called after the sequence of the nodes has been determined. It {@link yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures inserts the same-layer structures}, + * invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode the hook} in which the custom port assignment should be done, and finally {@link yfiles.hierarchic.PortConstraintOptimizerBase#removeSameLayerStructures restores the original state} of the + * layout graph by removing the temporary edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the given {@link yfiles.hierarchic.ILayers} instance holding the layering information + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory factory} that sets the temporary port constraints + * @see yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures + * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing + * @see yfiles.hierarchic.PortConstraintOptimizerBase#removeSameLayerStructures + */ + optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Assigns new temporary port constraints after the order of the nodes in each layer has been determined. + *

+ * More precisely, it is called after the sequence of the nodes has been determined. It invokes {@link yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencingForSingleNode} + * for every node of the original layout graph and omits the nodes of the same-layer structures. + *

+ *

+ * Incoming and outgoing edges are sorted using {@link yfiles.collections.IComparer.} instances which define the preferred ordering of the incoming and outgoing + * edges from left to right. + *

+ * @param {yfiles.collections.IComparer.} inEdgeOrder a given {@link yfiles.collections.IComparer.} instance for incoming edges + * @param {yfiles.collections.IComparer.} outEdgeOrder a given {@link yfiles.collections.IComparer.} instance for outgoing edges + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory factory} that sets the temporary port constraints + * @param {yfiles.hierarchic.ILayers} layers + * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing + * @protected + */ + optimizeAfterSequencingForAllNodes(inEdgeOrder:yfiles.collections.IComparer,outEdgeOrder:yfiles.collections.IComparer,graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Assigns new temporary port constraints to a given node of the graph after the order of the nodes in each layer has been + * determined. + *

+ * More precisely, it is called after the sequence of the nodes has been determined. + *

+ *

+ * Incoming and outgoing edges are sorted using {@link yfiles.collections.IComparer.} instances which define the preferred ordering of the incoming and outgoing + * edges from left to right. + *

+ * @param {yfiles.algorithms.Node} node the original node to set temporary port constraints + * @param {yfiles.collections.IComparer.} inEdgeOrder a given {@link yfiles.collections.IComparer.} instance for incoming edges + * @param {yfiles.collections.IComparer.} outEdgeOrder a given {@link yfiles.collections.IComparer.} instance for outgoing edges + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory factory} that sets the temporary port constraints + * @see yfiles.hierarchic.PortConstraintOptimizerBase#optimizeAfterSequencing + * @protected + * @abstract + */ + optimizeAfterSequencingForSingleNode(node:yfiles.algorithms.Node,inEdgeOrder:yfiles.collections.IComparer,outEdgeOrder:yfiles.collections.IComparer,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Removes the same-layer edge structure created using + * {@link yfiles.hierarchic.PortConstraintOptimizerBase#insertSameLayerStructures}. + * @param {yfiles.hierarchic.PortConstraintOptimizerSameLayerData} sameLayerData a given {@link yfiles.hierarchic.PortConstraintOptimizerSameLayerData} instance holding the information about the same-layer + * structures. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.IItemFactory} itemFactory the {@link yfiles.hierarchic.IItemFactory factory} that sets the temporary port constraints + * @see yfiles.hierarchic.IItemFactory#setTemporaryPortConstraint + * @protected + */ + removeSameLayerStructures(sameLayerData:yfiles.hierarchic.PortConstraintOptimizerSameLayerData,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,itemFactory:yfiles.hierarchic.IItemFactory):void; + /** + * Gets or sets the mirror mask that defines which orientations should be mirrored. + *

+ * Setting a layout orientation can be considered as rotating the graph by 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. + *

+ * @see yfiles.layout.OrientationLayout + * @see yfiles.layout.LayoutOrientation + * @type {yfiles.layout.MirrorModes} + */ + mirrorMode:yfiles.layout.MirrorModes; + /** + * Gets or sets the layout orientation. + *

+ * This setting is necessary to correctly interpret the values provided by the {@link yfiles.layout.PortCandidate}s since the {@link yfiles.layout.OrientationLayout} + * cannot automatically adjust these values. + *

+ * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @type {yfiles.layout.LayoutOrientation} + */ + layoutOrientation:yfiles.layout.LayoutOrientation; + static $class:yfiles.lang.Class; + } + /** + * This class is used by {@link yfiles.hierarchic.EdgeLayoutDescriptor} to specify the routing style for different types of edges. + * @see yfiles.hierarchic.EdgeLayoutDescriptor#routingStyle + * @see yfiles.hierarchic.IEdgeData#type + * @class yfiles.hierarchic.RoutingStyle + */ + export interface RoutingStyle extends Object{} + export class RoutingStyle { + /** + * Creates a new {@link yfiles.hierarchic.RoutingStyle} instance with the given routing style for each edge. + * @param {yfiles.hierarchic.EdgeRoutingStyle} routingStyle one of the predefined routing styles + * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given + * @constructor + */ + constructor(routingStyle:yfiles.hierarchic.EdgeRoutingStyle); + /** + * Gets or sets the routing style for back-loop edges. + *

+ * 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.HierarchicLayout#backLoopRouting} is enabled or in some + * other scenarios with port constraints/candidates. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given + * @type {yfiles.hierarchic.EdgeRoutingStyle} + */ + backLoopRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; + /** + * Gets or sets the routing style for grouped edges at the common segments. + *

+ * More precisely, grouped edges are routed in a bus-style fashion (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. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given + * @type {yfiles.hierarchic.EdgeRoutingStyle} + */ + edgeGroupRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; + /** + * Gets or sets the default routing style for edges that have no individual routing style. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given + * @type {yfiles.hierarchic.EdgeRoutingStyle} + */ + defaultEdgeRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; + /** + * Gets or sets the routing style for same-layer edges. + *

+ * A same-layer edge is an edge whose source/target are assigned to the same layer. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given + * @type {yfiles.hierarchic.EdgeRoutingStyle} + */ + sameLayerEdgeRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; + /** + * Gets or sets the routing style for self-loops. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown routing style is given + * @type {yfiles.hierarchic.EdgeRoutingStyle} + */ + selfLoopRoutingStyle:yfiles.hierarchic.EdgeRoutingStyle; + static $class:yfiles.lang.Class; + } + /** + * This class calculates bend points for self-loops routed in orthogonal or octilinear fashion. + *

+ * It is used during the layout phase of {@link yfiles.hierarchic.HierarchicLayoutCore}, but can be used as a stand-alone tool. + *

+ * @class yfiles.hierarchic.SelfLoopCalculator + */ + export interface SelfLoopCalculator extends Object{} + export class SelfLoopCalculator { + /** + * Creates a new instance of {@link yfiles.hierarchic.SelfLoopCalculator} using the given parameters. + * @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 + * @constructor + */ + constructor(minFirstSegmentLength:number,minEdgeDistance:number); + /** + * Convenience method that calculates a list of self-loops that belong to a given node. + *

+ * The current port positions will be used for determining the start and end ports. The {@link yfiles.algorithms.IDataProvider} + * instances hold information about the source/target ports of the edges and can be used for specifying the direction of + * first and last segments. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @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 the {@link yfiles.algorithms.IDataProvider} that returns the {@link yfiles.layout.PortConstraint} object associated with the source + * ports of the edges + * @param {yfiles.algorithms.IDataProvider} tpc the {@link yfiles.algorithms.IDataProvider} that returns the {@link yfiles.layout.PortConstraint} object associated with the target + * ports of the edges + */ + calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,selfLoops:yfiles.algorithms.YList,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; + /** + * Calculates all self-loops at the given node of the given input graph. + *

+ * The current port positions will be used for determining the start and end ports. The {@link yfiles.algorithms.IDataProvider} + * instances hold information about the source/target ports of the edges and can be used for specifying the direction of + * first and last segments. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} node the node whose self-loops will be routed + * @param {yfiles.algorithms.IDataProvider} spc the {@link yfiles.algorithms.IDataProvider} that returns the {@link yfiles.layout.PortConstraint} object associated with the source + * ports of the edges + * @param {yfiles.algorithms.IDataProvider} tpc the {@link yfiles.algorithms.IDataProvider} that returns the {@link yfiles.layout.PortConstraint} object associated with the target + * ports of the edges + */ + calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; + /** + * Returns the minimum length between two edges associated with the given edge. + *

+ * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_EDGE_DISTANCE_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {number} the minimum length between two edges + * @protected + */ + getMinimumDistance(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns the minimum length of the first segment of the given edge. + *

+ * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {number} the minimum length of the first segment of an edge + * @protected + */ + getMinimumFirstSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns the minimum length of the last segment of the given edge. + *

+ * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {number} the minimum length of the last segment of the given edge + * @protected + */ + getMinimumLastSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns the minimum distance between two nodes associated with the given node. + *

+ * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_NODE_DISTANCE_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} node the given node + * @returns {number} the minimum distance between two nodes + * @protected + */ + getMinimumNodeDistance(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + /** + * Returns the minimum octilinear segment length of the given edge. + *

+ * The value is fetched from the corresponding {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.SelfLoopCalculator#MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {number} the minimum octilinear segment length of the given edge + * @protected + */ + getMinimumOctilinearSegmentLength(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 {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.hierarchic.SelfLoopCalculator#OCTILINEAR_EDGES_DP_KEY}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {boolean} true if the edge is octilinear, false otherwise + * @protected + */ + isOctilinearEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; + /** + * Data provider key for defining for each node a minimum distance to the self-loop edges + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static MINIMUM_NODE_DISTANCE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for specifying whether or not an edge is octilinear + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static OCTILINEAR_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the minimum length of the octilinear segments of an octilinear edge + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the minimum length of the first segment of each edge + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the minimum length of the last segment of each edge + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the minimum distance to the next edge or node side + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static MINIMUM_EDGE_DISTANCE_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * This class is a {@link yfiles.hierarchic.INodePlacer} implementation based on {@link yfiles.algorithms.RankAssignments rank assignment}. + *

+ * The drawer works with integer values and rounds double values to integers using sophisticated quantizing. + *

+ * @class yfiles.hierarchic.SimplexNodePlacer + * @implements {yfiles.hierarchic.INodePlacer} + */ + export interface SimplexNodePlacer extends Object,yfiles.hierarchic.INodePlacer{} + export class SimplexNodePlacer { + constructor(); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayoutDataProvider} layoutDataProvider + * @param {yfiles.hierarchic.ILayers} layers + */ + assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers):void; + /** + * Assigns the nodes of a given layer to the corresponding upper/lower sublayer if {@link yfiles.hierarchic.SimplexNodePlacer#nodeCompaction node compaction} is enabled. + *

+ * Information about sublayers is given by a {@link yfiles.algorithms.INodeMap} whose GetBool method has to return true for each + * node that should be placed in the lower sublayer (values are set by this method). + *

+ * @param {yfiles.algorithms.NodeList} layerNodes a {@link yfiles.algorithms.NodeList list} of all @link y.layout.hierarchic.incremental.NodeData#TYPE_NORMAL normal nodes} of a layer + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.layout.LayoutGraph} graph the given graph + * @param {yfiles.algorithms.INodeMap} lowerSublayer the {@link yfiles.algorithms.INodeMap} holding sublayer information + * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction + * @protected + */ + assignNodesToSublayer(layerNodes:yfiles.algorithms.NodeList,ldp:yfiles.hierarchic.ILayoutDataProvider,graph:yfiles.layout.LayoutGraph,lowerSublayer:yfiles.algorithms.INodeMap):void; + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayoutDataProvider} layoutDataProvider + * @param {yfiles.hierarchic.ILayers} layers + * @param {yfiles.hierarchic.IDrawingDistanceCalculator} drawingDistanceCalculator + */ + assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.ILayoutDataProvider,layers:yfiles.hierarchic.ILayers,drawingDistanceCalculator:yfiles.hierarchic.IDrawingDistanceCalculator):void; + /** + * Returns the alignment of the node with a specified layer. + *

+ * This callback method used by {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.algorithms.Node} node the given node + * @param {number} layerIndex the index of the layer + * @param {number} minLayerHeight the minimum height of the layer + * @returns {number} + * @protected + */ + getLayerAlignment(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,layerIndex:number,minLayerHeight:number):number; + /** + * Specifies the minimum allowed distance between two nodes of the same given layer. + *

+ * This callback method is used by {@link yfiles.hierarchic.SimplexNodePlacer#assignSequenceCoordinates}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes + * @param {yfiles.hierarchic.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 + * @returns {number} the minimum distance allowed between those two nodes ( >=0 ) + * @see yfiles.hierarchic.IDrawingDistanceCalculator + * @protected + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,predNode:yfiles.algorithms.Node,succ:yfiles.algorithms.Node):number; + /** + * Returns the minimum height of a given {@link yfiles.hierarchic.ILayer layer}. + *

+ * This callback method is used by {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the given graph + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.hierarchic.ILayer} layer the given {@link yfiles.hierarchic.ILayer} object + * @returns {number} the minimum height + * @protected + */ + getMinimumLayerHeight(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.ILayoutDataProvider,layer:yfiles.hierarchic.ILayer):number; + /** + * Returns whether or not the given node should be treated as a node with fixed (given) coordinates. + *

+ * This callback method is used by both {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates} and + * {@link yfiles.hierarchic.SimplexNodePlacer#assignSequenceCoordinates}. + *

+ *

+ * If inLayer argument is true, this method is called from within the {@link yfiles.hierarchic.SimplexNodePlacer#assignLayerCoordinates} + * method. + *

+ * @param {yfiles.layout.LayoutGraph} graph the given graph + * @param {yfiles.hierarchic.ILayoutDataProvider} provider the {@link yfiles.hierarchic.ILayoutDataProvider} implementation which provides access to the {@link yfiles.hierarchic.INodeData} and {@link yfiles.hierarchic.IEdgeData} + * instances + * @param {yfiles.algorithms.Node} node the given node + * @param {boolean} inLayer true if the layer coordinate of the node is queried, false if the sequence coordinate is queried + * @returns {boolean} true if the node should be treated as fixed, false otherwise + * @protected + */ + isFixedNode(graph:yfiles.layout.LayoutGraph,provider:yfiles.hierarchic.ILayoutDataProvider,node:yfiles.algorithms.Node,inLayer:boolean):boolean; + /** + * Gets or sets 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. + *

+ * @see yfiles.hierarchic.SimplexNodePlacer#minimumSublayerDistance + * @see yfiles.hierarchic.SimplexNodePlacer#assignNodesToSublayer + * @type {boolean} + */ + nodeCompaction:boolean; + /** + * Gets or sets the minimum distance between the upper and lower sublayer. + *

+ * 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 greater than or equal to the value specified by {@link yfiles.hierarchic.NodeLayoutDescriptor#minimumDistance}. + *

+ *

+ * Values should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if minimum sublayer distance is negative + * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction + * @type {number} + */ + minimumSublayerDistance:number; + /** + * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} places labels 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. + *

+ * @type {boolean} + */ + labelCompaction:boolean; + /** + * Gets or sets whether or not an optimization step should be applied that tries to further reduce the number of bends. + * @see yfiles.hierarchic.SimplexNodePlacer#maximumDuration + * @type {boolean} + */ + bendReduction:boolean; + /** + * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} tries to create a maximally compact horizontal + * layout at the cost of more bends. + *

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

+ * @see yfiles.hierarchic.SimplexNodePlacer#labelCompaction + * @see yfiles.hierarchic.SimplexNodePlacer#breakLongSegments + * @type {boolean} + */ + horizontalCompaction:boolean; + /** + * Gets or sets whether or not a postprocessing step should be applied to reduce the number of bends. + *

+ * Furthermore, enabling this option may violate some minimum distances specified by the user and the edge distribution is + * no longer uniform. + *

+ * @type {boolean} + */ + straightenEdges:boolean; + /** + * Gets or sets the strategy used for controlling the horizontal compactness of group nodes. + * @type {yfiles.hierarchic.GroupCompactionPolicy} + */ + groupCompactionStrategy:yfiles.hierarchic.GroupCompactionPolicy; + /** + * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} enforces the placement of nodes at their exact + * current positions, even if this violates minimum distance constraints. + * @type {boolean} + */ + exactPlacement:boolean; + /** + * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} should try to use the coordinates given from the + * current sketch for the determination of the layer coordinates. + * @type {boolean} + */ + fromSketchLayerAssignment:boolean; + /** + * Gets or sets the time limit (in milliseconds) set for the layout algorithm. + *

+ * Values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the relative weight of edges crossing a swimlane relative to edges that stay in their lane. + *

+ * Higher values lead to more compact drawings but may cause additional bends. + *

+ *

+ * Values should lie within [0,1] interval. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the relative weight does not lie within [0,1] + * @type {number} + */ + swimLaneCrossingWeight:number; + /** + * Gets or sets whether or not a barycenter drawing mode should be used. + *

+ * If this mode is enabled the resulting drawing is likely to have more bends, but may be more symmetric. + *

+ * @type {boolean} + */ + barycenterMode:boolean; + /** + * Gets or sets whether or not the {@link yfiles.hierarchic.SimplexNodePlacer} should break long edge segments in favor of a more + * compact layout. + * @type {boolean} + */ + breakLongSegments:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class is used by {@link yfiles.hierarchic.HierarchicLayoutCore} during the various phases and models a swimlane structure. + *

+ * For layout orientation + * {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}, swimlanes partition the drawing area into vertical stripes. Each node is + * placed within a user-specified lane. Swimlanes are, for example, often used in flow diagrams to separate logical units. + *

+ *

+ * 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 swimlanes' geometry will be stored by the instances after the layout. + *

+ *

+ * A {@link yfiles.hierarchic.SwimlaneDescriptor} instance can be bound to the layout algorithm using a {@link yfiles.algorithms.IDataProvider} + * registered with the graph using key {@link yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY} that returns a {@link yfiles.hierarchic.SwimlaneDescriptor} + * instance for each node of the graph. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#SWIMLANE_DESCRIPTOR_DP_KEY + * @class yfiles.hierarchic.SwimlaneDescriptor + * @implements {yfiles.lang.IComparable} + */ + export interface SwimlaneDescriptor extends Object,yfiles.lang.IComparable{} + export class SwimlaneDescriptor { + /** + * Creates a new {@link yfiles.hierarchic.SwimlaneDescriptor} instance with a given client {@link Object} and a given {@link yfiles.collections.IComparer.}. + *

+ * The given client {@link Object} should be an instance of {@link yfiles.lang.IComparable} if the given {@link yfiles.collections.IComparer.} is null. + *

+ * @param {Object} clientObject a client {@link Object} used for sorting the lanes + * @param {yfiles.collections.IComparer.} comparer a {@link yfiles.collections.IComparer.} used for comparing the client objects + * @throws {Stubs.Exceptions.ArgumentError} if the specified client {@link Object} is null or the specified {@link yfiles.collections.IComparer.} is null but the specified client {@link Object} is not an instance of + * {@link yfiles.lang.IComparable}. + * @constructor + */ + constructor(clientObject:Object,comparer:yfiles.collections.IComparer); + /** + * Creates a new {@link yfiles.hierarchic.SwimlaneDescriptor} instance with a given {@link yfiles.lang.IComparable} object. + * @param {yfiles.lang.IComparable} clientObject a {@link yfiles.lang.IComparable} used for determining the order of the lanes + * @throws {Stubs.Exceptions.ArgumentError} if the specified client object is null. + * @constructor + */ + constructor(clientObject:yfiles.lang.IComparable); + /** + * Implements the {@link yfiles.lang.IComparable} interface using the {@link yfiles.hierarchic.SwimlaneDescriptor#comparer} and {@link yfiles.hierarchic.SwimlaneDescriptor#clientObject} fields. + * @param {Object} o + * @returns {number} + */ + compareTo(o:Object):number; + /** + * Gets or sets whether or not an index of a swimlane is fixed (based on the result of the comparison with the other + * swimlanes) or whether the index should be chosen automatically in order to minimize edge lengths. + *

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

+ * @type {boolean} + */ + indexFixed:boolean; + /** + * Gets or sets the client {@link Object object}. + *

+ * The given client {@link Object} should be an instance of {@link yfiles.lang.IComparable}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if there is currently no {@link yfiles.collections.IComparer. comparator} and the specified object is not a {@link yfiles.lang.IComparable} instance + * @see yfiles.hierarchic.SwimlaneDescriptor#comparer + * @see yfiles.hierarchic.SwimlaneDescriptor#comparer + * @type {Object} + */ + clientObject:Object; + /** + * Gets or sets the tightness factor of the lane. + *

+ * This value should lie within [0,1] interval. + *

+ *

+ * The greater the value, the more will the lane be forced to obtain its minimum 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 obtain its {@link yfiles.hierarchic.SwimlaneDescriptor#minimumLaneWidth minimum width}.
  • + *
+ * @throws {Stubs.Exceptions.ArgumentError} if the tightness value is outside [0,1] interval + * @type {number} + */ + laneTightness:number; + /** + * Gets or sets the {@link yfiles.collections.IComparer.} instance used for sorting the lanes. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.collections.IComparer.} is null. + * @type {yfiles.collections.IComparer.} + */ + comparer:yfiles.collections.IComparer; + /** + * Gets or sets the minimum width of the swimlane. + *

+ * The minimum width should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value negative + * @type {number} + */ + minimumLaneWidth:number; + /** + * Gets or sets the left insets of the swimlane in which no element will lie in the resulting layout. + *

+ * The inset should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0. + * @type {number} + */ + leftLaneInset:number; + /** + * Gets or sets the right insets of the swimlane in which no element will lie in the resulting layout. + *

+ * The inset should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value is less than 0. + * @type {number} + */ + rightLaneInset:number; + /** + * Gets the computed position (smaller coordinate) of the swimlane after the layout has been calculated. + * @type {number} + */ + computedLanePosition:number; + /** + * Gets the computed width of the swimlane after the layout has been calculated. + * @type {number} + */ + computedLaneWidth:number; + /** + * Gets the computed zero-based index of the swimlane after the layout has been calculated. + * @type {number} + */ + computedLaneIndex:number; + static $class:yfiles.lang.Class; + } + /** + * This {@link yfiles.layout.ILayoutStage layout stage} can be used for automatically assigning {@link yfiles.hierarchic.SwimlaneDescriptor} instances to nodes by + * treating top-level group nodes as swimlanes. + *

+ * This stage will modify the hierarchy by temporarily removing the top-level group nodes and assigning corresponding + * descriptors to the remaining nodes. After running the core layout, the top-level group nodes will be arranged to + * function as swimlanes. This class allows using the current coordinates of the group nodes to + * {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage#orderSwimlanesFromSketch arrange the swimlanes from sketch}. Also, the {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage#spacing spacing} between swimlanes may be specified. + *

+ *

+ * This stage can be {@link yfiles.layout.MultiStageLayout#appendStage appended} to the {@link yfiles.hierarchic.HierarchicLayout}. + *

+ * @see yfiles.hierarchic.HierarchicLayout + * @see yfiles.hierarchic.SwimlaneDescriptor + * @see yfiles.layout.GroupingKeys + * @class yfiles.hierarchic.TopLevelGroupToSwimlaneStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface TopLevelGroupToSwimlaneStage extends yfiles.layout.LayoutStageBase{} + export class TopLevelGroupToSwimlaneStage { + /** + * Creates a new instance of {@link yfiles.hierarchic.TopLevelGroupToSwimlaneStage} with the default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the spacing between the swimlanes. + *

+ * The spacing should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the spacing is negative + * @type {number} + */ + spacing:number; + /** + * Gets or sets whether or not the order of the swimlanes should be determined based on the current sketch. + * @type {boolean} + */ + orderSwimlanesFromSketch:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class implements the layering phase of the {@link yfiles.hierarchic.HierarchicLayout} (i.e., assignment of the nodes to + * layers). + *

+ * It uses topological sorting to assign layers to the nodes. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[63.79,0,[[73.45,24.35,10.67,18.7,"1"]]],[121,150,[[130.66,174.35,10.67,18.7,"2"]]],[71,150,[[80.66,174.35,10.67,18.7,"3"]]],[162.99,0,[[172.65,24.35,10.67,18.7,"6"]]],[162.99,70,[[172.65,94.35,10.67,18.7,"7"]]],[112.99,70,[[122.65,94.35,10.67,18.7,"8"]]],[30.99,70,[[37.31,94.35,17.35,18.7,"12"]]],[35.5,220,[[45.16,244.35,10.67,18.7,"8"]]],[0,150,[[9.66,174.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,0,-15,[127.99,120,136,120]],[0,1,10,15,-10,-15,[88.79,50,92.49,50,92.49,130,126,130]],[0,2,0,15,0,-15,[78.79,50,81.49,50,81.49,120,86,120]],[4,1,0,15,10,-15,[177.99,120,146,120]],[3,4,0,15,0,-15],[0,6,-10,15,0,-15,[68.79,50,45.99,50]],[6,7,7.5,15,0,-15,[53.49,120,50.5,120]],[6,8,-7.5,15,0,-15,[38.49,120,15,120]],[8,7,0,15,-10,-15,[15,200,40.5,200]],[2,7,0,15,10,-15,[86,200,60.5,200]]],"vp":[0.0,0.0,193.0,250.0]}} + *

+ * @class yfiles.hierarchic.TopologicalLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface TopologicalLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class TopologicalLayerer { + /** + * Creates a new instance of {@link yfiles.hierarchic.TopologicalLayerer} with default settings. + * @constructor + */ + constructor(); + /** + * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Gets or sets the (re-)ranking policy used by this {@link yfiles.hierarchic.TopologicalLayerer} instance. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown ranking policy is given + * @type {yfiles.hierarchic.RankingPolicy} + */ + rankingPolicy:yfiles.hierarchic.RankingPolicy; + static $class:yfiles.lang.Class; + } + /** + * This class is a {@link yfiles.hierarchic.IDrawingDistanceCalculator} implementation that returns the minimum distances for each + * kind of node pair based on their type as returned by {@link yfiles.hierarchic.INodeData#type}. + * @class yfiles.hierarchic.TypeBasedDrawingDistanceCalculator + * @implements {yfiles.hierarchic.IDrawingDistanceCalculator} + */ + export interface TypeBasedDrawingDistanceCalculator extends Object,yfiles.hierarchic.IDrawingDistanceCalculator{} + export class TypeBasedDrawingDistanceCalculator { + /** + * Creates a new instance of {@link yfiles.hierarchic.TypeBasedDrawingDistanceCalculator} with default settings. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayers} layers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + */ + dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayer} layer + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + * @param {yfiles.algorithms.Node} left + * @param {yfiles.algorithms.Node} right + * @returns {number} + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.ILayer,ldp:yfiles.hierarchic.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; + /** + * + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.hierarchic.ILayers} layers + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp + */ + initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Gets or sets whether or not the compaction option is enabled. + * @see yfiles.hierarchic.SimplexNodePlacer#nodeCompaction + * @see yfiles.hierarchic.SimplexNodePlacer#labelCompaction + * @type {boolean} + */ + compaction:boolean; + /** + * Gets or sets the minimum distance between two {@link yfiles.algorithms.Node}s. + *

+ * Minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + nodeToNodeDistance:number; + /** + * Gets or sets the minimum distance between a {@link yfiles.algorithms.Node} and an (non-adjacent) {@link yfiles.algorithms.Edge}. + *

+ * Minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + nodeToEdgeDistance:number; + /** + * Gets or sets the minimum distance between two edges. + *

+ * Minimum distance should be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum distance is negative + * @type {number} + */ + edgeToEdgeDistance:number; + /** + * Gets or sets the minimum length of the first segment of the edge path (at the source node). + *

+ * The minimum length should be greater than 0. + *

+ *

+ * If the value is 0.0d the first segment does not need to be orthogonal. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative + * @type {number} + */ + minimumFirstSegmentLength:number; + static $class:yfiles.lang.Class; + } + /** + * This class implements the layering phase of the {@link yfiles.hierarchic.HierarchicLayout} (i.e., the assignment of the nodes to + * layers). + *

+ * It first makes the directed graph acyclic. Then, it assigns the layers such that edge weights are respected. A weight + * defines a minimum distance between the two end points of an edge. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[100,70,[[109.66,94.35,10.67,18.7,"1"]]],[45.59,140,[[55.25,164.35,10.67,18.7,"2"]]],[95.59,140,[[105.25,164.35,10.67,18.7,"3"]]],[0,0,[[9.66,24.35,10.67,18.7,"6"]]],[0,70,[[9.66,94.35,10.67,18.7,"7"]]],[50,70,[[59.66,94.35,10.67,18.7,"8"]]],[145.59,140,[[151.91,164.35,17.35,18.7,"12"]]],[125.59,280,[[135.25,304.35,10.67,18.7,"8"]]],[125.59,210,[[135.25,234.35,10.67,18.7,"9"]]]],"e":[[5,1,0,15,0,-15,[65,120,60.59,120]],[0,1,-10,15,10,-15,[105,120,70.59,120]],[0,2,0,15,0,-15,[115,120,110.59,120]],[4,1,0,15,-10,-15,[15,120,50.59,120]],[3,4,0,15,0,-15],[0,6,10,15,0,-15,[125,120,160.59,120]],[6,7,7.5,15,10,-15,[168.09,190,176.09,190,176.09,260,150.59,260]],[6,8,-7.5,15,0,-15,[153.09,190,140.59,190]],[8,7,0,15,0,-15],[2,7,0,15,-10,-15,[110.59,190,105.09,190,105.09,260,130.59,260]]],"vp":[0.0,0.0,177.0,310.0]}} + *

+ * @class yfiles.hierarchic.WeightedLayerer + * @implements {yfiles.hierarchic.ILayerer} + */ + export interface WeightedLayerer extends Object,yfiles.hierarchic.ILayerer{} + export class WeightedLayerer { + /** + * Creates an instance of {@link yfiles.hierarchic.WeightedLayerer} with the given key that provides access to the {@link yfiles.algorithms.IDataProvider} + * that holds the edge weights and unlimited maximum duration for the {@link yfiles.hierarchic.WeightedLayerer}. + * @param {Object} [key=null] the key to access the {@link yfiles.algorithms.IDataProvider} that holds the edge weights + * @constructor + */ + constructor(key?:Object); + /** + * Assigns all nodes of the graph to layers and adds them to the {@link yfiles.hierarchic.ILayers} instance. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.hierarchic.ILayers} layers the {@link yfiles.hierarchic.ILayers} instance that will be filled with the results of the calculation + * @param {yfiles.hierarchic.ILayoutDataProvider} ldp the {@link yfiles.hierarchic.ILayoutDataProvider} used for querying information about the nodes and edges + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.ILayers,ldp:yfiles.hierarchic.ILayoutDataProvider):void; + /** + * Assigns all nodes of the graph to layers. + * @param {yfiles.algorithms.Graph} graph the graph for which the layers are determined + * @param {yfiles.algorithms.INodeMap} layerID the {@link yfiles.algorithms.INodeMap} that will be filled by the layout algorithm and returns a zero-based layer index for each + * node + * @returns {number} the number of layers + */ + assignLayersFast(graph:yfiles.algorithms.Graph,layerID:yfiles.algorithms.INodeMap):number; + /** + * Assigns all nodes of the graph to layers. + * @param {yfiles.algorithms.Graph} graph the graph for which the layers are determined + * @param {yfiles.algorithms.INodeMap} layerID the {@link yfiles.algorithms.INodeMap} that will be filled by the layout algorithm and returns the zero-based index of the layer + * to which each node belongs + * @returns {number} the number of layers + */ + assignLayersToMap(graph:yfiles.algorithms.Graph,layerID:yfiles.algorithms.INodeMap):number; + /** + * Assigns all nodes of the graph to layers. + * @param {yfiles.layout.LayoutGraph} graph the graph for which the layers are determined + * @param {yfiles.algorithms.INodeMap} layerID the {@link yfiles.algorithms.INodeMap} that will be filled by the layout algorithm and returns a zero-based layer index for each + * node + * @param {yfiles.algorithms.EdgeList} reversedEdges an {@link yfiles.algorithms.EdgeList} containing the edges which had been reversed + * @param {yfiles.algorithms.IDataProvider} weight the {@link yfiles.algorithms.IDataProvider} that returns an integer value (weight) for each edge + * @returns {number} the number of layers + */ + assignNodeLayerWithDataProvider(graph:yfiles.layout.LayoutGraph,layerID:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList,weight:yfiles.algorithms.IDataProvider):number; + /** + * Returns the edge weight of the given edge using the weight based cycle removal heuristic. + *

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

+ *

+ * It may be overridden if non-uniform weights are desired. + *

+ * @param {yfiles.algorithms.Edge} edge given edge + * @returns {number} the edge weight of the specified edge + * @see yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval + * @see yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval + * @protected + */ + getWeight(edge:yfiles.algorithms.Edge):number; + /** + * Removes cycles from the graph using a depth first search. + * @param {yfiles.algorithms.Graph} graph the graph + * @param {yfiles.algorithms.EdgeList} reversedEdges an {@link yfiles.algorithms.EdgeList} containing the edges which will be reversed + */ + makeDFSAcyclic(graph:yfiles.algorithms.Graph,reversedEdges:yfiles.algorithms.EdgeList):void; + /** + * This is a {@link yfiles.algorithms.IDataProvider} that holds for each {@link yfiles.algorithms.Edge} an integer value representing its + * weight. + * @protected + * @type {yfiles.algorithms.IDataProvider} + */ + weight:yfiles.algorithms.IDataProvider; + /** + * The key to access the {@link yfiles.algorithms.IDataProvider} that holds the edge weights. + *

+ * More precisely, the corresponding {@link yfiles.algorithms.IDataProvider} maps each edge of the input graph to an integer value + * representing the edge's weight. + *

+ * @protected + * @type {Object} + */ + key:Object; + /** + * Gets or sets whether or not the edges that need to be reversed are determined using an edge weight based heuristic or + * using a depth first search based approach. + *

+ * 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. + *

+ * @type {boolean} + */ + weightedCycleRemoval:boolean; + /** + * Gets or sets the time limit in milliseconds set for the layout algorithm. + *

+ * Values have to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative + * @type {number} + */ + maximumDuration:number; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.hierarchic.HierarchicLayout}. + * @class yfiles.hierarchic.HierarchicLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface HierarchicLayoutData extends yfiles.layout.LayoutData{} + export class HierarchicLayoutData { + constructor(); + /** + * Gets or sets a mapping from edges to alternative paths for edges connecting to groups, group content or folder nodes. + * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_EDGE_PATH_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + alternativeEdgePath:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from group/folder nodes to alternative bounds for these nodes. + * @see yfiles.hierarchic.HierarchicLayout#ALTERNATIVE_GROUP_BOUNDS_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + alternativeGroupBounds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their priority to be a 'critical' edge. + *

+ * The layout tries to vertically align each node pair that is connected by a critical edge (integer value > 0). + *

+ * @see yfiles.hierarchic.HierarchicLayout#CRITICAL_EDGE_PRIORITY_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + criticalEdgePriorities:yfiles.layout.ItemMapping; + /** + * Gets or sets the collection of folder nodes used for recursive edge styles in incremental mode. + * @see yfiles.hierarchic.HierarchicLayout#FOLDER_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + folderNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping of edges to their {@link yfiles.hierarchic.EdgeLayoutDescriptor}. + *

+ * If an edge is mapped to null, the {@link yfiles.hierarchic.HierarchicLayout#edgeLayoutDescriptor default descriptor} is used. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeLayoutDescriptors:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping of nodes to their {@link yfiles.hierarchic.NodeLayoutDescriptor} + *

+ * If a node is mapped to null, the {@link yfiles.hierarchic.HierarchicLayout#nodeLayoutDescriptor default descriptor} is used. + *

+ * @see yfiles.hierarchic.HierarchicLayoutCore#NODE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeLayoutDescriptors:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. + * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodePortCandidateSets:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their source port group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target port group. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the factory to specify layer constraints. + * @see yfiles.hierarchic.HierarchicLayout#createLayerConstraintFactory + * @see yfiles.hierarchic.ILayerConstraintFactory + * @type {yfiles.hierarchic.ILayerConstraintFactory} + */ + layerConstraintFactory:yfiles.hierarchic.ILayerConstraintFactory; + /** + * Gets or sets the factory to specify sequence constraints. + * @see yfiles.hierarchic.HierarchicLayout#createSequenceConstraintFactory + * @see yfiles.hierarchic.ISequenceConstraintFactory + * @type {yfiles.hierarchic.ISequenceConstraintFactory} + */ + sequenceConstraintFactory:yfiles.hierarchic.ISequenceConstraintFactory; + /** + * Gets or sets a mapping from nodes and edges to their incrementally hints. + * @see yfiles.hierarchic.HierarchicLayout#INCREMENTAL_HINTS_DP_KEY + * @type {yfiles.hierarchic.IncrementalHintItemMapping} + */ + incrementalHints:yfiles.hierarchic.IncrementalHintItemMapping; + /** + * Gets or sets a mapper from nodes to the index of their layer. + *

+ * If this property is set, the mapper is filled by the layout with the layer information. + *

+ * @see yfiles.hierarchic.HierarchicLayout#LAYER_INDEX_DP_KEY + * @type {yfiles.collections.IMapper.} + */ + layerIndices:yfiles.collections.IMapper; + /** + * Gets or sets a mapper from nodes to the sequence index in their layer. + *

+ * If this property is set, the mapper is filled by the layout with the sequence information. + *

+ * @see yfiles.hierarchic.HierarchicLayout#SEQUENCE_INDEX_DP_KEY + * @type {yfiles.collections.IMapper.} + */ + sequenceIndices:yfiles.collections.IMapper; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the partition grid layout data. + * @type {yfiles.layout.PartitionGridData} + */ + partitionGridData:yfiles.layout.PartitionGridData; + /** + * Gets or sets the layout data for the {@link yfiles.hierarchic.SelfLoopCalculator}. + * @type {yfiles.hierarchic.SelfLoopCalculatorData} + */ + selfLoopCalculatorData:yfiles.hierarchic.SelfLoopCalculatorData; + /** + * Gets or sets the mapping from edges to an additional weight used by the {@link yfiles.hierarchic.ConstraintIncrementalLayerer}. + *

+ * The Layerer tries to keep edges with higher weights short. + *

+ * @see yfiles.hierarchic.ConstraintIncrementalLayerer#ADDITIONAL_EDGE_WEIGHT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + constraintIncrementalLayererAdditionalEdgeWeights:yfiles.layout.ItemMapping; + /** + * Gets or sets the collection of core nodes used by the {@link yfiles.hierarchic.BFSLayerer}. + *

+ * The {@link yfiles.hierarchic.BFSLayerer} is used when {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy} is set to {@link yfiles.hierarchic.LayeringStrategy#BFS}. + *

+ * @see yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + bfsLayererCoreNodes:yfiles.layout.ItemCollection; + /** + * Gets or set the mapping from nodes to their layer index when using the {@link yfiles.hierarchic.GivenLayersLayerer}. + *

+ * The {@link yfiles.hierarchic.GivenLayersLayerer} is used when {@link yfiles.hierarchic.HierarchicLayout#fromScratchLayeringStrategy} is set to {@link yfiles.hierarchic.LayeringStrategy#USER_DEFINED}. + *

+ * @see yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + givenLayersLayererIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to their directedness. + *

+ * Generally, the hierarchic layout algorithm assigns nodes to layers such that most of the edges point in the + * {@link yfiles.layout.MultiStageLayout#layoutOrientation main layout direction}. The directedness of an edge specifies whether it should comply with this strategy. More + * precisely, a value of 1 means that the edge should fully comply, a value of -1 that it should comply inversely (the edge + * should point against the main layout direction), and a value of 0 means that the direction doesn't matter at all and the + * endpoints of the edges may be placed at the same layer. If there are conflicting preferences, edges with higher absolute + * values are more likely to point in the desired direction. + *

+ * @see yfiles.hierarchic.HierarchicLayout#EDGE_DIRECTEDNESS_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeDirectedness:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to their thickness. + *

+ * The specified non-negative thickness is considered when calculating minimum distances so that there are no overlaps + * between edges and other graph elements. By default, each edge has thickness 0. + *

+ * @see yfiles.hierarchic.HierarchicLayout#EDGE_THICKNESS_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeThickness:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + /** + * Provides different ways to define a mapping from model items to incremental hints for use with + * {@link yfiles.hierarchic.HierarchicLayoutData}. + *

+ * Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties of + * this class should be set on an instance. + *

+ * @class yfiles.hierarchic.IncrementalHintItemMapping + * @extends {yfiles.layout.ContextItemMapping.} + * @final + */ + export interface IncrementalHintItemMapping extends yfiles.layout.ContextItemMapping{} + export class IncrementalHintItemMapping { + constructor(); + /** + * Gets or sets an item collection of nodes that are mapped to {@link yfiles.hierarchic.IIncrementalHintsFactory#createLayerIncrementallyHint incremental layering hints}. + * @type {yfiles.layout.ItemCollection.} + */ + incrementalLayeringNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets an item collection of nodes that are mapped to {@link yfiles.hierarchic.IIncrementalHintsFactory#createSequenceIncrementallyHint incremental sequencing hints}. + * @type {yfiles.layout.ItemCollection.} + */ + incrementalSequencingItems:yfiles.layout.ItemCollection; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.hierarchic.SelfLoopCalculator}. + * @class yfiles.hierarchic.SelfLoopCalculatorData + * @extends {yfiles.layout.LayoutData} + */ + export interface SelfLoopCalculatorData extends yfiles.layout.LayoutData{} + export class SelfLoopCalculatorData { + constructor(); + /** + * Gets or sets the collection of edges that are octilinear. + * @see yfiles.hierarchic.SelfLoopCalculator#OCTILINEAR_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + octilinearEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping from nodes to their minimum distance to selfloop edges. + * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_NODE_DISTANCE_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + minimumNodeDistances:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to their minimum distance to the next edge and to node sides. + * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_EDGE_DISTANCE_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + minimumEdgeDistances:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to the minimum length of their first segment. + * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + minimumFirstSegmentLengths:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to the minimum length of their last segment. + * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + minimumLastSegmentLengths:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to the minimum length of their octilinear segments. + * @see yfiles.hierarchic.SelfLoopCalculator#MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + minimumOctilinearSegmentLengths:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace organic{ + export enum InitialPlacement{ + /** + * Initial placement strategy for starting with randomly chosen node locations. + * @see yfiles.organic.ClassicOrganicLayout#initialPlacement + */ + RANDOM, + /** + * Initial placement strategy for starting with all node location coordinates set to 0. + *

+ * This strategy is best if the initial placement should be maximally neutral, ignoring the existing layout of the input + * graph. + *

+ * @see yfiles.organic.ClassicOrganicLayout#initialPlacement + */ + ZERO, + /** + * Initial placement strategy for starting with the node locations as they are in the input graph. + *

+ * This strategy is best if the existing layout should change as little as possible. + *

+ * @see yfiles.organic.ClassicOrganicLayout#initialPlacement + */ + AS_IS + } + export enum GroupsPolicy{ + /** + * Group handling policy for considering and arranging the nodes contained in a group such that their togetherness is + * highlighted. + * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy + */ + LAYOUT, + /** + * Group handling policy for keeping the relative positions of nodes that belong to the same group fixed. + *

+ * The fixed groups will be taken into account when placing the other nodes of the graph. + *

+ *

+ * By registering a {@link yfiles.algorithms.IDataProvider} with key + * {@link yfiles.organic.ClassicOrganicLayout#FIXED_GROUP_NODES_DP_KEY}, the individual group nodes can be marked as fixed or not + * fixed. If there is no data provider registered with the mentioned key, then all group nodes of the graph will be treated + * as fixed. + *

+ * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy + */ + FIXED, + /** + * Group handling policy for completely ignoring group nodes during the layout process. + * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy + */ + IGNORE + } + export enum Scope{ + /** + * Scope mode indicating that the algorithm should place all nodes of the graph. + * @see yfiles.organic.ClassicOrganicLayout#scope + */ + ALL, + /** + * Scope mode indicating that the algorithm should mainly place a subset of nodes. + *

+ * The subset is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered with key + * {@link yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY}. Nodes that don't belong to the subset may be moved to a + * certain degree but will keep their relative positions to the other nodes outside the subset. + *

+ * @see yfiles.organic.ClassicOrganicLayout#scope + * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY + */ + MAINLY_SUBSET, + /** + * Scope mode indicating that the algorithm should only place a subset of nodes. + *

+ * The subset is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered with key + * {@link yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY}. Nodes not being part of the subset will remain at their + * location. + *

+ * @see yfiles.organic.ClassicOrganicLayout#scope + * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY + */ + SUBSET + } + export enum HorizontalOverlapCriterion{ + /** + * Horizontal overlap criterion defining an overlap as horizontal if the overlapping area is greater in height than in + * width. + *

+ * Otherwise, if the overlap area's width is greater than or equal to its height, an overlap will be categorized as + * vertical. + *

+ *

+ * The area of an overlap is defined as the rectangle where two nodes intersect with each other. + *

+ * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion + */ + INTERSECTION_BOX, + /** + * Horizontal overlap criterion categorizing an overlap as horizontal if the center-to-center difference between the + * overlapping nodes is greater in horizontal direction (x-coordinates) than in vertical direction (y-coordinates). + *

+ * Otherwise, if the center-to-center difference between two overlapping nodes is greater in vertical direction + * (y-coordinates), the corresponding overlap is categorized as vertical. The same applies if the differences in vertical + * and horizontal direction are equal. + *

+ * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion + */ + NODE_CENTER, + /** + * Horizontal overlap criterion categorizing an overlap as horizontal if the required movement for solving the overlap is + * shorter in horizontal direction than in vertical direction. + *

+ * Otherwise, an overlap will be categorized as vertical. + *

+ *

+ * This criterion tries to avoid moving nodes too much because the direction for resolving overlaps will be chosen such + * that the shorter movement is preferred. + *

+ * @see yfiles.organic.ShuffleLayout#horizontalOverlapCriterion + */ + LESS_MOVEMENT + } + export enum ChainSubstructureStyle{ + /** + * Substructure style specifier for chains that indicates that the algorithm does not handle such structures in a special + * way. + * @see yfiles.organic.OrganicLayout#chainSubstructureStyle + */ + NONE, + /** + * Substructure style specifier for chains that leads to a compact (rotated) rectangular layout style for chains. + * @see yfiles.organic.OrganicLayout#chainSubstructureStyle + */ + RECTANGULAR, + /** + * Substructure style specifier for chains that leads to a straight-line layout style for chains. + * @see yfiles.organic.OrganicLayout#chainSubstructureStyle + */ + STRAIGHT_LINE + } + export enum StarSubstructureStyle{ + /** + * Substructure style specifier for stars that indicates that the algorithm does not handle such structures in a special + * way. + * @see yfiles.organic.OrganicLayout#starSubstructureStyle + */ + NONE, + /** + * Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed in the + * middle. + * @see yfiles.organic.OrganicLayout#starSubstructureStyle + */ + RADIAL, + /** + * Substructure style specifier for stars that leads to a radial layout style for stars where the root is placed on the + * outside (separated from the nodes with degree one). + * @see yfiles.organic.OrganicLayout#starSubstructureStyle + */ + SEPARATED_RADIAL, + /** + * Substructure style specifier for stars that leads to a circular layout style for stars where the root is placed in the + * middle. In contrast to the radial layout style, all nodes (except the root) are placed on a single cycle. + * @see yfiles.organic.OrganicLayout#starSubstructureStyle + */ + CIRCULAR + } + export enum ParallelSubstructureStyle{ + /** + * Substructure style specifier for parallel structures that indicates that the algorithm does not handle such structures + * in a special way. + * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle + */ + NONE, + /** + * Substructure style specifier for parallel structures that leads to a (rotated) rectangular layout style for the inner + * nodes. + * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle + */ + RECTANGULAR, + /** + * Substructure style specifier for parallel structures that leads to a radial layout style for the inner nodes. + * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle + */ + RADIAL, + /** + * Substructure style specifier for parallel structures that places the inner nodes on a straight-line. + * @see yfiles.organic.OrganicLayout#parallelSubstructureStyle + */ + STRAIGHT_LINE + } + export enum CycleSubstructureStyle{ + /** + * Substructure style specifier for cycle structures that indicates that the algorithm does not handle such structures in a + * special way. + * @see yfiles.organic.OrganicLayout#cycleSubstructureStyle + */ + NONE, + /** + * Substructure style specifier for cycle structures that leads to a circular layout style. + * @see yfiles.organic.OrganicLayout#cycleSubstructureStyle + */ + CIRCULAR + } + export enum GroupNodeMode{ + /** + * A mode constant for placing and resizing the group nodes and their content by the layout algorithm. The size of the + * group is adjusted to the space that is needed by the placement of its contained nodes. + * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY + */ + NORMAL, + /** + * A mode constant for placing the group nodes and their content with respect to the original bounds of the group node. The + * bounds of the group nodes are treated as fixed and cannot be exceeded by the content of the group nodes. + * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY + */ + FIX_BOUNDS, + /** + * A mode constant for placing group nodes with fixed content. Although these particular group nodes can move like all + * other ordinary group nodes, their content remains fixed relative to the position of the group node. + * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY + */ + FIX_CONTENTS + } + /** + * This layout algorithm removes overlaps between nodes in a graph. + *

+ * Note: The usage of {@link yfiles.organic.RemoveOverlapsStage} instead of this class is recommended for most use cases involving the + * mere removal of overlaps. That stage offers a more powerful strategy to do the task. + *

+ *

+ * Layout Style + *

+ *

+ * The style of results often resembles the look of tiles which have been dropped onto each other, where tiles correspond + * to nodes of the graph. The reason is that overlapping nodes are moved in order to resolve the overlap. During this + * process, several nodes moving in the same direction may be stacked next to or above each other. + *

+ *

+ * This algorithm does not route the edges of the input graph - edges might although be stretched due to the node + * movement. + *

+ *

+ * {@graph {"ann":{"s":[88,86],"d":0},"n":[[10,161.5,100,157],[-14,262.5],[-44,292.5],[-74,322.5],[-104,352.5],[-134,382.5],[46,262.5],[76,292.5],[106,322.5],[136,352.5],[166,382.5],[-100,198.5,320,46],[37.5,139,45,45],[195,181.5,30,73.5],[-105,181.5,30,73.5],[537.5,56,100,157],[513.5,219],[483.5,311],[453.5,403],[423.5,495],[393.5,587],[607.5,219],[603.5,311],[633.5,403],[663.5,495],[693.5,587],[458.5,4,320,46],[565,-55.5,45,45],[784.5,-13.25,30,73.5],[422.5,-13.25,30,73.5]],"e":[],"vp":[-134.0,-56.0,949.0,729.0]}} Example with overlaps (left) and after executing the shuffle layout (right) {@graph {"ann":{"s":[65.2,39.6],"d":0},"n":[[360.9,272.2],[360.9,345.2],[575.9,369.2],[378.9,401.2],[494.4,369.2],[528.4,257.7],[538.4,313.2],[657.4,369.2],[619.9,313.2],[-2.6,293],[-2.6,365.8],[173.4,369.2],[15.4,391],[130.6,383],[165.2,278.6],[174.8,296.2],[203.8,383],[191.4,309.2]],"e":[[6,0],[6,3],[1,6],[1,0],[6,5],[8,2],[15,9],[15,12],[10,15],[10,9],[15,14],[17,11]],"vp":[-3.0,257.0,726.0,184.0]}} Example with overlaps (left) and after + * executing the shuffle layout (right) Concept Nodes overlapping with other nodes will be moved in horizontal or vertical + * direction in order to remove overlaps. The concept behind this removal step is based on a famous Russian arcade game. Features + *

+ *

+ * This layout stage can also be {@link yfiles.organic.ShuffleLayout#applyLayout executed} on its own, without specifying a {@link yfiles.organic.ShuffleLayout#coreLayout core layout algorithm}. + *

+ *

+ * A minimum distance between nodes can be specified such that not only overlaps will be removed but nodes will keep this + * specified distance to other nodes. This distance can be defined separately for each node using a {@link yfiles.algorithms.IDataProvider} + * registered with key {@link yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY}. The minimum distance can also be specified + * globally via {@link yfiles.organic.ShuffleLayout#minimumNodeDistance}. + *

+ *

+ * To specify that specific nodes should not be moved, they can be marked as fixed using a {@link yfiles.algorithms.IDataProvider} + * registered with key {@link yfiles.organic.ShuffleLayout#FIXED_NODE_DP_KEY}. + *

+ * @class yfiles.organic.ShuffleLayout + * @implements {yfiles.layout.ILayoutStage} + */ + export interface ShuffleLayout extends Object,yfiles.layout.ILayoutStage{} + export class ShuffleLayout { + /** + * Creates a new instance of {@link yfiles.organic.ShuffleLayout} with default settings. + * @constructor + */ + constructor(); + /** + * Performs the overlap removal (shuffle) algorithm on the given graph, after the {@link yfiles.organic.ShuffleLayout#coreLayout core layout algorithm} was applied to it. + * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Data provider key for specifying a minimum distance for each node + *

+ * The default minimum distance specified by {@link yfiles.organic.ShuffleLayout#minimumNodeDistance} will be ignored for a node if the {@link yfiles.algorithms.IDataProvider} registered + * with this key contains a valid minimum distance for that node. + *

+ *

+ * Minimum distance values need to be greater than 0. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static MINIMUM_DISTANCE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for marking nodes as fixed + *

+ * A node marked as fixed will not be moved by this algorithm but stay at its current position. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the criterion for marking an overlap as horizontal. + *

+ * This criterion influences how overlaps will be resolved. If an overlap is considered horizontal, it will preferably be solved by + * moving nodes horizontally, else vertically. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given criterion is unknown + * @type {yfiles.organic.HorizontalOverlapCriterion} + */ + horizontalOverlapCriterion:yfiles.organic.HorizontalOverlapCriterion; + /** + * Gets or sets the default minimum distance that has to be obeyed between any two nodes. + *

+ * This default distance will be considered for a node if the {@link yfiles.algorithms.IDataProvider} registered with the graph + * with key {@link yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY} does not contain a valid, positive distance for that node. + * If there is no {@link yfiles.algorithms.IDataProvider} registered with the mentioned key, then this default distance will be + * applied to all nodes. + *

+ *

+ * The minimum distance needs to be a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative + * @see yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets whether or not the simple, fast layout mode of this algorithm is active. + *

+ * Enabling this mode, the overlap removal step will be executed using a simpler and less sophisticated approach. All + * overlaps will only be solved by moving nodes vertically. The algorithm will not try to figure out which direction might + * be better for overlap removal. + *

+ *

+ * The runtime will improve, but results may be of lower quality when using this mode. + *

+ * @type {boolean} + */ + simpleMode:boolean; + /** + * Gets or sets whether or not the barycenter mode is used for node shuffling when removing overlaps. + *

+ * If this mode is active, the overlap removal step will be executed two times for each direction, once with the normal + * node ordering and once with the reversed ordering. Finally, the barycenter between both results will be used for + * assigning the node coordinates. + *

+ *

+ * Activating the barycenter mode allows more symmetric results for some graphs. However, the runtime might increase. + *

+ * @type {boolean} + */ + barycenterMode:boolean; + static $class:yfiles.lang.Class; + } + /** + * A layout algorithm that arranges graphs in an organic fashion, using a force-directed drawing approach. + *

+ * Layout Style + *

+ *

+ * The organic layout style is characterized by a natural distribution of nodes. It is well suited to exhibit clusters and + * symmetric properties of a graph. Nodes are placed in a space-saving manner, close to their adjacent nodes. Distances + * between neighbors and edge lengths are highly uniform and edges are drawn as straight-line segments without bends. + *

+ *

+ * Organic diagrams are well suited for visualizing relations in large networks, for example, in bioinformatics, enterprise + * networking, social networks visualization, mesh visualization or system management. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[595.38,758.73,90,90],[1117.49,809.3],[536.78,520.64],[1003.62,223.83,60,60],[144.24,1098.18,60,60],[821.57,320.27,60,60],[1021.74,95.55],[546.05,952.52],[339.03,1117.6],[619.72,286.05,60,60],[459.77,255.26],[819.8,180.32],[352.63,758.67],[602.52,1268.98],[418.51,994.58],[1203,194.02],[474.19,1194.71],[1369.52,207.86],[1229.77,66.55],[1130.53,480.76],[1026.12,377.23],[416.54,865.26],[1405.72,431.59],[742.7,1277.43],[576.4,127.48],[818.41,57.66],[609.01,0],[107.77,1267.45],[468.43,35.76],[168.05,858.48],[1479.05,113.81],[347.41,29.93],[363.19,151.7],[1317.66,551.96],[648.62,1164.37],[1213.89,683.56],[1463.15,308.66],[343.86,303.87],[1583.67,28.36],[221.25,1242],[551.17,1091.78],[652.84,482.26,90,90],[257.56,950.62],[1317.11,333.14],[1249.57,431.4],[1180.69,326.71],[1213.95,579.36],[987.92,896.99],[798.79,926.46,60,60],[766.38,1113.01,60,60],[1027.6,1013.7],[921.45,1059.25],[900.59,1191.83],[863.5,1315.51],[0,1086.46],[73.01,996.02],[17.49,1193.73],[1112.66,599.54],[1026.84,506.48]],"e":[[5,3,-2.34,-4.42,-2.34,-4.42],[5,3,-0,5.66,0,5.66],[6,3],[0,7],[8,4],[5,9,-0.84,4.93,-0.84,4.93],[5,9,0,-5.07,0,-5.07],[9,10],[5,11],[7,14],[14,8],[3,15],[8,16],[13,16],[15,17],[15,18],[5,20],[3,20],[20,19],[14,21],[0,21,1.55,4.23,1.55,4.23],[0,21,0,-4.79,0,-4.79],[21,12],[23,13],[9,24],[11,25],[24,26],[4,27],[24,28],[17,30],[28,31],[10,32],[32,31],[22,33],[34,13],[33,35],[35,1],[17,36],[36,22],[10,37],[30,38],[4,39],[7,40],[34,40],[40,16],[0,41,-4.9,-1.02,-4.9,-1.02],[0,41,15.32,0,15.32,0],[0,41,5.11,0,5.11,0],[0,41,-15.32,0,-15.32,0],[41,2],[41,9,-4.88,1.11,-4.88,1.11],[41,5],[41,9,5.13,0,5.13,0],[41,5,0,15.25,13.25,0],[41,5,0,-15.25,-13.25,0],[4,42],[21,42],[42,29],[17,43],[22,43],[33,44],[43,44],[44,19],[15,45],[43,45],[45,44],[45,20],[33,46],[46,19],[46,35],[47,1],[0,48],[0,48,0,-12.87,0,-12.87],[48,47],[48,0,0,12.87,0,12.87],[49,34],[49,23],[49,48,-4.93,-0.86,-4.93,-0.86],[49,48,5.07,0,5.07,0],[50,47],[50,51],[51,48],[51,52],[52,49],[52,53],[53,23],[54,4],[55,4],[4,56],[19,57],[57,46],[57,35],[20,58],[58,19],[58,57]],"vp":[0.0,0.0,1614.0,1346.0]}} Organic layout obtained using default settings {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[791.09,783.74],[562.01,0],[0,578.93],[654.52,397.12],[398.71,661.82],[289.49,301.35],[607.55,181.65],[486.39,286.91],[431.7,133.95],[585.61,83.22],[526.07,132.08],[499.31,59.31],[643.49,286.85],[577.45,334.93],[570.46,256.07],[384.63,282.87],[349.44,208.68],[428.89,217.67],[735.86,604.59],[609.97,735.23],[576.81,577.73],[708.83,495.34],[664.78,560.98],[627.87,490.62],[768.83,700.17],[706.56,764.55],[692.13,688.28],[499.4,712.48],[490.84,632.17],[563.39,666.04],[178.72,621.75],[126.84,449.31],[282.43,497.82],[287.3,654.44],[253.43,582.88],[333.1,587.05],[74.97,603.05],[57.42,516.13],[124.98,543.53],[198.43,365.41],[274.03,396.79],[209.79,443.73]],"e":[[1,9],[9,6],[6,10],[10,9],[10,8],[9,11],[8,11],[11,1],[11,10],[6,12],[12,3],[3,13],[13,12],[13,7],[12,14],[7,14],[14,6],[14,13],[7,15],[15,5],[5,16],[16,15],[16,8],[15,17],[8,17],[17,7],[17,16],[3,21],[21,18],[18,22],[22,21],[22,20],[21,23],[20,23],[23,3],[23,22],[18,24],[24,0],[0,25],[25,24],[25,19],[24,26],[19,26],[26,18],[26,25],[19,27],[27,4],[4,28],[28,27],[28,20],[27,29],[20,29],[29,19],[29,28],[4,33],[33,30],[30,34],[34,33],[34,32],[33,35],[32,35],[35,4],[35,34],[30,36],[36,2],[2,37],[37,36],[37,31],[36,38],[31,38],[38,30],[38,37],[31,39],[39,5],[5,40],[40,39],[40,32],[39,41],[32,41],[41,31],[41,40]],"vp":[0.0,0.0,822.0,814.0]}} Organic layout exposing symmetries of the graph structureConcept + *

+ *

+ * This algorithm uses a force-directed approach to place the nodes of the input graph. The graph is modeled as a physical + * system with forces acting on it. Nodes are considered as electrically charged particles with mutually repulsive forces. + * Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an equilibrium state of the + * system, i.e., the nodes are rearranged based on the physical forces until the system reaches a (local) minimum of the + * sum of the forces. + *

+ *

+ * Features + *

+ *

+ * The {@link yfiles.organic.ClassicOrganicLayout#activateTreeBeautifier tree beautifier} feature activates a special layout style for subgraphs with a tree structure. These subgraphs will + * be arranged using an algorithm dedicated to tree graphs and incorporated into the main organic diagram. + *

+ *

+ * Several parameters for the internal force-directed drawing algorithm can be modified. For example, the {@link yfiles.organic.ClassicOrganicLayout#repulsion repulsion}, {@link yfiles.organic.ClassicOrganicLayout#attraction attraction} + * and {@link yfiles.organic.ClassicOrganicLayout#initialTemperature initial temperature} can be controlled. This allows experts to configure and fine-tune the algorithm with respect to + * their needs. + *

+ * @class yfiles.organic.ClassicOrganicLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface ClassicOrganicLayout extends yfiles.layout.MultiStageLayout{} + export class ClassicOrganicLayout { + /** + * Creates a new {@link yfiles.organic.ClassicOrganicLayout} with default settings. + * @constructor + */ + constructor(); + /** + * Frees internal resources which were in use during a previous algorithm run. + */ + dispose():void; + /** + * Data provider key for marking the nodes that are part of the current scope + * @see yfiles.organic.ClassicOrganicLayout#scope + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for marking group nodes as fixed + *

+ * The content of a fixed group node will not be changed by this algorithm but be treated as fixed. + *

+ *

+ * The groups marked as fixed will be considered for the {@link yfiles.organic.ClassicOrganicLayout#groupNodePolicy group node policy} settings {@link yfiles.organic.GroupsPolicy#FIXED} and + * {@link yfiles.organic.GroupsPolicy#LAYOUT}. When {@link yfiles.organic.GroupsPolicy#IGNORE} is chosen, the data provider registered with + * this key will be ignored. + *

+ * @see yfiles.organic.ClassicOrganicLayout#groupNodePolicy + * @see yfiles.organic.GroupsPolicy#FIXED + * @see yfiles.organic.GroupsPolicy#LAYOUT + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FIXED_GROUP_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for defining an individual preferred length for each edge + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static PREFERRED_EDGE_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the node repulsion value. + *

+ * The repulsion influences the forces between nodes. A higher repulsion value can lead to more compact drawings, whereas a + * lower repulsion value potentially enlarges drawings. + *

+ *

+ * The repulsion is defined to range from 0 to 2. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the repulsion value is negative or greater than 2 + * @type {number} + */ + repulsion:number; + /** + * Gets or sets the edge attraction value. + *

+ * The attraction influences the attractive force associated with edges. A higher attraction value can lead to more compact + * drawings, whereas a lower value potentially enlarges drawings. + *

+ *

+ * The attraction is defined to range from 0 to 2. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the attraction value is negative or greater than 2 + * @type {number} + */ + attraction:number; + /** + * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. + * @type {yfiles.layout.IGroupBoundsCalculator} + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * Gets or sets the compactness of group nodes. + *

+ * The compactness ranges from 0 to 1 where 0 results in group nodes not affecting the overall layout too much while 1 + * forces nodes in the same group to be clustered tightly. + *

+ *

+ * The compactness values needs to lie within [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if compactness value does not lie within the interval [0,1] + * @type {number} + */ + groupNodeCompactness:number; + /** + * Gets or sets the policy for the handling of group nodes. + *

+ * The group policy defines whether this algorithm {@link yfiles.organic.GroupsPolicy#IGNORE ignores} groups, leaves them {@link yfiles.organic.GroupsPolicy#FIXED fixed} or actively {@link yfiles.organic.GroupsPolicy#LAYOUT arranges} them. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given policy is unknown + * @type {yfiles.organic.GroupsPolicy} + */ + groupNodePolicy:yfiles.organic.GroupsPolicy; + /** + * Gets or sets the initial temperature for the force-directed layout process. + *

+ * The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature + * decreases and if it reaches a certain limit, the process terminates. This limit can be controlled using {@link yfiles.organic.ClassicOrganicLayout#finalTemperature}. + *

+ *

+ * The initial temperature will be multiplied by the {@link yfiles.organic.ClassicOrganicLayout#preferredEdgeLength preferred edge length} and then assigned as the actual initial heat of + * nodes. + *

+ * @see yfiles.organic.ClassicOrganicLayout#finalTemperature + * @type {number} + */ + initialTemperature:number; + /** + * Gets or sets the absolute, final temperature value, which will cause the algorithm to stop if the average temperature + * falls under this value. + *

+ * The algorithm starts with an initial temperature. During the iterations of the layout process, this temperature + * decreases. + *

+ * @see yfiles.organic.ClassicOrganicLayout#initialTemperature + * @type {number} + */ + finalTemperature:number; + /** + * Gets or sets whether or not the deterministic mode of the layout algorithm is enabled. + *

+ * In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are + * given as input. + *

+ * @type {boolean} + */ + deterministic:boolean; + /** + * Gets or sets whether or not to arrange subtrees of the input graph in a special, optimized tree style. + *

+ * Subtrees will be arranged in a {@link yfiles.tree.BalloonLayout balloon-like fashion}. + *

+ *

+ * If this feature is disabled, subgraphs with a tree structure are arranged using the same style as for the rest of the + * graph. + *

+ *

+ * In case that the input graph is a {@link yfiles.algorithms.Trees#isRootedTree tree} and this feature is enabled, the whole graph will be drawn in a tree-like style. + *

+ * @type {boolean} + */ + activateTreeBeautifier:boolean; + /** + * Gets or sets the gravity factor whose magnitude determines the strength of the force towards the barycenter of the + * graph. + *
    + *
  • A high gravity factor value leads to layouts with nodes clustered around the barycenter of the graph.
  • + *
  • A low gravity factor value stretches the outskirts of the graph far away from the barycenter.
  • + *
+ * @type {number} + */ + gravityFactor:number; + /** + * Gets or sets the scope that determines which nodes are placed by this algorithm. + * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown + * @see yfiles.organic.ClassicOrganicLayout#AFFECTED_NODES_DP_KEY + * @type {yfiles.organic.Scope} + */ + scope:yfiles.organic.Scope; + /** + * Gets or sets the strategy for the initial placement of nodes. + *

+ * The initial placement has an influence on the final result, because this force-directed algorithm starts with some + * positions and then uses forces between nodes to finally aim for a stable result drawing. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given initial placement mode is unknown + * @type {yfiles.organic.InitialPlacement} + */ + initialPlacement:yfiles.organic.InitialPlacement; + /** + * Gets or sets the maximum duration in milliseconds that this layout algorithm is allowed to run. + *

+ * The duration needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the iteration factor which influences the maximum number of optimization iterations the algorithm may + * perform. + * @type {number} + */ + iterationFactor:number; + /** + * Gets or sets the default preferred edge length. + *

+ * The default preferred edge length will be used for edges that don't have an individual length preference defined via a {@link yfiles.algorithms.IDataProvider} + * registered with key {@link yfiles.organic.ClassicOrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY}. + *

+ *

+ * The preferred edge length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative + * @type {number} + */ + preferredEdgeLength:number; + /** + * Gets or sets whether or not to consider node sizes during layout calculation. + *

+ * If this feature is disabled, overlaps between nodes (e.g. due to large node sizes) may occur. + *

+ * @type {boolean} + */ + considerNodeSizes:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext} provides control over the layout calculation in the case of + * single-threaded algorithm execution. + * @see yfiles.organic.InteractiveOrganicLayout#startLayout + * @interface + */ + export interface InteractiveOrganicLayoutExecutionContext extends Object{ + /** + * Starts the layout calculation, continuing where it has stopped before and allowing a certain maximum duration in + * milliseconds. + * @param {number} duration the duration in milliseconds the layout calculation is allowed to run + * @abstract + */ + continueLayout(duration:number):void; + /** + * Stops the layout calculation. + * @abstract + */ + stopLayout():void; + } + var InteractiveOrganicLayoutExecutionContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This algorithm arranges graphs in an organic fashion and offers special functionality to interact with the graph while + * the algorithm is running. + *

+ * Besides the organic graph arrangement, this algorithm enables to immediately visualize changes made to a graph. Changes + * can be committed and the layout will be locally updated. That way, live interactions with an adapting graph layout are + * possible. Another advantage is that it is not necessary to compute a completely new layout if only small changes were + * made. + *

+ *

+ * Layout Style + *

+ *

+ * This algorithm supports the organic layout style which is characterized by a natural distribution of nodes. It is well + * suited to exhibit clusters and symmetric properties of a graph. Nodes are placed in a space-saving manner and distances + * between neighbors are highly uniform. Edges maintain uniform lengths too and are routed with straight-line segments + * without bends. + *

+ *

+ * Organic diagrams are well suited for visualizing relations in large networks, for example, in bioinformatics, enterprise + * networking, social networks visualization, mesh visualization or system management. + *

+ *

+ * {@graph {"ann":{"s":[48,48],"d":0,"c":1},"n":[[-2901.1,82.94],[-2776.3,150.06],[-3044.96,-84.47],[-3100.49,54.95],[-3341.59,-232.28],[-3150.07,-159.49],[-2593.59,-25.02],[-2797.37,369.15],[-2792.54,582.9],[-2408.44,-110.43],[-3646.34,-1285.02],[-2406.36,-423.92],[-2508.48,535.38],[-3061.33,-181.39],[-3576.11,-153.25],[-3291.19,-446.62],[-3232.03,168.75],[-2991.88,23.83],[-2875.69,-19.77],[-3311.02,255.49],[-3211.58,273.66],[-3238.43,-589.82],[-3371.25,-336.26],[-3780.22,-96.13],[-2438.22,451.91],[-2348.8,552.52],[-2524.48,-582.24],[-2397.54,-234.83],[-3717.44,-1204.02],[-3539.82,-1255.44],[-2280.66,-209.75],[-2305.78,-69.98],[-2710.41,513.62],[-2747.74,704.16],[-2823.23,749.08],[-2354.53,12.96],[-2918.36,-219.22],[-2746.37,809.37],[-2657.24,754.28],[-3054.29,380.79],[-2235.49,-319.69],[-3521.75,-1120.87],[-3498.17,-1358.62],[-3729.27,-1087.89],[-2661.13,-725.91],[-2220.36,485.66],[-2577.32,481.65],[-2278.76,391.75],[-3911.01,-117.89],[-3889.39,-12.86],[-3449.65,-560.78],[-3236.89,-238.15],[-3271.16,-341.32],[-3062.01,-674.62],[-3372.21,-829.48],[-3343.54,161.81],[-3403.91,-648.81],[-2650.26,75.72],[-2655.19,191.31],[-2482.07,33.2],[-2545.18,138.92],[-3389.07,735.04],[-3233.93,-696.37],[-3571.23,-672.16],[-3451.64,-420.88],[-3550.73,-949.47],[-3331.67,-944.96],[-3058.81,-774.77],[-2903.06,-735.09],[-3508.46,-749.04],[-3962.39,59.51],[-4014.76,-33.26],[-4162.59,-51.88],[-2213.5,331.67],[-2143.12,434.04],[-2082.3,582.85],[-2563.73,-859.16],[-3872.43,-1134.67],[-2276.55,-427.33],[-3065.02,511.6],[-3216.65,13.18],[-3228.93,507],[-2666.53,647.27],[-2828.44,878.41],[-2888.55,-350.13],[-2803.46,-224.75],[-2274.13,227.36],[-2702.86,-255.45],[-2938.6,-442.63],[-2801.51,-416.97],[-2850.68,986.11],[-3315.58,637.75],[-3335,498.26],[-3322.98,-0.08],[-2999.45,592.68],[-3121.13,611.43],[-2191.35,-498.52],[-3933.14,-1230.72],[-3975.46,-1097.6],[-2618.48,-953.77],[-2458.11,-831.59],[-2490.11,-956.72],[-2049.18,482.82],[-1967.47,616.36],[-2076.61,696.43],[-4236.41,-130.92],[-4253.91,12.07],[-4056.39,65.42],[-2834.31,-815.64],[-2994.48,-872.19],[-3118.99,-869],[-3291.19,-1046.13],[-3606.59,-1027.04],[-3652.5,-907.63],[-3531.64,-338.57],[-3562.98,-455.05],[-3659.45,-608.85],[-3667.52,-730.4],[-3453.32,820.54],[-2454.91,197.69],[-2634.6,286.15]],"e":[[0,1],[0,2],[2,3],[2,4],[2,5],[1,6],[1,7],[7,8],[6,9],[5,13],[13,2],[4,14],[4,15],[3,16],[3,17],[17,18],[18,2],[16,19],[16,20],[20,19],[15,21],[22,4],[14,23],[12,24],[12,25],[11,26],[11,27],[10,28],[10,29],[9,30],[9,31],[8,32],[32,12],[8,33],[8,34],[34,33],[31,35],[27,35],[36,2],[34,37],[37,33],[33,38],[38,37],[32,39],[30,40],[29,41],[29,42],[28,43],[26,44],[25,45],[24,46],[46,12],[46,32],[24,47],[47,45],[23,48],[23,49],[22,50],[22,51],[51,5],[21,52],[21,53],[21,54],[19,55],[55,16],[50,56],[18,57],[57,58],[57,59],[59,35],[57,60],[56,62],[62,21],[56,63],[52,64],[50,64],[54,65],[43,65],[41,65],[54,66],[53,67],[62,67],[53,68],[44,68],[68,67],[50,69],[69,63],[69,65],[49,70],[49,71],[48,71],[70,71],[72,71],[47,73],[73,45],[47,74],[45,74],[45,75],[44,76],[43,77],[40,78],[78,11],[39,79],[39,80],[80,52],[39,81],[38,82],[82,33],[82,32],[37,83],[83,34],[36,84],[36,85],[35,86],[86,47],[86,73],[85,87],[84,88],[84,89],[83,90],[81,91],[61,91],[81,92],[80,93],[79,94],[79,95],[78,96],[77,97],[77,98],[76,99],[76,100],[76,101],[75,102],[74,102],[75,103],[75,104],[72,105],[72,106],[71,107],[70,107],[68,108],[67,109],[67,110],[66,111],[65,112],[65,113],[64,114],[64,115],[63,116],[63,117],[61,118],[60,119],[58,120]],"vp":[-4254.0,-1359.0,2335.0,2394.0]}} Organic layout obtained using this algorithmConcept + *

+ *

+ * The internal basis for computing actual layouts is a force-directed approach placing the nodes of the input graph. The + * graph is modeled as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged + * particles with mutually repulsive forces. Edges are modeled as forces that attract adjacent nodes. A good diagram is + * obtained from an equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the + * system reaches a (local) minimum of the sum of the forces. + *

+ *

+ * Features + *

+ *

+ * Several update methods allow to indicate lightweight changes on the graph, for example, {@link yfiles.organic.InteractiveOrganicLayout#setCenter} + * for node location updates. These updates will be scheduled and executed at a specific point within the life-cycle of the + * layout algorithm. They are ideally suited for usage in interactive scenarios, where users, for example, change node + * positions via mouse-dragging. + *

+ *

+ * If a {@link yfiles.layout.CopiedLayoutGraph} is being laid out, structural changes (e.g. creation or removal of nodes and edges) + * in the original graph can be automatically scheduled and applied to the {@link yfiles.layout.CopiedLayoutGraph} instance. Enable + * {@link yfiles.organic.InteractiveOrganicLayout#automaticStructureUpdate automatic structure updates} for this feature. + *
+ * Method {@link yfiles.organic.InteractiveOrganicLayout#addStructureUpdate} allows to schedule a custom event handler instance + * that is executed in a synchronized context and can safely update the structure of the graph. + *

+ *

+ * Usage Hints + *

+ *

+ * It is easiest to start the algorithm using {@link yfiles.organic.InteractiveOrganicLayout#startLayout}. Furthermore, it is + * strongly recommended to start it by passing a copy of the original graph (i.e. a {@link yfiles.layout.CopiedLayoutGraph} + * instance) as parameter to the mentioned method. + *

+ *

+ * Importantly, changes will not be automatically applied to the input graph. Updates can be scheduled via various methods (e.g. + * {@link yfiles.organic.InteractiveOrganicLayout#setCenter}). The whole layout will then internally be adjusted accordingly and + * changes are stored as intermediate results. Such intermediate results can be {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} in order to apply them to the + * actual graph. + *

+ * @class yfiles.organic.InteractiveOrganicLayout + * @implements {yfiles.layout.ILayoutAlgorithm} + */ + export interface InteractiveOrganicLayout extends Object,yfiles.layout.ILayoutAlgorithm{} + export class InteractiveOrganicLayout { + /** + * Creates a new instance of the {@link yfiles.organic.InteractiveOrganicLayout} with default settings. + * @constructor + */ + constructor(); + /** + * Schedules an update for the structure of the graph, which will automatically be executed at a later point in the + * life-cycle of this algorithm. + *

+ * The given event handler will be queued and executed at a specific time. The event handler can make structural changes + * (e.g. removal/creation of edges or nodes). They will be synchronized with the rest of the layout algorithm. + *

+ * @param {function(Object, yfiles.lang.EventArgs): void} handler The handler delegate that will be invoked using null as the sender and args as the event arguments + * @param {yfiles.lang.EventArgs} evt The event argument that will be piped to the handler invocation. + */ + addStructureUpdate(handler:(sender:Object,evt:yfiles.lang.EventArgs)=>void,evt:yfiles.lang.EventArgs):void; + /** + * Calculates an organic layout for the given input graph, however, the layout is not automatically applied to the graph. + *

+ * Changes have to be {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} to update the graph with the actual calculated positions. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @see yfiles.organic.InteractiveOrganicLayout#startLayout + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Writes calculated intermediate locations of nodes and edges to the actual graph. + *

+ * Update methods like {@link yfiles.organic.InteractiveOrganicLayout#setCenter} schedule changes which cause that the whole layout + * will internally be adjusted. All adjustments are stored as intermediate results. This method immediately transfers all + * these intermediate results to the actual input graph. + *

+ * @see yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly + */ + commitPositions():void; + /** + * Writes calculated intermediate locations of nodes and edges to the actual graph and returns the largest movement value. + *

+ * Update methods like {@link yfiles.organic.InteractiveOrganicLayout#setCenter} schedule changes which cause that the whole layout + * will internally be adjusted. All adjustments are stored as intermediate results. This method smoothly transfers all + * these intermediate results to the actual input graph. + *

+ *

+ * Positions are, however, not transferred directly (use {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} if that is intended). Instead, the + * nodes are moved towards the calculated position. The movement is restricted to the given maximum distance. + *

+ *

+ * The movement will be calculated as (movement) = (factor) * (distance between calculated and actual location) + *

+ *

+ * The returned largest movement can be used for estimating the difference between calculated layout and actual positions. + * If the return value is 0, the calculated layout was completely transferred. + *

+ * @param {number} maxMovement the maximum distance a node will be moved + * @param {number} factor a factor that determines the node movement + * @returns {number} the largest movement value or 0, if the calculated layout has been transferred completely + * @see yfiles.organic.InteractiveOrganicLayout#commitPositions + */ + commitPositionsSmoothly(maxMovement:number,factor:number):number; + /** + * Disables all predefined {@link yfiles.layout.ILayoutStage}s so that upon {@link yfiles.organic.InteractiveOrganicLayout#applyLayout} + * only the internal organic layout algorithm will be executed. + *

+ * This method is called upon construction of this class so that by default additional + * {@link yfiles.layout.ILayoutStage}s are deactivated. This method may be overridden if the additional stages should stay active + * (e.g. override the method and return silently). + *

+ * @see yfiles.layout.MultiStageLayout#disableAllStages + */ + disableAllStages():void; + /** + * Polls the current coordinates of the center of the given node. + *

+ * The returned coordinates do not necessarily correspond to the actual location of the node in the input graph. They may + * only be intermediate results stored in the algorithm. This will be the case if scheduled updates were not yet completely + * {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} to the actual graph. + *

+ * @param {yfiles.algorithms.Node} node the node for which the center should be polled + * @returns {yfiles.algorithms.YPoint} the {@link yfiles.algorithms.YPoint} representing the center location of the given node, or null if nothing about the node is + * known + * @see yfiles.organic.InteractiveOrganicLayout#setCenter + */ + getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; + /** + * Polls the current x-coordinate of the center location of the given node. + *

+ * The returned coordinate is not necessarily the actual x-coordinate of the node in the input graph but only an + * intermediate result stored in the algorithm. This will be the case if scheduled updates were not yet completely {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} + * to the actual graph. + *

+ * @param {yfiles.algorithms.Node} node the node for which the x-coordinate should be polled + * @returns {number} the x-coordinate of the center location of the given node + * @see yfiles.organic.InteractiveOrganicLayout#setCenterX + */ + getCenterX(node:yfiles.algorithms.Node):number; + /** + * Polls the current y-coordinate of the center location of the given node. + *

+ * The returned coordinate is not necessarily the actual y-coordinate of the node in the input graph but only an + * intermediate result stored in the algorithm. This will be the case if scheduled updates were not yet completely {@link yfiles.organic.InteractiveOrganicLayout#commitPositions committed} + * to the actual graph. + *

+ * @param {yfiles.algorithms.Node} node the node for which the y-coordinate should be polled + * @returns {number} the y-coordinate of the center location of the given node + * @see yfiles.organic.InteractiveOrganicLayout#setCenterY + */ + getCenterY(node:yfiles.algorithms.Node):number; + /** + * Polls the current stress value of a given node. + *

+ * The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may + * move. + *

+ *

+ * The stress value is defined to be a value from the interval [0,1]. + *

+ * @param {yfiles.algorithms.Node} node the node for which the stress value should be polled + * @returns {number} the stress value of the given node + * @see yfiles.organic.InteractiveOrganicLayout#setStress + */ + getStress(node:yfiles.algorithms.Node):number; + /** + * Schedules an update for the center location of the given node. + *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ * @param {yfiles.algorithms.Node} node the node that should be updated + * @param {number} x the desired x-coordinate of the given node + * @param {number} y the desired y-coordinate of the given node + */ + setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; + /** + * Schedules an update for the center location's x-coordinate of the given node. + *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ * @param {yfiles.algorithms.Node} node the node that should be updated + * @param {number} x the desired x-coordinate of the given node + * @see yfiles.organic.InteractiveOrganicLayout#setCenterY + * @see yfiles.organic.InteractiveOrganicLayout#setCenter + */ + setCenterX(node:yfiles.algorithms.Node,x:number):void; + /** + * Schedules an update for the center location's y-coordinate of the given node. + *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ * @param {yfiles.algorithms.Node} node the node that should be updated + * @param {number} y the desired y-coordinate of the given node + * @see yfiles.organic.InteractiveOrganicLayout#setCenterX + * @see yfiles.organic.InteractiveOrganicLayout#setCenter + */ + setCenterY(node:yfiles.algorithms.Node,y:number):void; + /** + * Schedules an update for the inertia of the given node. + *

+ * The inertia is defined to be a value from the interval [0,1]. + *

+ *
    + *
  • 1.0: The node will not move.
  • + *
  • 0.5: The node will only move half as far as it would with an inertia of 0.0.
  • + *
  • 0.0: The node will move as fast as possible.
  • + *
+ *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ * @param {yfiles.algorithms.Node} node the node whose inertia to set + * @param {number} inertia an inertia value between 0 and 1 + * @throws {Stubs.Exceptions.ArgumentError} if the given inertia value is negative or greater than 1 + */ + setInertia(node:yfiles.algorithms.Node,inertia:number):void; + /** + * Schedules an update for the preferred length of the given edge. + *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ * @param {yfiles.algorithms.Edge} edge the edge whose preferred length should be updated + * @param {number} newEdgeLength the new preferred edge length + */ + setPreferredEdgeLength(edge:yfiles.algorithms.Edge,newEdgeLength:number):void; + /** + * Schedules an update for the radius of the given node. + *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ * @param {yfiles.algorithms.Node} node the node whose radius should be updated + * @param {number} radius the desired radius for the given node + */ + setRadius(node:yfiles.algorithms.Node,radius:number):void; + /** + * Schedules an update for the stress value of the given node. + *

+ * The stress value indicates how far a node will possibly move. The higher the stress of a node is, the farther it may + * move. + *

+ *

+ * This method can be used while layout calculation is in progress (e.g. for interactive layout scenarios). However, the + * change will not directly be applied to the graph itself but only stored internally as an intermediate result. Scheduled updates can be + * committed to the graph while the algorithm is running using methods {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * or {@link yfiles.organic.InteractiveOrganicLayout#commitPositionsSmoothly}. + *

+ *

+ * The stress value is defined to be a value from the interval [0,1]. + *

+ * @param {yfiles.algorithms.Node} node the node whose stress value should be updated + * @param {number} stress a stress value from the interval [0,1] + * @throws {Stubs.Exceptions.ArgumentError} if the given stress value is negative or greater than 1 + */ + setStress(node:yfiles.algorithms.Node,stress:number):void; + /** + * Creates a {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext context object} that provides methods to continue and {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext#stopLayout stop} the layout calculation for running this layout + * algorithm in a single-threaded environment. + *

+ * Usage: Call doLayout(long) on the created instance to run the actual layout calculation for some specified period of time, + * whenever the layout should be recalculated. To actually transfer the changes, {@link yfiles.organic.InteractiveOrganicLayout#commitPositions} + * should be called subsequently. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.organic.InteractiveOrganicLayoutExecutionContext} a {@link yfiles.organic.InteractiveOrganicLayoutExecutionContext context instance} to control layout calculation + * @see yfiles.organic.InteractiveOrganicLayoutExecutionContext + * @see yfiles.organic.InteractiveOrganicLayout#applyLayout + */ + startLayout(graph:yfiles.layout.LayoutGraph):yfiles.organic.InteractiveOrganicLayoutExecutionContext; + /** + * Stops the layout algorithm. + *

+ * In contrast to + * {@link yfiles.organic.InteractiveOrganicLayout#stopAndWait}, the algorithm terminates immediately and will not wait until the + * ongoing layout calculation is finished. + *

+ * @see yfiles.organic.InteractiveOrganicLayout#stopped + * @see yfiles.organic.InteractiveOrganicLayout#stopAndWait + */ + stop():void; + /** + * Stops a previously {@link yfiles.organic.InteractiveOrganicLayout#startLayout started} algorithm and then blocks until the current layout calculation is completed. + * @see yfiles.organic.InteractiveOrganicLayout#stopped + * @see yfiles.organic.InteractiveOrganicLayout#stop + */ + stopAndWait():void; + /** + * Synchronizes the structure of the graph copy with the original graph. + * @throws {Stubs.Exceptions.InvalidOperationError} if the currently handled graph is not of type {@link yfiles.layout.CopiedLayoutGraph} + */ + syncStructure():void; + /** + * Wakes up the algorithm with the effect that it will restart/continue the layout calculation. + *

+ * This method is useful if the layouter is {@link yfiles.organic.InteractiveOrganicLayout#sleeping sleeping} but should be notified of changes (e.g. due to user interaction). + *

+ * @see yfiles.organic.InteractiveOrganicLayout#sleeping + */ + wakeUp():void; + /** + * Gets or sets whether or not this algorithm performs automatic structure updates on the graph copy if the original graph + * changes. + *

+ * If this feature is enabled, a listener will be registered with the original input graph. This listener will + * automatically transfer structural changes on the original graph to the graph copy and update its internal data + * structures. + *

+ * @type {boolean} + */ + automaticStructureUpdate:boolean; + /** + * Gets the time when the last wake-up, that is, call to {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}, occurred. + *

+ * The time is defined in terms of the difference between the current time and midnight, January 1, 1970 UTC, measured in + * milliseconds. + *

+ * @type {number} + */ + lastWakeupTime:number; + /** + * Gets whether or not this layout algorithm has stopped. + *

+ * If the algorithm has stopped, it terminated all its layout calculations. It is not {@link yfiles.organic.InteractiveOrganicLayout#running running} anymore and can not be + * restarted/continued by calling {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}. + *

+ * @type {boolean} + */ + stopped:boolean; + /** + * Gets whether or not this layout algorithm is currently sleeping. + *

+ * Sleeping indicates that the algorithm has not {@link yfiles.organic.InteractiveOrganicLayout#stopped stopped} yet but is waiting (i.e. doing nothing). It can be notified to + * continue its work using {@link yfiles.organic.InteractiveOrganicLayout#wakeUp}. + *

+ * @see yfiles.organic.InteractiveOrganicLayout#wakeUp + * @type {boolean} + */ + sleeping:boolean; + /** + * Gets whether or not this layout algorithm is currently running. + *

+ * The algorithm is running if the layout process is still active, the algorithm has not {@link yfiles.organic.InteractiveOrganicLayout#stopped stopped} yet and is not {@link yfiles.organic.InteractiveOrganicLayout#sleeping sleeping}. + *

+ * @type {boolean} + */ + running:boolean; + /** + * Gets or sets the working ratio which defines the amount of processor time this algorithm tries to get. + *

+ * A working ratio value of 1 means that the algorithm will try to run as fast as possible. Lower values will lead to small + * breaks after each internal round. + *

+ *

+ * The ratio needs to be a value in (0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given ratio is not in (0,1]. + * @type {number} + */ + workingRatio:number; + /** + * Gets or sets the default preferred edge length. + *

+ * This length does not define the actual absolute length of edges, but the layout algorithm considers the specified + * preference where possible. + *

+ *

+ * The preferred edge length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative + * @see yfiles.organic.InteractiveOrganicLayout#setPreferredEdgeLength + * @type {number} + */ + preferredEdgeLength:number; + /** + * Gets or sets the preferred distance between nodes. + *

+ * The minimum node distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified minimum node distance is negative + * @type {number} + */ + preferredNodeDistance:number; + /** + * Gets or sets the maximum duration in milliseconds that this algorithm is allowed to run. + *

+ * The duration needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified maximum duration has a negative value + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the ratio of layout quality versus running time. + *

+ * The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout + * calculation. + *

+ *

+ * The value needs to lie within [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0,1] + * @type {number} + */ + qualityTimeRatio:number; + /** + * Gets or sets an {@link yfiles.organic.OutputRestriction} which restricts the area for the layout result of this algorithm. + * @see yfiles.organic.OutputRestriction + * @type {yfiles.organic.OutputRestriction} + */ + outputRestriction:yfiles.organic.OutputRestriction; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm arranges graphs in an organic fashion. + *

+ * Layout Style The organic layout style is characterized by a natural distribution of nodes that exhibits clusters and symmetric + * properties of the graph. Nodes are placed space-saving, close to their adjacent nodes. Edges maintain uniform lengths + * and are routed with straight-line segments without bends. + *

+ *

+ * Organic diagrams are commonly used for visualizing relations in large networks for example in bioinformatics, enterprise + * networking, visualizing social networks, mesh visualization or system management. + *

+ *

+ * {@graph {"ann": {"s": [30,30], "d": 1},"n": [[623,552], [719,500], [460,606], [461,312], [650,830], [467,417], [399,245], [710,595], [712,756], [423,492], [336,473], [387,373], [545,645], [883,702], [688,675], [507,226], [796,722], [667,62], [572,158], [470,158], [594,354], [520,352], [615,651], [687,222], [731,111], [950,654], [361,553], [309,325], [365,631], [722,895], [282,570], [496,729], [554,76], [211,540], [308,103], [256,489], [703,312], [850,621], [720,405], [333,181], [658,141], [281,421], [159,261], [791,555], [541,0], [574,864], [777,646], [513,518], [590,745], [611,221], [630,289], [557,278], [663,366], [237,274], [809,470], [874,520], [923,583], [889,446], [958,478], [999,550], [1020,624], [722,835], [626,922], [678,895], [251,867], [406,695], [235,779], [63,939], [130,979], [238,810], [355,820], [166,734], [147,828], [317,756], [94,705], [194,852], [127,898], [195,927], [68,863], [761,971], [693,970], [518,920], [637,1005], [714,1036], [255,203], [330,260], [976,402], [1039,447], [1078,551], [1105,411], [893,782], [958,741], [826,393], [0,980], [734,1109]], "e": [[0,1], [5,3], [6,3], [0,7], [8,4], [5,9,3.45,2.02,3.45,2.02], [5,9,-4.64,0,-4.64,0], [9,10], [5,11], [7,14], [14,8], [3,15], [8,16], [13,16], [15,18], [15,19], [5,21], [3,21], [21,20], [14,22], [0,22], [22,12], [25,13], [9,26], [11,27], [26,28], [4,29], [26,30], [18,32], [30,33], [10,35], [35,33], [23,36], [37,13], [36,38], [38,1], [6,39], [39,34], [18,40], [40,17], [40,24], [40,23], [10,41], [37,43], [43,1], [43,7], [32,44], [4,45], [7,46], [37,46], [46,16], [0,47], [0,47,0,-7.33,0,-7.33], [0,47,0,7.33,0,7.33], [47,2], [47,9,-1.25,4.32,-1.25,4.32], [47,5,-4.1,1.87,-4.1,1.87], [47,9,0,-4.68,0,-4.68], [47,5,4.94,0,4.94,0], [4,48], [22,48], [48,31], [18,49], [23,49], [36,50], [49,50], [50,20], [15,51], [49,51], [51,50], [51,21], [36,52], [52,20], [42,53], [53,27], [54,1], [55,43], [55,54], [56,37], [56,55], [56,25], [57,54], [57,58], [58,55], [58,59], [59,56], [59,60], [60,25], [61,4], [62,4], [4,63], [63,61], [2,65], [31,65], [28,65], [64,66], [68,67], [66,71], [69,72], [66,73], [73,65], [73,70], [73,69], [71,74], [66,75], [69,75], [72,76], [75,76], [76,67], [64,77], [75,77], [77,76], [77,68], [72,78], [78,67], [29,79], [63,80], [45,81], [62,82], [79,83], [80,83], [83,82], [39,84], [84,53], [85,6], [85,27], [58,86], [58,87], [59,88], [87,89], [13,90], [13,91], [54,92], [67,93], [83,94]], "vp": [0.0,0.0,1135.0,1139.0]}} Organic Layout obtained with default settings {@graph {"ann": {"s": [30,30], "d": 1},"n": [[563.5,1043.5], [1196.5,36.5], [-0.5,15.5], [871.5,537.5], [598.5,41.5], [315.5,513.5], [717.5,813.5], [590.5,599.5], [439.5,797.5], [635.5,935.5], [576.5,835.5], [502.5,928.5], [597.5,992.5], [568.5,943.5], [532.5,989.5], [682.5,878.5], [649.5,826.5], [622.5,877.5], [507.5,821.5], [464.5,867.5], [525.5,873.5], [809.5,683.5], [737.5,582.5], [688.5,691.5], [773.5,756.5], [750.5,704.5], [714.5,751.5], [846.5,612.5], [807.5,565.5], [788.5,622.5], [663.5,586.5], [641.5,642.5], [699.5,631.5], [446.5,567.5], [364.5,660.5], [482.5,680.5], [520.5,577.5], [478.5,619.5], [535.5,637.5], [378.5,544.5], [334.5,587.5], [391.5,602.5], [391.5,735.5], [451.5,736.5], [419.5,685.5], [1050.5,277.5], [915.5,36.5], [799.5,257.5], [974.5,416.5], [926.5,304.5], [851.5,397.5], [926.5,481.5], [910.5,424.5], [867.5,467.5], [1022.5,351.5], [991.5,300.5], [965.5,354.5], [861.5,283.5], [820.5,328.5], [877.5,341.5], [1127.5,150.5], [1065.5,34.5], [1011.5,140.5], [1095.5,217.5], [1070.5,162.5], [1035.5,209.5], [1165.5,90.5], [1134.5,34.5], [1107.5,87.5], [990.5,29.5], [966.5,84.5], [1024.5,79.5], [756.5,25.5], [706.5,139.5], [823.5,125.5], [837.5,19.5], [804.5,65.5], [863.5,73.5], [676.5,29.5], [655.5,86.5], [713.5,74.5], [748.5,202.5], [807.5,191.5], [766.5,147.5], [282.5,15.5], [142.5,256.5], [392.5,237.5], [442.5,8.5], [368.5,105.5], [486.5,125.5], [522.5,18.5], [481.5,59.5], [538.5,77.5], [360.5,-0.5], [332.5,51.5], [392.5,46.5], [383.5,171.5], [442.5,185.5], [425.5,128.5], [132.5,15.5], [64.5,127.5], [184.5,121.5], [207.5,9.5], [173.5,58.5], [231.5,64.5], [63.5,14.5], [28.5,68.5], [86.5,65.5], [97.5,194.5], [158.5,188.5], [122.5,141.5], [215.5,393.5], [339.5,373.5], [265.5,282.5], [168.5,329.5], [225.5,332.5], [200.5,278.5], [261.5,457.5], [321.5,442.5], [279.5,401.5], [371.5,307.5], [330.5,261.5], [313.5,318.5]], "e": [[0,12], [12,9], [9,13], [13,12], [13,11], [12,14], [11,14], [14,0], [14,13], [9,15], [15,6], [6,16], [16,15], [16,10], [15,17], [10,17], [17,9], [17,16], [10,18], [18,8], [8,19], [19,18], [19,11], [18,20], [11,20], [20,10], [20,19], [6,24], [24,21], [21,25], [25,24], [25,23], [24,26], [23,26], [26,6], [26,25], [21,27], [27,3], [3,28], [28,27], [28,22], [27,29], [22,29], [29,21], [29,28], [22,30], [30,7], [7,31], [31,30], [31,23], [30,32], [23,32], [32,22], [32,31], [7,36], [36,33], [33,37], [37,36], [37,35], [36,38], [35,38], [38,7], [38,37], [33,39], [39,5], [5,40], [40,39], [40,34], [39,41], [34,41], [41,33], [41,40], [34,42], [42,8], [8,43], [43,42], [43,35], [42,44], [35,44], [44,34], [44,43], [3,51], [51,48], [48,52], [52,51], [52,50], [51,53], [50,53], [53,3], [53,52], [48,54], [54,45], [45,55], [55,54], [55,49], [54,56], [49,56], [56,48], [56,55], [49,57], [57,47], [47,58], [58,57], [58,50], [57,59], [50,59], [59,49], [59,58], [45,63], [63,60], [60,64], [64,63], [64,62], [63,65], [62,65], [65,45], [65,64], [60,66], [66,1], [1,67], [67,66], [67,61], [66,68], [61,68], [68,60], [68,67], [61,69], [69,46], [46,70], [70,69], [70,62], [69,71], [62,71], [71,61], [71,70], [46,75], [75,72], [72,76], [76,75], [76,74], [75,77], [74,77], [77,46], [77,76], [72,78], [78,4], [4,79], [79,78], [79,73], [78,80], [73,80], [80,72], [80,79], [73,81], [81,47], [47,82], [82,81], [82,74], [81,83], [74,83], [83,73], [83,82], [4,90], [90,87], [87,91], [91,90], [91,89], [90,92], [89,92], [92,4], [92,91], [87,93], [93,84], [84,94], [94,93], [94,88], [93,95], [88,95], [95,87], [95,94], [88,96], [96,86], [86,97], [97,96], [97,89], [96,98], [89,98], [98,88], [98,97], [84,102], [102,99], [99,103], [103,102], [103,101], [102,104], [101,104], [104,84], [104,103], [99,105], [105,2], [2,106], [106,105], [106,100], [105,107], [100,107], [107,99], [107,106], [100,108], [108,85], [85,109], [109,108], [109,101], [108,110], [101,110], [110,100], [110,109], [85,114], [114,111], [111,115], [115,114], [115,113], [114,116], [113,116], [116,85], [116,115], [111,117], [117,5], [5,118], [118,117], [118,112], [117,119], [112,119], [119,111], [119,118], [112,120], [120,86], [86,121], [121,120], [121,113], [120,122], [113,122], [122,112], [122,121]], "vp": [-1.0,-1.0,1228.0,1075.0]}} Organic Layout exhibiting symmetric propertiesConcept{@link yfiles.organic.OrganicLayout} + * uses a force-directed approach to place the nodes of the input graph. According to this approach, the graph is modeled + * as a physical system with appropriate forces acting on it. Nodes are considered as electrically charged particles with + * mutually repulsive forces. Edges are modeled as springs that attract adjacent nodes. A good diagram is obtained from an + * equilibrium state of the system, i.e., the nodes are rearranged based on the physical forces until the system reaches a + * (local) minimum of the sum of the forces. Features + *

+ *

+ * The ratio between the layout quality and the running time is conveniently adjustable. + *

+ *

+ * This layout algorithm is able to consider a {@link yfiles.layout.PartitionGrid} structure. However, for common nodes (i.e. + * non-group nodes) it only considers single partition cells. Furthermore, the layout algorithm will throw a {@link yfiles.algorithms.InvalidGraphStructureError} + * 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 a group node mode other than {@link yfiles.organic.GroupNodeMode#NORMAL}. + *

+ *

+ * Although overlaps between edges and nodes are avoided, this layout algorithm doesn't guarantee that they won't appear in + * the resulting layout. To avoid overlaps, it is possible to route the edges afterwards using an edge routing algorithm, + * e.g., {@link yfiles.router.OrganicEdgeRouter}. + *

+ *

+ * The algorithm is also able to detect certain types of substructures in a graph (i.e., {@link yfiles.organic.OrganicLayout#chainSubstructureStyle chains}, {@link yfiles.organic.OrganicLayout#starSubstructureStyle stars}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle cycles} and + * {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle parallel structures}) and arrange these structures with special-purpose layout styles. Using substructure styles ensures + * that the corrsponding structures are easily recognized in the graph. + *

+ *

+ * {@graph {"ann":{"s":[50,50],"d":0, "c":1},"n":[[651.02,746.2],[499.25,376.34],[757.43,840.9],[574.93,802.49],[772.23,780.83],[712.08,729.69],[591.5,342.9],[630.22,404.23],[511.3,574.88],[356.15,353.31],[488.74,447.78],[566.25,739.99],[832.31,791.39],[152.43,610.4],[689.57,879.35],[248.1,596.17],[120.25,697.57],[639.18,467.72],[427.77,458.88],[408.48,519.6],[691.9,669.45],[818.01,882.83],[539.8,660.71],[585.22,875.17],[636.28,814.7],[714.64,608.38],[656.9,343.12],[511.04,217.28],[470.75,277.59],[422.59,338.16],[565.7,413.55],[531.15,295.7],[348.61,180.63],[402.12,271.28],[284.34,91.79],[321.78,0],[381.55,66.78],[214.95,158.82],[187.52,306.65],[287.7,278.04],[92.76,309.88],[631.56,613.97],[513.18,814.11],[775.66,700.72],[601.82,679.52],[504.9,731.91],[697.17,813.09],[606.93,266.97],[450.55,583.13],[728.3,327.65],[717.42,253.29],[543.5,154.51],[614.76,150.96],[500.57,513.16],[360.14,445.09],[293.67,694],[348.53,611.5],[206.29,734.57],[571.37,553.51],[0,313.72],[233.88,6.24],[182.4,76.67],[420.47,398.21],[561.25,487.65],[680.21,183.49]],"e":[[0,2],[0,5],[0,3],[0,4],[1,7],[1,6],[1,8],[1,10],[1,9],[0,12],[0,14],[0,11],[15,13],[16,13],[1,17],[1,19],[1,18],[0,24],[0,22],[0,20],[0,23],[0,21],[1,58],[0,25],[0,58],[1,29],[1,31],[1,26],[1,27],[1,28],[1,30],[32,34],[1,33],[32,33],[36,34],[35,34],[37,34],[38,40],[38,39],[0,44],[0,41],[0,46],[0,43],[0,45],[0,42],[1,47],[48,8],[48,58],[48,10],[48,18],[48,19],[50,47],[51,47],[52,47],[49,47],[48,53],[48,54],[1,54],[1,53],[55,56],[56,15],[16,57],[57,55],[56,48],[39,33],[59,40],[60,34],[61,34],[1,62],[48,62],[1,63],[48,63],[64,47]],"vp":[0.0,0.0,883.0,933.0]}} Organic Layout without applying specific layout styles to substructures {@graph {"ann":{"s":[50,50],"d":0,"c":1},"n":[[222.41,751.98],[933.19,715.06],[333.12,751.98],[167.05,656.1],[111.7,751.98],[277.76,656.1],[1075.74,818.63],[987.64,882.64],[826.53,1248.81],[1109.39,715.06],[923.05,1325.6],[250.02,979.37],[167.05,847.86],[283.81,1327.29],[277.76,847.86],[357.8,1251.78],[312.21,1429.13],[1075.74,611.5],[946.75,1221.23],[879.92,1137.62],[451.47,751.98],[352.53,563.47],[425.23,858.43],[425.23,645.53],[352.53,940.5],[250.02,524.59],[790.64,611.5],[756.99,715.06],[790.64,818.63],[987.64,547.49],[878.74,882.64],[878.74,547.49],[1282.21,484.89],[1243.62,401.08],[1488.63,603.97],[1399.06,538.9],[1522.84,498.68],[1399.06,669.05],[1287.59,215.47],[1262.1,323.21],[1313.08,107.74],[50.95,600.08],[141.18,966.16],[0,806.8],[141.18,537.8],[50.95,903.88],[0,697.16],[765.65,208.84],[592.77,1142.94],[799.86,314.13],[799.86,103.55],[676.08,143.76],[676.08,273.91],[772.89,1137.75],[706.25,1221.5],[488.59,1379.94],[460.19,1278.11],[414.6,1455.45],[619.49,1010.84],[1338.57,0],[1522.84,709.26],[1599.34,603.97],[730.18,1325.82],[826.67,1372.15],[876.36,208.84]],"e":[[0,2],[0,5],[0,3],[0,4],[1,7],[1,6],[1,8],[1,10],[1,9],[0,12],[0,14],[0,11],[15,13],[16,13],[1,17],[1,19],[1,18],[0,24],[0,22],[0,20],[0,23],[0,21],[1,58],[0,25],[0,58],[1,29],[1,31],[1,26],[1,27],[1,28],[1,30],[32,34],[1,33],[32,33],[36,34],[35,34],[37,34],[38,40],[38,39],[0,44],[0,41],[0,46],[0,43],[0,45],[0,42],[1,47],[48,8],[48,58],[48,10],[48,18],[48,19],[50,47],[51,47],[52,47],[49,47],[48,53],[48,54],[1,54],[1,53],[55,56],[56,15],[16,57],[57,55],[56,48],[39,33],[59,40],[60,34],[61,34],[1,62],[48,62],[1,63],[48,63],[64,47]],"vp":[0.0,0.0,1650.0,1506.0]}} Organic Layout of the same graph applying + * specific layout styles to the detected substructures + *

+ * @class yfiles.organic.OrganicLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface OrganicLayout extends yfiles.layout.MultiStageLayout{} + export class OrganicLayout { + /** + * Creates a new {@link yfiles.organic.OrganicLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Configures the given {@link yfiles.layout.ComponentLayout} to take fixed nodes in components into account. + *

+ * Components that contain fixed nodes will not be rearranged. + *

+ *

+ * This method is called by {@link yfiles.organic.OrganicLayout#applyLayout} before the actual layout is calculated. It may be + * overridden in order to manually configure the {@link yfiles.layout.ComponentLayout}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.layout.ComponentLayout} layouter the {@link yfiles.layout.ComponentLayout} instance to reconfigure + * @see yfiles.organic.OrganicLayout#smartComponentLayout + * @protected + */ + configureComponentLayout(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayout):void; + /** + * Disposes of the {@link yfiles.layout.ComponentLayout} instance. + *

+ * This method is called by {@link yfiles.organic.OrganicLayout#applyLayout} after the actual layout is calculated. It may be + * overridden in order to revert a custom configuration made in {@link yfiles.organic.OrganicLayout#configureComponentLayout}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.layout.ComponentLayout} layouter the {@link yfiles.layout.ComponentLayout} to reset + * @see yfiles.organic.OrganicLayout#smartComponentLayout + * @protected + */ + disposeComponentLayout(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayout):void; + /** + * Data provider key for specifying the directedness of edges. + *

+ * Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this {@link yfiles.algorithms.IDataProvider} + * allows the user to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge + * should be considered to be directed from source to target, a value of -1 that it is directed from target to source, and + * a value of 0 means that it is undirected. + *

+ *

+ * Currently, the specified values are only considered during the detection of special substructures, see {@link yfiles.organic.OrganicLayout#chainSubstructureStyle}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle}, {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle} and {@link yfiles.organic.OrganicLayout#starSubstructureStyle}. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_DIRECTEDNESS_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for marking the nodes that are part of the relevant subset + * @see yfiles.organic.OrganicLayout#scope + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static AFFECTED_NODES_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for assigning individual modes for all group nodes + *

+ * The modes specify how a group's content is handled and if it is resized during layout calculation. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static GROUP_NODE_MODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for defining an individual preferred length for each edge + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static PREFERRED_EDGE_LENGTH_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * 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 AutomaticGroupNodeCompactionEnabled is disabled and if there is + * no partition grid structure. + *

+ *

+ * By default this value is 0.4. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if compactness value does not lie in [0..1] + * @type {number} + */ + groupNodeCompactness:number; + /** + * Gets or sets whether or not group nodes are compacted automatically. + *

+ * When enabled, the compactness factor is determined automatically, i.e. it only depends on the general compactness + * specified by option {@link yfiles.organic.OrganicLayout#compactnessFactor}. + *

+ * @see yfiles.organic.OrganicLayout#groupNodeCompactness + * @see yfiles.organic.OrganicLayout#compactnessFactor + * @type {boolean} + */ + automaticGroupNodeCompaction:boolean; + /** + * Gets or sets whether or not a clustering algorithm should be applied to the input graph. + *

+ * When this option is enabled, the following steps are performed during the layout: + *

+ *
    + *
  1. A clustering algorithm is applied to the input graph.
  2. + *
  3. All nodes of the same cluster are put into a newly created group node.
  4. + *
  5. The layout is applied to the modified graph.
  6. + *
  7. Group nodes denoting clusters (inserted during step 2) are removed.
  8. + *
+ *

+ * The user can also specify customized clusters by defining appropriate groups. + *

+ * @see yfiles.organic.OrganicLayout#maximumDuration + * @type {boolean} + */ + clusterNodes:boolean; + /** + * Gets or sets the quality measure of the clustering algorithm. + *

+ * The higher the value, the higher the clustering quality. + *

+ *

+ * The value needs to lie in [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified quality measure is outside the interval [0,1] + * @see yfiles.organic.OrganicLayout#clusterNodes + * @see yfiles.organic.OrganicLayout#maximumDuration + * @type {number} + */ + clusteringQuality:number; + /** + * Gets or sets whether or not to reserve space for node labels during layout calculation. + * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.layout.IGroupBoundsCalculator} is null + * @type {yfiles.layout.IGroupBoundsCalculator} + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * Gets or sets whether or not this instance should configure the {@link yfiles.layout.ComponentLayout} to respect subsets of + * nodes. + *

+ * When only a subset of nodes is placed by the layout algorithm, the fixed nodes will keep their locations even if they + * reside in different components. + *

+ * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.organic.OrganicLayout#scope + * @type {boolean} + */ + smartComponentLayout:boolean; + /** + * Gets or sets whether or not the layout algorithm tries to avoid node/edge overlaps. + * @see yfiles.organic.OrganicLayout#nodeOverlapsAllowed + * @type {boolean} + */ + nodeEdgeOverlapAvoided:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + /** + * Gets or sets the ratio of layout quality versus running time. + *

+ * The larger the ratio, the better the quality of the resulting layout but the longer it may take to perform the layout + * calculation. + *

+ *

+ * The value needs to lie within [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is outside the interval [0,1] + * @type {number} + */ + qualityTimeRatio:number; + /** + * Gets or sets the maximum duration in milliseconds that this layout algorithm is allowed to run. + *

+ * The duration needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the scope that determines which nodes are placed by this algorithm. + * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown + * @see yfiles.organic.OrganicLayout#AFFECTED_NODES_DP_KEY + * @type {yfiles.organic.Scope} + */ + scope:yfiles.organic.Scope; + /** + * Gets or sets the style specifier for chain substructures. + *

+ * A chain is a simple edge path where the degree of the nodes is less than or equal to 2. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown + * @see yfiles.organic.OrganicLayout#scope + * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY + * @type {yfiles.organic.ChainSubstructureStyle} + */ + chainSubstructureStyle:yfiles.organic.ChainSubstructureStyle; + /** + * Gets or sets the style specifier for cycle substructures. + *

+ * A cycle is a simple edge path where the first and last node are identical. The algorithm only considers cycles where the + * number of edges connecting nodes of the cycle with the remaining nodes is less than or equal to 2. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown + * @see yfiles.organic.OrganicLayout#scope + * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY + * @type {yfiles.organic.CycleSubstructureStyle} + */ + cycleSubstructureStyle:yfiles.organic.CycleSubstructureStyle; + /** + * Gets or sets the style specifier for parallel substructures. + *

+ * A parallel structure consists of a set of nodes (called the inner nodes) such that all nodes have degree two and are + * connected to the same pair of neighbors (called the outer nodes). + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown + * @see yfiles.organic.OrganicLayout#scope + * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY + * @type {yfiles.organic.ParallelSubstructureStyle} + */ + parallelSubstructureStyle:yfiles.organic.ParallelSubstructureStyle; + /** + * Gets or sets the style specifier for star substructures. + *

+ * A star consists of a set of degree one nodes that are all connected to the same node (called the root of the star). + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given style is unknown + * @see yfiles.organic.OrganicLayout#scope + * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY + * @type {yfiles.organic.StarSubstructureStyle} + */ + starSubstructureStyle:yfiles.organic.StarSubstructureStyle; + /** + * Gets or sets the compactness factor for the layout algorithm. + *

+ * Smaller values result in less compact drawings, greater values result in more compact drawings. + *

+ *

+ * The compactness value needs to lie in [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified value is outside the interval [0,1] + * @type {number} + */ + compactnessFactor:number; + /** + * Gets or sets the default preferred edge length. + *

+ * If there is no specific preferred edge length assigned to an edge, this default preferred edge length is used. + *

+ *

+ * The preferred edge length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified edge length is negative + * @see yfiles.organic.OrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY + * @type {number} + */ + preferredEdgeLength:number; + /** + * Gets or sets the minimum preferred distance between nodes and edges when node-edge overlaps are not allowed. + *

+ * The minimum preferred distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + preferredMinimumNodeToEdgeDistance:number; + /** + * Gets or sets whether or not to consider node sizes during layout calculation. + *

+ * If this option is enabled, the circumcircles of the nodes are used. If it is disabled, points will be used instead. + *

+ * @type {boolean} + */ + considerNodeSizes:boolean; + /** + * Gets or sets whether or not the deterministic mode of this algorithm is enabled. + *

+ * In deterministic mode, the layout algorithm will yield the same results if the exact same input and same settings are + * given as input. + *

+ * @type {boolean} + */ + deterministic:boolean; + /** + * Gets or sets the minimum node distance that this algorithm should enforce between all pairs of nodes. + *

+ * The minimum node distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified minimum node distance is negative + * @see yfiles.organic.OrganicLayout#nodeOverlapsAllowed + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets whether or not overlaps between nodes are allowed. + * @see yfiles.organic.OrganicLayout#minimumNodeDistance + * @see yfiles.organic.OrganicLayout#scope + * @type {boolean} + */ + nodeOverlapsAllowed:boolean; + /** + * Gets or sets the area restriction for the result of the layout algorithm. + * @type {yfiles.organic.OutputRestriction} + */ + outputRestriction:yfiles.organic.OutputRestriction; + static $class:yfiles.lang.Class; + } + /** + * This layout stage enables support for handling a graph with a {@link yfiles.layout.PartitionGrid} structure. + *

+ * Concept + *

+ *

+ * Before executing the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}, this stage prepares the grid structure of the graph accordingly, e.g., by hiding top-level grid + * nodes. Then, the core layout algorithm is applied to the graph. Finally, the grid is restored, configured and positioned + * such that it is consistent with the layout computed by the core algorithm. + *

+ *

+ * Information about the {@link yfiles.layout.PartitionGrid} structure is retrieved from a {@link yfiles.algorithms.IDataProvider} + * registered with the graph using key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. + *

+ *

+ * Usage + *

+ *

+ * When using {@link yfiles.organic.OrganicLayout}, this stage will automatically be used, if required. It is not necessary to + * append this stage manually to {@link yfiles.organic.OrganicLayout}. + *

+ *

+ * Appending this stage can be useful to add support for {@link yfiles.layout.PartitionGrid partition grid} structures to other + * {@link yfiles.layout.ILayoutAlgorithm}s. + *

+ *

+ * The stage can be appended to all algorithms of type {@link yfiles.layout.MultiStageLayout} by using method + * {@link yfiles.layout.MultiStageLayout#appendStage}. + *

+ * @see yfiles.layout.PartitionGrid + * @class yfiles.organic.OrganicPartitionGridLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface OrganicPartitionGridLayoutStage extends yfiles.layout.LayoutStageBase{} + export class OrganicPartitionGridLayoutStage { + /** + * Creates a new instance of {@link yfiles.organic.OrganicPartitionGridLayoutStage} with the given layout algorithm as + * {@link yfiles.layout.LayoutStageBase#coreLayout core algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} core the core layout algorithm + * @constructor + */ + constructor(core:yfiles.layout.ILayoutAlgorithm); + static $class:yfiles.lang.Class; + } + /** + * This layout stage removes node overlaps while changes to the original layout structure are avoided and a specified + * minimum node distance is guaranteed. + *

+ * Layout Style + *

+ *

+ * Unlike the overlap removal approach implemented by + * {@link yfiles.organic.RemoveOverlapsStage}, this stage tries to keep the original layout structure, i.e., it tries to keep the + * geometric distances between the nodes. + *

+ *

+ * The strategy for removing overlaps is similar to the layout strategy used by organic (force-directed) layout algorithms + * (e.g. + * {@link yfiles.organic.OrganicLayout}). Therefore, this stage is especially well suited to remove node overlaps in undirected + * graph drawings with straight-line edges, as produced by organic layout approaches. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[-264.13,89.64],[-109.95,153.19],[-68.91,-95.12],[-178.12,-35.61,60,60],[-88.42,-54.43],[-134.12,41.2],[-214.95,40.96,60,60],[-96.74,81.55,60,60],[-145.17,111.32],[-255.82,6.45],[-272.91,49.11],[-47.42,-39.94,60,60],[-645,65.04],[-507.21,54.41],[-586.74,40.54,60,60],[-488.66,89.42,60,60],[-539.17,115.13],[-488.66,132.42],[-636.26,24.59],[-645,46.48],[-468.9,-54.43],[-546.97,19.76,60,60],[-456.97,-40.24],[-447.21,-40.24,60,60],[-320.5,-180,1,1,4],[-320.5,251.5,1,1,4]],"e":[[2,3],[8,7],[5,7],[9,6],[6,5],[8,6],[0,6],[10,6],[3,6],[8,5],[7,6],[3,4],[4,2],[7,1],[8,1],[7,11],[20,21],[16,15],[13,15],[18,14],[14,13],[16,14],[12,14],[19,14],[21,14],[16,13],[15,14],[21,22],[22,20],[15,17],[16,17],[15,23],[24,25]],"vp":[-645.0,-182.0,658.0,436.0]}} A graph containing overlaps (left) and the result after applying this layout stageFeatures + *

+ *

+ * It is possible to define a {@link yfiles.organic.OrganicRemoveOverlapsStage#minimumNodeDistance minimum distance} between nodes. This feature allows to not only remove overlaps but forces + * nodes to keep the specified distance to other nodes. + *

+ *

+ * Nodes can be marked as fixed. Such nodes will not be moved during the overlap removal process. A {@link yfiles.algorithms.IDataProvider} + * with key {@link yfiles.organic.OrganicRemoveOverlapsStage#FIXED_NODE_DP_KEY} can be registered to mark the fixed nodes. + *

+ * @class yfiles.organic.OrganicRemoveOverlapsStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface OrganicRemoveOverlapsStage extends yfiles.layout.LayoutStageBase{} + export class OrganicRemoveOverlapsStage { + /** + * Creates a new instance of {@link yfiles.organic.OrganicRemoveOverlapsStage} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The core layout algorithm. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Data provider key for marking nodes as fixed + *

+ * A node marked as fixed will not be moved by this algorithm but stay at its current position. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FIXED_NODE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the maximum duration in milliseconds that this layout stage is allowed to run. + *

+ * This maximum time does not include the time required for the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ *

+ * The duration needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified duration has a negative value + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the minimum distance to be kept between any two nodes of the graph. + *

+ * Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too + * close to each other with respect to this distance will be displaced. + *

+ *

+ * The distance needs to be a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative + * @type {number} + */ + minimumNodeDistance:number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.organic.OutputRestriction}s restrict the output area and the shape of a layout in conjunction with organic layout + * algorithms such as {@link yfiles.organic.OrganicLayout} or {@link yfiles.organic.InteractiveOrganicLayout}. + *

+ * In consequence, all nodes need to be placed inside a specific restricted area. + *

+ * @see yfiles.organic.OrganicLayout#outputRestriction + * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction + * @class yfiles.organic.OutputRestriction + */ + export interface OutputRestriction extends Object{} + export class OutputRestriction { + /** + * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to a rectangular area which roughly complies + * with the given aspect ratio. + *

+ * The aspect ratio is defined as the ratio between the width and the height of a layout. + *

+ *
    + *
  • aspect ratio 1: width and height of the layout should be equal
  • + *
  • aspect ratio between 0 and 1: the height of a layout should be greater than its width
  • + *
  • aspect ratio larger than 1: the width of a layout should be greater than its height
  • + *
+ *

+ * The aspect ratio needs to be strictly positive. + *

+ * @param {number} ratio the preferred aspect ratio of the output + * @returns {yfiles.organic.OutputRestriction} an {@link yfiles.organic.OutputRestriction} imposing the given aspect ratio on the layout + * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is 0 or negative + * @see yfiles.organic.OrganicLayout#outputRestriction + * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction + * @static + */ + static createAspectRatioRestriction(ratio:number):yfiles.organic.OutputRestriction; + /** + * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to a circle. + *

+ * The actual restriction circle is defined by the given coordinates and radius. + *

+ *

+ * The radius of the restriction circle needs to be greater than zero. + *

+ * @param {number} x the x-coordinate of the restriction circle's center + * @param {number} y the y-coordinate of the restriction circle's center + * @param {number} radius the radius of the restriction circle + * @returns {yfiles.organic.OutputRestriction} the {@link yfiles.organic.OutputRestriction} confining the layout to a circular area + * @throws {Stubs.Exceptions.ArgumentError} if the given radius is less than or equal to zero + * @see yfiles.organic.OrganicLayout#outputRestriction + * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction + * @static + */ + static createCircularCageRestriction(x:number,y:number,radius:number):yfiles.organic.OutputRestriction; + /** + * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout result to an elliptical area. + *

+ * The restriction ellipse is defined by its bounding box specified by the given coordinates and size values. + *

+ *

+ * The main axes of the ellipse are parallel to the coordinate axes. + *

+ *

+ * The values for height and width of the ellipse's bounding box need to be greater than zero. + *

+ * @param {number} x the x-coordinate of the bounding box's upper left corner + * @param {number} y the y-coordinate of the bounding box's upper left corner + * @param {number} w the width of the bounding box + * @param {number} h the height of the bounding box + * @returns {yfiles.organic.OutputRestriction} the {@link yfiles.organic.OutputRestriction} confining the layout to an elliptical area + * @throws {Stubs.Exceptions.ArgumentError} if the given width or height is 0 or negative + * @see yfiles.organic.OrganicLayout#outputRestriction + * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction + * @static + */ + static createEllipticalCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; + /** + * Creates an {@link yfiles.organic.OutputRestriction} that confines the layout to a rectangular area. + *

+ * This restriction rectangle is defined by the given coordinates and size values. + *

+ *

+ * The values for height and width of the rectangle need to be greater than zero. + *

+ * @param {number} x the x-coordinate of the restriction rectangle's upper-left corner + * @param {number} y the y-coordinate of the restriction rectangle's upper-left corner + * @param {number} w width of the restriction rectangle + * @param {number} h height of the restriction rectangle + * @returns {yfiles.organic.OutputRestriction} the {@link yfiles.organic.OutputRestriction} confining the layout to a rectangular area + * @throws {Stubs.Exceptions.ArgumentError} if the given width or height is less than or equal to zero + * @see yfiles.organic.OrganicLayout#outputRestriction + * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction + * @static + */ + static createRectangularCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; + /** + * This {@link yfiles.organic.OutputRestriction} does not restrict the output by any means. + *

+ * It is a no-op that can be used when the output area and shape of a layout should be unrestricted. + *

+ * @see yfiles.organic.OrganicLayout#outputRestriction + * @see yfiles.organic.InteractiveOrganicLayout#outputRestriction + * @const + * @static + * @type {yfiles.organic.OutputRestriction} + */ + static NONE:yfiles.organic.OutputRestriction; + static $class:yfiles.lang.Class; + } + /** + * This algorithm recursively removes node overlaps from a graph with a hierarchic group structure. + *

+ * Basically, this algorithm combines a {@link yfiles.layout.RecursiveGroupLayout} with a specific customizable {@link yfiles.organic.RecursiveShuffleLayout#shuffleLayout shuffle algorithm} + * as its + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. The shuffle algorithm will be recursively applied to all groups of the input graph to remove node + * overlaps. + *

+ *

+ * {@graph {"ann":{"s":[50,50],"d":1},"n":[[158,104.94,384.5,224.75,2,[[158,127.31,384.5,22.38,"Group 1"]]],[173,142.31,175,172.38,2,[[173,164.69,175,22.38,"Group 2"]]],[205,187.69,60,30],[235,179.69,60,30],[225,249.69,60,30],[188,239.69,60,30],[407.5,177.69],[445,187.69,60,30],[432.5,203.38],[382.5,218.75],[295,242.31,155,177.88,2,[[295,264.69,155,22.38,"Group 3"]]],[310,279.69],[335,305.19],[360,329.69],[385,355.19],[469,265.25,50,154.94],[737.5,104.94,386,204.75,2,[[737.5,127.31,386,22.38,"Group 1"]]],[752.5,142.31,170,152.38,2,[[752.5,164.69,170,22.38,"Group 2"]]],[781.5,187.69,60,30],[847.5,179.69,60,30],[833.5,249.69,60,30],[767.5,239.69,60,30],[987,169.5],[1048.5,176.5,60,30],[1042,212.5],[974,225.5],[889.5,315.62,155,270.38,2,[[889.5,338,155,22.38,"Group 3"]]],[904.5,353],[929.5,409],[954.5,465],[979.5,521],[1063.5,324.84,50,154.94],[569.5,329.5,1,1,4],[706.5,329.5,1,1,4]],"e":[[32,33]],"vp":[158.0,104.0,966.0,482.0]}} Input graph (left) and result (right) after executing this algorithm with default settings + *

+ *

+ * Since this algorithm is a {@link yfiles.layout.ILayoutStage}, a {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} can be specified. In consequence, this + * algorithm will perform its work after the core algorithm was executed. + *

+ * @see yfiles.organic.ShuffleLayout + * @see yfiles.layout.RecursiveGroupLayout + * @class yfiles.organic.RecursiveShuffleLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface RecursiveShuffleLayout extends yfiles.layout.LayoutStageBase{} + export class RecursiveShuffleLayout { + /** + * Creates a new {@link yfiles.organic.RecursiveShuffleLayout} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The core layout algorithm. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Gets or sets the {@link yfiles.layout.IGroupBoundsCalculator} instance that computes the sizes of all group nodes. + * @type {yfiles.layout.IGroupBoundsCalculator} + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm} instance that is used for removing node overlaps. + *

+ * This instance will be applied recursively to all group nodes of the graph. + *

+ * @type {yfiles.layout.ILayoutAlgorithm} + */ + shuffleLayout:yfiles.layout.ILayoutAlgorithm; + static $class:yfiles.lang.Class; + } + /** + * This {@link yfiles.layout.ILayoutStage} removes node overlaps and guarantees a certain minimum distance between nodes. + *

+ * Layout Style This stage only removes overlaps between nodes of the input graph. To do so, overlapping nodes will be moved apart. + * Results often look like a stretched version of the original graph. {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[206,563.54],[343.79,552.91],[264.26,539.04,60,60],[362.34,587.92,60,60],[311.83,613.63],[362.34,630.92],[214.74,523.09],[206,544.98],[382.1,444.07],[304.03,518.26,60,60],[394.03,458.26],[403.79,458.26,60,60],[530.5,318.5,1,1,4],[530.5,750,1,1,4],[587.5,574.26],[819.5,549.26],[677.5,536.26,60,60],[847.5,609.26,60,60],[757.5,647.26],[838.5,680.26],[601.5,492.26],[587.5,533.26],[870.5,365.26],[748.5,503.26,60,60],[881.5,406.26],[922.5,406.26,60,60]],"e":[[8,9],[4,3],[1,3],[6,2],[2,1],[4,2],[0,2],[7,2],[9,2],[4,1],[3,2],[9,10],[10,8],[3,5],[4,5],[3,11],[12,13],[22,23],[18,17],[15,17],[20,16],[16,15],[18,16],[14,16],[21,16],[23,16],[18,15],[17,16],[23,24],[24,22],[17,19],[18,19],[17,25]],"vp":[206.0,317.0,777.0,436.0]}} A graph containing overlaps (left) and the result after the + * overlap removal Features + *

+ *

+ * It is possible to define a {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum distance} between nodes. This feature allows to not only remove overlaps but forces + * nodes to keep a specified distance to other nodes. + *

+ * @class yfiles.organic.RemoveOverlapsStage + * @implements {yfiles.layout.ILayoutStage} + */ + export interface RemoveOverlapsStage extends Object,yfiles.layout.ILayoutStage{} + export class RemoveOverlapsStage { + /** + * Creates a new {@link yfiles.organic.RemoveOverlapsStage} instance with a given {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum node distance}. + *

+ * The minimum node distance needs to be non-negative. + *

+ * @param {number} minimumNodeDistance a non-negative minimum distance value + * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative + * @constructor + */ + constructor(minimumNodeDistance:number); + /** + * Removes node overlaps and displaces nodes of the given graph such that they keep the specified {@link yfiles.organic.RemoveOverlapsStage#minimumNodeDistance minimum distance} to each + * other. + *

+ * If a {@link yfiles.organic.RemoveOverlapsStage#coreLayout core layout algorithm} is specified, it will be executed first. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Gets or sets the minimum distance to be kept between any two nodes of the graph. + *

+ * Due to this distance not only nodes that overlap will be moved to resolve the overlap, but also nodes which are too + * close to each other with respect to this distance will be displaced. + *

+ *

+ * The minimum node distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative + * @type {number} + */ + minimumNodeDistance:number; + /** + * + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + static $class:yfiles.lang.Class; + } + /** + * This layout stage replaces edges by a path of split-edges with a specified length before it calls a {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm}. + *

+ * Concept + *

+ *

+ * Each edge segment (or only segments that belong to a particular subset of edges) in the input graph will be split up + * into several segments such that all segments have a maximum length defined by the specified + * {@link yfiles.organic.SplitEdgeStage#splitSegmentLength split segment length}. If an edge segment is already shorter than the split segment length, then it will not be split + * up. + *

+ *

+ * At each split location, a dummy node (the so-called split-node) will be inserted. Split-nodes inserted for the same original edge + * and the actual source and target node of the original edge will be connected by so called + * split-edges. In consequence, the original source and target node are not connected by a single edge but by a path consisting of + * split-edges. Furthermore, all edges are simple straight lines. + *

+ *

+ * After this replacement step, the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} will be invoked. + *

+ *

+ * When the core layout algorithm has finished, the split-nodes will be removed from the graph and the original edge will + * be restored. The coordinates of the bends will be the center-coordinates of the corresponding split-node. + *

+ *

+ * Features + *

+ *

+ * The {@link yfiles.algorithms.IDataProvider} registered with key {@link yfiles.organic.SplitEdgeStage#splitNodesDpKey} can be used by the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} to determine whether + * or not a certain node is a split-node that was created by this stage. This information may be useful when providing a + * custom core layout algorithm which should handle split-nodes in a different way than normal nodes. If no {@link yfiles.algorithms.IDataProvider} + * is registered with this key, this information is dropped. + *

+ *

+ * By registering a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.organic.SplitEdgeStage#affectedEdgesDpKey}, the subset of edges that should be split by this layout + * stage can be specified. If no {@link yfiles.algorithms.IDataProvider} with this key is registered, all edges of the input graph + * will be split by the layout stage. + *

+ *

+ * The amount of split-nodes replacing a single original edge can be controlled via the + * {@link yfiles.organic.SplitEdgeStage#splitSegmentLength split segment length}. The smaller the value, the more split-nodes this stage will insert. + *

+ * @class yfiles.organic.SplitEdgeStage + * @implements {yfiles.layout.ILayoutStage} + */ + export interface SplitEdgeStage extends Object,yfiles.layout.ILayoutStage{} + export class SplitEdgeStage { + /** + * Creates a new {@link yfiles.organic.SplitEdgeStage} with default settings. + * @constructor + */ + constructor(); + /** + * Replaces the edges of the given graph by a path of split-edges, executes the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} and restores the + * original edges, introducing bends at the locations of the split-nodes. + * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to determine which edges are to be split by this layout stage. + *

+ * If no {@link yfiles.algorithms.IDataProvider} is registered with this key, all edges will be split. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @type {Object} + */ + affectedEdgesDpKey:Object; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key for marking the nodes that were created by splitting edges, i.e., + * the split-nodes. + *

+ * The information provided by the {@link yfiles.algorithms.IDataProvider} registered with this key is useful for the {@link yfiles.organic.SplitEdgeStage#coreLayout core layout algorithm} + * to know whether or not some node is a (dummy) split-node. After {@link yfiles.organic.SplitEdgeStage#applyLayout} finishes, the + * split-nodes will have been removed and this information will not be available anymore. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @type {Object} + */ + splitNodesDpKey:Object; + /** + * Gets or sets the maximum length for a split-edge. + *

+ * The length of the original edge path divided by the given split segment length yields the number of nodes on the new + * path. + *

+ *

+ * The split segment length must be a strictly positive value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given split segment length is smaller than or equal to zero + * @type {number} + */ + splitSegmentLength:number; + /** + * Gets or sets the size of the split-nodes that are inserted when splitting edges. + *

+ * The given size will be used for defining the height and the width of the split-nodes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given size is negative + * @type {number} + */ + splitNodeSize:number; + /** + * + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.organic.OrganicLayout}. + * @class yfiles.organic.OrganicLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface OrganicLayoutData extends yfiles.layout.LayoutData{} + export class OrganicLayoutData { + constructor(); + /** + * Gets or sets the collection of nodes that is laid out by the layout. + * @see yfiles.organic.OrganicLayout#AFFECTED_NODES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedNodes:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping from edges to their preferred edge length. + * @see yfiles.organic.OrganicLayout#PREFERRED_EDGE_LENGTH_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + preferredEdgeLengths:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their minimum distance to other nodes. + *

+ * Note that the distances are only considered by the internally used {@link yfiles.organic.ShuffleLayout} when {@link yfiles.organic.OrganicLayout#nodeOverlapsAllowed} is true and {@link yfiles.organic.OrganicLayout#scope} is + * not {@link yfiles.organic.Scope#ALL}. + *

+ * @see yfiles.organic.ShuffleLayout#MINIMUM_DISTANCE_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + minimumNodeDistances:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from group nodes to a mode constant describing how to handle the group node. + *

+ * The algorithm expects for each group node to find one of the following constants or null: + *

    + *
  • + * {@link yfiles.organic.GroupNodeMode#NORMAL} + *
  • + *
  • + * {@link yfiles.organic.GroupNodeMode#FIX_BOUNDS} + *
  • + *
  • + * {@link yfiles.organic.GroupNodeMode#FIX_CONTENTS} + *
  • + *
+ *

+ * @see yfiles.organic.OrganicLayout#GROUP_NODE_MODE_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + groupNodeModes:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the partition grid layout data. + * @type {yfiles.layout.PartitionGridData} + */ + partitionGridData:yfiles.layout.PartitionGridData; + /** + * Gets or sets the mapping from edges to their directedness. + *

+ * Generally, the organic layout algorithm doesn't consider the edge direction. Nevertheless, this property allows the user + * to specify hints on the directedness of edges. More precisely, a value of 1 indicates that the edge should be considered + * to be directed from source to target, a value of -1 that it is directed from target to source, and a value of 0 means + * that it is undirected. + *

+ *

+ * Currently, the specified values are only considered during the detection of special substructures, see {@link yfiles.organic.OrganicLayout#chainSubstructureStyle}, {@link yfiles.organic.OrganicLayout#cycleSubstructureStyle}, {@link yfiles.organic.OrganicLayout#parallelSubstructureStyle} and {@link yfiles.organic.OrganicLayout#starSubstructureStyle}. + *

+ * @see yfiles.organic.OrganicLayout#EDGE_DIRECTEDNESS_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeDirectedness:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace router{ + /** + * {@link yfiles.router.ParallelEdgeRouter} is a {@link yfiles.layout.ILayoutStage} that routes parallel edges which connect the same pair + * of nodes in a graph. + *

+ * Layout Style The edge paths of parallel edges consist of parallel segments. At the end points, the edges can either still be + * parallel or {@link yfiles.router.ParallelEdgeRouter#joinEnds joined in one point}. {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[198,216],[54,226],[0,93],[110,0],[232,76],[119,122]],"e":[[1,0],[2,1],[3,2],[0,4],[4,3],[2,5,[43.96,125.35,100.3,139.08]],[2,5,[48.7,105.92,105.04,119.65]],[2,5,[51.07,96.2,107.4,109.93]],[3,5,[147.32,45.67,151.57,103.38]],[1,5,[77.62,208.34,108.42,159.06]],[1,5,[69.14,203.04,99.94,153.76]],[0,5,[184.58,212.72,147.11,168.14]],[0,5,[176.92,219.16,139.46,174.58]],[5,3,[141.6,104.12,137.34,46.41]],[5,3,[121.66,105.59,117.4,47.88]],[5,3,[111.68,106.33,107.43,48.62]],[5,4,[171.36,143.38,224.72,121.66]],[5,4,[167.59,134.12,220.95,112.4]],[5,4,[160.05,115.6,213.41,93.88]],[5,2,[97.93,148.8,41.6,135.07]],[5,4,[156.28,106.34,209.64,84.62]],[5,0,[162.42,155.28,199.89,199.86]],[5,0,[170.08,148.84,207.54,193.42]],[5,1,[125.38,169.66,94.58,218.94]],[5,1,[133.86,174.96,103.06,224.24]],[1,5,1],[2,5,1],[0,5,1],[5,3,1],[5,4,1]],"vp":[0.0,0.0,262.0,256.0]}} + *

+ *

+ * The master edge determining the routing is highlighted + *

+ *

+ * Concept {@link yfiles.router.ParallelEdgeRouter} performs four basic steps: + *

+ *
    + *
  1. Remove all parallel edges from the input graph, leaving one master edge in the graph
  2. + *
  3. Invoke the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} on the graph without parallel edges
  4. + *
  5. Reinsert all previously removed edges
  6. + *
  7. Route the parallel edges
  8. + *
+ *

+ * Features + *

+ *

+ * {@link yfiles.router.ParallelEdgeRouter} can either be used as a {@link yfiles.layout.ILayoutStage} wrapping a {@link yfiles.layout.ILayoutAlgorithm layout algorithm} which + * cannot handle parallel edges. Then it will hide the parallel edges from this {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} and take over the + * routing of them. + *
+ * If no {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is specified, {@link yfiles.router.ParallelEdgeRouter} can work alone. It will route only the + * parallel edges and keep the remaining graph unchanged. + *

+ *

+ * Parallel edges can either be all edges between the same two nodes, ignoring the direction, or edges are only considered + * parallel if they share the same source node and target node. Hence, they share the same {@link yfiles.router.ParallelEdgeRouter#directedMode direction}. + *

+ *

+ * To make sure that the ports of all parallel edges are on the end nodes, the first and last segments can be + * {@link yfiles.router.ParallelEdgeRouter#joinEnds joined}. However, these segments won't be parallel. + *

+ *

+ * There are two ways to define the distance between two parallel edges. First, an absolute distance can be {@link yfiles.router.ParallelEdgeRouter#lineDistance defined}. + * Parallel segments will keep this distance. Second, the distance can be + * {@link yfiles.router.ParallelEdgeRouter#adaptiveLineDistances determined relative to the node bounds}. Depending on the size of the nodes and the number of parallel edges between + * them, the distance between parallel edges is adjusted. This will keep the edges straight in most cases. + *

+ *

+ * It is possible to select + * {@link yfiles.router.ParallelEdgeRouter#LEADING_EDGE_DP_KEY custom master edges}. All edges that are parallel to the selected edges will be temporarily removed. + *

+ * @class yfiles.router.ParallelEdgeRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface ParallelEdgeRouter extends yfiles.layout.LayoutStageBase{} + export class ParallelEdgeRouter { + /** + * Creates a new {@link yfiles.router.ParallelEdgeRouter} instance with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] The core layout algorithm. + * @see yfiles.layout.LayoutStageBase#coreLayout + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Hides all parallel edges leaving a master edge in the graph. + *

+ * {@link yfiles.router.ParallelEdgeRouter} detects parallel edges of the given graph. From each set of parallel edges it hides all + * but one edge from the given graph. + *

+ *

+ * This method is called before invoking the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. It may be overridden to change the selection of leading + * edges. Hidden edges should be stored in {@link yfiles.router.ParallelEdgeRouter#hiddenEdges} to enable un-hiding later on. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @see yfiles.router.ParallelEdgeRouter#directedMode + * @see yfiles.router.ParallelEdgeRouter#AFFECTED_EDGES_DP_KEY + * @protected + */ + findAndHideParallelEdges(graph:yfiles.algorithms.Graph):void; + /** + * Assigns a layout to all parallel edges. + *

+ * The layout for each parallel edge follows the layout of the master edge which was not removed from the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ *

+ * This method is called when the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} is finished. It may be overridden to introduce a custom routing for + * parallel edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph after the core layout + * @param {yfiles.algorithms.IEdgeMap} parallelEdges the map that provides all parallel edges for each master edge + * @see yfiles.router.ParallelEdgeRouter#joinEnds + * @see yfiles.router.ParallelEdgeRouter#adaptiveLineDistances + * @see yfiles.router.ParallelEdgeRouter#adjustLeadingEdge + * @protected + */ + layoutParallelEdges(graph:yfiles.layout.LayoutGraph,parallelEdges:yfiles.algorithms.IEdgeMap):void; + /** + * Data provider key for marking edges that will be routed + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the master edges + *

+ * Marked edges won't be removed for the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. All edges parallel to the master edges will get parallel paths. + *

+ *

+ * If no leading edge is specified for a bundle of parallel edges, it will be determined automatically. If there is more + * than one leading edge, the first one is chosen. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static LEADING_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Holds the list of parallel edges that are hidden from the {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @protected + * @type {yfiles.algorithms.EdgeList} + */ + hiddenEdges:yfiles.algorithms.EdgeList; + /** + * {@link yfiles.algorithms.IEdgeMap} that associates a hidden edge with the unique parallel edge not hidden from the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @type {yfiles.algorithms.IEdgeMap} + */ + parallelEdges:yfiles.algorithms.IEdgeMap; + /** + * Gets or sets whether or not the direction of edges should be considered. + *

+ * In directed mode, only edges that share the same source and target node will be routed in parallel. Edges that connect + * to the same nodes but in different directions won't be considered parallel. + *

+ *

+ * In undirected mode, all edges connecting the same pair of nodes will be routed in parallel. + *

+ * @type {boolean} + */ + directedMode:boolean; + /** + * Gets or sets whether or not the distances between parallel edges should be determined automatically according to the + * sizes of their source and target nodes. + *

+ * If enabled, the distances between edges are chosen such that all parallel edges can be drawn as straight lines and still + * connect to the nodes' bounds. + *

+ * @see yfiles.router.ParallelEdgeRouter#lineDistance + * @type {boolean} + */ + adaptiveLineDistances:boolean; + /** + * Gets or sets the distance between two adjacent edge paths that run in parallel. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is less than 0 + * @see yfiles.router.ParallelEdgeRouter#adaptiveLineDistances + * @type {number} + */ + lineDistance:number; + /** + * Gets or sets whether or not to join end points of parallel edges. + *

+ * If enabled, all edges end with non-parallel segments that connect at the same point to the node. Otherwise, all segments + * of the edges are parallel. In this case, some edges may not connect to the nodes' bounds. + *

+ * @see yfiles.router.ParallelEdgeRouter#absJoinEndDistance + * @see yfiles.router.ParallelEdgeRouter#relJoinEndDistance + * @type {boolean} + */ + joinEnds:boolean; + /** + * Gets or sets the absolute distance from the end point of the joined lines to the first parallel segments. + *

+ * The absolute distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @see yfiles.router.ParallelEdgeRouter#joinEnds + * @see yfiles.router.ParallelEdgeRouter#relJoinEndDistance + * @type {number} + */ + absJoinEndDistance:number; + /** + * Gets or sets the relative distance from the end point of the joined lines to the first parallel segments. + *

+ * The length is relative to the corresponding original segment's length. It needs to have a value in the interval [0,1]. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified relative distance is less than 0 or greater than 1 + * @see yfiles.router.ParallelEdgeRouter#joinEnds + * @see yfiles.router.ParallelEdgeRouter#absJoinEndDistance + * @type {number} + */ + relJoinEndDistance:number; + /** + * Gets or sets whether or not to adjust the leading edge to obtain more symmetric results. + * @type {boolean} + */ + adjustLeadingEdge:boolean; + static $class:yfiles.lang.Class; + } + export enum Scope{ + /** + * A scope specifier which defines that all edges of the input graph will be routed. + * @see yfiles.router.BusRouter#scope + */ + ROUTE_ALL_EDGES, + /** + * A scope specifier which defines that only the selected edges of the input graph will be routed. + *

+ * The selection state of an edge is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered + * with key {@link yfiles.router.BusRouter#affectedEdgesDpKey}. + *

+ *

+ * All other non-selected edges will be considered to have fixed routes. + *

+ * @see yfiles.router.BusRouter#scope + * @see yfiles.router.BusRouter#affectedEdgesDpKey + * @see yfiles.router.BusRouter#DEFAULT_AFFECTED_EDGES_DP_KEY + */ + ROUTE_AFFECTED_EDGES, + /** + * A scope specifier which defines that only edges incident to selected nodes will be routed. + *

+ * The selection state of a node is determined by a boolean value returned by a {@link yfiles.algorithms.IDataProvider} registered + * with key {@link yfiles.router.EdgeRouter#affectedNodesDpKey}. + *

+ *

+ * All other edges that are incident to non-selected nodes will be considered to have fixed routes. + *

+ * @see yfiles.router.EdgeRouter#scope + * @see yfiles.router.EdgeRouter#affectedNodesDpKey + */ + ROUTE_EDGES_AT_AFFECTED_NODES + } + export enum ChannelOrientation{ + /** + * Channel orientation specifier for routing edges vertically. + *

+ * More precisely, the algorithm calculates the x-coordinates of the vertical middle segments of the added edges. + *

+ */ + VERTICAL, + /** + * Channel orientation specifier for routing edges horizontally. + *

+ * More precisely, the algorithm calculates the y-coordinates of the horizontal middle segments of the added edges. + *

+ */ + HORIZONTAL + } + export enum MonotonicPathRestriction{ + /** + * A constant specifying that there are no monotonic edge path restrictions. + * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction + */ + NONE, + /** + * A constant specifying monotonic edge path restrictions for the vertical direction. + *

+ * This implies that each vertical edge segment is directed from the source to the target. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction + */ + VERTICAL, + /** + * A constant specifying monotonic edge path restrictions for the horizontal direction. + *

+ * This implies that each horizontal edge segment is directed from the source to the target. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction + */ + HORIZONTAL, + /** + * A constant specifying monotonic edge path restrictions for the horizontal and vertical direction. + *

+ * This implies that each horizontal as well as each vertical edge segment is directed from the source to the target. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction + */ + BOTH + } + /** + * This edge routing algorithm routes edges as straight-lines considering the specified {@link yfiles.layout.PortConstraint}s. + *

+ * Layout Style The edges connect to their ports with straight-lines. This may lead to edges crossing nodes. {@graph {"ann":{"s":[30,30],"d":1},"n":[[591,590],[157,454],[558,361],[665,476],[466,502],[335,663],[230,267],[350,325],[17,519],[187,590],[248,387],[145,310],[464,337],[310,506],[670,151],[220,106],[697,285],[522,187],[457,2],[111,0],[305,5],[375,139],[0,260]],"e":[[0,3],[3,2],[4,0],[1,6],[6,7],[7,2],[1,8],[1,9],[10,7],[10,11],[11,7],[12,4],[12,7],[5,13],[9,13],[1,13],[7,13],[4,13],[15,6],[14,16],[16,2],[12,17],[17,14],[15,19],[15,20],[18,21],[20,21],[15,21],[17,21],[7,21],[11,22]],"vp":[0.0,0.0,727.0,693.0]}}Concept{@link yfiles.router.StraightLineEdgeRouter} + * will first invoke the {@link yfiles.layout.LayoutStageBase#coreLayout} if one exists. Then, it will remove all bends from the edges and will place the ports either on + * the center of the nodes or at a location specified by a {@link yfiles.layout.PortConstraint}. + *

+ * @class yfiles.router.StraightLineEdgeRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface StraightLineEdgeRouter extends yfiles.layout.LayoutStageBase{} + export class StraightLineEdgeRouter { + /** + * Creates a new instance of {@link yfiles.router.StraightLineEdgeRouter} with an optional {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The core layout algorithm. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Gets or sets the (sub-)set of edges to be routed. + *

+ * {@link yfiles.router.StraightLineEdgeRouter} will only route those edges and leave the remaining edges unchanged. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given argument is an unknown specifier + * @see yfiles.router.StraightLineEdgeRouter#affectedEdgesDpKey + * @see yfiles.router.StraightLineEdgeRouter#affectedNodesDpKey + * @type {yfiles.router.Scope} + */ + scope:yfiles.router.Scope; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that provides the selected state of the nodes of the + * graph. + *

+ * If the scope only includes {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES edges at selected nodes}, only edges of the nodes marked in this {@link yfiles.algorithms.IDataProvider} + * are routed while all other edges are considered to have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @see yfiles.router.StraightLineEdgeRouter#scope + * @type {Object} + */ + affectedNodesDpKey:Object; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that provides the selected state of the edges of the + * graph. + *

+ * If the scope only includes {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES selected edges}, only edges of the nodes marked in this {@link yfiles.algorithms.IDataProvider} are + * routed while all other edges are considered to have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @see yfiles.router.StraightLineEdgeRouter#scope + * @type {Object} + */ + affectedEdgesDpKey:Object; + static $class:yfiles.lang.Class; + } + /** + * This class describes the location and the direction from which a given {@link yfiles.router.PartitionCell partition cell} has been entered during a path + * search. + *

+ * The path that was followed in order to reach a given {@link yfiles.router.PartitionCell partition cell} can be reconstructed by traversing all + * {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. The {@link yfiles.router.CellEntrance#enterInterval enter interval} and {@link yfiles.router.CellEntrance#enterDirection enter direction} determine how the {@link yfiles.router.PartitionCell partition cell} was entered. + *

+ * @class yfiles.router.CellEntrance + */ + export interface CellEntrance extends Object{} + export class CellEntrance { + /** + * Creates a new {@link yfiles.router.CellEntrance} instance that is a copy of a given other {@link yfiles.router.CellEntrance}. + * @param {yfiles.router.CellEntrance} other the {@link yfiles.router.CellEntrance} to be copied + * @constructor + */ + constructor(other:yfiles.router.CellEntrance); + /** + * Creates a new {@link yfiles.router.CellEntrance} instance for a given {@link yfiles.router.PartitionCell}. + * @param {yfiles.router.PartitionCell} cell the {@link yfiles.router.PartitionCell} that is entered + * @constructor + */ + constructor(cell:yfiles.router.PartitionCell); + /** + * Gets the {@link yfiles.router.PartitionCell partition cell} of this {@link yfiles.router.CellEntrance} instance. + * @type {yfiles.router.PartitionCell} + */ + cell:yfiles.router.PartitionCell; + /** + * Gets or sets the previous {@link yfiles.router.CellEntrance} along the path that was traversed in order to reach the {@link yfiles.router.CellEntrance#cell cell}. + * @type {yfiles.router.CellEntrance} + */ + previousEntrance:yfiles.router.CellEntrance; + /** + * Gets or sets the {@link yfiles.router.OrthogonalInterval} that was used for entering this {@link yfiles.router.CellEntrance#cell cell}. + * @type {yfiles.router.OrthogonalInterval} + */ + enterInterval:yfiles.router.OrthogonalInterval; + /** + * Gets or sets the direction from which this {@link yfiles.router.CellEntrance#cell cell} was entered. + * @type {yfiles.layout.Direction} + */ + enterDirection:yfiles.layout.Direction; + /** + * Gets or sets the costs for the implicit path given by the {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. + *

+ * The costs must be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the costs are negative + * @type {number} + */ + costs:number; + /** + * Gets or sets the heuristic costs for the implicit path given by the {@link yfiles.router.CellEntrance#previousEntrance previous entrances}. + *

+ * Heuristic costs must be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the heuristic costs are negative + * @type {number} + */ + heuristicCosts:number; + /** + * Gets or sets the {@link yfiles.router.EdgeCellInfo} describing how the previous {@link yfiles.router.PartitionCell partition cell} was traversed. + * @type {yfiles.router.EdgeCellInfo} + */ + previousEdgeCellInfo:yfiles.router.EdgeCellInfo; + static $class:yfiles.lang.Class; + } + /** + * This class stores information about the part of an edge segment that lies inside a specified {@link yfiles.router.PartitionCell partition cell}. + * @class yfiles.router.CellSegmentInfo + * @extends {yfiles.router.SegmentInfoBase} + */ + export interface CellSegmentInfo extends yfiles.router.SegmentInfoBase{} + export class CellSegmentInfo { + /** + * Creates a new {@link yfiles.router.CellSegmentInfo} instance. + * @param {yfiles.algorithms.Edge} edge the edge to which the segment of this info belongs + * @param {number} segmentIndex the index of the segment to which this info belongs + * @param {yfiles.layout.Direction} direction the direction to which the segment of this info points + * @param {yfiles.router.Interval} locationRange the range within which the common location of this segment has to lie + * @param {yfiles.router.Interval} minExtension the minimum interval in extension direction this segment part is known to intersect + * @param {yfiles.router.Interval} maxExtension the maximum interval in extension direction this segment part will span + * @param {yfiles.router.PartitionCell} cell the partition cell within which this part of the edge segment lies + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval,cell:yfiles.router.PartitionCell); + /** + * Gets the direction to which the segment of this info points. + * @type {yfiles.layout.Direction} + */ + direction:yfiles.layout.Direction; + /** + * Gets the {@link yfiles.router.PartitionCell partition cell} within which this part of the edge segment lies. + * @type {yfiles.router.PartitionCell} + */ + cell:yfiles.router.PartitionCell; + static $class:yfiles.lang.Class; + } + /** + * This class describes a channel, i.e., a set of vertical or horizontal edge segments whose locations depend on each + * other. + *

+ * Channels are used by the {@link yfiles.router.ChannelBasedPathRouting} to route edges using + * {@link yfiles.router.SegmentInfo}s describing their path. + *

+ * @class yfiles.router.Channel + */ + export interface Channel extends Object{} + export class Channel { + /** + * Creates a new {@link yfiles.router.Channel} that contains the given {@link yfiles.router.SegmentInfo segment info}. + * @param {yfiles.router.SegmentInfo} segment the given segment info for which the {@link yfiles.router.Channel} is created + * @throws {Stubs.Exceptions.ArgumentError} if the given segment has a different orientation than the other segments already contained in the channel + * @constructor + */ + constructor(segment:yfiles.router.SegmentInfo); + /** + * Adds a new {@link yfiles.router.SegmentInfo segment info} to the {@link yfiles.router.Channel channel}. + * @param {yfiles.router.SegmentInfo} segment the segment info to be added to this channel + * @throws {Stubs.Exceptions.ArgumentError} if the given segment has a different orientation than the other segments already contained in the channel + */ + addSegment(segment:yfiles.router.SegmentInfo):void; + /** + * Adds a {@link yfiles.router.SegmentGroup segment group} to this {@link yfiles.router.Channel channel}. + * @param {yfiles.router.SegmentGroup} group the segment group to be added + */ + addSegmentGroup(group:yfiles.router.SegmentGroup):void; + /** + * Returns the current location that the given {@link yfiles.router.SegmentInfo segment info} has been assigned within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. + * @param {yfiles.router.SegmentInfo} segmentInfo the segment info for which the current location will be returned + * @returns {number} the current location of the segment info or {@link number#NaN} if no location has been assigned before + * @see yfiles.router.Channel#setCurrentLocation + */ + getCurrentLocation(segmentInfo:yfiles.router.SegmentInfo):number; + /** + * Returns the {@link yfiles.router.SegmentInfo segment info} with the given index in the list of segments of this {@link yfiles.router.Channel channel}. + * @param {number} index the index of the segment in the list of segments + * @returns {yfiles.router.SegmentInfo} the {@link yfiles.router.SegmentInfo segment info} with the given index in the list of segments + */ + getSegment(index:number):yfiles.router.SegmentInfo; + /** + * Returns the {@link yfiles.router.SegmentGroup segment group} with the given index in this {@link yfiles.router.Channel channel}. + * @param {number} index the index of the segment group + * @returns {yfiles.router.SegmentGroup} the {@link yfiles.router.SegmentGroup segment group} with the given index in this channel + */ + getSegmentGroup(index:number):yfiles.router.SegmentGroup; + /** + * Returns the number of {@link yfiles.router.SegmentInfo segment infos} in this channel. + * @returns {number} the number of segment infos in this channel + */ + segmentCount():number; + /** + * Returns the number of {@link yfiles.router.SegmentGroup segment groups} in this {@link yfiles.router.Channel channel}. + * @returns {number} the number of segment groups in this channel + */ + segmentGroupCount():number; + /** + * Specifies the current location that the given {@link yfiles.router.SegmentInfo segment info} has been assigned within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. + *

+ * During the distribution of the segments in the channel, different locations can be assigned but only the last one is + * finally assigned to the {@link yfiles.router.SegmentInfo segment info}. + *

+ * @param {yfiles.router.SegmentInfo} segmentInfo the segment info for which the current location will be set + * @param {number} location the location of the segment info within its location range + * @see yfiles.router.SegmentInfoBase#location + */ + setCurrentLocation(segmentInfo:yfiles.router.SegmentInfo,location:number):void; + /** + * Gets an {@link yfiles.router.Interval interval} spanning the union of the location ranges of the {@link yfiles.router.SegmentInfo segment infos}. + * @see yfiles.router.SegmentInfoBase#locationRange + * @type {yfiles.router.Interval} + */ + widthInterval:yfiles.router.Interval; + /** + * Gets an {@link yfiles.router.Interval interval} spanning the union of the maximum extension of the {@link yfiles.router.SegmentInfo segment infos}. + * @see yfiles.router.SegmentInfoBase#maxExtension + * @type {yfiles.router.Interval} + */ + lengthInterval:yfiles.router.Interval; + /** + * Gets whether or not the segments in this {@link yfiles.router.Channel channel} are vertical. + * @type {boolean} + */ + vertical:boolean; + /** + * Gets the bounds of this {@link yfiles.router.Channel channel}. + *

+ * These bounds are determined by the channel's {@link yfiles.router.Channel#widthInterval width} and {@link yfiles.router.Channel#lengthInterval length}. + *

+ * @see yfiles.router.Channel#widthInterval + * @see yfiles.router.Channel#lengthInterval + * @type {yfiles.algorithms.YRectangle} + */ + bounds:yfiles.algorithms.YRectangle; + static $class:yfiles.lang.Class; + } + /** + * This class routes edges using their pre-calculated {@link yfiles.router.Path} information. + *

+ * The concept of this algorithm is to bundle edge {@link yfiles.router.SegmentInfo segment}s into so-called {@link yfiles.router.Channel}s and route each {@link yfiles.router.Channel} + * individually. + *

+ *

+ * This class is initialized using {@link yfiles.router.ChannelBasedPathRouting#initialize} which must have been called before the + * edges are {@link yfiles.router.ChannelBasedPathRouting#route routed}. + *

+ *

+ * After a {@link yfiles.router.ChannelBasedPathRouting} instance is no longer in use, the {@link yfiles.router.Channel} information and + * the reference to the {@link yfiles.router.PathSearchConfiguration configuration} must be reset using method {@link yfiles.router.ChannelBasedPathRouting#cleanup}. + *

+ * @see yfiles.router.EdgeInfo#getSegmentInfo + * @see yfiles.layout.LayoutGraph#setPath + * @class yfiles.router.ChannelBasedPathRouting + */ + export interface ChannelBasedPathRouting extends Object{} + export class ChannelBasedPathRouting { + /** + * Creates a new instance of {@link yfiles.router.ChannelBasedPathRouting}. + * @constructor + */ + constructor(); + /** + * Adjusts the location assigned to a {@link yfiles.router.SegmentInfo segment info} in the {@link yfiles.router.Channel channel} considering 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 {@link yfiles.router.SegmentInfo segment info}s. + *

+ * @param {yfiles.router.Channel} channel the channel that contains the segment infos for which the alignment should be considered + * @see yfiles.router.Channel#getCurrentLocation + * @see yfiles.router.SegmentInfoBase#preferredAlignment + * @protected + */ + adjustSegmentLocations(channel:yfiles.router.Channel):void; + /** + * Calculates the locations of the {@link yfiles.router.SegmentInfo segment infos} in the given {@link yfiles.router.Channel channel}. + *

+ * This method is called after the order of the {@link yfiles.router.SegmentInfo segment infos} within a channel has been {@link yfiles.router.ChannelBasedPathRouting#optimizeSegmentOrder optimized}. + *

+ * @param {yfiles.router.Channel} channel the channel that contains the segment infos for which the locations will be calculated + * @see yfiles.router.Channel#setCurrentLocation + * @protected + */ + calculateSegmentLocations(channel:yfiles.router.Channel):void; + /** + * Resets all {@link yfiles.router.Channel channel} information and the reference to the {@link yfiles.router.PathSearchConfiguration configuration}. + *

+ * Afterwards, {@link yfiles.router.ChannelBasedPathRouting} is ready to calculate paths for a new layout. + *

+ */ + cleanup():void; + /** + * Creates a {@link yfiles.collections.IComparer. comparator} for sorting the {@link yfiles.router.SegmentInfo}s in a {@link yfiles.router.Channel} from left to right (for + * vertical segments) or top to bottom (for horizontal segments), respectively. + *

+ * This method is called in {@link yfiles.router.ChannelBasedPathRouting#route} before edge segments are distributed within the + * channels. + *

+ * @param {yfiles.algorithms.YList} channels the channels whose segments will be sorted by the {@link yfiles.collections.IComparer. comparator} + * @param {yfiles.router.PathSearchResult} pathSearchResult the {@link yfiles.router.PathSearchResult path search result} containing the {@link yfiles.router.EdgeInfo}s with the + * {@link yfiles.router.SegmentInfo}s for which the comparator will be used + * @param {yfiles.router.PathSearchConfiguration} configuration the {@link yfiles.router.PathSearchConfiguration configuration} used during this path search + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer. comparator} used for sorting the {@link yfiles.router.SegmentInfo}s in a {@link yfiles.router.Channel channel} + * @protected + */ + createSegmentInfoComparer(channels:yfiles.algorithms.YList,pathSearchResult:yfiles.router.PathSearchResult,configuration:yfiles.router.PathSearchConfiguration):yfiles.collections.IComparer; + /** + * Initializes this {@link yfiles.router.ChannelBasedPathRouting} instance for routing paths that have been found with the given + * {@link yfiles.router.PathSearchConfiguration configuration}. + *

+ * This method must be called before the edges are {@link yfiles.router.ChannelBasedPathRouting#route routed}. + *

+ * @param {yfiles.router.PathSearchConfiguration} configuration the {@link yfiles.router.PathSearchConfiguration configuration} used for the following path routing + * @see yfiles.router.ChannelBasedPathRouting#route + */ + initialize(configuration:yfiles.router.PathSearchConfiguration):void; + /** + * Optimizes the order of the {@link yfiles.router.SegmentInfo segments} in the given {@link yfiles.router.Channel channel}. + *

+ * After the segments in the channel have been sorted using the comparator created by method + * {@link yfiles.router.ChannelBasedPathRouting#createSegmentInfoComparer}, segments having a common {@link yfiles.router.SegmentGroup} are + * replaced by their common {@link yfiles.router.SegmentGroup#commonSegmentInfo representative segment info}. + *

+ *

+ * This method further improves the order of the resulting segment info list to make sure that the subsequent {@link yfiles.router.ChannelBasedPathRouting#calculateSegmentLocations location calculation} + * is able to respect the {@link yfiles.router.SegmentInfoBase#locationRange location ranges} of the + * {@link yfiles.router.SegmentInfo}s and, if possible, the minimum edge to edge distances and possible grid constraints for the + * segments. + *

+ * @param {yfiles.router.Channel} channel the channel for which the order of the {@link yfiles.router.SegmentInfo}s is optimized + * @protected + */ + optimizeSegmentOrder(channel:yfiles.router.Channel):void; + /** + * Routes the given edges. + *

+ * Before calling this method, method {@link yfiles.router.ChannelBasedPathRouting#initialize} must have been called. + *

+ *

+ * As a first step, the {@link yfiles.router.SegmentInfo}s of all edge paths are distributed to {@link yfiles.router.Channel}s. After that, + * the segments in each of these + * {@link yfiles.router.Channel}s are sorted and locations are assigned respecting the segments' location ranges by calling the + * subsequent methods: + *

+ *
    + *
  1. {@link yfiles.router.ChannelBasedPathRouting#optimizeSegmentOrder}
  2. + *
  3. {@link yfiles.router.ChannelBasedPathRouting#calculateSegmentLocations}
  4. + *
  5. {@link yfiles.router.ChannelBasedPathRouting#adjustSegmentLocations}
  6. + *
+ *

+ * Finally, the control points for the paths are calculated. + *

+ * @param {yfiles.algorithms.EdgeList} edges the {@link yfiles.algorithms.EdgeList list of edges} to be routed + * @param {yfiles.router.PathSearchResult} pathSearchResult the {@link yfiles.router.PathSearchResult path search result} containing the {@link yfiles.router.Path} objects for the edges + * @throws {Stubs.Exceptions.InvalidOperationError} if the locations are not within the segment's location range + * @see yfiles.router.PathSearchResult#getPath + * @see yfiles.router.SegmentInfoBase#locationRange + * @see yfiles.router.SegmentInfoBase#location + */ + route(edges:yfiles.algorithms.EdgeList,pathSearchResult:yfiles.router.PathSearchResult):void; + /** + * Sorts the given list of {@link yfiles.router.SegmentInfo}s using the given {@link yfiles.collections.IComparer. comparator}. + *

+ * This method is called in {@link yfiles.router.ChannelBasedPathRouting#route} when the edge segments are distributed within the + * channels. + *

+ * @param {yfiles.collections.IList.} segmentInfos the list of {@link yfiles.router.SegmentInfo}s to be sorted + * @param {yfiles.collections.IComparer.} segmentInfoComparer the comparator used for sorting the list of {@link yfiles.router.SegmentInfo}s + * @protected + */ + sortSegmentInfos(segmentInfos:yfiles.collections.IList,segmentInfoComparer:yfiles.collections.IComparer):void; + /** + * Gets the {@link yfiles.router.PathSearchConfiguration path search configuration} with which the {@link yfiles.router.ChannelBasedPathRouting} has been {@link yfiles.router.ChannelBasedPathRouting#initialize initialized}. + * @see yfiles.router.ChannelBasedPathRouting#initialize + * @protected + * @type {yfiles.router.PathSearchConfiguration} + */ + configuration:yfiles.router.PathSearchConfiguration; + static $class:yfiles.lang.Class; + } + /** + * This class describes an {@link yfiles.router.IObstaclePartition} that decomposes its area dynamically. + *

+ * The partitioning strategy is based on binary space partitioning. It divides the partition space recursively in two {@link yfiles.router.PartitionCell cells} + * until each cell is completely covered by one or more {@link yfiles.router.Obstacle}s or completely empty. + *

+ * @class yfiles.router.DynamicObstacleDecomposition + * @implements {yfiles.router.IObstaclePartition} + * @implements {yfiles.router.IDynamicDecomposition} + */ + export interface DynamicObstacleDecomposition extends Object,yfiles.router.IObstaclePartition,yfiles.router.IDynamicDecomposition{} + export class DynamicObstacleDecomposition { + /** + * Constructs a new instance of {@link yfiles.router.DynamicObstacleDecomposition}. + * @constructor + */ + constructor(); + /** + * Adds the given {@link yfiles.router.IDecompositionListener dynamic decomposition listener} to receive {@link yfiles.router.PartitionCell} subdivision and creation events + * from this decomposition. + *

+ * These events occur when the decomposition changes the partition by subdividing cells into sub-cells or when new cells + * are created. + *

+ * @param {yfiles.router.IDecompositionListener} listener the dynamic decomposition listener to add + * @see yfiles.router.IDecompositionListener + */ + addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; + /** + * Clears the partition data such that the {@link yfiles.router.DynamicObstacleDecomposition} can be reused and {@link yfiles.router.DynamicObstacleDecomposition#init initialized} with + * new {@link yfiles.router.Obstacle}s. + * @see yfiles.router.DynamicObstacleDecomposition#init + */ + clear():void; + /** + * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} that the given {@link yfiles.router.PartitionCell partition cell} has been created. + *

+ * This method is also called in {@link yfiles.router.DynamicObstacleDecomposition#init}. + *

+ * @param {yfiles.router.PartitionCell} createdCell the newly created cell + * @see yfiles.router.IDecompositionListener + * @protected + */ + fireCreateCellEvent(createdCell:yfiles.router.PartitionCell):void; + /** + * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} that the given {@link yfiles.router.PartitionCell partition cell} has been finalized. + * @param {yfiles.router.PartitionCell} finalizedCell the cell that has been finalized + * @see yfiles.router.IDecompositionListener + * @protected + */ + fireFinalizeCellEvent(finalizedCell:yfiles.router.PartitionCell):void; + /** + * Notifies all registered {@link yfiles.router.IDecompositionListener dynamic decomposition listeners} of a subdivision of a given {@link yfiles.router.PartitionCell partition cell}. + * @param {yfiles.router.PartitionCell} cell the cell that has been subdivided + * @param {yfiles.collections.IList.} subCells the new sub-cells resulting from the subdivision of the given cell + * @see yfiles.router.IDecompositionListener + * @protected + */ + fireSubdividedEvent(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; + /** + * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle. + * @param {yfiles.algorithms.YRectangle} rect the rectangular area whose (partially) covered cells will be returned + * @returns {yfiles.collections.IList.} a list of {@link yfiles.router.PartitionCell}s that (partially) cover the given rectangular area + */ + getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; + /** + * Returns all {@link yfiles.router.PartitionCell partition cells} that are completely covered by the given {@link yfiles.router.Obstacle}. + * @param {yfiles.router.Obstacle} obstacle the obstacle for which the covered cells will be returned + * @returns {yfiles.collections.IList.} an unmodifiable list of {@link yfiles.router.PartitionCell} instances that are completely covered by the given obstacle + */ + getCellsForObstacle(obstacle:yfiles.router.Obstacle):yfiles.collections.IList; + /** + * Calculates the cost of a cut with respect to the geometry of the sub-cells. + *

+ * The cost can take values between 0 and 1. + *

+ *

+ * This method is called while a {@link yfiles.router.PartitionCell} is divided into upper and lower or left and right child cells + * depending on the cut costs (during {@link yfiles.router.DynamicObstacleDecomposition#getCellsForObstacle}, {@link yfiles.router.DynamicObstacleDecomposition#getCells} + * and {@link yfiles.router.DynamicObstacleDecomposition#getNeighbors} methods). + *

+ * @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 + * @returns {number} the cost of a cut with respect to the geometry of the sub-cells + * @protected + */ + getGeometricCutCosts(cut:number,min:number,max:number,orthogonalMin:number,orthogonalMax:number):number; + /** + * Returns the neighbor {@link yfiles.router.PartitionCell partition cells} of the given cell. + * @param {yfiles.router.PartitionCell} cell the cell whose neighbors will be returned + * @returns {yfiles.collections.IList.} the neighbor cells of the given cell + */ + getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; + /** + * Calculates the cost of a cut with respect to the subdivided obstacles. + *

+ * The cost can take values between 0 and 1. + *

+ *

+ * This method is called while a {@link yfiles.router.PartitionCell} is divided into upper and lower or left and right child cells + * depending on the cut costs (during {@link yfiles.router.DynamicObstacleDecomposition#getCellsForObstacle}, {@link yfiles.router.DynamicObstacleDecomposition#getCells} + * and {@link yfiles.router.DynamicObstacleDecomposition#getNeighbors} methods). + *

+ * @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 + * @returns {number} the cost of a cut with respect to the subdivided obstacles + * @protected + */ + getObstacleCutCosts(numObstaclesInFirstHalf:number,numObstaclesInSecondHalf:number,numObstaclesOnCut:number):number; + /** + * Returns all {@link yfiles.router.Obstacle}s that cover the given {@link yfiles.router.PartitionCell partition cell}. + * @param {yfiles.router.PartitionCell} cell the partition cell for which the obstacles will be returned + * @returns {yfiles.collections.IList.} an unmodifiable list of {@link yfiles.router.Obstacle} instances that cover the given cell + */ + getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; + /** + * Initializes this {@link yfiles.router.DynamicObstacleDecomposition} instance with the given obstacles and partition bounds. + *

+ * This method must be called before any other method is invoked. + *

+ * @param {yfiles.collections.IList.} obstacles a list of {@link yfiles.router.Obstacle} objects + * @param {yfiles.algorithms.YRectangle} partitionBounds the bounds of the partition + */ + init(obstacles:yfiles.collections.IList,partitionBounds:yfiles.algorithms.YRectangle):void; + /** + * Removes the given {@link yfiles.router.IDecompositionListener dynamic decomposition listener} such that it no longer receives {@link yfiles.router.PartitionCell} subdivision + * and creation events from this decomposition. + * @param {yfiles.router.IDecompositionListener} listener the dynamic decomposition listener to remove + * @see yfiles.router.IDecompositionListener + */ + removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; + /** + * Gets or sets the costs incurred for every {@link yfiles.router.Obstacle} that must be cut in a subdivision. + *

+ * Values need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative + * @type {number} + */ + cutObstacleCost:number; + /** + * Gets or sets the costs incurred if the distribution after a subdivision of obstacles is unbalanced in sub-cells. + *

+ * Values need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative + * @type {number} + */ + unbalancedObstaclesCost:number; + /** + * Gets or sets the costs incurred if the subdivision produces unbalanced rectangles. + *

+ * Values need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the cost is negative + * @type {number} + */ + unbalancedRatioCost:number; + /** + * Gets the bounds of the original rectangular area that is being partitioned. + * @type {yfiles.algorithms.YRectangle} + */ + bounds:yfiles.algorithms.YRectangle; + static $class:yfiles.lang.Class; + } + /** + * This class encapsulates the information that determines the route of a specific edge within a specific {@link yfiles.router.PartitionCell partition cell}. + * @class yfiles.router.EdgeCellInfo + */ + export interface EdgeCellInfo extends Object{} + export class EdgeCellInfo { + /** + * Creates a new {@link yfiles.router.EdgeCellInfo} instance. + * @param {yfiles.algorithms.Edge} edge the edge whose routing in the cell is described + * @param {yfiles.router.PartitionCell} cell the cell in which the edge is routed + * @param {yfiles.router.OrthogonalInterval} enterInterval the interval that the edge uses to enter the cell + * @param {yfiles.router.OrthogonalInterval} exitInterval the interval that the edge uses to exit the cell + * @param {yfiles.layout.Direction} enterDirection the direction in which the edge enters the cell + * @param {yfiles.layout.Direction} exitDirection the direction in which the edge exits the cell + * @param {number} enterSegmentNo the index of the edge segment that enters the cell + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,cell:yfiles.router.PartitionCell,enterInterval:yfiles.router.OrthogonalInterval,exitInterval:yfiles.router.OrthogonalInterval,enterDirection:yfiles.layout.Direction,exitDirection:yfiles.layout.Direction,enterSegmentNo:number); + /** + * Gets the number of bends of the edge within this cell. + * @type {number} + */ + bendCount:number; + /** + * Gets the routing type of the edge within this cell. + * @type {yfiles.router.RoutingType} + */ + type:yfiles.router.RoutingType; + /** + * Gets or sets the index of the edge segment that enters this cell. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given index is negative + * @type {number} + */ + enterSegmentIndex:number; + /** + * Gets or sets the index of the edge segment that exits this cell. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given index is negative + * @type {number} + */ + exitSegmentIndex:number; + /** + * Gets or sets the {@link yfiles.router.SegmentGroup segment group} containing the entering segment. + *

+ * When specifying the segment group, the {@link yfiles.router.EdgeCellInfo#enterInterval enter interval} is updated to use the segment group's common enter interval. + *

+ * @see yfiles.router.SegmentGroup#commonLocationRange + * @type {yfiles.router.SegmentGroup} + */ + enterSegmentGroup:yfiles.router.SegmentGroup; + /** + * Gets or sets the {@link yfiles.router.SegmentGroup segment group} containing the exiting segment. + *

+ * When specifying the segment group, the {@link yfiles.router.EdgeCellInfo#exitInterval exit interval} is updated to use the segment group's common exit interval. + *

+ * @see yfiles.router.SegmentGroup#commonLocationRange + * @type {yfiles.router.SegmentGroup} + */ + exitSegmentGroup:yfiles.router.SegmentGroup; + /** + * Gets the edge that is routed within the {@link yfiles.router.EdgeCellInfo#cell partition cell}. + * @type {yfiles.algorithms.Edge} + */ + edge:yfiles.algorithms.Edge; + /** + * Gets the {@link yfiles.router.PartitionCell partition cell} within which the edge is routed. + * @type {yfiles.router.PartitionCell} + */ + cell:yfiles.router.PartitionCell; + /** + * Gets the {@link yfiles.router.OrthogonalInterval interval} that the edge uses to enter this cell. + * @type {yfiles.router.OrthogonalInterval} + */ + enterInterval:yfiles.router.OrthogonalInterval; + /** + * Gets the {@link yfiles.router.OrthogonalInterval interval} that the edge uses to exit this cell. + * @type {yfiles.router.OrthogonalInterval} + */ + exitInterval:yfiles.router.OrthogonalInterval; + /** + * Gets the {@link yfiles.layout.Direction direction} in which the edge enters this cell. + * @type {yfiles.layout.Direction} + */ + enterDirection:yfiles.layout.Direction; + /** + * Gets the {@link yfiles.layout.Direction direction} in which the edge exits this cell. + * @type {yfiles.layout.Direction} + */ + exitDirection:yfiles.layout.Direction; + /** + * Calculates the list of {@link yfiles.router.CellSegmentInfo}s for the segment parts of this edge that lie within the associated + * {@link yfiles.router.EdgeCellInfo#cell partition cell}. + * @type {yfiles.algorithms.YList} + */ + cellSegmentInfos:yfiles.algorithms.YList; + static $class:yfiles.lang.Class; + } + /** + * This class encapsulates the information required to route an edge with a path routing algorithm. + * @see yfiles.router.ChannelBasedPathRouting + * @class yfiles.router.EdgeInfo + */ + export interface EdgeInfo extends Object{} + export class EdgeInfo { + /** + * Creates a new {@link yfiles.router.EdgeInfo} instance. + * @param {yfiles.router.Path} path the path that will be used for routing the edge + * @param {yfiles.router.PathSearchConfiguration} configuration the {@link yfiles.router.PathSearchConfiguration configuration} of the path search algorithm + * @constructor + */ + constructor(path:yfiles.router.Path,configuration:yfiles.router.PathSearchConfiguration); + /** + * Calculates an array of {@link yfiles.algorithms.LineSegment}s created by the {@link yfiles.router.EdgeInfo#calculatePathPoints calculated path points}. + * @returns {Array.} an array of {@link yfiles.algorithms.LineSegment}s created by the calculated path points + */ + calculateLineSegments():yfiles.algorithms.LineSegment[]; + /** + * Calculates a list of {@link yfiles.algorithms.YPoint}s containing the source port, bend and target port locations. + * @returns {yfiles.algorithms.YList} a list of {@link yfiles.algorithms.YPoint}s containing the source port, bend and target port locations + */ + calculatePathPoints():yfiles.algorithms.YList; + /** + * Returns the {@link yfiles.router.EdgeCellInfo} of the given {@link yfiles.router.CellEntrance} in the path. + * @param {yfiles.router.CellEntrance} entrance the entrance for which the {@link yfiles.router.EdgeCellInfo} will be returned + * @returns {yfiles.router.EdgeCellInfo} the {@link yfiles.router.EdgeCellInfo} of the given {@link yfiles.router.CellEntrance} in the path + */ + getEdgeCellInfo(entrance:yfiles.router.CellEntrance):yfiles.router.EdgeCellInfo; + /** + * Returns the {@link yfiles.router.SegmentInfo} of the segment following the segment of the given {@link yfiles.router.SegmentInfo}. + * @param {yfiles.router.SegmentInfo} segment the segment info for which the next segment info will be returned + * @returns {yfiles.router.SegmentInfo} the segment info of the segment following the segment of the given segment info + */ + getNextSegment(segment:yfiles.router.SegmentInfo):yfiles.router.SegmentInfo; + /** + * Returns the {@link yfiles.router.SegmentInfo} of the segment preceding the segment of the given {@link yfiles.router.SegmentInfo}. + * @param {yfiles.router.SegmentInfo} segment the segment info for which the previous segment info will be returned + * @returns {yfiles.router.SegmentInfo} the segment info of the segment preceding the segment of the given segment info + */ + getPreviousSegment(segment:yfiles.router.SegmentInfo):yfiles.router.SegmentInfo; + /** + * Returns the {@link yfiles.router.SegmentInfo} of the edge segment with the given index. + * @param {number} segmentIndex the index of the edge segment for which the segment info will be returned + * @returns {yfiles.router.SegmentInfo} the {@link yfiles.router.SegmentInfo} of the edge segment with the given index + */ + getSegmentInfo(segmentIndex:number):yfiles.router.SegmentInfo; + /** + * Returns the number of segments of the edge. + * @returns {number} the number of segments of the edge + */ + segmentCount():number; + /** + * Gets whether the path of this {@link yfiles.router.EdgeInfo#edge edge} is fixed or should be routed by the path search algorithm. + * @type {boolean} + */ + fixed:boolean; + /** + * Gets the edge whose route is described by this {@link yfiles.router.EdgeInfo} instance. + * @type {yfiles.algorithms.Edge} + */ + edge:yfiles.algorithms.Edge; + /** + * Gets a list of {@link yfiles.router.EdgeCellInfo}s describing how the edge traverses each {@link yfiles.router.PartitionCell} on its + * path. + * @type {yfiles.collections.IList.} + */ + edgeCellInfos:yfiles.collections.IList; + /** + * Gets or sets the location of the strong source port that the edge uses. + *

+ * Defining a new strong source port also updates the first {@link yfiles.router.SegmentInfo} to use this fixed port location. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the first segment is already fixed and the given port location contradicts the segment's fixed location + * @see yfiles.router.SegmentInfoBase#location + * @see yfiles.router.SegmentInfo#atStrongPortConstraint + * @type {yfiles.algorithms.YPoint} + */ + strongSourcePort:yfiles.algorithms.YPoint; + /** + * Gets or sets the location of the strong target port that the edge uses. + *

+ * Defining a new strong target port also updates the last {@link yfiles.router.SegmentInfo} to use this fixed port location. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the last segment is already fixed and the given port location contradicts the segment's fixed location + * @see yfiles.router.SegmentInfoBase#location + * @see yfiles.router.SegmentInfo#atStrongPortConstraint + * @type {yfiles.algorithms.YPoint} + */ + strongTargetPort:yfiles.algorithms.YPoint; + static $class:yfiles.lang.Class; + } + /** + * This class is used by {@link yfiles.router.EdgeRouter} to provide routing details for the edges of the graph. + *

+ * An {@link yfiles.router.EdgeLayoutDescriptor} instance can be specified individually for single edges using a {@link yfiles.algorithms.IDataProvider} + * that returns an {@link yfiles.router.EdgeLayoutDescriptor} instance for each edge of the graph, or null if no {@link yfiles.router.EdgeLayoutDescriptor} + * is bound to an edge. The {@link yfiles.algorithms.IDataProvider} is registered with the graph using key + * {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ *

+ * This class is designed such that it allows future additions of new getter methods. + *

+ * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @class yfiles.router.EdgeLayoutDescriptor + */ + export interface EdgeLayoutDescriptor extends Object{} + export class EdgeLayoutDescriptor { + /** + * Creates a new instance of an {@link yfiles.router.EdgeLayoutDescriptor} with the default settings. + * @constructor + */ + constructor(); + /** + * Creates a copy of this {@link yfiles.router.EdgeLayoutDescriptor} instance. + * @returns {yfiles.router.EdgeLayoutDescriptor} a copy of this {@link yfiles.router.EdgeLayoutDescriptor} instance + */ + createCopy():yfiles.router.EdgeLayoutDescriptor; + /** + * Gets or sets the minimum length of the first segment of the edge path (at the source node). + *

+ * The minimum length should be greater than or equal to 0. If a negative value is given as input, the default value, i.e., + * 5.0, will be used instead. + *

+ * @type {number} + */ + minimumFirstSegmentLength:number; + /** + * Gets or sets the minimum length of the last segment of the edge path (at the target node). + *

+ * The minimum length should be greater than or equal to 0. If a negative value is given as input, the default value, i.e., + * 10.0, will be used instead. + *

+ * @type {number} + */ + minimumLastSegmentLength:number; + /** + * Gets or sets the minimum distance between a pair of edges. + *

+ * The minimum distance should be greater than or equal to 0. If a negative value is given as input, the default value, + * i.e., 3.0, will be used instead. + *

+ * @type {number} + */ + minimumEdgeToEdgeDistance:number; + /** + * Gets or sets the minimum distance that the edge should maintain from node corners when entering or leaving the node. + *

+ * The minimum distance should be greater than or equal to 0. If a negative value is given as input, the default value, + * i.e., 3.0, will be used instead. + *

+ * @type {number} + */ + minimumNodeCornerDistance:number; + /** + * Gets or sets the monotonic path restrictions that should be applied. + *

+ * Monotonic path restrictions imply that (ideally) the vertical and/or horizontal segments of an edge path are directed + * from the source node towards the target node without ever changing their direction back towards the source node. + *

+ *

+ * If an unknown restriction is specified, {@link yfiles.router.MonotonicPathRestriction#NONE} will be used instead. + *

+ * @type {yfiles.router.MonotonicPathRestriction} + */ + monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; + /** + * Gets or sets the {@link yfiles.router.PenaltySettings} used for this edge. + *

+ * Besides specifying a completely customized setting, the user can choose between four predefined optimization strategies: + * {@link yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS} + * and {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given penalty settings are null + * @see yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED + * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS + * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS + * @see yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS + * @type {yfiles.router.PenaltySettings} + */ + penaltySettings:yfiles.router.PenaltySettings; + static $class:yfiles.lang.Class; + } + /** + * This edge routing algorithm applies polyline routes to the edges of the graph. + *

+ * Layout Style Edges are normally routed in an orthogonal fashion, i.e., they only consist of horizontal and vertical segments. There + * is also a {@link yfiles.router.EdgeRouter#polylineRouting routing style} in which, between horizontal and vertical segments, additional segments with other slopes are + * inserted. + *

+ *

+ * During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not + * modify their locations or their sizes in any way. + *

+ *

+ * The edge routing algorithm can be applied wherever it is needed to route the edges as polyline or orthogonal segments + * without crossing any nodes, while keeping the positions of the nodes in the diagram fixed. Some potential applications + * include electric circuit design, floor planning and navigation maps. + *

+ *

+ * {@graph {"ann":{"s":[80,100],"d":1},"n":[[217.75,668.75],[447.12,732.5,135,30],[582,230.25],[582,530.75],[738,668.75],[497.5,372],[770.38,245.25,30,70],[674,419.5],[447.12,525.12,30,30],[357.12,253.38,30,82.5],[369.62,441.38,30,60]],"e":[[0,1,40,28.75,-67.5,0],[0,2,-9.25,-50,-40,-41.94,[248.5,238.31]],[1,3,67.5,-6,3.56,50,[625.56,741.5]],[0,4,40,-8.94,-40,-8.94],[1,4,67.5,6,-40,34.75],[0,5,27.75,-50,-40,-4.72,[285.5,417.28]],[0,6,-27.75,-50,0,-35,[230,220.25,785.38,220.25]],[4,6,7.38,-50,0,35],[2,6,40,0,-15,0],[5,7,40,44.95,-40,-2.55],[4,7,-32,-50,32,50],[7,2,-40,-17.6,19.12,50,[641.12,451.9]],[0,8,40,-34.31,0,15,[462.12,684.44]],[0,9,9.25,-50,-15,0,[267,294.62]],[5,9,-40,-32.91,0,41.25,[372.12,389.09]],[9,2,15,-2.81,-40,11.56],[10,8,15,21.54,0,-15,[462.12,492.92]],[10,3,15,10.62,-16.62,-50,[605.38,482]],[10,5,15,-19.48,-40,29.9]],"vp":[217.0,220.0,601.0,549.0]}} Sample output of the edge routing algorithm with default settings {@graph {"ann":{"s":[80,100],"d":1},"n":[[-80.25,263.5,30,30],[-309.62,407.12],[-170.25,-8.25,30,82.5],[-80.25,470.88,135,30],[54.62,-31.38],[54.62,269.12],[-157.75,179.75,30,60],[210.62,407.12],[-29.88,110.38],[243,-16.38,30,70],[146.62,157.88]],"e":[[1,0,40,28.75,-15,0,[-207.88,485.88,-199.94,477.94,-199.94,300.94,-177.5,278.5]],[1,2,40,28.75,-6,41.25,[-207.88,485.88,-199.94,477.94,-199.94,152.94,-188.56,141.56,-172.56,141.56,-161.25,130.25]],[1,3,40,28.75,-67.5,0],[1,4,40,28.75,0,-50,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,94.62,-41.38]],[2,4,15,-2.81,-40,11.56],[3,5,67.5,0,3.56,50,[86.12,485.88,98.19,473.81]],[6,0,15,-14.69,0,-15,[-80.94,195.06,-65.25,210.75]],[6,5,15,-14.69,-18.5,-50,[-80.94,195.06,-65.25,210.75,-65.25,233.75,-49.25,249.75,70.75,249.75,76.12,255.12]],[1,7,40,28.75,34.69,-50,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,268.62,-41.38,285.31,-24.69]],[3,7,67.5,0,-40,28.75],[6,8,15,-14.69,-40,34.69],[1,8,40,28.75,-40,-18.81,[-207.88,485.88,-199.94,477.94,-199.94,152.94,-188.56,141.56]],[8,2,40,47,6,41.25,[60.12,207.38,60.12,100.12,52.31,92.31,-144.69,92.31,-149.25,87.75]],[1,9,40,28.75,0,-35,[-207.88,485.88,-199.94,477.94,-199.94,-19.06,-177.62,-41.38,250.62,-41.38,258,-34]],[7,9,-32,-50,0,35,[218.62,334.38,229.5,323.5,246.5,323.5,258,312]],[4,9,40,0,-15,0],[8,10,40,47,-40,-0.5],[7,10,-32,-50,32,50],[10,4,-40,-29.22,18.5,50,[122.65,178.65,113.12,169.12]]],"vp":[-310.0,-42.0,601.0,550.0]}} Sample output of the edge routing algorithm with + * polyline routing and grouped edges {@graph {"ann":{"s":[80,100],"d":1},"n":[[556.12,477.62],[648.12,366.38],[471.62,318.88],[316.25,181.25,150,335.75,2],[421.25,472,30,30],[331.25,200.25,30,82.5],[343.75,388.25,30,60],[191.88,615.62],[421.25,679.38,135,30],[712.12,615.62],[541.12,158.12,248.38,134,2],[556.12,177.12],[744.5,192.12,30,70]],"e":[[2,1,40,36.2,-40,-11.3],[2,5,-7.94,-50,15,19.12,[503.69,277.69,486.62,260.62]],[6,4,15,21.54,0,-15,[426.79,439.79,436.25,449.25]],[6,0,15,10.62,-16.62,-50,[564.88,428.88,579.5,443.5]],[6,2,15,-14.69,-40,34.69],[7,4,40,-38.54,0,15,[413.92,627.08,436.25,604.75]],[7,2,40,-21.62,-0.44,50,[489,644,511.19,621.81]],[7,5,24.67,-50,-15,0,[256.54,263.46,278.5,241.5]],[7,8,40,28.75,-67.5,0],[8,0,67.5,-6,3.56,50,[587.62,688.38,599.69,676.31]],[7,9,40,-4.71,-40,-4.71],[8,9,67.5,6,-40,34.75],[9,1,-32,-50,32,50],[7,11,0,-50,0,-50,[231.88,189.12,253.88,167.12,596.12,167.12]],[5,11,15,-19.12,-40,-4.75],[1,11,-40,-35.1,19.12,50,[624.27,381.27,615.25,372.25]],[7,12,-24.67,-50,0,-35,[207.21,186.79,229.87,164.12,751.12,164.12,759.5,172.5]],[9,12,7.38,-50,0,35],[11,12,40,0,-15,0]],"vp":[191.0,158.0,602.0,558.0]}} Sample output of the edge routing algorithm with polyline routing and group + * nodesConceptThe edge routing algorithm basically performs three (four) steps to achieve an orthogonal (polyline) edge routing. + *

+ *
    + *
  1. Creating a {@link yfiles.router.IPartition} which divides the area of the graph area into several {@link yfiles.router.PartitionCell}s.
  2. + *
  3. Finding the shortest/cheapest paths for all edges through the {@link yfiles.router.IPartition} using {@link yfiles.router.PathSearch}.
  4. + *
  5. + * Assigning coordinates to the segments of the edges based on the paths that were calculated before with + * {@link yfiles.router.ChannelBasedPathRouting}. + *
  6. + *
  7. Inserting non-orthogonal segments where horizontal and vertical segments meet (only if {@link yfiles.router.EdgeRouter#polylineRouting polyline routing} is enabled).
  8. + *
+ *

+ * The first two steps are customizable. {@link yfiles.router.IGraphPartitionExtension}s are able to influence how the {@link yfiles.router.IPartition} + * is created. They add {@link yfiles.router.PartitionCell}s and/or mark them for adding costs later in the process. The currently + * used {@link yfiles.router.EdgeRouter#registeredPartitionExtensions partition extensions} can be dropped or extended by custom implementations. + *

+ *

+ * For example, the extension 'Node Partition' adds a {@link yfiles.router.PartitionCell} to the {@link yfiles.router.IPartition} for each + * node and marks it as belonging to a node. During {@link yfiles.router.PathSearch}, the extension 'Node Crossing' recognizes + * these + * {@link yfiles.router.PartitionCell}s and adds costs that penalizes crossing a node. The edge will be routed around the nodes. + *

+ *

+ * {@link yfiles.router.PathSearchExtension}s influence the {@link yfiles.router.PathSearch} by adding costs for traversing + * {@link yfiles.router.PartitionCell}s or narrowing their intervals to allow a less expensive traversal of a + * {@link yfiles.router.PartitionCell}. The currently used {@link yfiles.router.EdgeRouter#registeredPathSearchExtensions partition extensions} can be dropped or extended by custom + * implementations. + *

+ *

+ * Using {@link yfiles.router.EdgeLayoutDescriptor}s, it is possible to add individual layout settings like routing styles to + * edges. They are registered with the graph with key {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If no + * descriptor is provided for an edge, a {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default edge layout descriptor} is used as fallback value. + *

+ *

+ * Features + *

+ *

+ * The routing algorithm supports two approaches to connect edges on a specific side or even on 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 {@link yfiles.layout.PortCandidate}s connects to nodes with {@link yfiles.layout.PortCandidateSet}s, the edge + * router will try to match both collections in order to find an appropriate port. In case there is no matching port + * candidate, a {@link yfiles.layout.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 {@link yfiles.layout.PortConstraint}s and + * {@link yfiles.layout.PortCandidate}s in the same diagram. + *

+ *

+ * Edges can be grouped so that they share common segments at the beginning or end of their routes. Although a graph may + * contain source and target grouped edges, an edge can only either be part of a source or a target group. Edge groups are + * specified using {@link yfiles.algorithms.IDataProvider}s that provide the same ID object for all edges in the same group. Those + * {@link yfiles.algorithms.IDataProvider}s are registered with the graph with key {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * for source groups or key {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} for target groups. + *

+ * @class yfiles.router.EdgeRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface EdgeRouter extends yfiles.layout.LayoutStageBase{} + export class EdgeRouter { + /** + * Creates a new {@link yfiles.router.EdgeRouter} instance with an optional core layout algorithm. + * @param {yfiles.layout.ILayoutAlgorithm} [core=null] The core layout algorithm. + * @constructor + */ + constructor(core?:yfiles.layout.ILayoutAlgorithm); + /** + * Checks the sizes of the nodes to be non-zero. + * @param {yfiles.layout.LayoutGraph} g The graph to check. + * @protected + */ + checkNodeSize(g:yfiles.layout.LayoutGraph):void; + /** + * Removes all registered {@link yfiles.router.IGraphPartitionExtension}s from a given {@link yfiles.router.GraphPartition} instance. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} after the edge routes are calculated. It may be overridden + * in order to provide a custom implementation for cleaning up a {@link yfiles.router.GraphPartition} instance. + *

+ * @param {yfiles.router.GraphPartition} partition the given {@link yfiles.router.GraphPartition} instance + * @see yfiles.router.EdgeRouter#configureGraphPartition + * @see yfiles.router.EdgeRouter#registeredPartitionExtensions + * @protected + */ + cleanUpGraphPartition(partition:yfiles.router.GraphPartition):void; + /** + * Adds all registered {@link yfiles.router.IGraphPartitionExtension}s instances to a given {@link yfiles.router.GraphPartition} instance. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to adjust the configuration of the {@link yfiles.router.GraphPartition} instance. + *

+ * @param {yfiles.router.GraphPartition} partition the given {@link yfiles.router.GraphPartition} instance + * @see yfiles.router.EdgeRouter#registeredPartitionExtensions + * @see yfiles.router.EdgeRouter#cleanUpGraphPartition + * @protected + */ + configureGraphPartition(partition:yfiles.router.GraphPartition):void; + /** + * Adds all registered {@link yfiles.router.PathSearchExtension}s to a given {@link yfiles.router.PathSearch} instance. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to adjust the configuration of a {@link yfiles.router.PathSearch} instance. + *

+ * @param {yfiles.router.PathSearch} pathSearch a {@link yfiles.router.PathSearch} instance + * @see yfiles.router.EdgeRouter#createPathSearch + * @see yfiles.router.EdgeRouter#registeredPathSearchExtensions + * @protected + */ + configurePathSearch(pathSearch:yfiles.router.PathSearch):void; + /** + * Creates a {@link yfiles.router.PathSearchConfiguration} that is used during the path searching process. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to create a new {@link yfiles.router.PathSearchConfiguration} object with custom configuration. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.layout.GroupingSupport} grouping the grouping structure of the graph + * @returns {yfiles.router.PathSearchConfiguration} a {@link yfiles.router.PathSearchConfiguration} instance + * @protected + */ + createConfiguration(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GroupingSupport):yfiles.router.PathSearchConfiguration; + /** + * Creates a default {@link yfiles.collections.IComparer.} instance to determine the order of the edges according to which they will be routed. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to create a new {@link yfiles.collections.IComparer.} object with a custom configuration. + *

+ *

+ * By default, this method returns an instance of the default implementation. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.router.PathSearchConfiguration} configuration the given configuration for the path searching process + * @returns {yfiles.collections.IComparer.} a {@link yfiles.collections.IComparer.} instance + * @protected + */ + createDefaultEdgeOrderComparer(graph:yfiles.layout.LayoutGraph,configuration:yfiles.router.PathSearchConfiguration):yfiles.collections.IComparer; + /** + * Creates a {@link yfiles.router.GraphPartition} instance that divides the area of the graph into several rectangles. + *

+ * This implementation creates a {@link yfiles.router.GraphPartition} using the current {@link yfiles.router.IObstaclePartition} instance. + *

+ *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to create a new {@link yfiles.router.GraphPartition} object with a custom configuration. + *

+ * @param {yfiles.router.IObstaclePartition} decomposition the current {@link yfiles.router.IObstaclePartition} + * @returns {yfiles.router.GraphPartition} a {@link yfiles.router.GraphPartition} instance + * @see yfiles.router.EdgeRouter#configureGraphPartition + * @see yfiles.router.EdgeRouter#registeredPartitionExtensions + */ + createGraphPartition(decomposition:yfiles.router.IObstaclePartition):yfiles.router.GraphPartition; + /** + * Creates a {@link yfiles.router.DynamicObstacleDecomposition} that is used by the {@link yfiles.router.GraphPartition} to divide the + * graph area in rectangles. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to create a new {@link yfiles.router.DynamicObstacleDecomposition} object with custom configuration. + *

+ * @returns {yfiles.router.DynamicObstacleDecomposition} a {@link yfiles.router.DynamicObstacleDecomposition} instance + * @see yfiles.router.EdgeRouter#createGraphPartition + * @protected + */ + createObstacleDecomposition():yfiles.router.DynamicObstacleDecomposition; + /** + * Creates a {@link yfiles.router.ChannelBasedPathRouting} instance that routes the edges using pre-calculated {@link yfiles.router.Path} + * objects. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to create a new {@link yfiles.router.ChannelBasedPathRouting} object with custom configuration. + *

+ * @returns {yfiles.router.ChannelBasedPathRouting} a {@link yfiles.router.ChannelBasedPathRouting} instance + * @protected + */ + createPathRouting():yfiles.router.ChannelBasedPathRouting; + /** + * Creates a {@link yfiles.router.PathSearch} instance that finds the paths of the edges through the {@link yfiles.router.GraphPartition}. + *

+ * This method may be overridden in order to create a new {@link yfiles.router.PathSearch} object with custom configuration. + *

+ * @returns {yfiles.router.PathSearch} a {@link yfiles.router.PathSearch} instance + * @see yfiles.router.EdgeRouter#configurePathSearch + * @see yfiles.router.EdgeRouter#registeredPathSearchExtensions + * @protected + */ + createPathSearch():yfiles.router.PathSearch; + /** + * Creates a {@link yfiles.router.PathSearchContext} that provides context information for the path searching algorithm. + *

+ * This method is called by {@link yfiles.router.EdgeRouter#applyLayout} before the edge routes are calculated. It may be + * overridden in order to create a new {@link yfiles.router.PathSearchContext} object with custom configuration. + *

+ * @param {yfiles.router.PathSearch} pathSearch a given {@link yfiles.router.PathSearch} instance + * @param {yfiles.router.PathSearchConfiguration} configuration a given configuration for the path searching process + * @returns {yfiles.router.PathSearchContext} a {@link yfiles.router.PathSearchContext} instance + * @protected + */ + createPathSearchContext(pathSearch:yfiles.router.PathSearch,configuration:yfiles.router.PathSearchConfiguration):yfiles.router.PathSearchContext; + /** + * Returns the {@link yfiles.router.EdgeLayoutDescriptor} instance for a given edge that is provided by a {@link yfiles.algorithms.IDataProvider} + * which is registered with the graph with key {@link yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ * For all those edges that do not have a specific layout descriptor assigned, the default layout descriptor returned by {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor} + * will be assigned. + *

+ *

+ * This method may be overridden in order to create an {@link yfiles.router.EdgeLayoutDescriptor} with custom configuration. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge + * @returns {yfiles.router.EdgeLayoutDescriptor} the current {@link yfiles.router.EdgeLayoutDescriptor} instance for a given edge + * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor + * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + */ + getEdgeLayoutDescriptor(edge:yfiles.algorithms.Edge):yfiles.router.EdgeLayoutDescriptor; + /** + * Returns whether or not a given edge is selected. + *

+ * If all the edges of the graph will be routed by {@link yfiles.router.EdgeRouter}, i.e., the {@link yfiles.router.EdgeRouter#scope scope} is set to + * {@link yfiles.router.Scope#ROUTE_ALL_EDGES}, this utility method returns true for all edges. + *

+ *

+ * This method may be overridden in order to determine differently whether or not a given edge is considered to be + * selected. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge + * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {boolean} true if the given edge is selected, false otherwise + */ + isAffected(edge:yfiles.algorithms.Edge,graph:yfiles.algorithms.Graph):boolean; + /** + * Data provider key for specifying individual edge layout information + *

+ * If this {@link yfiles.algorithms.IDataProvider} does not contain an {@link yfiles.router.EdgeLayoutDescriptor} for an edge, then the + * layout algorithm will use the {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default descriptor}. + *

+ * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for weighting the costs for crossing each label individually + *

+ * If the factor for a label is 0 then it is allowed to cross it. Very important labels should get a high factor. + *

+ *

+ * This factor is multiplied by the basic penalty arising when an edge must cross a {@link yfiles.router.PenaltySettings#nodeLabelCrossingPenalty node label} or an {@link yfiles.router.PenaltySettings#edgeLabelCrossingPenalty edge label} in order to + * determine the final costs arising when this label is crossed. + *

+ * @see yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor + * @see yfiles.router.EdgeLayoutDescriptor#penaltySettings + * @const + * @static + * @type {yfiles.algorithms.ILabelLayoutDpKey.} + */ + static LABEL_CROSSING_PENALTY_FACTOR_DP_KEY:yfiles.algorithms.ILabelLayoutDpKey; + /** + * Gets or sets the time limit (in milliseconds) set for the edge routing algorithm. + *

+ * The maximum duration has to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum duration is negative + * @type {number} + */ + maximumDuration:number; + /** + * Gets the {@link yfiles.router.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific edge layout + * descriptor assigned. + * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.router.EdgeLayoutDescriptor} + */ + defaultEdgeLayoutDescriptor:yfiles.router.EdgeLayoutDescriptor; + /** + * Gets or sets whether or not the routing algorithm will route the edges of the graph with (non-orthogonal) polyline + * segments. + * @see yfiles.router.EdgeRouter#preferredPolylineSegmentLength + * @see yfiles.router.EdgeRouter#maximumPolylineSegmentRatio + * @type {boolean} + */ + polylineRouting:boolean; + /** + * Gets or sets the preferred length of (non-orthogonal) polyline segments. + *

+ * If there is not enough space to use this preferred length, polyline segments may also be shorter. + *

+ *

+ * The preferred length of (non-orthogonal) polyline segments has to be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the preferred polyline segment length is negative + * @see yfiles.router.EdgeRouter#maximumPolylineSegmentRatio + * @type {number} + */ + preferredPolylineSegmentLength:number; + /** + * Gets or sets the maximum ratio between the horizontal/vertical part of a segment and the (non-orthogonal) polyline + * part. + *

+ * When polyline segments are added to an edge path, corners between horizontal and vertical segments are cut and replaced + * by the new segment. This ratio describes the cutting points on a segment. If it is zero, the route stays orthogonal. The + * value cannot be larger than 0.5 because there may be another polyline segment at the other side of the segment. For long + * orthogonal segments the length of the polyline segment is determined by the value returned by {@link yfiles.router.EdgeRouter#preferredPolylineSegmentLength}. + *

+ *

+ * The maximum polyline segment ratio must be between 0 and 0.5. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the maximum segment length is negative or greater than 0.5 + * @type {number} + */ + maximumPolylineSegmentRatio:number; + /** + * Gets or sets whether or not the routing algorithm uses an additional step to reroute the edges that are considered to + * have the worst paths. + * @type {boolean} + */ + rerouting:boolean; + /** + * Gets or sets a (sub-)set of edges that shall be routed. + * @throws {Stubs.Exceptions.ArgumentError} if the given scope is unknown + * @see yfiles.router.EdgeRouter#affectedEdgesDpKey + * @type {yfiles.router.Scope} + */ + scope:yfiles.router.Scope; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the nodes. + *

+ * If the {@link yfiles.router.EdgeRouter#scope scope} is set to + * {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}, only the edges that are incident to selected nodes will be routed, + * while all other edges will be considered to have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null + * @see yfiles.router.EdgeRouter#scope + * @type {Object} + */ + affectedNodesDpKey:Object; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key to look up the selection state of the edges. + *

+ * If the {@link yfiles.router.EdgeRouter#scope scope} is set to + * {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the selected edges will be routed, while all other edges will be + * considered to have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null + * @see yfiles.router.EdgeRouter#scope + * @type {Object} + */ + affectedEdgesDpKey:Object; + /** + * Gets or sets a custom {@link yfiles.collections.IComparer.} to define the processing order of the edges. + * @see yfiles.router.EdgeRouter#createDefaultEdgeOrderComparer + * @type {yfiles.collections.IComparer.} + */ + edgeComparer:yfiles.collections.IComparer; + /** + * Gets or sets whether or not the routing algorithm considers the labels of the nodes as obstacles when calculating the + * edge routes to avoid overlaps. + * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty + * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets whether or not this routing algorithm ignores node labels that are inside the bounds of their owner as + * obstacles for edge routes. + * @see yfiles.router.EdgeRouter#considerNodeLabels + * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty + * @see yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY + * @type {boolean} + */ + ignoreInnerNodeLabels:boolean; + /** + * Gets or sets whether or not the routing algorithm considers as obstacles the edge labels that do not belong to the + * (sub-)set of edges to be routed when calculating the edge routes. + * @see yfiles.router.EdgeRouter#scope + * @see yfiles.router.EdgeRouter#affectedEdgesDpKey + * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty + * @type {boolean} + */ + considerEdgeLabels:boolean; + /** + * Gets or sets the {@link yfiles.router.Grid} instance on which the routing algorithm places the orthogonal segments. + * @type {yfiles.router.Grid} + */ + grid:yfiles.router.Grid; + /** + * Gets or sets the minimum distance between edges and node bounds. + *

+ * The minimum distance should have a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum node-to-edge distance is negative + * @see yfiles.router.PenaltySettings#minimumNodeToEdgeDistancePenalty + * @type {number} + */ + minimumNodeToEdgeDistance:number; + /** + * Gets a list of all registered {@link yfiles.router.IGraphPartitionExtension}s. + *

+ * {@link yfiles.router.IGraphPartitionExtension}s can be added to a {@link yfiles.router.GraphPartition} in order to create new + * {@link yfiles.router.Obstacle}s or can be removed from a {@link yfiles.router.GraphPartition} instance. + *

+ *

+ * By default, the following {@link yfiles.router.IGraphPartitionExtension}s are registered with a given {@link yfiles.router.GraphPartition} + * instance: + *

+ *
    + *
  • Minimum Node To Edge Distance Partition
  • + *
  • Node Partition
  • + *
  • Partition Grid Partition
  • + *
  • Node Label Partition
  • + *
  • Edge Label Partition
  • + *
  • Fixed Edges Partition
  • + *
  • External Strong Port Restriction Partition
  • + *
+ * @see yfiles.router.EdgeRouter#createGraphPartition + * @see yfiles.router.EdgeRouter#configureGraphPartition + * @type {yfiles.collections.IList.} + */ + registeredPartitionExtensions:yfiles.collections.IList; + /** + * Gets a list of all registered {@link yfiles.router.PathSearchExtension}s. + *

+ * {@link yfiles.router.PathSearchExtension}s can be added to a {@link yfiles.router.PathSearch} instance in order to influence the path + * searching process or can be removed from a {@link yfiles.router.PathSearch} instance. + *

+ *

+ * By default, the following {@link yfiles.router.PathSearchExtension}s are registered with a {@link yfiles.router.PathSearch} instance: + *

+ *
    + *
  • Fixed Grouped Edges
  • + *
  • Node Crossing
  • + *
  • Minimum Node To Edge Distance
  • + *
  • Group Node Crossing
  • + *
  • Minimum Group Node To Edge Distance
  • + *
  • Node Label Crossing
  • + *
  • Edge Label Crossing
  • + *
  • Bends In Node To Edge Distance
  • + *
  • Bend
  • + *
  • Monotonic Route
  • + *
  • Edge Length
  • + *
  • Partition Grid
  • + *
  • Port Restriction
  • + *
  • Edge Grouping
  • + *
  • Minimum Node Corner Distance
  • + *
  • Interval Based Crossing
  • + *
  • Minimum Edge To Edge Distance And Grid
  • + *
  • Minimum First Last Segment Length
  • + *
  • Intersecting Source And Target
  • + *
+ * @see yfiles.router.EdgeRouter#createPathSearch + * @see yfiles.router.EdgeRouter#configurePathSearch + * @type {yfiles.collections.IList.} + */ + registeredPathSearchExtensions:yfiles.collections.IList; + /** + * Gets the {@link yfiles.router.GraphPartition} instance used during the routing process. + * @type {yfiles.router.GraphPartition} + */ + partition:yfiles.router.GraphPartition; + static $class:yfiles.lang.Class; + } + export enum Alignment{ + /** + * A constant specifying that the segment prefers to be placed close to the lower bound of its location range. + * @see yfiles.router.SegmentInfoBase#preferredAlignment + * @see yfiles.router.SegmentInfoBase#preferredAlignment + */ + MIN, + /** + * A constant specifying that the segment prefers to be placed close to the upper bound of its location range. + * @see yfiles.router.SegmentInfoBase#preferredAlignment + * @see yfiles.router.SegmentInfoBase#preferredAlignment + */ + MAX, + /** + * A constant specifying that the segment can be placed anywhere within its location range. + * @see yfiles.router.SegmentInfoBase#preferredAlignment + * @see yfiles.router.SegmentInfoBase#preferredAlignment + */ + ANY + } + export enum RoutingType{ + /** + * A routing type representing a straight crossing of the + * {@link yfiles.router.PartitionCell partition cell}, i.e., a single orthogonal edge segment enters and exits the cell. + * @see yfiles.router.EdgeCellInfo#type + */ + STRAIGHT, + /** + * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition 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 yfiles.router.EdgeCellInfo#type + */ + STRAIGHT_BENDING, + /** + * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition 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 yfiles.router.EdgeCellInfo#type + */ + BENDING, + /** + * A routing type representing a crossing of the {@link yfiles.router.PartitionCell partition 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 yfiles.router.EdgeCellInfo#type + */ + U_TURN, + /** + * A routing type representing the source or target end of an edge being in the cell, i.e., the enter and/or exit interval + * is null. + * @see yfiles.router.EdgeCellInfo#type + */ + END + } + /** + * A {@link yfiles.router.GraphPartition} partitions the bounding box of a graph into rectangles using the graph elements as + * {@link yfiles.router.Obstacle}s. + *

+ * All {@link yfiles.router.Obstacle}s used during the partitioning are {@link yfiles.router.GraphPartition#createObstacle created} by {@link yfiles.router.IGraphPartitionExtension}s. + * {@link yfiles.router.IGraphPartitionExtension}s have been {@link yfiles.router.GraphPartition#addDynamicDecompositionListener registered} before using method {@link yfiles.router.IGraphPartitionExtension#preparePartition} + * which is called during the {@link yfiles.router.GraphPartition#init initialization} of a {@link yfiles.router.GraphPartition}. + *

+ *

+ * The core partitioning is delegated to an {@link yfiles.router.IObstaclePartition} that is {@link yfiles.router.IObstaclePartition#init initialized} with these + * {@link yfiles.router.Obstacle}s. + *

+ *

+ * If the {@link yfiles.router.IObstaclePartition} is of type {@link yfiles.router.IDynamicDecomposition}, {@link yfiles.router.GraphPartition} + * re-dispatches the decomposition notifications to its extensions. + *

+ * @see yfiles.router.IGraphPartitionExtension + * @class yfiles.router.GraphPartition + * @implements {yfiles.router.IPartition} + * @implements {yfiles.router.IDynamicDecomposition} + * @implements {yfiles.router.IDecompositionListener} + */ + export interface GraphPartition extends Object,yfiles.router.IPartition,yfiles.router.IDynamicDecomposition,yfiles.router.IDecompositionListener{} + export class GraphPartition { + /** + * Creates a new {@link yfiles.router.GraphPartition} instance using the given {@link yfiles.router.GraphPartition#partition delegate inner obstacle partition}. + * @param {yfiles.router.IObstaclePartition} partition the delegate inner obstacle partition + * @constructor + */ + constructor(partition:yfiles.router.IObstaclePartition); + /** + * Adds the given listener to the {@link yfiles.router.GraphPartition}. + *

+ * The listener will be notified upon dynamic decomposition events. If it is a {@link yfiles.router.IGraphPartitionExtension}, + * method {@link yfiles.router.IGraphPartitionExtension#preparePartition} is called during {@link yfiles.router.GraphPartition#init initialization}. + *

+ * @param {yfiles.router.IDecompositionListener} listener the listener to be added + */ + addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; + /** + * Clears the {@link yfiles.router.GraphPartition partition} data such that the {@link yfiles.router.GraphPartition} can be reused and {@link yfiles.router.GraphPartition#init initialized} with a new + * configuration. + *

+ * All {@link yfiles.router.IGraphPartitionExtension}s are {@link yfiles.router.IGraphPartitionExtension#cleanup cleaned up}; partition listeners and obstacles are {@link yfiles.router.GraphPartition#removeDynamicDecompositionListener removed}. + *

+ * @see yfiles.router.GraphPartition#init + */ + clear():void; + /** + * Creates and returns a new {@link yfiles.router.Obstacle} using the given bounds and data. + *

+ * All obstacles created via this method are delegated to the {@link yfiles.router.GraphPartition#partition inner partition} upon {@link yfiles.router.GraphPartition#init initialization}. + *

+ * @param {yfiles.algorithms.YRectangle} bounds the bounds of the obstacle + * @param {Object} data the additional data that should be associated with the obstacle + * @returns {yfiles.router.Obstacle} a new {@link yfiles.router.Obstacle} using the given bounds and data + */ + createObstacle(bounds:yfiles.algorithms.YRectangle,data:Object):yfiles.router.Obstacle; + /** + * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle by delegating to the + * corresponding method of the {@link yfiles.router.GraphPartition#partition inner partition}. + * @param {yfiles.algorithms.YRectangle} rect the rectangular area whose (partially) covered cells will be returned + * @returns {yfiles.collections.IList.} a list containing (partially) covered {@link yfiles.router.PartitionCell}s + * @see yfiles.router.IPartition#getCells + */ + getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; + /** + * Returns all {@link yfiles.router.PartitionCell}s that are completely covered by the bounds of the given node. + * @param {yfiles.algorithms.Node} node the node for which the covered cells will be returned + * @returns {yfiles.collections.IList.} an unmodifiable list of {@link yfiles.router.PartitionCell} instances that are completely covered by the bounds of the given + * node + * @throws {Stubs.Exceptions.ArgumentError} if the node is unknown + */ + getCellsForNode(node:yfiles.algorithms.Node):yfiles.collections.IList; + /** + * Returns a list of all + * {@link yfiles.router.PartitionCell}s that are neighbors of the given cell, i.e., those cells that have a common border segment + * with the given cell. + * @param {yfiles.router.PartitionCell} cell the cell whose neighbors will be returned + * @returns {yfiles.collections.IList.} a list of {@link yfiles.router.PartitionCell}s that are neighbors of the given cell + */ + getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.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.PartitionCell} cell the cell + * @returns {yfiles.collections.IList.} a list of {@link yfiles.algorithms.Node}s that are intersected by the given cell + */ + getNodes(cell:yfiles.router.PartitionCell):yfiles.collections.IList; + /** + * Returns the {@link yfiles.router.Obstacle} that has been created earlier for the given data object. + * @param {Object} data the given data for which the obstacle will be returned + * @returns {yfiles.router.Obstacle} the {@link yfiles.router.Obstacle} that has been created earlier for the given data object + */ + getObstacle(data:Object):yfiles.router.Obstacle; + /** + * Returns all {@link yfiles.router.Obstacle}s covering the given {@link yfiles.router.PartitionCell} by delegating to the corresponding + * method of the {@link yfiles.router.GraphPartition#partition inner partition}. + * @param {yfiles.router.PartitionCell} cell the cell whose obstacles will be returned + * @returns {yfiles.collections.IList.} a list of {@link yfiles.router.Obstacle}s that cover the given cell + * @see yfiles.router.IObstaclePartition#getObstacles + */ + getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; + /** + * Initializes the {@link yfiles.router.GraphPartition} with the given graph instance based on the given {@link yfiles.router.PathSearchConfiguration configuration} used by path + * search algorithms. + *

+ * Before calling this method, any old partitioning information must be {@link yfiles.router.GraphPartition#clear cleared}. + *

+ *

+ * This initialization method calls {@link yfiles.router.IGraphPartitionExtension#preparePartition} of all registered extensions. + * Then, the {@link yfiles.router.GraphPartition#partition inner delegate partition} is initialized passing all {@link yfiles.router.GraphPartition#createObstacle added} obstacles as well as the given graph's bounds + * extended by a small padding. + *

+ *

+ * In the case where the {@link yfiles.router.GraphPartition#partition delegate partition} is of type {@link yfiles.router.IDynamicDecomposition}, this {@link yfiles.router.GraphPartition} + * will also be added as {@link yfiles.router.IDecompositionListener} to it. + *

+ * @param {yfiles.router.PathSearchConfiguration} configuration the configuration used by path search algorithms + * @see yfiles.router.GraphPartition#clear + * @see yfiles.router.IGraphPartitionExtension#preparePartition + * @see yfiles.router.GraphPartition#addDynamicDecompositionListener + */ + init(configuration:yfiles.router.PathSearchConfiguration):void; + /** + * Re-dispatches the event of the creation of a new {@link yfiles.router.PartitionCell} to all registered + * {@link yfiles.router.IDecompositionListener}s. + *

+ * This method is a callback after a {@link yfiles.router.PartitionCell} has been created. + *

+ * @param {yfiles.router.PartitionCell} createdCell the newly created {@link yfiles.router.PartitionCell} + */ + onCellCreated(createdCell:yfiles.router.PartitionCell):void; + /** + * Re-dispatches the event of having completed the process of subdivisions of a given {@link yfiles.router.PartitionCell} to all + * registered {@link yfiles.router.IDecompositionListener}s. + *

+ * This method is a callback after a {@link yfiles.router.PartitionCell} has been finalized and won't be further subdivided. + *

+ * @param {yfiles.router.PartitionCell} finalizedCell the cell that has been finalized + */ + onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; + /** + * Re-dispatches the event of the subdivision of a given {@link yfiles.router.PartitionCell} into several sub-cells to all + * registered {@link yfiles.router.IDecompositionListener}s. + *

+ * This method is a callback after a {@link yfiles.router.PartitionCell} has been subdivided into several sub-cells. + *

+ * @param {yfiles.router.PartitionCell} cell the cell that has been subdivided + * @param {yfiles.collections.IList.} subCells the sub-cells resulting from the subdivision of the given {@link yfiles.router.PartitionCell} + */ + onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; + /** + * Removes the given listener from the {@link yfiles.router.GraphPartition}. + *

+ * The listener will not be notified of dynamic decomposition events anymore. + *

+ * @param {yfiles.router.IDecompositionListener} listener the listener to be removed + */ + removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; + /** + * Gets the delegate inner obstacle partition. + * @protected + * @type {yfiles.router.IObstaclePartition} + */ + partition:yfiles.router.IObstaclePartition; + /** + * Gets the bounds of the original rectangular area that is being partitioned. + *

+ * This method delegates to the corresponding method of the {@link yfiles.router.GraphPartition#partition inner partition}. + *

+ * @see yfiles.router.IPartition#bounds + * @type {yfiles.algorithms.YRectangle} + */ + bounds:yfiles.algorithms.YRectangle; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.router.GraphPartitionExtensionAdapter} provides an empty implementation of + * {@link yfiles.router.IGraphPartitionExtension}. + *

+ * The only real functionality is contained in method {@link yfiles.router.IGraphPartitionExtension#preparePartition} which stores + * the given {@link yfiles.router.PathSearchConfiguration} and {@link yfiles.router.GraphPartition} in properties. + *

+ * @see yfiles.router.GraphPartitionExtensionAdapter#configuration + * @see yfiles.router.GraphPartitionExtensionAdapter#graphPartition + * @class yfiles.router.GraphPartitionExtensionAdapter + * @implements {yfiles.router.IGraphPartitionExtension} + */ + export interface GraphPartitionExtensionAdapter extends Object,yfiles.router.IGraphPartitionExtension{} + export class GraphPartitionExtensionAdapter { + /** + * Creates a new instance of {@link yfiles.router.GraphPartitionExtensionAdapter}. + * @constructor + */ + constructor(); + /** + * + */ + cleanup():void; + /** + * + * @param {yfiles.router.PartitionCell} createdCell + */ + onCellCreated(createdCell:yfiles.router.PartitionCell):void; + /** + * + * @param {yfiles.router.PartitionCell} finalizedCell + */ + onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; + /** + * + * @param {yfiles.router.PartitionCell} cell + * @param {yfiles.collections.IList.} subCells + */ + onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; + /** + * Stores the given {@link yfiles.router.PathSearchConfiguration} and {@link yfiles.router.GraphPartition} such that they are accessible + * through {@link yfiles.router.GraphPartitionExtensionAdapter#configuration} and {@link yfiles.router.GraphPartitionExtensionAdapter#graphPartition}, respectively. + * @param {yfiles.router.PathSearchConfiguration} configuration the configuration used for the path search + * @param {yfiles.router.GraphPartition} graphPartition the graph partition that uses this extension + */ + preparePartition(configuration:yfiles.router.PathSearchConfiguration,graphPartition:yfiles.router.GraphPartition):void; + /** + * Gets the {@link yfiles.router.GraphPartition} passed to {@link yfiles.router.IGraphPartitionExtension#preparePartition}. + * @protected + * @type {yfiles.router.GraphPartition} + */ + graphPartition:yfiles.router.GraphPartition; + /** + * Gets the configuration of the {@link yfiles.router.PathSearch} passed to + * {@link yfiles.router.IGraphPartitionExtension#preparePartition}. + * @protected + * @type {yfiles.router.PathSearchConfiguration} + */ + configuration:yfiles.router.PathSearchConfiguration; + static $class:yfiles.lang.Class; + } + /** + * This 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. + *

+ * @class yfiles.router.Grid + * @final + */ + export interface Grid extends Object{} + export class Grid { + /** + * Creates a new {@link yfiles.router.Grid} instance. + *

+ * The spacing between the grid lines must be at least 1. If the given spacing is smaller, value 1 is assumed. + *

+ * @param {number} originX the x-coordinate of the origin of the grid + * @param {number} originY the y-coordinate of the origin of the grid + * @param {number} spacing the spacing between the grid lines + * @constructor + */ + constructor(originX:number,originY:number,spacing:number); + /** + * Gets the x-coordinate of the origin. + * @type {number} + */ + originX:number; + /** + * Gets the y-coordinate of the origin. + * @type {number} + */ + originY:number; + /** + * Gets the spacing between the horizontal and vertical grid lines. + * @type {number} + */ + spacing:number; + static $class:yfiles.lang.Class; + } + /** + * This interface should be implemented by classes that dispatch notifications about changes in {@link yfiles.router.IPartition}s. + *

+ * Such classes can be notified when {@link yfiles.router.PartitionCell}s are created, divided, and/or finalized. + *

+ * @see yfiles.router.IDecompositionListener + * @interface + */ + export interface IDynamicDecomposition extends Object{ + /** + * Adds the given {@link yfiles.router.IDecompositionListener} that will be notified of dynamic decomposition events to the + * {@link yfiles.router.IPartition}. + * @param {yfiles.router.IDecompositionListener} listener the listener to be added + * @abstract + */ + addDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; + /** + * Removes the given {@link yfiles.router.IDecompositionListener} from the {@link yfiles.router.IPartition}. + *

+ * The {@link yfiles.router.IDecompositionListener} will be no more notified of dynamic decomposition events. + *

+ * @param {yfiles.router.IDecompositionListener} listener the listener to be removed + * @abstract + */ + removeDynamicDecompositionListener(listener:yfiles.router.IDecompositionListener):void; + } + var IDynamicDecomposition:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is implemented by classes that require to be notified of changes in {@link yfiles.router.IPartition}s. + *

+ * Implementations are notified when {@link yfiles.router.PartitionCell}s are created, divided, and/or finalized. + *

+ * @interface + */ + export interface IDecompositionListener extends Object{ + /** + * Callback after the new given {@link yfiles.router.PartitionCell} has been created. + * @param {yfiles.router.PartitionCell} createdCell the newly created {@link yfiles.router.PartitionCell} + * @abstract + */ + onCellCreated(createdCell:yfiles.router.PartitionCell):void; + /** + * Callback after the given {@link yfiles.router.PartitionCell} has been finalized and won't be further subdivided. + * @param {yfiles.router.PartitionCell} finalizedCell the cell that has been finalized + * @abstract + */ + onCellFinalized(finalizedCell:yfiles.router.PartitionCell):void; + /** + * Callback after the given {@link yfiles.router.PartitionCell} has been subdivided into several sub-cells. + *

+ * {@link yfiles.router.IDecompositionListener} may not modify the list of sub-cells. + *

+ * @param {yfiles.router.PartitionCell} cell the cell that has been subdivided + * @param {yfiles.collections.IList.} subCells the sub-cells resulting from the subdivision of the given {@link yfiles.router.PartitionCell} + * @abstract + */ + onCellSubdivided(cell:yfiles.router.PartitionCell,subCells:yfiles.collections.IList):void; + } + var IDecompositionListener:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface provides additional intervals in order to move from one {@link yfiles.router.PartitionCell partition cell} into an adjacent one. + *

+ * To find a {@link yfiles.router.Path} for an edge, the {@link yfiles.router.PathSearch} algorithm moves 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 {@link yfiles.router.PathSearch} to calculate additional enter intervals that might + * accumulate lower costs for entering the adjacent cell. + *

+ * @see yfiles.router.PartitionCell + * @see yfiles.router.PathSearch#addAdditionalEnterIntervalCalculator + * @interface + */ + export interface IEnterIntervalCalculator extends Object{ + /** + * Appends additional enter intervals to the given list of enter intervals for moving from the {@link yfiles.router.PartitionCell partition cell} of the + * current {@link yfiles.router.CellEntrance} to the neighboring cell. + * @param {yfiles.router.CellEntrance} currentEntrance the current {@link yfiles.router.CellEntrance} that is exited + * @param {yfiles.router.PartitionCell} enteredCell the neighboring cell that will be entered + * @param {yfiles.router.OrthogonalInterval} commonInterval the common interval of the left and entered partition cells + * @param {yfiles.collections.IList.} allEnterIntervals the list to which additional enter intervals have to be appended + * @param {yfiles.router.PathSearchContext} context the context of the path search + * @abstract + */ + appendEnterIntervals(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,commonInterval:yfiles.router.OrthogonalInterval,allEnterIntervals:yfiles.collections.IList,context:yfiles.router.PathSearchContext):void; + } + var IEnterIntervalCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface provides methods for extending the functionality of a {@link yfiles.router.GraphPartition}. + *

+ * A {@link yfiles.router.IGraphPartitionExtension} can be used for {@link yfiles.router.GraphPartition#createObstacle creating} new {@link yfiles.router.Obstacle}s that will be given to the + * initializer of the {@link yfiles.router.IObstaclePartition} where they can react to the {@link yfiles.router.IObstaclePartition}'s + * decomposition events if it implements the {@link yfiles.router.IDynamicDecomposition} interface. + *

+ *

+ * A {@link yfiles.router.IGraphPartitionExtension} has to be {@link yfiles.router.GraphPartition#addDynamicDecompositionListener added} to the {@link yfiles.router.GraphPartition} which will call method {@link yfiles.router.IGraphPartitionExtension#preparePartition} + * before the {@link yfiles.router.IObstaclePartition} is initialized. + *

+ * @interface + * @implements {yfiles.router.IDecompositionListener} + */ + export interface IGraphPartitionExtension extends Object,yfiles.router.IDecompositionListener{ + /** + * Cleans up the extension from the last partitioning with the current {@link yfiles.router.PathSearchConfiguration configuration} and {@link yfiles.router.GraphPartition}. + * @abstract + */ + cleanup():void; + /** + * Adds a {@link yfiles.router.IGraphPartitionExtension} to the {@link yfiles.router.GraphPartition}. + *

+ * It is called by the given {@link yfiles.router.GraphPartition} upon initialization before its {@link yfiles.router.IObstaclePartition} + * is initialized. Implementations may use the graph upon which the given {@link yfiles.router.GraphPartition} is based to + * initialize themselves and/or to {@link yfiles.router.GraphPartition#createObstacle add obstacles} to the list with which {@link yfiles.router.IObstaclePartition} is initialized. + *

+ * @param {yfiles.router.PathSearchConfiguration} configuration the configuration used for the path search + * @param {yfiles.router.GraphPartition} graphPartition the graph partition that uses this extension + * @abstract + */ + preparePartition(configuration:yfiles.router.PathSearchConfiguration,graphPartition:yfiles.router.GraphPartition):void; + } + var IGraphPartitionExtension:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class represents a one-dimensional closed interval. + * @class yfiles.router.Interval + */ + export interface Interval extends Object{} + export class Interval { + /** + * Creates a new {@link yfiles.router.Interval} between the given bounds. + *

+ * The upper and lower bound of the two given values are determined automatically, i.e., the smaller one will be treated as + * the lower bound and the larger one as the upper bound. + *

+ * @param {number} bound1 the first interval bound + * @param {number} bound2 the second interval bound + * @constructor + */ + constructor(bound1:number,bound2:number); + /** + * Returns the bridging {@link yfiles.router.Interval interval} between the given {@link yfiles.router.Interval intervals}. + *

+ * The bridging interval is null if the given intervals intersect each other. Otherwise, the bridging interval is + * [minimum of upper bounds, maximum of lower bounds]. + *

+ * @param {yfiles.router.Interval} i1 the first interval + * @param {yfiles.router.Interval} i2 the second interval + * @returns {yfiles.router.Interval} the bridging interval between the given intervals or null if the intervals intersect + * @static + */ + static calculateBridge(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; + /** + * Returns the intersection of the given {@link yfiles.router.Interval intervals}. + *

+ * The intersection is null if the given intervals do not intersect each other. Otherwise, the intersection is + * [maximum of lower bounds, minimum of upper bounds]. + *

+ * @param {yfiles.router.Interval} i1 the first interval + * @param {yfiles.router.Interval} i2 the second interval + * @returns {yfiles.router.Interval} the intersection of the given intervals or null if the intervals do not intersect + * @static + */ + static calculateIntersection(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; + /** + * Returns the spanning rectangle between the given {@link yfiles.router.Interval intervals}. + *

+ * The first interval spans the rectangle in horizontal dimension, the second interval in vertical dimension. + *

+ * @param {yfiles.router.Interval} horizontal the interval that defines the location and length of the rectangle in horizontal dimension + * @param {yfiles.router.Interval} vertical the interval that defines the location and length of the rectangle in vertical dimension + * @returns {yfiles.algorithms.YRectangle} the spanning rectangle between the given intervals + * @static + */ + static calculateSpanningRectangle(horizontal:yfiles.router.Interval,vertical:yfiles.router.Interval):yfiles.algorithms.YRectangle; + /** + * Returns the union of the given {@link yfiles.router.Interval intervals} and the given value. + *

+ * The union is between the minimum of the lower bound of the given interval and the given value and the maximum of the + * upper bound of the given interval and the given value. + *

+ * @param {yfiles.router.Interval} interval the interval to be extended + * @param {number} value the value to be in the union + * @returns {yfiles.router.Interval} the union of the given interval and the given value + * @static + */ + static calculateUnion(interval:yfiles.router.Interval,value:number):yfiles.router.Interval; + /** + * Returns the union of the given {@link yfiles.router.Interval intervals}. + *

+ * The union is [minimum of lower bounds, maximum of upper bounds]. + *

+ * @param {yfiles.router.Interval} i1 the first interval + * @param {yfiles.router.Interval} i2 the second interval + * @returns {yfiles.router.Interval} the union of the given intervals + * @static + */ + static calculateUnion(i1:yfiles.router.Interval,i2:yfiles.router.Interval):yfiles.router.Interval; + /** + * Checks whether or not the given value lies within the interval. + * @param {number} value the value to check + * @returns {boolean} true if the value lies within the interval, false otherwise + */ + contains(value:number):boolean; + /** + * Checks whether or not the given {@link yfiles.router.Interval interval} fully covers this {@link yfiles.router.Interval interval} given a small epsilon value. + *

+ * The given interval covers this interval, if other lower bound - epsilon <= this lower bound and + * this upper bound <= other upper bound + epsilon. + *

+ * @param {yfiles.router.Interval} other the other interval + * @param {number} [eps=1E-06] the epsilon value that determines the extended range of the other interval + * @returns {boolean} true if this interval is fully covered by the other interval, false otherwise + */ + coveredBy(other:yfiles.router.Interval,eps?:number):boolean; + /** + * Returns the distance between this {@link yfiles.router.Interval interval} and the given {@link yfiles.router.Interval interval}. + *

+ * If the intervals intersect, the distance is 0. Otherwise, it is equal to + * dist(minimum of upper bounds, maximum of lower bounds). + *

+ * @param {yfiles.router.Interval} other the other interval to which the distance is calculated + * @returns {number} the distance between this interval and the given interval + */ + distanceTo(other:yfiles.router.Interval):number; + /** + * Returns the distance between the value and this {@link yfiles.router.Interval 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 which the distance is calculated + * @returns {number} the distance between the value and the interval + */ + distanceTo(value:number):number; + /** + * Returns the {@link yfiles.router.Interval interval} bound that is closest to the given value. + * @param {number} value the value for which the closest interval bound will be returned + * @returns {number} + *
    + *
  • the value, if the given value lies within the interval, or
  • + *
  • the lower bound, if the given value is smaller than or equal to the lower bound, or
  • + *
  • the upper bound, if the given value is greater than or equal to the upper bound
  • + *
+ */ + getClosest(value:number):number; + /** + * Checks whether or not this {@link yfiles.router.Interval interval} and the given {@link yfiles.router.Interval interval} cover 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 the given epsilon value. + *

+ * @param {yfiles.router.Interval} other the other interval + * @param {number} [eps=1E-06] the maximum distance between the two minimum and the two maximum values + * @returns {boolean} true if the intervals cover the same range, false otherwise + */ + hasSameRange(other:yfiles.router.Interval,eps?:number):boolean; + /** + * Checks whether or not this {@link yfiles.router.Interval interval} intersects with the given + * {@link yfiles.router.Interval interval}, considering the given minimum intersection length. + * @param {yfiles.router.Interval} other the other interval to check + * @param {number} [minIntersection=0] the minimum length of the intersection of the intervals + * @returns {boolean} true if the intervals intersect at least by the given minimum length, false otherwise + */ + intersects(other:yfiles.router.Interval,minIntersection?:number):boolean; + /** + * Checks whether or not the lower bound of this {@link yfiles.router.Interval interval} is greater than the upper bound of the given interval. + * @param {yfiles.router.Interval} other the interval to compare + * @returns {boolean} true if the current interval is on the right of the given one, false otherwise + */ + isGreaterThan(other:yfiles.router.Interval):boolean; + /** + * Checks whether or not the upper bound of this {@link yfiles.router.Interval interval} is smaller than the lower bound of the given interval. + * @param {yfiles.router.Interval} other the interval to compare + * @returns {boolean} true if the current interval is on the left of the given one, false otherwise + */ + isLessThan(other:yfiles.router.Interval):boolean; + /** + * Gets the lower bound of the interval. + * @type {number} + */ + min:number; + /** + * Gets the upper bound of the interval. + * @type {number} + */ + max:number; + /** + * Gets the midpoint of the interval. + * @type {number} + */ + center:number; + /** + * Gets the size of the interval, i.e., the difference between the {@link yfiles.router.Interval#max upper bound} and the {@link yfiles.router.Interval#min lower bound}. + * @type {number} + */ + size:number; + static $class:yfiles.lang.Class; + } + /** + * This class implements a {@link yfiles.router.IPartition} that takes a list of {@link yfiles.router.Obstacle}s as input to subdivide an + * area into {@link yfiles.router.PartitionCell}s. + *

+ * Implementations have to satisfy the following condition for each pair of {@link yfiles.router.Obstacle} and + * {@link yfiles.router.PartitionCell}: + *

+ *
    + *
  • + * {@link yfiles.router.Obstacle}s either completely cover {@link yfiles.router.PartitionCell}s or do not intersect + * {@link yfiles.router.PartitionCell}s at all. + *
  • + *
+ *

+ * {@graph {"ann":{"s":[40,40],"d":1},"styles":{"6":{"s":"#0000ff", "f":null}},"n":[[380,280,[[394.66,309.35,10.67,18.7,"1"]]],[580,400,[[594.66,429.35,10.67,18.7,"2"]]],[240.2,280,139.8,40,6],[240.2,159.2,179.8,120.8,6],[240.2,320,179.95,280,6],[420.15,440,200,160,6],[420.15,400,159.85,40,6],[420.15,159.2,319.2,240.8,6],[620,400,119.35,200,6]],"e":[[0,1,[400,420]]],"vp":[240.0,159.0,500.0,441.0]}} Example of an {@link yfiles.router.IObstaclePartition} of a graph consisting of two nodes connected by one edge. The two nodes + * are considered to be obstacles. The colored partition cells subdivide the area such that each obstacle either completely + * covers a partition cell or does not intersect with a partition cell. + *

+ * @interface + * @implements {yfiles.router.IPartition} + */ + export interface IObstaclePartition extends Object,yfiles.router.IPartition{ + /** + * Clears the partition data such that the {@link yfiles.router.IObstaclePartition} can be reused and {@link yfiles.router.IObstaclePartition#init initialized} with new + * {@link yfiles.router.Obstacle}s. + * @see yfiles.router.IObstaclePartition#init + * @abstract + */ + clear():void; + /** + * Returns all {@link yfiles.router.PartitionCell}s that are completely covered by the given {@link yfiles.router.Obstacle}. + * @param {yfiles.router.Obstacle} obstacle the obstacle for which the covered cells will be returned + * @returns {yfiles.collections.IList.} an unmodifiable list of {@link yfiles.router.PartitionCell} instances that are completely covered by the given obstacle + * @abstract + */ + getCellsForObstacle(obstacle:yfiles.router.Obstacle):yfiles.collections.IList; + /** + * Returns all {@link yfiles.router.Obstacle}s that cover the given {@link yfiles.router.PartitionCell}. + * @param {yfiles.router.PartitionCell} cell the partition cell for which the obstacles will be returned + * @returns {yfiles.collections.IList.} an unmodifiable list of {@link yfiles.router.Obstacle} instances that cover the given cell + * @abstract + */ + getObstacles(cell:yfiles.router.PartitionCell):yfiles.collections.IList; + /** + * Initializes a new {@link yfiles.router.IObstaclePartition} of the area with the given bounds using the given list of + * {@link yfiles.router.Obstacle}s. + *

+ * Unused partitions must be cleared using method {@link yfiles.router.IObstaclePartition#clear}. + *

+ * @param {yfiles.collections.IList.} obstacles a list of {@link yfiles.router.Obstacle}s that have to be considered by the partition + * @param {yfiles.algorithms.YRectangle} bounds the bounds of the partition + * @see yfiles.router.IObstaclePartition#clear + * @abstract + */ + init(obstacles:yfiles.collections.IList,bounds:yfiles.algorithms.YRectangle):void; + } + var IObstaclePartition:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class divides a rectangular area into one or more {@link yfiles.router.PartitionCell}s. + *

+ * {@link yfiles.router.PartitionCell}s have to be disjoint. The union of all + * {@link yfiles.router.PartitionCell}s covers the original area. + *

+ * @interface + */ + export interface IPartition extends Object{ + /** + * Returns a list of all {@link yfiles.router.PartitionCell}s that intersect or cover the given rectangle. + * @param {yfiles.algorithms.YRectangle} rect the rectangular area whose (partially) covered cells will be returned + * @returns {yfiles.collections.IList.} a list of {@link yfiles.router.PartitionCell}s that (partially) cover the given rectangular area + * @abstract + */ + getCells(rect:yfiles.algorithms.YRectangle):yfiles.collections.IList; + /** + * Returns a list of all + * {@link yfiles.router.PartitionCell}s that are neighbors of the given cell, i.e., those cells that have a common border segment + * with the given cell. + * @param {yfiles.router.PartitionCell} cell the cell whose neighbors will be returned + * @returns {yfiles.collections.IList.} a list of {@link yfiles.router.PartitionCell}s that are neighbors of the given cell + * @abstract + */ + getNeighbors(cell:yfiles.router.PartitionCell):yfiles.collections.IList; + /** + * Gets the bounds of the original rectangular area that is partitioned. + * @abstract + * @type {yfiles.algorithms.YRectangle} + */ + bounds:yfiles.algorithms.YRectangle; + } + var IPartition:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class describes the obstacles that are used by implementations of {@link yfiles.router.IObstaclePartition} to subdivide an + * area into {@link yfiles.router.PartitionCell}s. + * @class yfiles.router.Obstacle + */ + export interface Obstacle extends Object{} + export class Obstacle { + /** + * Creates a new {@link yfiles.router.Obstacle} instance with the given bounds and additional data. + * @param {yfiles.algorithms.YRectangle} bounds the bounds of the obstacle + * @param {Object} data the additional data associated to the obstacle + * @constructor + */ + constructor(bounds:yfiles.algorithms.YRectangle,data:Object); + /** + * Gets the bounds of the obstacle. + * @type {yfiles.algorithms.YRectangle} + */ + bounds:yfiles.algorithms.YRectangle; + /** + * Gets the additional data related to the obstacle. + * @type {Object} + */ + data:Object; + static $class:yfiles.lang.Class; + } + /** + * A horizontal or vertical {@link yfiles.router.Interval} that additionally stores a y- (in the horizontal case) or x-coordinate + * (in the vertical case). + *

+ * During a {@link yfiles.router.PathSearch}, orthogonal intervals are used for specifying the location where an edge enters or + * exits a {@link yfiles.router.PartitionCell partition cell}. + *

+ * @see yfiles.router.PathSearch + * @class yfiles.router.OrthogonalInterval + */ + export interface OrthogonalInterval extends Object{} + export class OrthogonalInterval { + /** + * Creates a new {@link yfiles.router.OrthogonalInterval} 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 two-dimensional coordinate system + * @param {boolean} isVertical true if the orthogonal interval is vertical, false if it is horizontal + * @throws {Stubs.Exceptions.ArgumentError} if the given range is null + * @constructor + */ + constructor(from:number,to:number,location:number,isVertical:boolean); + /** + * Creates a new {@link yfiles.router.OrthogonalInterval} instance with the given interval bounds. + * @param {yfiles.router.Interval} range the given range + * @param {number} location the location in the two-dimensional coordinate system + * @param {boolean} isVertical true if the orthogonal interval is vertical, false if it is horizontal + * @throws {Stubs.Exceptions.ArgumentError} if the given range is null + * @constructor + */ + constructor(range:yfiles.router.Interval,location:number,isVertical:boolean); + /** + * Calculates the intersection of the given {@link yfiles.router.OrthogonalInterval orthogonal intervals}. + *

+ * If the returned 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.OrthogonalInterval} i1 the first orthogonal interval + * @param {yfiles.router.OrthogonalInterval} i2 the second orthogonal interval + * @returns {yfiles.router.OrthogonalInterval} the shared orthogonal interval of both given orthogonal intervals + * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations + * @see yfiles.router.OrthogonalInterval#intersects + * @static + */ + static calculateIntersection(i1:yfiles.router.OrthogonalInterval,i2:yfiles.router.OrthogonalInterval):yfiles.router.OrthogonalInterval; + /** + * Calculates the union of the given {@link yfiles.router.OrthogonalInterval orthogonal intervals}. + *

+ * If the returned 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.OrthogonalInterval} i1 the first orthogonal interval + * @param {yfiles.router.OrthogonalInterval} i2 the second orthogonal interval + * @returns {yfiles.router.OrthogonalInterval} the union of both given orthogonal intervals + * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations + * @see yfiles.router.OrthogonalInterval#intersects + * @static + */ + static calculateUnion(i1:yfiles.router.OrthogonalInterval,i2:yfiles.router.OrthogonalInterval):yfiles.router.OrthogonalInterval; + /** + * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} is fully covered by the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. + *

+ * 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 the same + * orientation. + *

+ * @param {yfiles.router.OrthogonalInterval} other the other orthogonal interval + * @returns {boolean} true if this orthogonal interval is fully covered by the other orthogonal interval, false otherwise + * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations + * @see yfiles.router.PartitionCell + */ + coveredBy(other:yfiles.router.OrthogonalInterval):boolean; + /** + * Determines whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} crosses the given one. + *

+ * The orthogonal intervals must have different orientations. + *

+ * @param {yfiles.router.OrthogonalInterval} other the other orthogonal interval + * @returns {boolean} true if this orthogonal interval crosses the given one, false otherwise + * @throws {Stubs.Exceptions.ArgumentError} if the given orthogonal intervals have the same orientation + */ + crosses(other:yfiles.router.OrthogonalInterval):boolean; + /** + * Returns the distance of the {@link yfiles.router.OrthogonalInterval#range ranges} of this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval}. + *

+ * The orthogonal intervals must have the same orientation. + *

+ * @param {yfiles.router.OrthogonalInterval} other the other orthogonal interval + * @returns {number} 0 if the orthogonal intervals intersect each other, otherwise the minimal distance between the orthogonal intervals is + * returned + * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations + */ + distanceTo(other:yfiles.router.OrthogonalInterval):number; + /** + * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval orthogonal interval} cover the same range. + *

+ * If both orthogonal intervals cover the same range, they are considered the same. The location of both orthogonal + * intervals is ignored. The orthogonal intervals must have the same orientation. + *

+ * @param {yfiles.router.OrthogonalInterval} other the other orthogonal interval + * @returns {boolean} true if the orthogonal intervals cover the same range, false otherwise + * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations + * @see yfiles.router.PartitionCell + */ + hasSameRange(other:yfiles.router.OrthogonalInterval):boolean; + /** + * Checks whether or not this {@link yfiles.router.OrthogonalInterval orthogonal interval} intersects the given {@link yfiles.router.OrthogonalInterval orthogonal interval} and the intersection has a given + * minimum intersection size. + *

+ * Orthogonal intervals intersect each other, if their ranges intersect each other by at least the given minimum + * intersection size. The location of both orthogonal intervals is ignored. The orthogonal intervals must have the same + * orientation. + *

+ * @param {yfiles.router.OrthogonalInterval} other the other orthogonal interval + * @param {number} [minIntersection=0] the minimum size of the intersection + * @returns {boolean} true if this interval intersects the given other orthogonal interval, false otherwise + * @throws {Stubs.Exceptions.ArgumentError} if the orthogonal intervals have different orientations + * @see yfiles.router.PartitionCell + */ + intersects(other:yfiles.router.OrthogonalInterval,minIntersection?:number):boolean; + /** + * Returns the Manhattan distance of this {@link yfiles.router.OrthogonalInterval orthogonal interval} and the given {@link yfiles.router.OrthogonalInterval 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 and the other interval's location. + *

+ * @param {yfiles.router.OrthogonalInterval} other the other orthogonal interval + * @returns {number} the Manhattan distance between this interval and the given one + */ + manhattanDistanceTo(other:yfiles.router.OrthogonalInterval):number; + /** + * Gets whether or not the {@link yfiles.router.OrthogonalInterval orthogonal interval} is oriented vertically. + * @type {boolean} + */ + vertical:boolean; + /** + * Gets the lower bound of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. + * @type {number} + */ + min:number; + /** + * Gets the upper bound of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. + * @type {number} + */ + max:number; + /** + * Gets the length of the {@link yfiles.router.OrthogonalInterval orthogonal interval}. + * @see yfiles.router.Interval#size + * @type {number} + */ + size:number; + /** + * Gets the range of this {@link yfiles.router.OrthogonalInterval orthogonal interval}. + * @type {yfiles.router.Interval} + */ + range:yfiles.router.Interval; + /** + * Gets the vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, + * respectively. + * @type {number} + */ + location:number; + /** + * Gets the center of this {@link yfiles.router.OrthogonalInterval orthogonal interval} in the 2D-coordinate system. + * @type {yfiles.algorithms.YPoint} + */ + center:yfiles.algorithms.YPoint; + static $class:yfiles.lang.Class; + } + /** + * This class is a type-safe enumeration used for defining the border of a {@link yfiles.router.PartitionCell}. + * @see yfiles.router.PartitionCell#createBorderInterval + * @class yfiles.router.PartitionCellBorder + */ + export interface PartitionCellBorder extends Object{} + export class PartitionCellBorder { + /** + * Returns the type of the border that is passed through when entering a {@link yfiles.router.PartitionCell} in the given + * direction. + * @param {yfiles.layout.Direction} direction the direction in which a {@link yfiles.router.PartitionCell} has been entered + * @returns {yfiles.router.PartitionCellBorder} the type of the border that is passed through when entering a {@link yfiles.router.PartitionCell} + * @see yfiles.router.PartitionCell + * @static + */ + static valueOfEnterDirection(direction:yfiles.layout.Direction):yfiles.router.PartitionCellBorder; + /** + * Returns the type of the border that is passed through when exiting a {@link yfiles.router.PartitionCell} in the given + * direction. + * @param {yfiles.layout.Direction} direction the direction in which a {@link yfiles.router.PartitionCell} has been exited + * @returns {yfiles.router.PartitionCellBorder} the type of the border that is passed through when exiting a {@link yfiles.router.PartitionCell} + * @see yfiles.router.PartitionCell + * @static + */ + static valueOfExitDirection(direction:yfiles.layout.Direction):yfiles.router.PartitionCellBorder; + /** + * Returns the type of the border that is defined by the given {@link yfiles.layout.PortCandidate}. + *

+ * The border type corresponds to the {@link yfiles.layout.PortCandidate#direction direction} of the given {@link yfiles.layout.PortCandidate}. + *

+ * @param {yfiles.layout.PortCandidate} pc the port candidate for which the border type is returned + * @returns {yfiles.router.PartitionCellBorder} the type of the border that is defined by the given port candidate + * @see yfiles.layout.PortCandidate + * @static + */ + static valueOfPortCandidate(pc:yfiles.layout.PortCandidate):yfiles.router.PartitionCellBorder; + /** + * Returns the type of the border that is defined by the given {@link yfiles.layout.PortConstraint}. + *

+ * The border type corresponds to the {@link yfiles.layout.PortConstraint#side side} of the given {@link yfiles.layout.PortConstraint}. + *

+ * @param {yfiles.layout.PortConstraint} pc the port constraint for which the border type is returned + * @returns {yfiles.router.PartitionCellBorder} the type of the border that is defined by the given port constraint + * @see yfiles.layout.PortConstraint + * @static + */ + static valueOfPortConstraint(pc:yfiles.layout.PortConstraint):yfiles.router.PartitionCellBorder; + /** + * A type constant that defines the upper border of a {@link yfiles.router.PartitionCell}. + * @see yfiles.router.PartitionCell#createBorderInterval + * @const + * @static + * @type {yfiles.router.PartitionCellBorder} + */ + static NORTH:yfiles.router.PartitionCellBorder; + /** + * A type constant that defines the bottom border of a {@link yfiles.router.PartitionCell}. + * @see yfiles.router.PartitionCell#createBorderInterval + * @const + * @static + * @type {yfiles.router.PartitionCellBorder} + */ + static SOUTH:yfiles.router.PartitionCellBorder; + /** + * A type constant that defines the right border of a {@link yfiles.router.PartitionCell}. + * @see yfiles.router.PartitionCell#createBorderInterval + * @const + * @static + * @type {yfiles.router.PartitionCellBorder} + */ + static EAST:yfiles.router.PartitionCellBorder; + /** + * A type constant that defines the left border of a {@link yfiles.router.PartitionCell}. + * @see yfiles.router.PartitionCell#createBorderInterval + * @const + * @static + * @type {yfiles.router.PartitionCellBorder} + */ + static WEST:yfiles.router.PartitionCellBorder; + /** + * Gets the type of the border that is on the opposite side of the border defined by this type. + * @type {yfiles.router.PartitionCellBorder} + */ + mirrorBorder:yfiles.router.PartitionCellBorder; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.router.PartitionCell} represents a rectangular part of a {@link yfiles.router.IPartition} as result of the decomposition + * process. + *

+ * Each instance of {@link yfiles.router.PartitionCell} can hold arbitrary additional information (e.g. what element of the graph + * is covered by a {@link yfiles.router.PartitionCell}) which can be provided using method {@link yfiles.router.PartitionCell#putData}. + * Accessing and removing this information can be done using {@link yfiles.router.PartitionCell#getData} and + * {@link yfiles.router.PartitionCell#removeData}, respectively. + *

+ * @see yfiles.router.PartitionCellKeys + * @class yfiles.router.PartitionCell + */ + export interface PartitionCell extends Object{} + export class PartitionCell { + /** + * Creates a new {@link yfiles.router.PartitionCell} instance of the given {@link yfiles.router.IPartition} with the given bounds. + * @param {number} x the x-coordinate of the upper-left corner of the partition cell + * @param {number} y the y-coordinate of the 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.IPartition} partition the partition to which the partition cell belongs + * @see yfiles.router.IPartition + * @constructor + */ + constructor(x:number,y:number,width:number,height:number,partition:yfiles.router.IPartition); + /** + * Creates a new {@link yfiles.router.PartitionCell} of the given {@link yfiles.router.IPartition} with the location and the size of the + * given rectangle. + * @param {yfiles.algorithms.YRectangle} bounds the bounds describing the size and location of the partition cell + * @param {yfiles.router.IPartition} partition the partition to which the partition cell belongs + * @see yfiles.router.IPartition + * @constructor + */ + constructor(bounds:yfiles.algorithms.YRectangle,partition:yfiles.router.IPartition); + /** + * Clears all additional data for this {@link yfiles.router.PartitionCell}. + * @see yfiles.router.PartitionCell#getData + * @see yfiles.router.PartitionCell#putData + * @see yfiles.router.PartitionCell#removeData + */ + clearData():void; + /** + * Returns an {@link yfiles.router.OrthogonalInterval} that defines the location, the size and the orientation of the given + * {@link yfiles.router.PartitionCellBorder}. + *

+ * The values defining the border are: + *

+ *
    + *
  • {@link yfiles.router.PartitionCellBorder#WEST}
  • + *
  • {@link yfiles.router.PartitionCellBorder#EAST}
  • + *
  • {@link yfiles.router.PartitionCellBorder#NORTH}
  • + *
  • {@link yfiles.router.PartitionCellBorder#SOUTH}
  • + *
+ * @param {yfiles.router.PartitionCellBorder} border a border of this partition cell + * @returns {yfiles.router.OrthogonalInterval} an {@link yfiles.router.OrthogonalInterval} that defines the location, the size and the orientation of the given border + * @see yfiles.router.PartitionCellBorder + */ + createBorderInterval(border:yfiles.router.PartitionCellBorder):yfiles.router.OrthogonalInterval; + /** + * Returns the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. + * @param {Object} key the key whose associated data will be returned + * @returns {Object} the additional data associated with the given key or null if there is no data associated with the given key + * @see yfiles.router.PartitionCell#putData + * @see yfiles.router.PartitionCell#removeData + * @see yfiles.router.PartitionCell#clearData + * @see yfiles.router.PartitionCellKeys + */ + getData(key:Object):Object; + /** + * Stores the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. + * @param {Object} key the key with which the additional data will be associated + * @param {Object} data the additional data + * @returns {Object} the previous data associated with the given key or null if there was no data associated with the given key + * @see yfiles.router.PartitionCell#getData + * @see yfiles.router.PartitionCell#removeData + * @see yfiles.router.PartitionCell#clearData + * @see yfiles.router.PartitionCellKeys + */ + putData(key:Object,data:Object):Object; + /** + * Removes the additional data associated with the given key for this {@link yfiles.router.PartitionCell}. + * @param {Object} key the key for which the associated data will be removed + * @returns {Object} the additional data associated with the given key or null if there is no data associated with the given key + * @see yfiles.router.PartitionCell#getData + * @see yfiles.router.PartitionCell#putData + * @see yfiles.router.PartitionCell#clearData + * @see yfiles.router.PartitionCellKeys + */ + removeData(key:Object):Object; + /** + * Gets the {@link yfiles.router.IPartition partition} to which this {@link yfiles.router.PartitionCell} belongs. + * @see yfiles.router.IPartition + * @type {yfiles.router.IPartition} + */ + partition:yfiles.router.IPartition; + /** + * Gets a unique identifier of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + id:number; + /** + * Gets the bounds of this {@link yfiles.router.PartitionCell}. + * @type {yfiles.algorithms.YRectangle} + */ + bounds:yfiles.algorithms.YRectangle; + /** + * Gets the x-coordinate of the left border of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + minX:number; + /** + * Gets the y-coordinate of the upper border of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + minY:number; + /** + * Gets the x-coordinate of the right border of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + maxX:number; + /** + * Gets the y-coordinate of the bottom border of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + maxY:number; + /** + * Gets the width of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + width:number; + /** + * Gets the height of this {@link yfiles.router.PartitionCell}. + * @type {number} + */ + height:number; + static $class:yfiles.lang.Class; + } + /** + * This class defines keys to obtain additional information about a {@link yfiles.router.PartitionCell}. + *

+ * In order to get the data of the {@link yfiles.router.PartitionCell} that is associated with the given key, method {@link yfiles.router.PartitionCell#getData} + * should be used. + *

+ * @class yfiles.router.PartitionCellKeys + * @static + */ + export interface PartitionCellKeys extends Object{} + export class PartitionCellKeys { + /** + * The key references a {@link yfiles.collections.IList.} of nodes whose bounds are covering a certain {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static NODES_KEY:Object; + /** + * The key references a {@link yfiles.collections.IList.} of nodes being in node to edge distance to a certain {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static NODES_IN_NODE_TO_EDGE_DISTANCE_KEY:Object; + /** + * The key references a {@link yfiles.collections.IList.} of {@link yfiles.layout.INodeLabelLayout}s covering a certain {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static NODE_LABEL_LAYOUTS_KEY:Object; + /** + * The key references a {@link yfiles.collections.IList.} of {@link number} values representing factors that are multiplied by an edge's {@link yfiles.router.PenaltySettings#nodeLabelCrossingPenalty node label crossing costs} in case + * the edge crosses the corresponding {@link yfiles.layout.INodeLabelLayout node label} registered with key + * {@link yfiles.router.PartitionCellKeys#NODE_LABEL_LAYOUTS_KEY}. + * @const + * @static + * @type {Object} + */ + static NODE_LABEL_CROSSING_COST_FACTORS_KEY:Object; + /** + * The key references a {@link yfiles.collections.IList.} of {@link yfiles.layout.IEdgeLabelLayout}s covering a certain {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static EDGE_LABEL_LAYOUTS_KEY:Object; + /** + * The key references a {@link yfiles.collections.IList.} of {@link number} values representing factors that are multiplied by an edge's {@link yfiles.router.PenaltySettings#edgeLabelCrossingPenalty edge label crossing costs} in case + * the edge crosses the corresponding {@link yfiles.layout.IEdgeLabelLayout edge label} registered with key + * {@link yfiles.router.PartitionCellKeys#EDGE_LABEL_LAYOUTS_KEY}. + * @const + * @static + * @type {Object} + */ + static EDGE_LABEL_CROSSING_COST_FACTORS_KEY:Object; + /** + * The key references the {@link yfiles.layout.PartitionCellId} of the {@link yfiles.layout.PartitionGrid} cell covering a certain + * {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static PARTITION_GRID_CELL_ID_KEY:Object; + /** + * The key references the row index of the {@link yfiles.layout.PartitionGrid} cell covering a certain + * {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static PARTITION_GRID_ROW_INDEX_KEY:Object; + /** + * The key references the column index of the {@link yfiles.layout.PartitionGrid} cell covering a certain + * {@link yfiles.router.PartitionCell}. + * @const + * @static + * @type {Object} + */ + static PARTITION_GRID_COLUMN_INDEX_KEY:Object; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.router.Path} represents the result of a path search as a list of consecutive {@link yfiles.router.CellEntrance}s. + *

+ * A path starts with a {@link yfiles.router.CellEntrance} for a {@link yfiles.router.PartitionCell} of the source node and ends with one + * for a {@link yfiles.router.PartitionCell} of the target node. + *

+ * @see yfiles.router.PathSearch + * @see yfiles.router.PathSearchResult + * @class yfiles.router.Path + */ + export interface Path extends Object{} + export class Path { + /** + * Creates a new instance of {@link yfiles.router.Path} for the given edge, {@link yfiles.router.CellEntrance cell entrances} and cost. + * @param {yfiles.algorithms.Edge} edge the edge for which the path was calculated + * @param {yfiles.collections.IList.} entrances the list of {@link yfiles.router.CellEntrance} objects describing the edge path from source node to target node + * @param {number} cost the overall cost of this path + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,entrances:yfiles.collections.IList,cost:number); + /** + * Returns the {@link yfiles.router.CellEntrance} at the given position of this path. + * @param {number} position the position of the {@link yfiles.router.CellEntrance} to return + * @returns {yfiles.router.CellEntrance} the {@link yfiles.router.CellEntrance} at the given position of this path + * @see yfiles.router.Path#setEntrance + */ + getEntrance(position:number):yfiles.router.CellEntrance; + /** + * Returns the number of {@link yfiles.router.CellEntrance} objects in this path. + * @returns {number} the number of {@link yfiles.router.CellEntrance} objects in this path + */ + length():number; + /** + * Returns the position of the first occurrence of the given {@link yfiles.router.CellEntrance} in this path, or -1 if this path + * does not contain this {@link yfiles.router.CellEntrance}. + * @param {yfiles.router.CellEntrance} entrance the {@link yfiles.router.CellEntrance} for which the position is retrieved + * @returns {number} the position of the first occurrence of the given {@link yfiles.router.CellEntrance} in this path, or -1 if this path does not + * contain this {@link yfiles.router.CellEntrance} + */ + positionOf(entrance:yfiles.router.CellEntrance):number; + /** + * Replaces the {@link yfiles.router.CellEntrance} at the given position of this path with the given {@link yfiles.router.CellEntrance}. + * @param {number} position the position of the {@link yfiles.router.CellEntrance} to replace + * @param {yfiles.router.CellEntrance} entrance the {@link yfiles.router.CellEntrance} to be stored at the given position + * @see yfiles.router.Path#getEntrance + */ + setEntrance(position:number,entrance:yfiles.router.CellEntrance):void; + /** + * Gets the edge for which this path was calculated. + * @type {yfiles.algorithms.Edge} + */ + edge:yfiles.algorithms.Edge; + /** + * Gets the overall cost of this path. + * @type {number} + */ + cost:number; + static $class:yfiles.lang.Class; + } + /** + * This is a pathfinding algorithm that calculates the shortest (i.e., the cheapest) paths for a set of edges through a + * {@link yfiles.router.GraphPartition}. + *

+ * It is based on an A*-algorithm and uses {@link yfiles.router.PartitionCell}s as steps between source node and target node. + *

+ *

+ * In each step, the algorithm takes a {@link yfiles.router.CellEntrance}, that consists mainly of a {@link yfiles.router.PartitionCell} + * and from where it was entered, from a queue with all seen {@link yfiles.router.CellEntrance}s, determines all possible neighbor + * cells and their enter intervals and enqueues the resulting {@link yfiles.router.CellEntrance}. To influence the order in which + * the {@link yfiles.router.CellEntrance}s will be processed, the path search assigns real costs (like Dijkstra) as well as + * heuristic costs (A*-algorithm's heuristic) to the enqueued {@link yfiles.router.CellEntrance}s. 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 neighboring cell. Therefore, the path search prefers + * searching in the direction in which the target node lies. The {@link yfiles.router.CellEntrance} with the lowest combined costs + * is processed next until the target cell is reached. + *

+ *

+ * {@link yfiles.router.PathSearchExtension}s modify the path search as they are able to add start entrances and weight them with + * costs. They also add real and heuristic costs to {@link yfiles.router.CellEntrance}s that are created for the currently entered + * {@link yfiles.router.PartitionCell} and calculate shorter enter intervals that are less expensive to pass. + *

+ *

+ * The algorithm gets a {@link yfiles.router.PathSearchContext} which provides information about the graph and the currently routed + * edge. It stores the results of the path search that can then be retrieved calling {@link yfiles.router.PathSearchContext#pathSearchResult}. + *

+ * @see yfiles.router.PathSearch#addPathSearchExtension + * @see yfiles.router.PathSearch#addAdditionalEnterIntervalCalculator + * @class yfiles.router.PathSearch + */ + export interface PathSearch extends Object{} + export class PathSearch { + /** + * Creates a new instance of {@link yfiles.router.PathSearch}. + * @constructor + */ + constructor(); + /** + * Adds a new interval calculator to the list of registered {@link yfiles.router.IEnterIntervalCalculator}s. + *

+ * {@link yfiles.router.IEnterIntervalCalculator}s may add + * {@link yfiles.router.CellEntrance}s with narrowed intervals to the queue. The interval is more specific and will be judged with + * lower costs. + *

+ * @param {yfiles.router.IEnterIntervalCalculator} enterIntervalCalculator the calculator to add + * @returns {boolean} true if the calculator was successfully added, false otherwise + */ + addAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.IEnterIntervalCalculator):boolean; + /** + * Adds the given extension to the list of {@link yfiles.router.PathSearchExtension}s. + *

+ * An extension can influence the pathfinding process by adding costs for entering certain {@link yfiles.router.CellEntrance}s. + *

+ * @param {yfiles.router.PathSearchExtension} extension the extension to add to this path search + * @returns {boolean} true if the extension has been added, false otherwise + */ + addPathSearchExtension(extension:yfiles.router.PathSearchExtension):boolean; + /** + * Calculates the costs for moving from the current {@link yfiles.router.CellEntrance} to the neighboring {@link yfiles.router.PartitionCell} + * using different enter intervals. + *

+ * It is called by {@link yfiles.router.PathSearch#handleNeighbor} to determine the costs for all + * {@link yfiles.router.CellEntrance}s that it will create and enqueue afterwards. + *

+ *

+ * The costs for the given enter intervals are retrieved from all registered + * {@link yfiles.router.PathSearchExtension}s. The calculation stops when it reaches the given maximum cost value. + *

+ * @param {yfiles.router.CellEntrance} currentEntrance the current cell entrance + * @param {yfiles.router.PartitionCell} enteredCell the partition cell to enter + * @param {Array.} enterIntervals the different entering intervals of the entered cell + * @param {Array.} lastEdgeCellInfos the information about how the last cell was crossed + * @param {yfiles.router.PathSearchContext} context the context information + * @param {Array.} costs the array in which the calculated costs for entering the neighbor cell via the according enter intervals shall be + * written + * @param {Array.} 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 yfiles.router.PathSearchExtension#calculateCosts + * @protected + */ + calculateCosts(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,enterIntervals:yfiles.router.OrthogonalInterval[],lastEdgeCellInfos:yfiles.router.EdgeCellInfo[],context:yfiles.router.PathSearchContext,costs:number[],maxAllowedCosts:number[]):void; + /** + * Returns the estimated costs for the rest of the path when using the given {@link yfiles.router.CellEntrance} for the next step + * in the path search. + *

+ * It is called by {@link yfiles.router.PathSearch#handleNeighbor} to determine the heuristic part of the costs with which the + * entrance will be enqueued. + *

+ *

+ * The heuristic costs for the given entrance are retrieved from all registered {@link yfiles.router.PathSearchExtension}s. + *

+ * @param {yfiles.router.CellEntrance} entrance the current entrance + * @param {yfiles.router.PathSearchContext} context the context information + * @returns {number} the heuristic costs for the rest of the path if the given entrance is used + * @see yfiles.router.PathSearchExtension#calculateHeuristicCosts + * @protected + */ + calculateHeuristicCosts(entrance:yfiles.router.CellEntrance,context:yfiles.router.PathSearchContext):number; + /** + * Resets all registered {@link yfiles.router.PathSearchExtension}s and {@link yfiles.algorithms.DataProviders} added to this + * {@link yfiles.router.PathSearch}. + *

+ * So, {@link yfiles.router.PathSearch} is ready to calculate paths for a new layout. + *

+ * @see yfiles.router.PathSearchExtension#cleanUp + */ + clear():void; + /** + * Decreases the given penalty settings for the current edge. + *

+ * If finding a path for the current edge takes too long according to the {@link yfiles.router.EdgeRouter#maximumDuration maximum duration} of the {@link yfiles.router.EdgeRouter edge routing algorithm}, + * the path search for the current edge is canceled and restarted using decreased penalties. The decreaseFactor indicates, + * how much the penalties shall be reduced. + *

+ *

+ * This method is called by + * {@link yfiles.router.PathSearch#findPathsForCurrentEdge}. If overriding this method, 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. + *

+ *

+ * The decreaseFactor takes values from [0,1], where 0 means no reduction while 1 means the strongest reduction. + *

+ * @param {yfiles.router.PenaltySettings} penaltySettings the penalty settings whose penalties shall be reduced + * @param {number} decreaseFactor the factor with values between 0 and 1 that indicates how strong to reduce the penalties + * @param {yfiles.router.PathSearchContext} context the context information of the current path search + * @protected + */ + decreasePenaltySettings(penaltySettings:yfiles.router.PenaltySettings,decreaseFactor:number,context:yfiles.router.PathSearchContext):void; + /** + * Informs all registered path search extensions about completing a path by calling their {@link yfiles.router.PathSearchExtension#finalizePath finalizePath(Path)} method. + *

+ * That way, extensions can collect data about this path to use it later during path search. + *

+ *

+ * This method is called by {@link yfiles.router.PathSearch#findPathsForCurrentEdge} and may be overridden to use a custom + * finalization step. + *

+ * @param {yfiles.router.Path} path the path to finalize + * @protected + */ + finalizePath(path:yfiles.router.Path):void; + /** + * Finds paths for the edges in the given context and stores them in its {@link yfiles.router.PathSearchContext#pathSearchResult PathSearchResult}. + *

+ * This is the main method of {@link yfiles.router.PathSearch}. + *

+ *

+ * It initializes its extensions using {@link yfiles.router.PathSearchExtension#initializeEdges} and delegates the path search for + * each edge to {@link yfiles.router.PathSearch#findPathsForCurrentEdge}. + *

+ *

+ * The path calculations for all edges are finalized by calling the extensions' {@link yfiles.router.PathSearchExtension#finalizeEdges} + * method and, after that, the path search result is filled with the path for each edge. + *

+ *

+ * At last, the extensions are asked to finalize the path search result using their {@link yfiles.router.PathSearchExtension#finalizePathSearchResult} + * callback. + *

+ * @param {yfiles.router.PathSearchContext} context the context to use during the path search + * @see yfiles.router.PathSearchContext#edges + * @see yfiles.router.PathSearchContext#pathSearchResult + */ + findPaths(context:yfiles.router.PathSearchContext):void; + /** + * Finds the path for the current edge in the given context. + *

+ * This method: + *

+ *
    + *
  • Calls {@link yfiles.router.PathSearchExtension#initializeCurrentEdge} for all extensions.
  • + *
  • Collects and enqueues all start entrances.
  • + *
  • Iteratively processes the next cheapest cell entrance and
  • + *
  • Calls {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} for all extensions.
  • + *
+ *

+ * It is called by {@link yfiles.router.PathSearch#findPaths} and may be overridden to skip certain edges or implement a custom + * path search. + *

+ * @param {yfiles.router.PathSearchContext} context the context information needed for finding a path + * @protected + */ + findPathsForCurrentEdge(context:yfiles.router.PathSearchContext):void; + /** + * Returns the path for the given edge if it has already been finalized. + *

+ * The path is finalized if the {@link yfiles.router.PathSearch} chose it as the best result for the edge. + *

+ * @param {yfiles.algorithms.Edge} edge the edge for which the path is returned + * @returns {yfiles.router.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.Path; + /** + * Adds + * {@link yfiles.router.CellEntrance}s for every interval through which the neighboring cell can be entered from the current + * entrance to the queue. + *

+ * The algorithm calls this method in every step for each 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 through which it + * has been entered. + *

+ *

+ * After calculating all possible enter intervals to the given neighboring cell, each interval gets rated with costs. If + * there is already an entrance for the neighboring cell whose interval is the same with one of these intervals, this + * entrance will be used and re-enqueued, so that 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 neighboring 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 has been matched + * with 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. + *

+ *

+ * This method is called during cost calculation. It may be overridden to change the interval handling for the + * {@link yfiles.router.CellEntrance}s. + *

+ * @param {yfiles.router.CellEntrance} currentEntrance the current cell entrance + * @param {yfiles.router.PartitionCell} neighborCell the neighboring cell that is handled. + * @param {yfiles.router.PathSearchContext} context the context information + * @see yfiles.router.PathSearch#calculateCosts + * @see yfiles.router.PathSearch#calculateHeuristicCosts + * @protected + */ + handleNeighbor(currentEntrance:yfiles.router.CellEntrance,neighborCell:yfiles.router.PartitionCell,context:yfiles.router.PathSearchContext):void; + /** + * Initializes the fields of this {@link yfiles.router.PathSearch}. + *

+ * This method also calls {@link yfiles.router.PathSearchExtension#initialize} for all registered path search extensions. + *

+ * @param {yfiles.router.PathSearchConfiguration} configuration the configuration that the path search shall use + */ + init(configuration:yfiles.router.PathSearchConfiguration):void; + /** + * Removes the given interval calculator from the list of registered {@link yfiles.router.IEnterIntervalCalculator}s. + * @param {yfiles.router.IEnterIntervalCalculator} enterIntervalCalculator the calculator to remove + * @returns {boolean} true if an interval calculator was removed as a result of this call, false if the given calculator was not part of the + * list + */ + removeAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.IEnterIntervalCalculator):boolean; + /** + * Removes the given extension from the list of {@link yfiles.router.PathSearchExtension}s. + * @param {yfiles.router.PathSearchExtension} extension the extension to remove from the path search + * @returns {boolean} true if an extension was removed as a result of this call, false if the given extension was not contained in the list + */ + removePathSearchExtension(extension:yfiles.router.PathSearchExtension):boolean; + static $class:yfiles.lang.Class; + } + /** + * This class contains the basic configuration used by path search algorithms. + * @class yfiles.router.PathSearchConfiguration + */ + export interface PathSearchConfiguration extends Object{} + export class PathSearchConfiguration { + /** + * Creates a new instance of {@link yfiles.router.PathSearchConfiguration} used for a path search. + * @param {yfiles.layout.LayoutGraph} graph the graph containing the edges whose path will be searched + * @param {yfiles.layout.GroupingSupport} grouping the grouping information of the graph + * @param {yfiles.router.EdgeRouter} edgeRouter the edge routing algorithm using this configuration + * @constructor + */ + constructor(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GroupingSupport,edgeRouter:yfiles.router.EdgeRouter); + /** + * Gets the graph containing the edges whose path is searched. + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + /** + * Gets the grouping information of the graph. + * @type {yfiles.layout.GroupingSupport} + */ + grouping:yfiles.layout.GroupingSupport; + /** + * Gets the edge routing algorithm using this configuration. + * @type {yfiles.router.EdgeRouter} + */ + edgeRouter:yfiles.router.EdgeRouter; + /** + * Gets the remaining time (in milliseconds) within which the algorithm should complete its calculation. + * @type {number} + */ + remainingTime:number; + static $class:yfiles.lang.Class; + } + /** + * This class provides context information that is useful for the {@link yfiles.router.PathSearch} algorithm. + *

+ * Most notably, the context provides access to the edge that is currently being routed (see {@link yfiles.router.PathSearchContext#currentEdge}). + *

+ * @class yfiles.router.PathSearchContext + */ + export interface PathSearchContext extends Object{} + export class PathSearchContext { + /** + * Creates a new instance of {@link yfiles.router.PathSearchContext}. + * @param {yfiles.router.PathSearch} pathSearch the path search that uses this context + * @param {yfiles.router.PathSearchConfiguration} configuration the configuration used for the path search + * @constructor + */ + constructor(pathSearch:yfiles.router.PathSearch,configuration:yfiles.router.PathSearchConfiguration); + /** + * Adds an additional source cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge} if it is not already contained in the list of source cells. + * @param {yfiles.router.PartitionCell} cell the new source cell to add + * @see yfiles.router.PathSearchContext#sourceCellCount + * @see yfiles.router.PathSearchContext#getSourceCell + */ + addSourceCell(cell:yfiles.router.PartitionCell):void; + /** + * Adds an additional target cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge} if it is not already contained in the list of target cells. + * @param {yfiles.router.PartitionCell} cell the new target cell to add + * @see yfiles.router.PathSearchContext#targetCellCount + * @see yfiles.router.PathSearchContext#getTargetCell + */ + addTargetCell(cell:yfiles.router.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.PathSearchContext#currentEdge current edge}. + * @param {number} index the index of the source cell + * @returns {yfiles.router.PartitionCell} the source cell with the given index in the list of all source cells + */ + getSourceCell(index:number):yfiles.router.PartitionCell; + /** + * 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.PathSearchContext#currentEdge current edge}. + * @param {number} index the index of the target cell + * @returns {yfiles.router.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.PathSearchContext#currentEdge current edge} + */ + getTargetCell(index:number):yfiles.router.PartitionCell; + /** + * Determines whether or not the given cell is a source cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. + * @param {yfiles.router.PartitionCell} cell the cell + * @returns {boolean} true if the given cell is in the list of source cells, false otherwise + * @see yfiles.router.PathSearchContext#sourceCellCount + * @see yfiles.router.PathSearchContext#getSourceCell + */ + isSourceCell(cell:yfiles.router.PartitionCell):boolean; + /** + * Determines whether or not the given cell is a target cell of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. + * @param {yfiles.router.PartitionCell} cell the cell + * @returns {boolean} true if the given cell is in the list of target cells, false otherwise + * @see yfiles.router.PathSearchContext#targetCellCount + * @see yfiles.router.PathSearchContext#getTargetCell + */ + isTargetCell(cell:yfiles.router.PartitionCell):boolean; + /** + * Specifies the edges that shall be routed. + * @param {yfiles.algorithms.EdgeList} edges the list of edges that shall be routed + */ + setEdges(edges:yfiles.algorithms.EdgeList):void; + /** + * Returns the number of all cells that are covered by the source node of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. + * @returns {number} the number of all cells that are covered by the source node + */ + sourceCellCount():number; + /** + * Returns the number of all cells that are covered by the target node of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. + * @returns {number} the number of all cells that are covered by the target node + */ + targetCellCount():number; + /** + * Gets the {@link yfiles.router.PathSearch} that uses this context. + * @type {yfiles.router.PathSearch} + */ + pathSearch:yfiles.router.PathSearch; + /** + * Gets the configuration used for the {@link yfiles.router.PathSearch}. + * @type {yfiles.router.PathSearchConfiguration} + */ + configuration:yfiles.router.PathSearchConfiguration; + /** + * Gets the {@link yfiles.algorithms.IEdgeCursor} to iterate over the edges that are routed. + * @type {yfiles.algorithms.IEdgeCursor} + */ + edges:yfiles.algorithms.IEdgeCursor; + /** + * Gets or sets the edge that is currently routed. + *

+ * This edge is one of those returned by {@link yfiles.router.PathSearchContext#edges}. + *

+ * @type {yfiles.algorithms.Edge} + */ + currentEdge:yfiles.algorithms.Edge; + /** + * Gets the {@link yfiles.router.EdgeLayoutDescriptor} for the {@link yfiles.router.PathSearchContext#currentEdge current edge} containing edge specific settings for the path search. + * @type {yfiles.router.EdgeLayoutDescriptor} + */ + currentEdgeLayoutDescriptor:yfiles.router.EdgeLayoutDescriptor; + /** + * Gets an artificial {@link yfiles.router.PartitionCell partition cell} with the size of the bounding box of all source cells of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. + * @see yfiles.router.PathSearchContext#getSourceCell + * @type {yfiles.router.PartitionCell} + */ + combinedSourceCell:yfiles.router.PartitionCell; + /** + * Gets an artificial {@link yfiles.router.PartitionCell partition cell} with the size of the bounding box of all target cells of the {@link yfiles.router.PathSearchContext#currentEdge current edge}. + * @see yfiles.router.PathSearchContext#getTargetCell + * @type {yfiles.router.PartitionCell} + */ + combinedTargetCell:yfiles.router.PartitionCell; + /** + * Gets the results of the {@link yfiles.router.PathSearch}. + * @type {yfiles.router.PathSearchResult} + */ + pathSearchResult:yfiles.router.PathSearchResult; + static $class:yfiles.lang.Class; + } + /** + * Extensions are added to a {@link yfiles.router.PathSearch} to influence the search process. + *

+ * An extension contains several callback methods that are used by the {@link yfiles.router.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.PathSearch} uses the callbacks in the following order: + *

+ *
    + *
  1. {@link yfiles.router.PathSearchExtension#initialize}
  2. + *
  3. {@link yfiles.router.PathSearchExtension#initializeEdges}
  4. + *
  5. {@link yfiles.router.PathSearchExtension#initializeCurrentEdge}
  6. + *
  7. {@link yfiles.router.PathSearchExtension#appendStartEntrances}
  8. + *
  9. {@link yfiles.router.PathSearchExtension#calculateStartEntranceCost}
  10. + *
  11. {@link yfiles.router.PathSearchExtension#calculateCosts}
  12. + *
  13. {@link yfiles.router.PathSearchExtension#calculateHeuristicCosts}
  14. + *
  15. {@link yfiles.router.PathSearchExtension#isValidTargetEntrance}
  16. + *
  17. {@link yfiles.router.PathSearchExtension#finalizePath}
  18. + *
  19. {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} or {@link yfiles.router.PathSearchExtension#cancelCurrentEdge}
  20. + *
  21. {@link yfiles.router.PathSearchExtension#finalizeEdges}
  22. + *
  23. {@link yfiles.router.PathSearchExtension#finalizePathSearchResult}
  24. + *
  25. {@link yfiles.router.PathSearchExtension#cleanUp}
  26. + *
+ * @see yfiles.router.PathSearch#addPathSearchExtension + * @see yfiles.router.PathSearchContext#currentEdge + * @class yfiles.router.PathSearchExtension + */ + export interface PathSearchExtension extends Object{} + export class PathSearchExtension { + /** + * Creates a new instance of {@link yfiles.router.PathSearchExtension}. + * @constructor + */ + constructor(); + /** + * Appends additional start {@link yfiles.router.CellEntrance entrances} for the path search of the current edge to the given list of all previously generated + * entrances. + *

+ * This method is called before starting the actual path search to determine possible starting points. The current + * implementation doesn't add any {@link yfiles.router.CellEntrance}s. It may be overridden to add {@link yfiles.router.CellEntrance}s with + * specific enter intervals, e.g., to consider {@link yfiles.layout.PortConstraint}s. + *

+ * @param {yfiles.collections.IList.} allStartEntrances a list of all previously generated entrances + */ + appendStartEntrances(allStartEntrances:yfiles.collections.IList):void; + /** + * Calculates the costs for entering the given {@link yfiles.router.PartitionCell} via the given enter + * {@link yfiles.router.OrthogonalInterval}. + *

+ * The given {@link yfiles.router.EdgeCellInfo} describes how the partition cell that has been entered by the current entrance + * would be traversed if this enter interval to the neighboring cell would be chosen. + *

+ *

+ * The maxAllowedCosts describe the maximum costs that entering the neighboring cell via the given enter interval 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. + *

+ *

+ * This implementation doesn't add any costs. It may be overridden to add costs, e.g., if entering through the given + * interval would create a bend. + *

+ * @param {yfiles.router.CellEntrance} currentEntrance the entrance that was used for entering the current cell + * @param {yfiles.router.PartitionCell} enteredCell the neighboring cell that shall be entered + * @param {yfiles.router.OrthogonalInterval} enterInterval the interval that shall be used for entering the neighboring cell + * @param {yfiles.router.EdgeCellInfo} edgeCellInfo the information about how the current cell would be traversed if the neighboring cell would be entered by this enter + * interval + * @param {number} maxAllowedCosts the maximum allowed costs for this enter interval + * @returns {number} the costs for entering the neighboring cell via the enter interval + * @protected + */ + calculateCosts(currentEntrance:yfiles.router.CellEntrance,enteredCell:yfiles.router.PartitionCell,enterInterval:yfiles.router.OrthogonalInterval,edgeCellInfo:yfiles.router.EdgeCellInfo,maxAllowedCosts:number):number; + /** + * Calculates the heuristic costs for the given {@link yfiles.router.CellEntrance} 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 neighboring cell, this method is called for each of the + * resulting {@link yfiles.router.CellEntrance}s. + *

+ *

+ * This implementation doesn't add any costs. It may be overridden to add some heuristic costs, e.g., if the edge would + * have to bend to reach the target node from the given {@link yfiles.router.CellEntrance}. + *

+ * @param {yfiles.router.CellEntrance} entrance the entrance to calculate the heuristic costs for the rest of the path + * @returns {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.CellEntrance):number; + /** + * Returns the cost for starting the path in the given entrance. + *

+ * This method is called for each start entrance of the current edge. + *

+ *

+ * The current implementation doesn't add any costs for the given {@link yfiles.router.CellEntrance}. It may be overridden to make + * start entrances with less specific intervals more expensive. For example, intervals that allow more than just the {@link yfiles.layout.PortConstraint} + * location to connect to the source node become more expensive. + *

+ * @param {yfiles.router.CellEntrance} startEntrance the start entrance for which the cost is calculated + * @returns {number} the cost for starting the path in the given entrance + */ + calculateStartEntranceCost(startEntrance:yfiles.router.CellEntrance):number; + /** + * Handles the cancellation of the path search for the current edge. + *

+ * This callback notifies the extension when the path search for the current edge is canceled. Then, the path search will + * proceed with altering the penalties of the current edge and reinitializing it again. + *

+ *

+ * This implementation does nothing. It may be overridden to reset some edge specific information, e.g., removing + * previously added listeners. + *

+ * @param {yfiles.router.PathSearchContext} context the context containing the current edge for which the path search has been canceled + * @see yfiles.router.PathSearchExtension#initializeCurrentEdge + * @see yfiles.router.PathSearchExtension#finalizeEdges + */ + cancelCurrentEdge(context:yfiles.router.PathSearchContext):void; + /** + * Cleans up the extension from the path searches with the current {@link yfiles.router.PathSearchExtension#configuration configuration} and {@link yfiles.router.PathSearchExtension#context context}. + */ + cleanUp():void; + /** + * Handles the completion of the path search for the current edge. + *

+ * This callback notifies the extension when enough paths are found for the current edge. After that, the path search + * either proceeds with initializing the next current edge in the context's edge list or calls {@link yfiles.router.PathSearchExtension#finalizeEdges} + * if all edges in this list have been handled. + *

+ *

+ * This implementation does nothing. It may be overridden to add/reset some edge specific information, e.g., removing + * previously added listeners or adding new start entrances. + *

+ * @param {yfiles.router.PathSearchContext} context the context containing the current edge for which the path search has been finished + * @see yfiles.router.PathSearchExtension#initializeCurrentEdge + * @see yfiles.router.PathSearchExtension#finalizeEdges + */ + finalizeCurrentEdge(context:yfiles.router.PathSearchContext):void; + /** + * Handles the completion of all marked edges. + *

+ * This callback notifies the extension if enough paths have been found for all edges in the context's edge list. + *

+ * @param {yfiles.router.PathSearchContext} context the context containing the list of edges for which paths have been found + * @see yfiles.router.PathSearchContext#edges + */ + finalizeEdges(context:yfiles.router.PathSearchContext):void; + /** + * After finding a valid target entrance and creating a {@link yfiles.router.Path}, the extension is notified of 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 {@link yfiles.router.CellEntrance}. + *

+ *

+ * This implementation does nothing. It may be overridden to collect some information about the given path that may + * influence the path search of later edges. + *

+ * @param {yfiles.router.Path} path the path found for the current edge in the context + * @see yfiles.router.PathSearchContext#currentEdge + */ + finalizePath(path:yfiles.router.Path):void; + /** + * Completes the path search result. + *

+ * This callback notifies the extensions of the paths chosen for the edges in the current context. After calling + * {@link yfiles.router.PathSearchExtension#finalizeEdges finalizeEdges}, the {@link yfiles.router.PathSearch} decides, which of the found paths to use for each edge and adds them to the + * {@link yfiles.router.PathSearchResult}. + *

+ *

+ * With this callback, the registered extensions are notified of 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.PathSearchExtension#cleanUp}. This implementation does nothing. + *

+ * @param {yfiles.router.PathSearchResult} pathSearchResult the path search result for the edge in the current context's edge list + * @see yfiles.router.PathSearchExtension#initializeEdges + * @see yfiles.router.PathSearchExtension#cleanUp + */ + finalizePathSearchResult(pathSearchResult:yfiles.router.PathSearchResult):void; + /** + * Initializes this extension for path searches using the given configuration. + *

+ * This method is the first one to be called by the {@link yfiles.router.PathSearch}. It may be overridden to initialize this + * extension with necessary settings like {@link yfiles.layout.GroupingSupport}. + *

+ * @param {yfiles.router.PathSearchConfiguration} configuration the configuration to use for the following path searches + */ + initialize(configuration:yfiles.router.PathSearchConfiguration):void; + /** + * Initializes this extension with the current edge set in the given context. + *

+ * This method is called for each edge of the {@link yfiles.router.PathSearchExtension#context context}. Each call will be balanced by a call to either {@link yfiles.router.PathSearchExtension#finalizeCurrentEdge} + * or {@link yfiles.router.PathSearchExtension#cancelCurrentEdge}. + *

+ *

+ * It may be overridden to initialize/reset the settings for the current edge (e.g. minimum distances). + *

+ * @param {yfiles.router.PathSearchContext} context the context containing the current edge + * @see yfiles.router.PathSearchContext#currentEdge + */ + initializeCurrentEdge(context:yfiles.router.PathSearchContext):void; + /** + * Initializes this extension with the context that contains the list of edges for which paths are calculated. + *

+ * This method may be called several times during a path search. Each call will be balanced by calls to {@link yfiles.router.PathSearchExtension#finalizeEdges} + * and {@link yfiles.router.PathSearchExtension#finalizePathSearchResult}. + *

+ *

+ * It may be overridden to initialize/reset the settings for the routed edges (e.g. minimum distances). + *

+ * @param {yfiles.router.PathSearchContext} context the context containing the list of edges for which paths shall be found + * @see yfiles.router.PathSearchContext#edges + */ + initializeEdges(context:yfiles.router.PathSearchContext):void; + /** + * Determines whether or not this extension considers the given {@link yfiles.router.CellEntrance} as a valid target entrance, + * i.e., the path may end with the given entrance. + *

+ * Each time a {@link yfiles.router.CellEntrance} is chosen as next step, all registered extensions are asked if this entrance is a + * valid target entrance. Only if none of the extensions returns false, a {@link yfiles.router.Path} is created. + *

+ *

+ * This implementation accepts all + * {@link yfiles.router.CellEntrance}s as valid targets. It may be overridden to only activate the target if the route fulfills a + * certain condition. + *

+ * @param {yfiles.router.CellEntrance} entrance the entrance to decide if it is a valid target entrance + * @returns {boolean} true if the path may end with this entrance, false otherwise + */ + isValidTargetEntrance(entrance:yfiles.router.CellEntrance):boolean; + /** + * Gets the configuration used for the path search. + *

+ * This property is initialized in {@link yfiles.router.PathSearchExtension#initialize}. + *

+ * @type {yfiles.router.PathSearchConfiguration} + */ + configuration:yfiles.router.PathSearchConfiguration; + /** + * Gets the current context of the path search. + *

+ * This property is initialized in {@link yfiles.router.PathSearchExtension#initializeEdges}. + *

+ * @protected + * @type {yfiles.router.PathSearchContext} + */ + context:yfiles.router.PathSearchContext; + static $class:yfiles.lang.Class; + } + /** + * This class manages the best {@link yfiles.router.Path}s found for each edge and provides according {@link yfiles.router.EdgeInfo}s. + *

+ * These are used by the {@link yfiles.router.ChannelBasedPathRouting} algorithm to calculate the final segment locations for the + * segments of an edge path. + *

+ * @class yfiles.router.PathSearchResult + */ + export interface PathSearchResult extends Object{} + export class PathSearchResult { + /** + * Creates a new instance of {@link yfiles.router.PathSearchResult}. + * @param {yfiles.router.PathSearchConfiguration} configuration the configuration used for the path search + * @constructor + */ + constructor(configuration:yfiles.router.PathSearchConfiguration); + /** + * Returns an {@link yfiles.router.EdgeInfo} for the given edge. + *

+ * If the given edge shall be routed but no path has been set for it, yet, null is returned. If no {@link yfiles.router.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 for which the {@link yfiles.router.EdgeInfo} will be returned + * @returns {yfiles.router.EdgeInfo} an {@link yfiles.router.EdgeInfo} describing the path of the edge + * @see yfiles.router.PathSearchResult#setPath + */ + getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.router.EdgeInfo; + /** + * Returns an {@link yfiles.router.EdgeInfo} for the given path. + *

+ * If no {@link yfiles.router.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.Path} path the path for which the {@link yfiles.router.EdgeInfo} will be returned + * @returns {yfiles.router.EdgeInfo} an {@link yfiles.router.EdgeInfo} describing the given path + */ + getEdgeInfo(path:yfiles.router.Path):yfiles.router.EdgeInfo; + /** + * Returns the previously registered path found for the edge. + * @param {yfiles.algorithms.Edge} edge the edge for which the path is provided + * @returns {yfiles.router.Path} the previously registered path found for the edge or null if no path has been registered, yet + */ + getPath(edge:yfiles.algorithms.Edge):yfiles.router.Path; + /** + * Specifies a found path for an edge. + * @param {yfiles.algorithms.Edge} edge the edge for which the path is set + * @param {yfiles.router.Path} path the found path + */ + setPath(edge:yfiles.algorithms.Edge,path:yfiles.router.Path):void; + static $class:yfiles.lang.Class; + } + /** + * This class provides the cost penalties that are applied for violating restrictions during a {@link yfiles.router.PathSearch}. + *

+ * The {@link yfiles.router.PathSearch} calculates the shortest path from the source to the target, where shortest path means the path with the + * lowest costs. Costs result from violations of restrictions that are defined by the different + * {@link yfiles.router.PathSearchExtension}s. This class defines penalties for the various violations. The {@link yfiles.router.PathSearch} + * can be adapted to specific needs by varying these penalties. In order to avoid a certain violation, the appropriate + * penalty must be increased. + *

+ *

+ * There are some predefined penalty settings which set a different focus for the path search: + * {@link yfiles.router.PenaltySettings#OPTIMIZATION_BALANCED}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS} + * and {@link yfiles.router.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS}. + *

+ * @class yfiles.router.PenaltySettings + */ + export interface PenaltySettings extends Object{} + export class PenaltySettings { + /** + * Creates a new instance of {@link yfiles.router.PenaltySettings}. + * @constructor + */ + constructor(); + /** + * Creates a copy of this {@link yfiles.router.PenaltySettings} instance. + *

+ * This implementation uses method {@link yfiles.router.PenaltySettings#newInstance} to obtain a new instance which adopts all + * settings. + *

+ * @returns {yfiles.router.PenaltySettings} a copy of this instance + */ + createCopy():yfiles.router.PenaltySettings; + /** + * Creates a new instance of {@link yfiles.router.PenaltySettings}. + *

+ * This factory method is used by + * {@link yfiles.router.PenaltySettings#createCopy}. Subclasses can override this method in order to return a more specialized + * version. + *

+ * @returns {yfiles.router.PenaltySettings} a specialized {@link yfiles.router.PenaltySettings} + * @protected + */ + newInstance():yfiles.router.PenaltySettings; + /** + * Optimization strategy that balances bends and edge crossings in the edge routes. + *

+ * By default, this strategy is used for the path search. + *

+ * @const + * @static + * @type {yfiles.router.PenaltySettings} + */ + static OPTIMIZATION_BALANCED:yfiles.router.PenaltySettings; + /** + * Optimization strategy that minimizes bends in the edge routes. + *

+ * Edges may cross other edges to prevent bends occurring around them. + *

+ * @const + * @static + * @type {yfiles.router.PenaltySettings} + */ + static OPTIMIZATION_EDGE_BENDS:yfiles.router.PenaltySettings; + /** + * Optimization strategy that minimizes edge crossings in the edge routes. + *

+ * This may cause more bends. + *

+ * @const + * @static + * @type {yfiles.router.PenaltySettings} + */ + static OPTIMIZATION_EDGE_CROSSINGS:yfiles.router.PenaltySettings; + /** + * Optimization strategy that minimizes the length of the edge routes. + *

+ * In consequence, there may be more edge crossings. + *

+ * @const + * @static + * @type {yfiles.router.PenaltySettings} + */ + static OPTIMIZATION_EDGE_LENGTHS:yfiles.router.PenaltySettings; + /** + * Gets or sets the penalty for the edge length. + *

+ * This penalty will make long routes more expensive than short routes so edges will preferably be kept short. + *

+ *

+ * Increasing the 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 maintain the edge as short as possible. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @type {number} + */ + edgeLengthPenalty:number; + /** + * Gets or sets the penalty for an edge bend. + *

+ * This penalty will make routes with many bends more expensive than routes with few or no bends. Hence, 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 increasing the edge bend penalty, the + * resulting routes will have more edge crossings. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @type {number} + */ + bendPenalty:number; + /** + * Gets or sets the penalty for a crossing of two edges. + *

+ * This penalty will make routes that cross many other edges more expensive than routes that cross few other edges or no + * edges at all. Hence, edges preferably won't cross other edges. + *

+ *

+ * Increasing the 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 increasing the edge + * crossing penalty, the resulting route will be longer and have more bends because crossing other edges needs to be + * avoided. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @type {number} + */ + edgeCrossingPenalty:number; + /** + * Gets or sets 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. Hence, edges + * won't preferably cross any nodes. + *

+ *

+ * Increasing the 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. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @type {number} + */ + nodeCrossingPenalty:number; + /** + * Gets or sets 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. Hence, + * edges won't preferably cross any group nodes. + *

+ *

+ * Increasing the 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. + *

+ * @type {number} + */ + groupNodeCrossingPenalty:number; + /** + * Gets or sets the penalty for an edge crossing a node label. + *

+ * This penalty will make routes that cross node labels more expensive than routes that avoid crossing node labels. Hence, + * edges won't preferably cross any node labels. + *

+ *

+ * Increasing the 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 labels. + *

+ *

+ * The crossing penalty can be weighted for each label individually using the + * {@link yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY}. + *

+ *

+ * Use {@link yfiles.router.EdgeRouter#considerNodeLabels} to set whether node labels should be considered when routing the edges. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeRouter#considerNodeLabels + * @type {number} + */ + nodeLabelCrossingPenalty:number; + /** + * Gets or sets the penalty for an edge crossing an edge label. + *

+ * 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 the 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 labels. + *

+ *

+ * The crossing penalty can be weighted for each label individually using the + * {@link yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY}. + *

+ *

+ * Use {@link yfiles.router.EdgeRouter#considerEdgeLabels} to set whether edge labels should be considered when routing the edges. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeRouter#considerEdgeLabels + * @type {number} + */ + edgeLabelCrossingPenalty:number; + /** + * Gets or sets the penalty for violations of the minimum distance between any edge and any normal node side. + *

+ * This penalty will make routes that pass too close to normal nodes more expensive than routes that maintain the specified + * minimum node to edge distance. + *

+ *

+ * Increasing the minimum node to edge distance penalty will raise the importance of maintaining the minimum distance to + * nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for violating + * the minimum distance between edges and nodes will produce edges that rather use a long route around nodes to maintain + * the specified distance than pass through a small channel between two nodes. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance + * @type {number} + */ + minimumNodeToEdgeDistancePenalty:number; + /** + * Gets or sets the penalty for violations of the minimum 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 maintain the specified + * minimum node to edge distance. + *

+ *

+ * Increasing the minimum group node to edge distance penalty will raise the importance of maintaining the minimum distance + * to group nodes, while decreasing this penalty will raise the importance of all other restrictions. A high penalty for + * violating the minimum distance between edges and group nodes will produce edges that rather use a long route around + * group nodes to maintain the specified distance than pass through a small channel between two group nodes. + *

+ *

+ * Use {@link yfiles.router.EdgeRouter#minimumNodeToEdgeDistance} to set the minimum distance. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance + * @type {number} + */ + minimumGroupNodeToEdgeDistancePenalty:number; + /** + * Gets or sets the penalty for violations of the minimum distance between any two edges. + *

+ * This penalty will make routes that pass other edges too close more expensive than routes that maintain the specified + * minimum edge to edge distance. + *

+ *

+ * Increasing the minimum edge to edge distance penalty will raise the importance of maintaining the minimum 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 maintain the specified distance. This may also reduce the number of edges 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.EdgeLayoutDescriptor#minimumEdgeToEdgeDistance} to set the minimum distance for a certain edge to any other edge. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#minimumEdgeToEdgeDistance + * @type {number} + */ + minimumEdgeToEdgeDistancePenalty:number; + /** + * Gets or sets the penalty for violations of the minimum distance the edge shall maintain 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 maintain the specified minimum node corner distance. + *

+ *

+ * Increasing the node corner distance penalty will raise the importance of maintaining the minimum distance to the corner + * of the adjacent nodes, while decreasing this penalty will raise the importance of all other restrictions. + *

+ *

+ * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumNodeCornerDistance} to set the minimum node corner distance for a certain edge. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#minimumNodeCornerDistance + * @type {number} + */ + minimumNodeCornerDistancePenalty:number; + /** + * Gets or sets the penalty for violations of the minimum 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 maintain the specified minimum first/last segment length. + *

+ *

+ * Increasing the minimum first last segment length penalty will raise the importance of maintaining the first and last + * segment as long as they fit the minimum first/last segment length, while decreasing this penalty will raise the + * importance of all other restrictions. + *

+ *

+ * Use {@link yfiles.router.EdgeLayoutDescriptor#minimumFirstSegmentLength} to set the minimum length of the first segment and {@link yfiles.router.EdgeLayoutDescriptor#minimumLastSegmentLength} to set the minimum length of the last segment of a certain + * edge. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#minimumFirstSegmentLength + * @see yfiles.router.EdgeLayoutDescriptor#minimumLastSegmentLength + * @type {number} + */ + minimumFirstLastSegmentLengthPenalty:number; + /** + * Gets or sets 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 minimum node to edge distance. + *

+ * This penalty will make routes that bend too close to their source or target node more expensive than routes that + * maintain the specified minimum node to edge distance. + *

+ *

+ * Increasing the bends in node to edge distance penalty will raise the importance of avoiding bends that violate the + * minimum node to edge distance, while decreasing this penalty will raise the importance of all other restrictions. This + * penalty supports + * {@link yfiles.router.EdgeRouter#minimumNodeToEdgeDistance}. In case the path search finally reaches the target node, the minimum node to edge distance for this node must be + * violated. Penalizing bends that are too close to the node forces the edge to directly cross this distance and connect to + * the node. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeRouter#minimumNodeToEdgeDistance + * @type {number} + */ + bendsInNodeToEdgeDistancePenalty:number; + /** + * Gets or sets the penalty for violating the monotonic path restrictions of an edge. + *

+ * This penalty will make routes with detours m ore expensive than routes that stay monotone. + *

+ *

+ * Increasing the 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.EdgeLayoutDescriptor#monotonicPathRestriction} to set the monotonic path restrictions of a certain edge. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.router.EdgeLayoutDescriptor#monotonicPathRestriction + * @type {number} + */ + monotonyViolationPenalty:number; + /** + * Gets or sets the penalty for an edge leaving and reentering in the same {@link yfiles.layout.PartitionGrid partition grid} cell. + *

+ * This penalty will make routes that re-enter the same partition grid cell more expensive than routes taking a more direct + * way. + *

+ *

+ * Increasing the 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. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.layout.PartitionGrid + * @type {number} + */ + partitionGridCellReentrancePenalty:number; + /** + * Gets or sets 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 at a point that doesn't comply with its port constraints more expensive + * than routes that obey them. + *

+ *

+ * Increasing the port violation penalty will raise the importance of maintaining 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 lose purpose if they are disregarded. + *

+ *

+ * The value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.layout.PortCandidate + * @see yfiles.layout.PortConstraint + * @type {number} + */ + portViolationPenalty:number; + /** + * Gets or sets 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 the 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 optimal + * with respect to the other restrictions. To maintain 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 with 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 value must be greater than or equal to 0, otherwise the default value will be assigned. + *

+ * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {number} + */ + invalidEdgeGroupingPenalty:number; + /** + * Gets or sets the penalty for bends of a self-loop edge. + *

+ * This penalty will make self-loops leave and enter the node at different sides unless they are forced to one side by + * {@link yfiles.layout.PortConstraint}s or {@link yfiles.layout.PortCandidate}s. + *

+ *

+ * Increasing this penalty will stronger enforce routing the self-loops between two sides of the node but it will also + * require more time for determining the edge path. Decreasing the penalty may result in self-loops that only connect to + * one side of the node. + *

+ *

+ * By default this value is set to 9. The value must be >= 0, otherwise the default value will be assigned. + *

+ * @type {number} + */ + singleSideSelfLoopPenalty:number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.router.PolylineLayoutStage} extends the orthogonal edge paths with polyline segments. + *

+ * The current implementation only adds octilinear segments to all orthogonal edges. Non-orthogonal edges are completely + * ignored. + *

+ *

+ * An octilinear segment is added between two consecutive vertical and horizontal segments. The length of an octilinear + * segment can be influenced by the {@link yfiles.router.PolylineLayoutStage#maximumNonOrthogonalSegmentRatio maximum non-orthogonal segment ratio} and the {@link yfiles.router.PolylineLayoutStage#preferredPolylineSegmentLength preferred polyline segment length}. The new + * octilinear segments maintain a {@link yfiles.router.PolylineLayoutStage#minimumNodeToEdgeDistance minimum distance} between the edges and all nodes in the graph if possible. + *

+ * @class yfiles.router.PolylineLayoutStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface PolylineLayoutStage extends yfiles.layout.LayoutStageBase{} + export class PolylineLayoutStage { + /** + * Creates a new instance of {@link yfiles.router.PolylineLayoutStage} using the given {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} [coreLayouter=null] the core layout routine + * @constructor + */ + constructor(coreLayouter?:yfiles.layout.ILayoutAlgorithm); + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected state of the nodes of the graph to + * be laid out. + *

+ * If the {@link yfiles.router.PolylineLayoutStage#scope scope} is set to + * {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}, only edges of selected nodes are routed, while all other edges are + * considered to have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @see yfiles.router.PolylineLayoutStage#scope + * @type {Object} + */ + affectedNodesDpKey:Object; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected state of the edges of the graph to + * be laid out. + *

+ * If the {@link yfiles.router.PolylineLayoutStage#scope scope} is set to + * {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the selected edges are routed, while all other edges are considered to + * have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @see yfiles.router.PolylineLayoutStage#scope + * @type {Object} + */ + affectedEdgesDpKey:Object; + /** + * Gets or sets the (sub-)set of edges to be routed in a polyline fashion. + * @throws {Stubs.Exceptions.ArgumentError} if the given argument is none of the predefined scope values + * @see yfiles.router.PolylineLayoutStage#affectedEdgesDpKey + * @see yfiles.router.PolylineLayoutStage#affectedNodesDpKey + * @type {yfiles.router.Scope} + */ + scope:yfiles.router.Scope; + /** + * Gets or sets the minimum distance between edges and node bounds. + *

+ * Values should be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the distance is negative + * @type {number} + */ + minimumNodeToEdgeDistance:number; + /** + * Gets or sets the maximum segment length ratio at each end of an orthogonal segment that may get converted into a + * (non-orthogonal) polyline segment. + *

+ * The ratio must be between 0 and 0.5. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the ratio does not lie within [0,0.5] interval + * @type {number} + */ + maximumNonOrthogonalSegmentRatio:number; + /** + * Gets or sets the preferred segment length for (non-orthogonal) polyline segments. + *

+ * Values should be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the length is negative + * @type {number} + */ + preferredPolylineSegmentLength:number; + static $class:yfiles.lang.Class; + } + /** + * Represents a group of segments of different edges that shall be combined at their common source or target. + *

+ * Grouped edges have the same source or target group ID assigned in the {@link yfiles.algorithms.IDataProvider} registered with + * the graph with {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + * keys. + *

+ *

+ * The {@link yfiles.router.SegmentGroup} contains the {@link yfiles.router.SegmentGroup#commonLocationRange common location range} for the edge group and provides a {@link yfiles.router.SegmentGroup#commonSegmentInfo common segment info} + * representing the grouped segments. + *

+ * @class yfiles.router.SegmentGroup + */ + export interface SegmentGroup extends Object{} + export class SegmentGroup { + /** + * Creates a new instance of {@link yfiles.router.SegmentGroup} that contains the given segments and a range to place them. + * @param {yfiles.router.Interval} commonLocationRange the location range of the given {@link yfiles.router.SegmentInfo}s + * @param {yfiles.collections.IList.} segmentInfos the list containing the grouped {@link yfiles.router.SegmentInfo}s + * @constructor + */ + constructor(commonLocationRange:yfiles.router.Interval,segmentInfos:yfiles.collections.IList); + /** + * Gets the common location range for the {@link yfiles.router.SegmentGroup#segmentInfos segments} in this group. + *

+ * For vertical grouped segments, this interval describes the horizontal range where this segment can be placed. Horizontal + * grouped segments are placed in a vertical range. + *

+ * @type {yfiles.router.Interval} + */ + commonLocationRange:yfiles.router.Interval; + /** + * Gets the list of {@link yfiles.router.SegmentInfo}s contained in this group. + * @type {yfiles.collections.IList.} + */ + segmentInfos:yfiles.collections.IList; + /** + * Gets the common {@link yfiles.router.SegmentInfo} representing the grouped segments. + *

+ * The returned segment info is used for placing the common segment. The coordinates are applied to all edges in the bundle + * later. + *

+ * @type {yfiles.router.SegmentInfo} + */ + commonSegmentInfo:yfiles.router.SegmentInfo; + static $class:yfiles.lang.Class; + } + /** + * A {@link yfiles.router.SegmentInfo} holds information about the possible location of an orthogonal edge segment. + *

+ * Most notably, it stores the {@link yfiles.router.SegmentInfoBase#direction direction} of the segment and the {@link yfiles.router.SegmentInfoBase#locationRange interval} that restricts the location of the segment. + *

+ * @class yfiles.router.SegmentInfo + * @extends {yfiles.router.SegmentInfoBase} + */ + export interface SegmentInfo extends yfiles.router.SegmentInfoBase{} + export class SegmentInfo { + /** + * Creates a new instance of {@link yfiles.router.SegmentInfo} with the given information. + * @param {yfiles.algorithms.Edge} edge the edge to which the segment of this info belongs + * @param {number} segmentIndex the index of the segment to which this info belongs + * @param {yfiles.layout.Direction} direction the direction to which the segment of this info points + * @param {yfiles.router.Interval} locationRange the range within which the common location of this segment has to lie + * @param {yfiles.router.Interval} minExtension the minimum interval in extension direction this segment is known to intersect + * @param {yfiles.router.Interval} maxExtension the maximum interval in extension direction this segment will span + * @param {yfiles.collections.IList.} cellSegmentInfos the list of {@link yfiles.router.CellSegmentInfo} objects upon which this segment info is built + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval,cellSegmentInfos:yfiles.collections.IList); + /** + * Creates a new instance of {@link yfiles.router.SegmentInfo} using a {@link yfiles.algorithms.LineSegment} to describe the edge segment. + * @param {yfiles.algorithms.Edge} edge the edge to which the segment of this info belongs + * @param {number} segmentIndex the index of the segment to which this info belongs + * @param {yfiles.algorithms.LineSegment} segment a line segment describing the edge segment + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment); + /** + * Returns the number of {@link yfiles.router.CellSegmentInfo} of this segment info. + * @returns {number} the number of {@link yfiles.router.CellSegmentInfo} of this segment info + */ + cellSegmentInfoCount():number; + /** + * Returns the {@link yfiles.router.CellSegmentInfo} at the given index of this segment info. + * @param {number} index the index of the {@link yfiles.router.CellSegmentInfo} to return + * @returns {yfiles.router.CellSegmentInfo} the {@link yfiles.router.CellSegmentInfo} at the given index of this segment info + */ + getCellSegmentInfo(index:number):yfiles.router.CellSegmentInfo; + /** + * Sets the {@link yfiles.router.SegmentGroup segment group} for this segment info and its associated {@link yfiles.router.CellSegmentInfo}s. + *

+ * The {@link yfiles.router.SegmentInfoBase#locationRange location ranges} are adjusted to use the {@link yfiles.router.SegmentGroup#commonLocationRange}. + *

+ * @see yfiles.router.SegmentGroup + * @type {yfiles.router.SegmentGroup} + */ + segmentGroup:yfiles.router.SegmentGroup; + /** + * Gets or sets whether or not this edge segment has the restriction of a strong {@link yfiles.layout.PortConstraint}. + * @type {boolean} + */ + atStrongPortConstraint:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class stores location information for orthogonal edge segments. + *

+ * Most notably, {@link yfiles.router.SegmentInfoBase} stores the {@link yfiles.router.SegmentInfoBase#direction direction} to which the segment points and the {@link yfiles.router.SegmentInfoBase#locationRange interval} describing + * possible locations and extensions of a segment. + *

+ * @class yfiles.router.SegmentInfoBase + */ + export interface SegmentInfoBase extends Object{} + export class SegmentInfoBase { + /** + * Creates a new instance of {@link yfiles.router.SegmentInfoBase}. + * @param {yfiles.algorithms.Edge} edge the edge to which the segment of this info belongs + * @param {number} segmentIndex the index of the segment to which this info belongs + * @param {yfiles.layout.Direction} direction the direction to which the segment of this info points + * @param {yfiles.router.Interval} locationRange the range within which the common location of this segment has to lie + * @param {yfiles.router.Interval} minExtension the minimum interval in extension direction this segment is known to intersect + * @param {yfiles.router.Interval} maxExtension the maximum interval in extension direction this segment will span + * @protected + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.Interval,minExtension:yfiles.router.Interval,maxExtension:yfiles.router.Interval); + /** + * Creates a new instance of {@link yfiles.router.SegmentInfoBase} 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 to which this segment info belongs + * @param {number} segmentIndex the index of the segment to which this info belongs + * @param {yfiles.algorithms.LineSegment} segment a line segment describing the edge segment + * @protected + * @constructor + */ + constructor(edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment); + /** + * Gets the minimum known extension of the segment, i.e., the minimum interval that this segment will cover in any case. + *

+ * For horizontal intervals, this is the minimum horizontal extension; for vertical intervals, this is the minimum vertical + * extension. + *

+ * @type {yfiles.router.Interval} + */ + minExtension:yfiles.router.Interval; + /** + * Gets the maximum extension that this segment can span. + *

+ * For horizontal intervals, this is the maximum horizontal extension; for vertical intervals, this is the maximum vertical + * extension. + *

+ * @type {yfiles.router.Interval} + */ + maxExtension:yfiles.router.Interval; + /** + * Gets the range, i.e., the interval within which the segment should be placed. + *

+ * For horizontal segments, this is the range containing the vertical location; for vertical segments, this is the range + * containing the horizontal location. + *

+ * @type {yfiles.router.Interval} + */ + locationRange:yfiles.router.Interval; + /** + * Gets or sets the preferred placement of this segment within its location range. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown alignment is given + * @type {yfiles.router.Alignment} + */ + preferredAlignment:yfiles.router.Alignment; + /** + * Gets or sets the {@link yfiles.router.SegmentInfoBase#fixed fixed} location within the {@link yfiles.router.SegmentInfoBase#locationRange location range} for this segment info. + *

+ * For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if the segment info already has a fixed location + * @throws {Stubs.Exceptions.ArgumentError} if the given location does not lie within the location range + * @see yfiles.router.SegmentInfoBase#fixed + * @see yfiles.router.SegmentInfoBase#locationRange + * @type {number} + */ + location:number; + /** + * Gets whether or not this segment info is fixed, i.e., a {@link yfiles.router.SegmentInfoBase#location fixed location} has been determined within its {@link yfiles.router.SegmentInfoBase#locationRange location range}. + * @type {boolean} + */ + fixed:boolean; + /** + * Gets whether or not the associated segment is vertical. + * @type {boolean} + */ + vertical:boolean; + /** + * Gets the {@link yfiles.layout.Direction} to which the segment of this info points. + * @type {yfiles.layout.Direction} + */ + direction:yfiles.layout.Direction; + /** + * Gets the edge to which the segment of this info belongs. + * @type {yfiles.algorithms.Edge} + */ + edge:yfiles.algorithms.Edge; + /** + * Gets the index of the segment of this info. + * @type {number} + */ + segmentIndex:number; + /** + * Gets or sets the segment group to which this segment info belongs. + *

+ * When defining the segment group, the {@link yfiles.router.SegmentInfoBase#locationRange location range} will be adjusted to use the common interval of the segment group. + *

+ * @see yfiles.router.SegmentGroup#commonLocationRange + * @type {yfiles.router.SegmentGroup} + */ + segmentGroup:yfiles.router.SegmentGroup; + static $class:yfiles.lang.Class; + } + /** + * 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 a valid bus ID. Every edge of ID null forms a group of its own. Also, every + * object except null can be used as a 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. + *

+ * @see yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY + * @class yfiles.router.BusDescriptor + */ + export interface BusDescriptor extends Object{} + export class BusDescriptor { + /** + * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters. + * @param {Object} busID the ID of the bus to which the associated edge belongs + * @param {boolean} fixed true if associated edge is fixed, false otherwise + * @param {Object} sourceGroupID the group ID of the source side + * @param {Object} targetGroupID the group ID of the target side + * @constructor + */ + constructor(busID:Object,fixed:boolean,sourceGroupID:Object,targetGroupID:Object); + /** + * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters and default group IDs. + * @param {Object} busID the ID of the bus to which the associated edge belongs + * @param {boolean} fixed true if associated edge is fixed, false otherwise + * @constructor + */ + constructor(busID:Object,fixed:boolean); + /** + * Creates a new instance of {@link yfiles.router.BusDescriptor} for the specified parameters and marks it as not fixed. + * @param {Object} busID the ID of the bus to which the associated edge belongs + * @param {Object} sourceGroupID the group ID of the source side + * @param {Object} targetGroupID the group ID of the target side + * @constructor + */ + constructor(busID:Object,sourceGroupID:Object,targetGroupID:Object); + /** + * Creates a new instance of {@link yfiles.router.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 to which the associated edge belongs + * @constructor + */ + constructor(busID:Object); + /** + * Gets or sets the bus ID. + *

+ * Edges associated with {@link yfiles.router.BusDescriptor descriptor instances} having the same bus ID belong to a common bus. Every edge associated with ID + * null forms a group of its own. + *

+ * @type {Object} + */ + busId:Object; + /** + * Gets or sets the group ID for the source side of the edge. + *

+ * Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections + * at v. + *

+ * @type {Object} + */ + sourceGroupId:Object; + /** + * Gets or sets the group ID for the target side of the edge. + *

+ * Edges incident to the same node v but associated with different group IDs at this endpoint, use separate bus connections + * at v. + *

+ * @type {Object} + */ + targetGroupId:Object; + /** + * Gets or sets whether or not the associated edge is fixed. + *

+ * The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges. + *

+ * @type {boolean} + */ + fixed:boolean; + static $class:yfiles.lang.Class; + } + /** + * This class provides helper methods 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 to which it is associated. This is the representation expected by + * {@link yfiles.router.BusRouter}. + *

+ * @class yfiles.router.BusRepresentations + */ + export interface BusRepresentations extends Object{} + export class BusRepresentations { + /** + * 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 as well as 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 {Array.} hubEdgesLists an array of {@link yfiles.algorithms.EdgeList}s each containing the edges of a bus + * @param {yfiles.algorithms.IDataProvider} hubMarker a {@link yfiles.algorithms.IDataProvider} that marks hub nodes + * @param {yfiles.algorithms.IDataProvider} fixedMarker a {@link yfiles.algorithms.IDataProvider} that marks fixed edges + * @param {yfiles.algorithms.IDataAcceptor} descriptorAcceptor a {@link yfiles.algorithms.IDataAcceptor} for storing the created bus descriptors + * @returns {yfiles.algorithms.EdgeList} a list of the created edges + * @static + */ + static replaceHubsBySubgraph(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 hubs to complete subgraphs. + *

+ * This method delegates to {@link yfiles.router.BusRepresentations#replaceHubsBySubgraph}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph of the bus + * @param {yfiles.algorithms.IDataProvider} hubMarker a {@link yfiles.algorithms.IDataProvider} that marks hub nodes + * @param {yfiles.algorithms.IDataAcceptor} descriptorAcceptor a {@link yfiles.algorithms.IDataAcceptor} for storing the created bus descriptors + * @returns {yfiles.algorithms.EdgeList} a list of the created edges + * @see yfiles.router.BusRepresentations#replaceHubsBySubgraph + * @see yfiles.router.BusRepresentations#toEdgeLists + * @static + */ + static replaceHubsBySubgraph(graph:yfiles.layout.LayoutGraph,hubMarker: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 of the given graph must form an orthogonal, cycle-free bus, otherwise an {@link Stubs.Exceptions.InvalidOperationError} + * is thrown. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph where each bus is represented by a complete subgraph of the corresponding nodes + * @param {yfiles.algorithms.IEdgeCursor} edgeCursor an {@link yfiles.algorithms.IEdgeCursor} of the regular edges + * @param {yfiles.algorithms.IDataProvider} descriptorProvider a {@link yfiles.algorithms.IDataProvider} that provides a {@link yfiles.router.BusDescriptor} for each edge + * @param {yfiles.algorithms.IDataAcceptor} busIDAcceptor an optional {@link yfiles.algorithms.IDataAcceptor} that stores the bus ID for each new edge + * @throws {Stubs.Exceptions.InvalidOperationError} if the path of an edge is not orthogonal or if some paths form a cycle + * @static + */ + static replaceSubgraphByHubs(graph:yfiles.layout.LayoutGraph,edgeCursor:yfiles.algorithms.IEdgeCursor,descriptorProvider:yfiles.algorithms.IDataProvider,busIDAcceptor:yfiles.algorithms.IDataAcceptor):void; + /** + * Calculates for every bus represented by hubs a list of all of its edges. + * @param {yfiles.algorithms.Graph} graph the graph where buses are represented by means of hubs + * @param {yfiles.algorithms.IDataProvider} hubMarker a {@link yfiles.algorithms.IDataProvider} which marks hub nodes + * @returns {Array.} an array of {@link yfiles.algorithms.EdgeList}s where each list contains all edges of a bus + * @static + */ + static toEdgeLists(graph:yfiles.algorithms.Graph,hubMarker:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; + /** + * Data acceptor key to transfer a user-defined object from each original edge to the respective newly created 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 endpoint is a regular node. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static SOURCE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data acceptor key to transfer a user-defined object from each original edge to the respective newly created 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 endpoint is a regular node. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static TARGET_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + static $class:yfiles.lang.Class; + } + /** + * An edge routing algorithm which routes edges of a graph in an orthogonal bus-style. + *

+ * Carefully observe that the resulting representation, with many edge segments drawn on top of each other, leaves little + * room for a sensible interpretation of edge direction. + *

+ *

+ * Layout Style + *

+ *

+ * Edge segments are bundled to buses. A bus is a segment shared by multiple edges to which shorter segments that connect + * to actual nodes are attached. Buses and all other segments are routed orthogonally. + *

+ *

+ * A bus can, for example, be created in parts of a diagram where each node is connected to each other node. 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. + *

+ *

+ * The algorithm tries to produce routes where the edges share as much of their paths as possible. It yields long line + * segments (so-called backbone segments) where ideally all but the first and last segments of all edge paths are drawn on top of each other + * (forming a + * bus), with short connections branching off to the nodes + * (bus connections). These short connections bundle the respective first or last segments of a node's incident edges. + *

+ *

+ * This algorithm will not modify positions or sizes of nodes in any way, but will route the edges of the graph. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0},"n":[[375,165],[375,255],[585,165],[585,255],[585,345],[705,345],[705,165],[705,255],[825,165],[495,435],[585,435],[585,525]],"e":[[2,1,-15,0,0,15,[555,180,555,315,390,315]],[2,3,-15,0,-15,0,[555,180,555,270]],[3,1,-15,0,0,15,[555,270,555,315,390,315]],[2,4,-15,0,-15,0,[555,180,555,360]],[3,4,-15,0,-15,0,[555,270,555,360]],[1,4,0,15,-15,0,[390,315,555,315,555,360]],[5,4,0,-15,-15,0,[720,315,555,315,555,360]],[5,1,0,-15,0,15,[720,315,390,315]],[5,3,0,-15,-15,0,[720,315,555,315,555,270]],[5,2,0,-15,-15,0,[720,315,555,315,555,180]],[5,7,0,-15,0,15],[7,4,0,15,-15,0,[720,315,555,315,555,360]],[7,1,0,15,0,15,[720,315,390,315]],[7,3,0,15,-15,0,[720,315,555,315,555,270]],[7,2,0,15,-15,0,[720,315,555,315,555,180]],[5,9,0,-15,15,0,[720,315,555,315,555,450]],[7,9,0,15,15,0,[720,315,555,315,555,450]],[2,9,-15,0,15,0,[555,180,555,450]],[3,9,-15,0,15,0,[555,270,555,450]],[1,9,0,15,15,0,[390,315,555,315,555,450]],[4,9,-15,0,15,0,[555,360,555,450]],[5,10,0,-15,-15,0,[720,315,555,315,555,450]],[7,10,0,15,-15,0,[720,315,555,315,555,450]],[2,10,-15,0,-15,0,[555,180,555,450]],[3,10,-15,0,-15,0,[555,270,555,450]],[1,10,0,15,-15,0,[390,315,555,315,555,450]],[4,10,-15,0,-15,0,[555,360,555,450]],[9,10,15,0,-15,0],[5,11,0,-15,-15,0,[720,315,555,315,555,540]],[7,11,0,15,-15,0,[720,315,555,315,555,540]],[2,11,-15,0,-15,0,[555,180,555,540]],[3,11,-15,0,-15,0,[555,270,555,540]],[1,11,0,15,-15,0,[390,315,555,315,555,540]],[4,11,-15,0,-15,0,[555,360,555,540]],[9,11,15,0,-15,0,[555,450,555,540]],[10,11,-15,0,-15,0,[555,450,555,540]],[0,1,0,15,0,-15,1],[0,2,0,15,0,15,1,[390,225,600,225]],[1,2,0,-15,0,15,1,[390,225,600,225]],[0,3,0,15,0,-15,1,[390,225,600,225]],[1,3,0,-15,0,-15,1,[390,225,600,225]],[3,2,0,-15,0,15,1],[0,6,0,15,0,15,1,[390,225,720,225]],[1,6,0,-15,0,15,1,[390,225,720,225]],[3,6,0,-15,0,15,1,[600,225,720,225]],[6,2,0,15,0,15,1,[720,225,600,225]],[0,7,0,15,0,-15,1,[390,225,720,225]],[1,7,0,-15,0,-15,1,[390,225,720,225]],[3,7,0,-15,0,-15,1,[600,225,720,225]],[7,2,0,-15,0,15,1,[720,225,600,225]],[7,6,0,-15,0,15,1],[0,8,0,15,0,15,1,[390,225,840,225]],[1,8,0,-15,0,15,1,[390,225,840,225]],[3,8,0,-15,0,15,1,[600,225,840,225]],[7,8,0,-15,0,15,1,[720,225,840,225]],[8,2,0,15,0,15,1,[840,225,600,225]],[8,6,0,15,0,15,1,[840,225,720,225]]],"vp":[375.0,165.0,480.0,390.0]}} Bus-style edge routing with default settings {@graph {"ann":{"s":[30,30],"d":0},"n":[[529,405,120,120],[765,405],[765,495],[945,405],[945,495],[255,405],[255,495],[435,405],[345,495],[435,495],[345,405],[765,212],[765,302],[945,212],[855,302],[945,302],[855,212],[675,302],[900,302],[900,212],[810,212],[810,302],[511,212],[435,212],[359,212],[283,212],[555,105],[622,105],[555,30],[622,30],[622,-45]],"e":[[0,1,60,0,0,15,[780,465]],[0,2,60,0,0,-15,[780,465]],[0,3,60,0,0,15,[960,465]],[0,4,60,0,0,-15,[960,465]],[0,5,-60,0,0,15,[270,465]],[0,6,-60,0,0,-15,[270,465]],[0,7,-60,0,0,15,[450,465]],[0,8,-60,0,0,-15,[360,465]],[0,9,-60,0,0,-15,[450,465]],[0,10,-60,0,0,15,[360,465]],[0,11,0,-60,0,15,[589,272,780,272]],[0,12,0,-60,0,-15,[589,272,780,272]],[0,13,0,-60,0,15,[589,272,960,272]],[0,14,0,-60,0,-15,[589,272,870,272]],[0,15,0,-60,0,-15,[589,272,960,272]],[0,16,0,-60,0,15,[589,272,870,272]],[0,17,0,-60,0,-15,[589,272,690,272]],[0,18,0,-60,0,-15,[589,272,915,272]],[0,19,0,-60,0,15,[589,272,915,272]],[0,20,0,-60,0,15,[589,272,825,272]],[0,21,0,-60,0,-15,[589,272,825,272]],[0,22,0,-60,0,15,[589,272,526,272]],[0,23,0,-60,0,15,[589,272,450,272]],[0,24,0,-60,0,15,[589,272,374,272]],[0,25,0,-60,0,15,[589,272,298,272]],[0,26,15,-60,15,0,[604,120]],[0,27,15,-60,-15,0,[604,120]],[0,28,15,-60,15,0,[604,45]],[0,29,15,-60,-15,0,[604,45]],[0,30,15,-60,-15,0,[604,-30]]],"vp":[255.0,-45.0,720.0,570.0]}} Edge routing sample including four different busesConcept + *

+ *

+ * The algorithm uses a two-phase process: + *

+ *
    + *
  1. Backbone Selection: a set of suitable initial backbone segments is determined.
  2. + *
  3. + * Routing and Recombination: each initial backbone segment is connected to all other backbone segments and to each node by using orthogonal edge + * paths. Then, the resulting structure is reduced to the most optimal structure where backbone segments are long and + * connections to the nodes are short. + *
  4. + *
+ *

+ * Features + *

+ *

+ * 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 {@link yfiles.algorithms.IDataProvider} holding {@link yfiles.router.BusDescriptor} instances is + * expected to be registered with the graph using the + * {@link yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY descriptor key}. In the absence of an individual bus ID for an edge, a bus consisting only of the single edge is + * created. + *

+ *

+ * This algorithm supports {@link yfiles.layout.PortConstraint}s as well as + * {@link yfiles.layout.PortCandidate}s to control where edges should connect to nodes. + *

+ *

+ * Note that if edges of the same bus connect to a common node but have inconsistent or contradicting port + * constraints/candidates, then any of these constraints/candidates can determine the actual location of the common port. + * The same applies for edges that, in addition, belong to the same edge group. + *

+ *

+ * Also, the cardinality defined with a {@link yfiles.layout.PortCandidateSet} object is interpreted in terms of different bus IDs + * (group IDs) instead of number of edges. + *

+ *

+ * This algorithm supports incremental edge routing, that is, extending or updating an already existing bus-style + * representation. This is useful to rearrange existing edges or to include additional edges in an existing bus. + *
+ * Incremental routing is supported by denoting so-called fixed edges using the + * {@link yfiles.router.BusDescriptor#fixed corresponding BusDescriptor property}. The paths of edges which are not marked as fixed are calculated by the algorithm. + * The structure induced by the fixed edges must be orthogonal and cycle-free. + *

+ * @class yfiles.router.BusRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface BusRouter extends yfiles.layout.LayoutStageBase{} + export class BusRouter { + /** + * Creates a new instance of {@link yfiles.router.BusRouter} with default settings. + * @constructor + */ + constructor(); + /** + * Data provider key for specifying a bus descriptor object for each edge + *

+ * The {@link yfiles.router.BusDescriptor} for an edge provides the edge's bus ID, its optional group IDs and whether or not the + * edge is fixed. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for specifying the edge subset to be routed + *

+ * This key is used if no custom key for specifying the subset is defined using {@link yfiles.router.BusRouter#affectedEdgesDpKey}. + *

+ * @see yfiles.router.BusRouter#scope + * @see yfiles.router.BusRouter#affectedEdgesDpKey + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. + *

+ * Positive values greater than 2 are allowed. Positive values less than 2 are ignored, while negative values are mapped to + * their absolute value. + *

+ * @see yfiles.router.BusRouter#gridRouting + * @type {number} + */ + gridSpacing:number; + /** + * Gets or sets whether or not to route edge segments on grid lines only. + * @type {boolean} + */ + gridRouting:boolean; + /** + * Gets or sets the minimum distance between edge segments and nodes. + *

+ * Positive values greater than 2 are allowed. Positive values less than 2 are ignored, while negative values are mapped to + * their absolutes. + *

+ * @type {number} + */ + minimumDistanceToNode:number; + /** + * Gets or sets the minimum distance between any two edge segments. + *

+ * The edge routing algorithm adheres to this value if possible, but reduces the distance value selectively, i.e., only for + * a currently processed edge, when there is not enough space to find a path with the proper value. + *

+ *

+ * Positive values greater than 4 are allowed. Positive values less than 4 are ignored, while negative values are mapped to + * their absolute values. + *

+ * @type {number} + */ + minimumDistanceToEdge:number; + /** + * Gets or sets the cost for each edge crossing. + *

+ * A cost value of n means that it is more profitable for a path to change its direction n times rather than crossing the + * path of an edge. If the cost value is set to 0.0, no global crossing optimization is performed. + *

+ *

+ * The cost is defined to be a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given cost value is negative + * @type {number} + */ + crossingCost:number; + /** + * Gets or sets whether or not to perform an additional step to reroute the edges such that the number of edge crossings is + * reduced. + *

+ * This features does not guarantee that the number of crossings will be the minimal. + *

+ * @see yfiles.router.BusRouter#crossingCost + * @type {boolean} + */ + rerouting:boolean; + /** + * Gets or sets the maximum number of selected backbone segments with the same orientation. + *

+ * This setting 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. + *

+ *

+ * The number must be a value greater than or equal to 1. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given preferred number is smaller than 1 + * @type {number} + */ + preferredBackboneSegmentCount:number; + /** + * Gets or sets the preferred minimum length of a backbone segment. + *

+ * 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. + *

+ *

+ * The minimum length is defined to be a value greater than or equal to 1.0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum length is smaller than 1.0 + * @type {number} + */ + minimumBackboneSegmentLength:number; + /** + * Gets or sets the minimum number of bus connections a backbone segment must have. + *

+ * If a backbone segment has less connections, it is removed and the affected nodes connect to another backbone segment. + *

+ *

+ * The minimum connection count must be a value greater than or equal to 1. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum count is smaller than 1 + * @type {number} + */ + minimumBusConnectionsCount:number; + /** + * Gets or sets whether or not collinear bends are removed from the layout. + *

+ * A collinear bend is a bend that lies on a common line with its predecessor bend and successor bend. + *

+ *

+ * 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 may be advantageous for some applications to keep such bends. + *

+ * @type {boolean} + */ + removeCollinearBends:boolean; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} for marking edges as selected. + *

+ * If the {@link yfiles.router.BusRouter#scope scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}, only the edges for which the registered {@link yfiles.algorithms.IDataProvider} + * returns true will be routed. All other edges will be considered to have fixed routes. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @type {Object} + */ + affectedEdgesDpKey:Object; + /** + * Gets or sets the scope for this routing algorithm that determines which edges are routed. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown scope is given + * @type {yfiles.router.Scope} + */ + scope:yfiles.router.Scope; + static $class:yfiles.lang.Class; + } + /** + * This edge routing algorithm generates orthogonal routes for the edges of the graph. + *

+ * Compared to the routing algorithm implemented by class + * {@link yfiles.router.EdgeRouter}, this implementation is usually faster but supports less constraints and, by default, may + * produce node-edge overlaps. + *

+ *

+ * Layout Style Edges are routed in an orthogonal fashion, i.e., edge paths consist only of vertical and horizontal segments. + *

+ *

+ * During the routing process, the positions of the nodes are considered to be fixed and the routing algorithm will not + * modify their locations or their sizes in any way. + *

+ *

+ * The edge routing algorithm can be applied wherever it is required to route the edges as orthogonal segments, while + * keeping the positions of the nodes in the diagram fixed. Some potential applications include electric circuit design, + * floor planning, UML class diagrams/inheritance diagrams and navigation maps. + *

+ *

+ * {@graph {"ann":{"s":[45,30],"d":0},"n":[[210,270,60,30],[405,165,60,30],[120,270,60,30],[-7.5,270],[75,375,60,30],[502.5,165],[615,270,60,30],[630,330,30,30],[292.5,225,75,30],[232.5,60],[112.5,165,75,30],[630,60,30,30],[225,0,60,30],[712.5,330],[-7.5,375],[712.5,0],[120,330,60,30],[307.5,330],[712.5,270],[585,165,30,30],[412.5,225],[502.5,225],[232.5,120],[465,105,75,30]],"e":[[7,6,0,-15,0,15],[8,17,0,15,0,-15],[9,3,-22.5,0,-5,-15,[10,75]],[1,9,0,-15,22.5,0,[435,75]],[11,6,0,15,0,-15],[3,2,22.5,0,-30,0],[18,6,-22.5,0,30,0],[3,14,0,15,0,-15],[12,10,-30,0,-5,-15,[145,15]],[10,1,37.5,-5,-30,-5],[10,2,0,15,0,-15],[6,0,-30,0,30,0],[5,19,22.5,0,-15,0],[1,8,-8.75,15,5,-15,[426.25,205,335,205]],[9,11,5,-15,0,-15,[260,50,645,50]],[10,3,-37.5,0,5,-15,[20,180]],[8,0,-37.5,0,0,-15,[240,240]],[18,15,0,-15,0,15],[13,7,-22.5,0,15,0],[2,0,30,0,-30,0],[10,8,37.5,5,-5,-15,[325,185]],[16,17,30,0,-22.5,0],[13,18,0,-15,0,15],[1,5,30,0,-22.5,0],[12,15,30,0,-22.5,0],[12,9,-5,15,-5,-15],[14,4,22.5,0,-30,0],[16,2,0,-15,0,15],[8,20,37.5,0,-22.5,0],[20,1,1.25,-15,1.25,15],[21,5,0,-15,0,15],[22,9,0,-15,0,15],[22,10,-22.5,0,5,-15,[155,135]],[21,20,-22.5,0,22.5,0],[7,17,-15,0,22.5,0],[13,4,0,15,30,0,[735,390]],[23,11,0,-15,-15,0,[502.5,75]],[23,19,37.5,0,0,-15,[600,120]]],"vp":[-8.0,0.0,766.0,405.0]}} Sample output of the orthogonal edge routing algorithm with default settingsConcept This edge routing algorithm combines two + * strategic steps of edge routing and executes them one after the 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. + *

+ *

+ * The default path finding strategy is {@link yfiles.router.OrthogonalPatternEdgeRouter}. The default edge distribution strategy + * is {@link yfiles.router.OrthogonalSegmentDistributionStage}. + *

+ *

+ * Features + *

+ *

+ * This class itself has no special routing options except from specifying the {@link yfiles.router.ChannelEdgeRouter#pathFinderStrategy path finding} and {@link yfiles.router.ChannelEdgeRouter#edgeDistributionStrategy edge distribution} strategy. + * Most of the features like minimum element distances, grid spacing and path restrictions have to be set on the used + * instances for the two routing steps. + *

+ *

+ * For incremental edge routing, {@link yfiles.algorithms.IDataProvider} key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY} + * has to be registered with the graph to mark all edges that should be routed by the algorithm. The routes of the other + * edges remain unchanged. If there is no such key registered, the algorithm routes all edges. + *

+ * @class yfiles.router.ChannelEdgeRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface ChannelEdgeRouter extends yfiles.layout.LayoutStageBase{} + export class ChannelEdgeRouter { + /** + * Creates a new {@link yfiles.router.ChannelEdgeRouter} instance with default settings. + * @constructor + */ + constructor(); + /** + * Checks the sizes of the nodes to be non-zero. + * @param {yfiles.layout.LayoutGraph} g The graph to check. + * @protected + */ + checkNodeSize(g:yfiles.layout.LayoutGraph):void; + /** + * Data provider key for marking the edges that should be routed. + *

+ * If this key is not registered with the graph, the algorithm will route all edges. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the strategy for the path finding step. + *

+ * This step routes the edges and may produce edge overlaps which are later resolved in the {@link yfiles.router.ChannelEdgeRouter#edgeDistributionStrategy edge distribution} step. + *

+ * @type {yfiles.layout.ILayoutAlgorithm} + */ + pathFinderStrategy:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the strategy for the edge distribution step. + *

+ * This step distributes overlapping edge segments in their channel. The channel in which the segments can be distributed + * is defined by the surrounding graph elements. + *

+ * @type {yfiles.layout.ILayoutAlgorithm} + */ + edgeDistributionStrategy:yfiles.layout.ILayoutAlgorithm; + static $class:yfiles.lang.Class; + } + /** + * This edge routing algorithm applies organic routes to the edges of the graph. + *

+ * Layout Style Edges are routed organically, i.e. in smooth curves around the nodes observing a {@link yfiles.router.OrganicEdgeRouter#minimumDistance minimum distance} to the nodes. + *

+ *

+ * During the routing process, the positions of the nodes are considered to be fixed and the router will not modify their + * locations or their sizes in any way. + *

+ *

+ * The edge routing algorithm can be applied whenever edge paths should avoid crossing any nodes in organic or cyclic + * layout styles. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0,"c":1},"n":[[339,332],[314,663],[246,391],[112,365],[280,143],[309,245],[521,184],[519,462],[638,200],[118,200],[289,600],[419,153],[194,257],[564,349],[39,419],[266,76],[637,149],[247,23],[663,356],[420,517],[583,496],[183,525],[406,271],[498,406],[519,95],[250,263],[634,471],[340,459],[93,504],[368,110],[488,592],[177,154],[266,548],[470,161],[180,365],[606,400],[0,309],[130,256],[154,631],[60,311],[397,568],[16,241],[421,51],[22,368],[463,102],[67,224],[139,45],[196,95],[238,606],[347,510],[471,535],[365,631],[199,314],[125,96],[99,445],[421,463],[457,281],[497,35],[351,161],[572,190],[288,340],[400,220],[119,147],[570,98],[340,569],[526,513],[416,636],[196,35],[447,412],[242,496],[559,292],[150,416],[348,403],[38,477],[539,581],[228,146],[594,554],[610,280],[297,194],[329,0],[406,0],[181,206],[163,467],[317,66],[661,305],[55,150],[508,307],[180,576],[689,231],[96,555],[240,657],[543,241],[111,308],[555,405],[467,643],[449,352],[232,445],[666,416]],"e":[[0,1,[335.66,406.18,333.37,416.82,331.63,427.45,326.91,469.44,325.45,574.7,326.08,585.88,329.61,608.76,330.67,620.69]],[0,2,[322.18,373.25,310.13,381.03]],[0,3,[324.5,334.9,309.02,329.8,293.4,330.34,236.16,351.02,222.05,355.29,206.97,355.02,192.08,353.11,178.03,357.07]],[0,4,[351.49,268.72,349.88,254.78,343.6,242.42,331.57,234.82,303.36,234.17,292.35,226.33,286.5,215.59,286.02,203.04]],[0,5],[0,6,[428.62,311.49,440.22,302.84,454.41,274.85]],[0,7,[446.52,392.65,474.45,404,484.01,413.8,488.6,427.79,494.98,440.48]],[0,8,[426.01,313.31,439.52,303.87,453.15,277.95,464.34,271.34,476.96,270.23,500.5,273.67,544.26,281.36,555.61,282.65,567.08,280.79,577.87,275.33]],[0,9,[308.77,326.66,262.87,308.22,248.01,300.72,238.93,288.48,235.94,272.58,231.01,257.56,219.51,247.31,188.2,245.93,173.56,238.97]],[0,10,[338.79,396.59,334.49,413.65,328.25,447.31,320.83,497.58,312.44,564.66]],[0,11,[389.21,229.75,395.29,218.04]],[0,12,[317.61,329.41,260.47,307.45,250.73,302.73,241.57,296.79]],[0,13,[455.92,337.29,471.02,338.02,485.35,341.25,511.94,349.47]],[0,14,[322.04,373.66,309.3,379.72,294.9,380.89,266.5,377.98,252.08,379.76,238.85,386.12,213.64,401.5,199.41,406.7,183.85,406.68,167.87,404.99,151.09,407.31,134.98,411.26]],[0,15,[353.71,330.4,350.89,263.48,348.57,246.47,341.24,213.46,336.58,196.79,325.52,164.96,319.31,148.97,310.63,133.49]],[0,16,[414.67,318.85,438.09,305.77,445.29,294.3,450.39,282.07,458.9,273.15,469,266.59,548.02,222.11,556.91,213.74,565.88,190.33,574.87,182.39,586.14,178.03]],[0,17,[351.18,260.4,349.73,248.97,342.55,215.84,336.08,193.14,323.88,159.03,318.91,147.37,310.73,137.35,299.46,130.24,274.92,118.04,263.72,110.5,256.06,98.75,255.2,83.29]],[0,18,[449.23,337.24,460.44,336.84,472.05,337.94,483.25,340.2,515.57,347.93,527.01,348.23,538.21,346.05,570.17,336.94,581.97,336.14,593.53,338.61]],[0,19,[386.75,401.74,391.67,414.2,406.76,475.79,410.7,488.12,416.28,499.76,422.43,510.76,429.28,521.1]],[0,20,[441.16,390.65,454.09,396.14,467.28,401.18,479.65,408.23,486.46,419.97,490.73,433.62,499.82,443.19,513.09,447.19,527.26,449.42,540.69,452.14,552.84,459.14,562.64,469.33]],[0,21,[346.85,359.59,309.35,420.4,300.65,431.95,292.74,444.04,275.05,467.54,264.99,478.94,237.08,493.01,226.61,504.8]],[0,22],[0,23,[441.87,390.83,452.09,395.12,474.02,402.99]],[0,24,[394.9,278.08,405.38,265.78,420.33,260.03,433.54,253.67,440.93,239.63,453.72,194.88,457.41,179.4,462.73,163.54,473.96,151.35,489.87,142.62,505.68,131.98]],[0,25],[0,26,[443.76,391.94,454.52,396.46,465.49,400.4,475.94,405.45,483.96,413.69,487.9,425.26,492.62,436.58,501.97,444.03,513.85,447.54,538.88,451.1,551.26,454.29]],[0,27,[335.47,409.13,335.91,425.89,341.76,442.39]],[0,28,[304.63,401.81,279.42,427.37,264.93,433.6,249.25,434.04,233.94,436,177.31,454.17,162.81,461.08,150.78,471.69]],[0,29,[391.99,183.49,392.17,168.35]],[0,30,[379.7,389.49,387.21,404.3,392.85,419.75,407.6,477.96,412.89,491.58,422.65,501.66,437.13,505.23,451.35,510.41,461.14,523.17,460.71,539.45,459.43,556.24,467.8,571.02]],[0,31,[345.1,335.21,335.76,323.75,326.96,311.7,289.98,263.58,279.75,251.93]],[0,32,[343.55,373.14,315.75,453.99]],[0,33,[395.41,277.39,404.28,266.36,430.24,255.67,439.95,245.33,447.72,233.23,455.38,222.46,462.6,210.62,470.24,199.31]],[0,34,[320.5,374.57,310.3,379.58,299.25,381.01,267,377.27,256.18,376.82]],[0,35,[447.26,393.05,464.75,396.92,517.71,393.94,552.46,393.96,570.56,394.48,588.29,399.05]],[0,36,[324.51,334.8,313.86,330.99,302.52,329.37,291.4,331,229.75,353.05,218.61,355.85,206.54,355.04,194.57,352.53,183.37,351.65,140.67,350.4,74.42,351.92,63.14,348.81,43.25,339.26]],[0,37,[315.65,330.79,302.24,326.14,221.99,302.44,208.11,298.95,194.21,294.54]],[0,38,[291.97,443.38,271.04,472.33,261.99,480.94,249.87,486.16,238.48,492.54,232.04,503.67,229.86,516.59,221.46,592.14,216.53,604.24,208.21,614.3]],[0,39,[322.7,334.1,305.86,329.69,288.77,331.39,222.92,355.38,204.68,355.06,185.55,351.32,166.46,350.31,147.42,349.96,127.91,348.98,109.08,344.26]],[0,40,[385.83,399.93,391.14,415,405.18,536.96]],[0,41,[315.73,330.32,285.46,320.65,224.16,303.07,212.95,301.44,150.12,299.63,138.87,297.96,128.22,294.68]],[0,42,[392.06,206.63]],[0,43,[327.11,335.97,312.77,330.73,298.03,329.65,284.06,333.44,230.99,352.58,217.24,355.83,202.62,354.37,187.97,351.92,130.42,351.25,115.65,353.54]],[0,44,[389.02,229.97,397.45,216.12,410.94,207.76,438.95,194.72,452.19,186.4,459.38,173.33,463.33,158.21]],[0,45,[319.72,332.86,301.9,326.53,232.62,305.39,198.66,296.17,186.46,286.52,170.91,259.6,160.55,248.12,145.88,243.01]],[0,46,[286.25,258.53,248.79,216.04,242.43,206.94,235,197.31,228.43,187.39,221.82,176.16,217.01,162.99,210.26,150.25,198.66,139.63,188.34,129.15,180.36,115.63,173.55,101.92]],[0,47,[280.19,249.76,224.45,181.39,217.36,164.22]],[0,48,[285.9,512.16,276.58,527.31,263.6,539.9,254.29,553.79,252.08,570.91]],[0,49,[337.85,400.86,335.22,412.8,335.86,425.11,341.55,436.2,351.73,443.92,363.37,449.51,373.84,456.56,379.94,467.39,380.17,479.84,376.25,491.95,371.73,503.11]],[0,50,[363.53,357.76,373.66,368.31,383.38,379.43,393.44,390.12,433.18,435.74,454.89,458.54,463.23,472.48]],[0,51,[338.15,399.57,334.71,417.74,339.34,434.34,353.71,444.87,370.07,453.14,380.21,466.15,383.35,483.6,387.37,519.13,387.54,537.38,384.43,573.7]],[0,52,[319.73,332.96,301.78,329.04,283.75,328.69]],[0,53,[301.52,278.38,291.52,264.42,231.87,190.09,222.09,176.91,216.51,161.08,208.24,148.12,194.61,139.94]],[0,54,[328.75,368.24,314.97,377.91,298.88,381.42,264.15,377.59,247.67,381.71,234.12,393.32,188.56,445.62,174.64,454.91,158.8,458.39]],[0,55,[385.81,395.38]],[0,56,[442.78,309.64]],[0,57,[378.17,262.12,383.23,246.33,389.07,230.06,397.76,216.16,410.81,208.08,437.76,195.53,450.07,188.37,458.21,177.78,459.5,164.06,457.17,151.5,451.13,127.97,450.06,115.65,453.12,104.07,460.33,94.22]],[0,58],[0,59,[421.29,315.21,437.79,306.24,446.01,291.77,453.41,277.31,467.69,267.94]],[0,60],[0,61,[391.19,276.52]],[0,62,[343.32,333.1,332.31,319.71,321.89,305.25,289,262.94,276.51,250.23,222.11,206.93,207.08,197.5,173.74,189.82]],[0,63,[397.1,274,408.19,264.17,424.19,258.19,439.83,249.88,494.17,203.53]],[0,64,[336.87,404.08,333.8,419.28,329.35,464.32,329.41,479.8,333.11,509.98,335.6,525.23,339.44,540.66]],[0,65,[440.17,441.81,452.51,453.34]],[0,66,[384.08,396.29,390.86,414.32,393.85,433.39,403.11,506.26,405.93,524.42,409.95,542.54,421.55,555.65,435.45,567.44,440.34,583.83,438.64,600.97]],[0,67,[306.34,281.88,300.22,271.55,295.69,260.61,279.48,207.91,267.29,152.86,263.63,142.28,239.06,94.7]],[0,68],[0,69],[0,70,[469.45,323.87,482.71,319.47,494.32,311.46,505.19,301.93,517.88,296.03,532.51,296.41]],[0,71,[323.13,372.77,310.98,379.24,297.29,381.04,270.49,378.25,256.85,378.74,244.01,383.32,199,411.8]],[0,72],[0,73,[325.78,370.71,315.11,377.72,302.8,380.91,290.09,380.37,265.1,378.01,251.79,380.05,241.04,386.57,231.83,395.9,189.43,444.63,178.23,453.01,164.62,459.94,151.89,468.02,140.08,477.64,127.82,485.49,113.2,489.69,97.78,490.87]],[0,74,[453.85,457.25,464.04,469.46]],[0,75,[306.38,281.75,298.95,269.69]],[0,76,[440.85,442.45,452.16,452.04,509.45,492.6,521.63,499.85,535.67,502.44,550.32,503.97,562.01,512.5,580.43,536.15]],[0,77,[474.36,323,489.4,315.19,502.42,304.25,516.41,296.03,531.84,291.13,562.99,282.6,579.4,281.42,595.17,285.3]],[0,78,[353.21,311.51,351.75,274.78,349.92,255.71,341.42,238.46]],[0,79,[352.32,266.07,350.2,244.99,339.48,182.86,339.24,171.66,340.97,160.66,357.4,88.15,357.65,76.64,355.99,65.74]],[0,80,[375.1,267.1,384.99,225.91,396.91,184.78,409.57,132.2,410.69,121.28,408.94,67.51,410.21,56.22,412.62,45.46]],[0,81,[291.41,265.52,281.99,255.89,270.2,249.04]],[0,82,[289.83,417.4,279.44,426.99,267.12,432.95,253.03,433.84,239.16,435.43,227.3,441.61]],[0,83,[351.51,265.09,349.93,248.44,339.25,182.25,337.18,165.16]],[0,84,[455.7,337.03,469.05,337.55,481.96,339.78,505.92,345.81,518.43,348.12,531.41,347.66,567.71,337.38,580.54,334.73]],[0,85,[316.07,329.16,263.32,308.39,250.39,302.01,240.77,292.16,236.59,279.05,234.5,265.5,228.38,254.17,217.84,247.14,204.95,246.22,191.96,246.62,180.26,242.04,172.3,232.48,166.36,221.23,160.82,209.17,153.71,198.91,143.37,190.93,113.51,182.34]],[0,86],[0,87,[306.22,421.73,276.69,464.63,265.95,478.34,238.46,492.28,231.78,504.76,228.46,518.2,223.15,544.77,217.77,557.47]],[0,88,[476.59,322,487.46,316.77,506.01,301.68,516.62,295.9,628.38,263.9]],[0,89,[304.58,402.64,286.25,421.15,275.66,429.7,262.67,433.71,248.08,433.9,234.11,437.41,223.91,447.62,217.54,460.12,206.11,485.16,198.82,497.66,189.34,507.33]],[0,90,[348.03,366.59,344.43,376.17,335.23,405.79,332.53,416.36,309.42,567.16,304.71,578.23,296.24,587.44,286.64,595.91,279.81,606.85,278.36,620.58,275.34,634.69]],[0,91,[428.72,311.52,440.09,302.99,453.32,277.82,465.13,270.94,478.69,267.74]],[0,92,[327.03,335.9,312.92,330.7,298.41,329.58,284.16,333.41,230.95,352.66,216.96,355.85,202.5,353.87]],[0,93,[444.66,391.69,459.07,395.94,474.15,396.91,503.46,395.07,518.07,396.29,531.89,400.88]],[0,94,[386.41,400.52,390.51,410.75,392.91,421.24,405.97,527.76,408.98,540.16,416.51,551.43,428.68,560.5,438.65,572.18,453.33,600.22]],[0,95],[0,96,[288.85,419.25,275.08,433.27]],[0,97,[435.13,387.04,451.62,394.24,468.82,397.13,501.49,394.44,533.26,393.31,563.5,393.53,578.12,395.81,590.16,403.49,595.24,416.31,599.59,429.12,608.91,437.7,621.12,440.69,633.66,439.71,669.2,433.82]]],"vp":[0.0,0.0,719.0,693.0]}}Concept The edge routing algorithm uses a force-directed approach to calculate the edge paths. Nodes are considered to be + * repulsive forces while edges will try to become as short as possible. + *

+ *

+ * Each edge is routed separately and is influenced by the nodes in a certain area around it. The algorithm will add bends + * to the edge path that are placed by balancing the forces. + *

+ *

+ * The quality of the result highly depends on how much space there is between the nodes. More precisely, the distance + * between each pair of nodes should be at least twice the specified {@link yfiles.router.OrganicEdgeRouter#minimumDistance minimum distance}. If it is not necessary that the + * nodes keep their locations, this can be ensured using a combination of {@link yfiles.organic.RemoveOverlapsStage} and + * {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage node enlargement stage}. + *

+ *

+ * Features + *

+ *

+ * {@link yfiles.router.OrganicEdgeRouter#minimumDistance} will make edges keep a custom distance to the nodes. However, if there is not enough space between the nodes, this + * distance may be undershot (i.e. edges will be closer to nodes). + *

+ *

+ * {@link yfiles.router.OrganicEdgeRouter} is able to + * {@link yfiles.router.OrganicEdgeRouter#keepExistingBends reuse existing bends}. Edges will contain those bends along with other bends added by the layout algorithm. + *

+ *

+ * This edge routing algorithm is realized as a {@link yfiles.layout.ILayoutStage} which can be applied to a graph directly or + * using a {@link yfiles.router.OrganicEdgeRouter#coreLayout core layout algorithm}. + *

+ * @class yfiles.router.OrganicEdgeRouter + * @implements {yfiles.layout.ILayoutStage} + */ + export interface OrganicEdgeRouter extends Object,yfiles.layout.ILayoutStage{} + export class OrganicEdgeRouter { + /** + * Creates a new {@link yfiles.router.OrganicEdgeRouter} with the given {@link yfiles.router.OrganicEdgeRouter#coreLayout core layout algorithm}. + * @param {yfiles.layout.ILayoutAlgorithm} core the core layout algorithm + * @constructor + */ + constructor(core:yfiles.layout.ILayoutAlgorithm); + /** + * Creates a new {@link yfiles.router.OrganicEdgeRouter} instance with the default settings. + * @constructor + */ + constructor(); + /** + * Performs the organic routing of the edges of the input graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + */ + applyLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Checks the sizes of the nodes to be non-zero. + * @param {yfiles.layout.LayoutGraph} g The graph to check. + * @protected + */ + checkNodeSize(g:yfiles.layout.LayoutGraph):void; + /** + * Returns a {@link yfiles.layout.ILayoutStage} which temporarily increases the sizes of the nodes to avoid overlaps. + *

+ * The edges will keep a greater distance to the nodes. Therefore, they won't cross them. + *

+ * @returns {yfiles.layout.ILayoutStage} the {@link yfiles.layout.ILayoutStage} that resizes the nodes + */ + createNodeEnlargementStage():yfiles.layout.ILayoutStage; + /** + * Data provider key for selecting edges that should be routed + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets whether or not edges are allowed to cross nodes. + *

+ * Allowing edges to overlap with nodes will produce smoother edges, because the edge paths can be closer to the nodes. + *

+ * @see yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage + * @see yfiles.router.OrganicEdgeRouter#minimumDistance + * @type {boolean} + */ + edgeNodeOverlapAllowed:boolean; + /** + * Gets or sets the core layout algorithm which arranges the graph before edge routing. + * @type {yfiles.layout.ILayoutAlgorithm} + */ + coreLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the minimum distance the algorithm should guarantee between nodes and non-incident edges. + *

+ * The distance also influences how many bends are added to the path (a higher distance leads to less bends). + *

+ *

+ * The minimum distance is defined to be a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative + * @type {number} + */ + minimumDistance:number; + /** + * Gets or sets whether or not the initial bend coordinates are kept when determining the edge path. + *

+ * The bends are considered as fixed nodes and stay part of the path. + *

+ * @type {boolean} + */ + keepExistingBends:boolean; + /** + * Gets or sets whether a rerouting step is performed on all edges or just on a subset where distances are violated. + *

+ * If only a subset of edges is rerouted, only those edges which cross nodes or come too close to a node are included. + * During rerouting, more bends are added to the edges that will be influenced by the repulsive forces. + *

+ * @type {boolean} + */ + routeAllEdges:boolean; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.router.OrthogonalPatternEdgeRouter} routes edges orthogonally such that the resulting layout of the edges consists + * only of vertical and horizontal segments. + *

+ * Note that the location and size of the nodes in a diagram remains unchanged. + *

+ *

+ * The edge router will not try to find a perfect route from source to edge (unlike to what {@link yfiles.router.EdgeRouter} does) + * but chooses the best path out of a set of fixed paths. The best path out of these possible paths is determined by its + * cost. The costs may be influenced by setting several cost factors. The distance that an edge will have from its source + * and target node is determined by {@link yfiles.router.OrthogonalPatternEdgeRouter#minimumDistance}. + *

+ *

+ * The edges whose paths have to be routed can be defined registering a {@link yfiles.algorithms.IDataProvider} with key + * {@link yfiles.router.OrthogonalPatternEdgeRouter#DEFAULT_AFFECTED_EDGES_DP_KEY}. + *

+ * @class yfiles.router.OrthogonalPatternEdgeRouter + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface OrthogonalPatternEdgeRouter extends yfiles.layout.LayoutStageBase{} + export class OrthogonalPatternEdgeRouter { + /** + * Creates a new instance of {@link yfiles.router.OrthogonalPatternEdgeRouter} with default settings. + * @constructor + */ + constructor(); + /** + * Calculates the costs for all bends of the given path. + *

+ * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation multiplies + * the number of bends with the according {@link yfiles.router.OrthogonalPatternEdgeRouter#bendCost costs}. It may be overridden to change the calculation of these costs. + *

+ * @param {yfiles.algorithms.Edge} edge the edge for which the costs are calculated + * @param {yfiles.algorithms.YList} path the path of the given edge + * @param {yfiles.layout.PortCandidate} spc the source {@link yfiles.layout.PortCandidate} for this edge + * @param {yfiles.layout.PortCandidate} tpc the target {@link yfiles.layout.PortCandidate} for this edge + * @returns {number} the costs for the bends of this path + * @protected + */ + calculateBendCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the edge cost of a possible edge path, in order to determine which path is the best, i.e., the cheapest. + *

+ * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#applyLayout} in order to decide which path is the + * best. The default implementation considers the edge length, the number of bends, edge crossings, + * {@link yfiles.layout.PortCandidate}s and monotonic path restrictions. It may be overridden to apply a different set of costs or + * a different weighting. + *

+ * @param {yfiles.algorithms.Edge} edge the edge whose costs to calculate + * @param {yfiles.algorithms.YList} path the edge's path + * @param {yfiles.layout.PortCandidate} spc the source {@link yfiles.layout.PortCandidate} for this edge + * @param {yfiles.layout.PortCandidate} tpc the target {@link yfiles.layout.PortCandidate} for this edge + * @returns {number} the sum of all costs for this edge's path + * @protected + */ + calculateCost(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. + *

+ * This method is called by + * {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation will determine overlaps and + * crossings between edge segments and nodes and sum up the costs. It may be overridden to use a different combination of + * costs. + *

+ * @param {yfiles.algorithms.Edge} edge the edge for which the costs are calculated + * @param {yfiles.algorithms.YList} path the path of the given edge + * @param {yfiles.layout.PortCandidate} spc the source {@link yfiles.layout.PortCandidate} for this edge + * @param {yfiles.layout.PortCandidate} tpc the target {@link yfiles.layout.PortCandidate} for this edge + * @returns {number} the overall crossing costs of the given path, including edge crossings, edge overlaps and node crossings + * @protected + */ + calculateCrossingCosts(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. + *

+ * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation returns + * costs between 0 for short paths and 1 for long paths. Hence, it has relatively little impact on the overall costs. The + * method may be overridden to introduce a different weighting of the edge length. + *

+ * @param {yfiles.algorithms.Edge} edge the edge for which the costs are calculated + * @param {yfiles.algorithms.YList} path the path of the given edge + * @param {yfiles.layout.PortCandidate} spc the source {@link yfiles.layout.PortCandidate} for this edge + * @param {yfiles.layout.PortCandidate} tpc the target {@link yfiles.layout.PortCandidate} for this edge + * @returns {number} the costs for the length of the given path + * @protected + */ + calculateEdgeLength(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the costs for the chosen {@link yfiles.layout.PortCandidate}s. + *

+ * This method is called by {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation will return + * the {@link yfiles.layout.PortCandidate#cost candidates' costs}. It may be overridden to change the calculation of these costs. + *

+ * @param {yfiles.algorithms.Edge} edge the edge for which the costs are calculated + * @param {yfiles.algorithms.YList} path the path of the given edge + * @param {yfiles.layout.PortCandidate} spc the source {@link yfiles.layout.PortCandidate} for this edge + * @param {yfiles.layout.PortCandidate} tpc the target {@link yfiles.layout.PortCandidate} for this edge + * @returns {number} the costs for the {@link yfiles.layout.PortCandidate}s + * @protected + */ + calculatePortCandidateCost(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 path's cost if the edge is a self-loop and source and target ports + * have the same direction. + *

+ * This method is called by + * {@link yfiles.router.OrthogonalPatternEdgeRouter#calculateCost}. The default implementation adds costs for another bend if + * source and target ports share the same node side. In this manner, paths with different source and target directions are + * cheaper and thus preferred. The method may be overridden to change the calculation of this penalty. + *

+ * @param {yfiles.algorithms.Edge} edge the edge for which the costs are calculated + * @param {yfiles.algorithms.YList} path the path of the given edge + * @param {yfiles.layout.PortCandidate} spc the source {@link yfiles.layout.PortCandidate} for this edge + * @param {yfiles.layout.PortCandidate} tpc the target {@link yfiles.layout.PortCandidate} for this edge + * @returns {number} an extra penalty for specific self-loop paths + * @protected + */ + calculateSelfLoopSelfSidePenaltyCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Checks the sizes of the nodes to be non-zero. + * @param {yfiles.layout.LayoutGraph} g The graph to check. + * @protected + */ + checkNodeSize(g:yfiles.layout.LayoutGraph):void; + /** + * Data provider key for determining which edges are routed. + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the monotonic path restriction that should be applied. + * @throws {Stubs.Exceptions.ArgumentError} if the specified path restriction is unknown + * @type {yfiles.router.MonotonicPathRestriction} + */ + monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which determines the edges that shall be routed by + * this algorithm. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null + * @type {Object} + */ + affectedEdgesDpKey:Object; + /** + * Gets or sets the minimum distance that an edge will maintain from its source and target node. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @type {number} + */ + minimumDistance:number; + /** + * Gets or sets the spacing of the grid on which edges are routed. + *

+ * The spacing between two grid lines must be at least 2. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified grid spacing is less than 2 + * @see yfiles.router.OrthogonalPatternEdgeRouter#gridRouting + * @type {number} + */ + gridSpacing:number; + /** + * Gets or sets the origin of the grid. + * @throws {Stubs.Exceptions.ArgumentError} if the specified point is null + * @see yfiles.router.OrthogonalPatternEdgeRouter#gridRouting + * @type {yfiles.algorithms.YPoint} + */ + gridOrigin:yfiles.algorithms.YPoint; + /** + * Gets or sets whether or not to route the edges on a grid. + *

+ * The grid can be defined using methods {@link yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin} and {@link yfiles.router.OrthogonalPatternEdgeRouter#gridSpacing}. + *

+ * @see yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin + * @see yfiles.router.OrthogonalPatternEdgeRouter#gridSpacing + * @type {boolean} + */ + gridRouting:boolean; + /** + * Gets or sets the costs for a crossing between two edges. + *

+ * These costs are used for finding the best path out of the predefined paths from which the router can choose. + *

+ *

+ * The costs need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative + * @type {number} + */ + edgeCrossingCost:number; + /** + * Gets or sets the costs for edges that cross nodes. + *

+ * These costs are used for finding the best path out of the predefined paths from which the router can choose. + *

+ *

+ * The costs need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative + * @type {number} + */ + nodeCrossingCost:number; + /** + * Gets or sets the costs for creating a bend on the edge's path. + *

+ * These costs are used for finding the best path out of the predefined paths from which the router can choose. + *

+ *

+ * The costs need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative + * @type {number} + */ + bendCost:number; + /** + * Gets or sets the costs for overlapping edge paths. + *

+ * These costs are used for finding the best path out of the predefined paths from which the router can choose. + *

+ *

+ * The costs need to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified costs are negative + * @type {number} + */ + edgeOverlapCost:number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.router.OrthogonalSegmentDistributionStage} distributes overlapping edge segments of orthogonally routed edges. + *

+ * The edge segments are assigned to the so-called channels within which they are distributed. Those channels are defined by the + * surrounding graph elements. + *

+ *

+ * The algorithm will not distribute the segments, whose endpoints connect to a node using a port that has a strong {@link yfiles.layout.PortConstraint} + * or a fixed {@link yfiles.layout.PortCandidate}. + *

+ *

+ * Features + *

+ *

+ * It is possible to define a {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance preferred distance} between distributed edge segments. This distance will only be applied if + * there is enough space in the according channel. In the case where there is not enough space, the preferred distance may + * be {@link yfiles.router.OrthogonalSegmentDistributionStage#flexiblePreferredDistance reduced} for the edges. If the layout algorithm is not allowed to reduce the preferred distance, these edges won't be + * distributed. + *

+ *

+ * Edges can be distributed on {@link yfiles.router.OrthogonalSegmentDistributionStage#gridRouting grid coordinates}. The grid can only be considered if there is enough space in the according + * channel for at least as many grid lines as the number of segments. In the case where there is not enough space, the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} + * may be {@link yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing reduced} in this channel. If the layout algorithm is not allowed to reduce the grid spacing, these edges won't be + * distributed. + *

+ *

+ * Method {@link yfiles.router.OrthogonalSegmentDistributionStage#lockFirstAndLastSegment} can be used to guarantee that the first and last segment of an edge won't be distributed. So, ports can easily + * be maintained without setting explicit strong {@link yfiles.layout.PortConstraint}s or fixed {@link yfiles.layout.PortCandidate}s. + *

+ * @class yfiles.router.OrthogonalSegmentDistributionStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface OrthogonalSegmentDistributionStage extends yfiles.layout.LayoutStageBase{} + export class OrthogonalSegmentDistributionStage { + /** + * Creates a new instance of {@link yfiles.router.OrthogonalSegmentDistributionStage} with default settings. + * @constructor + */ + constructor(); + /** + * Specifies the coordinates of the origin of the grid. + *

+ * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. + *

+ * @param {number} offsetX the x-coordinate of the grid origin + * @param {number} offsetY the y-coordinate of the grid origin + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting + */ + setGridOrigin(offsetX:number,offsetY:number):void; + /** + * Data provider key for determining which edges are distributed. + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DEFAULT_AFFECTED_EDGES_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} which determines the edges that shall be routed by + * this algorithm. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.IDataProvider} key is null + * @type {Object} + */ + affectedEdgesDpKey:Object; + /** + * Gets or sets whether or not the preferred distance between edges can be reduced if there is not enough space. + *

+ * The space between the nodes restricts the distribution of the orthogonal segments while considering the + * {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance preferred distance}. In case this option is enabled, the layout algorithm may reduce the preferred distance, otherwise + * the algorithm will only distribute segments if there is enough space. + *

+ * @type {boolean} + */ + flexiblePreferredDistance:boolean; + /** + * Gets or sets whether or not the grid spacing can be reduced if there is not enough space. + *

+ * The space between the nodes limits the number of grid lines on which edges are placed. In case this option is enabled, + * the layout algorithm will divide the given grid spacing by 2 as long as there are not enough grid lines on which the + * segments can be distributed, otherwise the grid spacing remains unchanged. + *

+ * @type {boolean} + */ + flexibleGridSpacing:boolean; + /** + * Gets or sets whether or not the orthogonal segments are distributed on grid coordinates. + * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing + * @see yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing + * @type {boolean} + */ + gridRouting:boolean; + /** + * Gets or sets the spacing between two grid lines. + *

+ * The spacing should be at least 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified spacing is negative + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting + * @see yfiles.router.OrthogonalSegmentDistributionStage#flexibleGridSpacing + * @type {number} + */ + gridSpacing:number; + /** + * Gets the x-coordinate of the origin of the grid. + *

+ * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. + *

+ * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridOriginY + * @type {number} + */ + gridOriginX:number; + /** + * Gets the y-coordinate of the origin of the grid. + *

+ * The grid coordinates will be multiples of the {@link yfiles.router.OrthogonalSegmentDistributionStage#gridSpacing grid spacing} added to this origin. + *

+ * @see yfiles.router.OrthogonalSegmentDistributionStage#setGridOrigin + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridRouting + * @see yfiles.router.OrthogonalSegmentDistributionStage#gridOriginX + * @type {number} + */ + gridOriginY:number; + /** + * Gets or sets whether or not the first and last segment of an edge will be distributed. + * @type {boolean} + */ + lockFirstAndLastSegment:boolean; + /** + * Gets or sets the preferred distance between each two segments. + *

+ * This value also applies to the distance between a segment and the border of the containing channel. + *

+ *

+ * The preferred distance should be at least 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is negative + * @see yfiles.router.OrthogonalSegmentDistributionStage#flexiblePreferredDistance + * @type {number} + */ + preferredDistance:number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.router.SnapOuterPortsToNodeBorderStage} moves edge ports that are outside the corresponding area of the nodes to + * their border. + *

+ * Thus, it guarantees that ports are always in the interior of the nodes or on their borders. + *

+ * @class yfiles.router.SnapOuterPortsToNodeBorderStage + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface SnapOuterPortsToNodeBorderStage extends yfiles.layout.LayoutStageBase{} + export class SnapOuterPortsToNodeBorderStage { + /** + * Creates a new instance of {@link yfiles.router.SnapOuterPortsToNodeBorderStage}. + * @constructor + */ + constructor(); + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.BusRouter}. + * @class yfiles.router.BusRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface BusRouterData extends yfiles.layout.LayoutData{} + export class BusRouterData { + constructor(); + /** + * Gets or sets the collection of edges affected by this router. + *

+ * This collection is only used by the router if the {@link yfiles.router.BusRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. The {@link yfiles.layout.DpKeyItemCollection.#dpKey} only has to + * be specified if the {@link yfiles.router.BusRouter#affectedEdgesDpKey} is not {@link yfiles.router.BusRouter#DEFAULT_AFFECTED_EDGES_DP_KEY} + *

+ * @see yfiles.router.BusRouter#affectedEdgesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedEdges:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets the mapping of edges to their {@link yfiles.router.BusDescriptor} + * @see yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeDescriptors:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. + * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodePortCandidateSets:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.ChannelEdgeRouter}. + * @class yfiles.router.ChannelEdgeRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface ChannelEdgeRouterData extends yfiles.layout.LayoutData{} + export class ChannelEdgeRouterData { + constructor(); + /** + * Gets or sets the collection of edges affected by this router. + * @see yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedEdges:yfiles.layout.ItemCollection; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.OrganicEdgeRouter}. + * @class yfiles.router.OrganicEdgeRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface OrganicEdgeRouterData extends yfiles.layout.LayoutData{} + export class OrganicEdgeRouterData { + constructor(); + /** + * Gets or sets the collection of edges routed by this router. + * @see yfiles.router.OrganicEdgeRouter#AFFECTED_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.OrthogonalPatternEdgeRouter}. + * @class yfiles.router.OrthogonalPatternEdgeRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface OrthogonalPatternEdgeRouterData extends yfiles.layout.LayoutData{} + export class OrthogonalPatternEdgeRouterData { + constructor(); + /** + * Gets or sets the collection of edges affected by this router. + * @see yfiles.router.OrthogonalPatternEdgeRouter#affectedEdgesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedEdges:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. + * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodePortCandidateSets:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.ParallelEdgeRouter}. + * @class yfiles.router.ParallelEdgeRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface ParallelEdgeRouterData extends yfiles.layout.LayoutData{} + export class ParallelEdgeRouterData { + constructor(); + /** + * Gets or sets the collection of edges affected by this router. + * @see yfiles.router.ParallelEdgeRouter#AFFECTED_EDGES_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + affectedEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the collection of leading edges. + *

+ * A leading edge is the edge whose layout is used to obtain the layout of the corresponding parallel edges. + *

+ * @see yfiles.router.ParallelEdgeRouter#LEADING_EDGE_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + leadingEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.EdgeRouter}. + * @class yfiles.router.PolylineEdgeRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface PolylineEdgeRouterData extends yfiles.layout.LayoutData{} + export class PolylineEdgeRouterData { + constructor(); + /** + * Gets or sets the collection of affected edges. + *

+ * This collection is only used by the router if the {@link yfiles.router.EdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. + *

+ * @see yfiles.router.EdgeRouter#affectedEdgesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedEdges:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets the collection of affected nodes. + *

+ * This collection is only used by the router if the {@link yfiles.router.EdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}. + *

+ * @see yfiles.router.EdgeRouter#affectedNodesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedNodes:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets the collection of labels of nodes or fixed edges that are ignored by the router. + * @see yfiles.layout.LabelLayoutKeys#IGNORED_LABELS_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + ignoredLabels:yfiles.layout.ItemCollection; + /** + * Gets or sets the mapping of edges to their {@link yfiles.router.EdgeLayoutDescriptor} + *

+ * If an edge is mapped to null, the {@link yfiles.router.EdgeRouter#defaultEdgeLayoutDescriptor default descriptor} is used. + *

+ * @see yfiles.router.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeLayoutDescriptors:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from labels to a crossing penalty factor. + *

+ * The crossing penalty factor of a label is multiplied with the basic penalty for an edge crossing the label so crossing a + * label with a higher cost factor is stronger avoided then crossing one with a lower factor. + *

+ * @see yfiles.router.PenaltySettings#edgeLabelCrossingPenalty + * @see yfiles.router.PenaltySettings#nodeLabelCrossingPenalty + * @see yfiles.router.EdgeRouter#LABEL_CROSSING_PENALTY_FACTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + labelCrossingPenaltyFactors:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to a collection of their source port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#SOURCE_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + sourcePortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from edges to a collection of their target port {@link yfiles.layout.PortCandidate candidates}. + * @see yfiles.layout.PortCandidate#TARGET_PORT_CANDIDATE_COLLECTION_DP_KEY + * @type {yfiles.layout.ItemMapping.>} + */ + targetPortCandidates:yfiles.layout.ItemMapping>; + /** + * Gets or sets a mapping from nodes to their {@link yfiles.layout.PortCandidateSet}. + * @see yfiles.layout.PortCandidateSet#NODE_PORT_CANDIDATE_SET_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodePortCandidateSets:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the partition grid layout data. + * @type {yfiles.layout.PartitionGridData} + */ + partitionGridData:yfiles.layout.PartitionGridData; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.router.StraightLineEdgeRouter}. + * @class yfiles.router.StraightLineEdgeRouterData + * @extends {yfiles.layout.LayoutData} + */ + export interface StraightLineEdgeRouterData extends yfiles.layout.LayoutData{} + export class StraightLineEdgeRouterData { + constructor(); + /** + * Gets or sets the collection of affected edges. + *

+ * This collection is only used by the router if the {@link yfiles.router.StraightLineEdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_AFFECTED_EDGES}. + *

+ * @see yfiles.router.StraightLineEdgeRouter#affectedEdgesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedEdges:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets the collection of affected nodes. + *

+ * This collection is only used by the router if the {@link yfiles.router.StraightLineEdgeRouter#scope} is set to {@link yfiles.router.Scope#ROUTE_EDGES_AT_AFFECTED_NODES}. + *

+ * @see yfiles.router.StraightLineEdgeRouter#affectedNodesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + affectedNodes:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets a mapping from edges to their source {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourcePortConstraints:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to their target {@link yfiles.layout.PortConstraint}. + * @see yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetPortConstraints:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace genealogy{ + /** + * This layout algorithm arranges genealogical graphs (family trees). + *

+ * Layout Style The family trees consist of nodes that represent individuals and nodes that represent families. Individuals are + * connected via these family nodes. The graph is arranged in layers that describe generations. {@graph {"ann":{"s":[122.27,30],"d":1},"styles":{"5":{"c":1}},"n":[[364.55,210,[[405.01,234.35,41.35,18.7,"Mother"]]],[364.55,140,[[406.35,164.35,38.68,18.7,"Father"]]],[182.27,385,[[206.06,409.35,74.7,18.7,"Grandmother"]]],[182.27,315,[[209.39,339.35,68.04,18.7,"Grandfather"]]],[182.27,175,[[206.06,199.35,74.7,18.7,"Grandmother"]]],[182.27,105,[[209.39,129.35,68.04,18.7,"Grandfather"]]],[0,490,[[6.78,514.35,108.71,18.7,"Great-Grandmother"]]],[0,420,[[10.11,444.35,102.04,18.7,"Great-Grandfather"]]],[0,350,[[6.78,374.35,108.71,18.7,"Great-Grandmother"]]],[0,280,[[10.11,304.35,102.04,18.7,"Great-Grandfather"]]],[0,210,[[6.78,234.35,108.71,18.7,"Great-Grandmother"]]],[0,140,[[10.11,164.35,102.04,18.7,"Great-Grandfather"]]],[0,70,[[6.78,94.35,108.71,18.7,"Great-Grandmother"]]],[0,0,[[10.11,24.35,102.04,18.7,"Great-Grandfather"]]],[56.14,45,10,10,5],[56.14,185,10,10,5],[56.14,325,10,10,5],[56.14,465,10,10,5],[238.41,360,10,10,5],[238.41,150,10,10,5],[420.69,185,10,10,5],[556.82,245,[[597.95,269.35,40.02,18.7,"Sibling"]]],[556.82,315,[[597.95,339.35,40.02,18.7,"Sibling"]]],[556.82,175,[[602.29,199.35,31.35,18.7,"Child"]]]],"e":[[12,14],[13,14],[14,5,5,0,-61.14,0,[132.27,50,132.27,120]],[11,15],[10,15],[15,4,5,0,-61.14,0],[8,16],[9,16],[16,3,5,0,-61.14,0],[6,17],[7,17],[17,2,5,0,-61.14,0,[132.27,470,132.27,400]],[2,18],[3,18],[18,0,5,0,-61.14,0,[314.55,365,314.55,225]],[4,19],[5,19],[19,1,5,0,-61.14,0],[0,20],[1,20],[20,21,5,0,-61.14,0,[536.82,190,536.82,260]],[20,22,5,0,-61.14,0,[536.82,190,536.82,330]],[20,23,5,0,-61.14,0]],"vp":[0.0,0.0,680.0,520.0]}} + *

+ *

+ * Basic Family Tree + *

+ *

+ * Concept + *

+ *

+ * In order to determine whether a node represents an individual or a partnership, a {@link yfiles.algorithms.IDataProvider} has to + * be registered with key {@link yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY}. If this {@link yfiles.algorithms.IDataProvider} is + * missing, an {@link Stubs.Exceptions.ArgumentError} will be thrown. + *

+ *

+ * This {@link yfiles.algorithms.IDataProvider} provides: + *

+ *
    + *
  • {@link yfiles.genealogy.FamilyType#MALE} for a node representing a male individual.
  • + *
  • {@link yfiles.genealogy.FamilyType#FEMALE} for a node representing a female individual.
  • + *
  • {@link yfiles.genealogy.FamilyType#FAMILY} for a node representing a family.
  • + *
+ *

+ * All other values will be interpreted as if the node represents an individual. + *

+ *

+ * A {@link yfiles.genealogy.FamilyType#FAMILY} node links all members of a family. It can only have two incoming edges from the + * parents. Two nodes of the same type (families or individuals) cannot be directly connected. If the input graph violates + * these specifications, a {@link yfiles.algorithms.InvalidGraphStructureError} exception will be thrown. + *

+ *

+ * The layout is calculated basically in two steps: + *

+ *
    + *
  • The families are laid out by the inner layouter in a compact way.
  • + *
  • + * The relations between these "family groups" and their children and other families are laid out by the + * {@link yfiles.genealogy.FamilyTreeLayout#topLayout top layout algorithm}. + *
  • + *
+ *

+ * Features + *

+ *

+ * The distances between nodes {@link yfiles.genealogy.FamilyTreeLayout#spacingBetweenFamilyMembers in the same generation} as well as between {@link yfiles.genealogy.FamilyTreeLayout#offsetForFamilyNodes individuals and family nodes} can be adjusted. + *

+ *

+ * Nodes in the same generation can be {@link yfiles.genealogy.FamilyTreeLayout#alignment aligned} at three different coordinates: top, center, bottom. + *

+ *

+ * The location of {@link yfiles.genealogy.FamilyType#FAMILY} nodes can be {@link yfiles.genealogy.FamilyTreeLayout#familyNodesAlwaysBelow specified} in relation to the partners. This placement + * can be set independently for {@link yfiles.genealogy.FamilyTreeLayout#partnerlessBelow parents}. + *

+ * @class yfiles.genealogy.FamilyTreeLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface FamilyTreeLayout extends yfiles.layout.MultiStageLayout{} + export class FamilyTreeLayout { + /** + * Creates a new instance of {@link yfiles.genealogy.FamilyTreeLayout} with default settings. + * @constructor + */ + constructor(); + /** + * Data provider key for assigning a node type for each node + *

+ * The layout algorithm will handle the nodes according to this type. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static FAMILY_TYPE_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the {@link yfiles.layout.ILayoutAlgorithm layout algorithm} that is responsible for the layout between family groups. + *

+ * If the specified layout algorithm is null, fallback algorithm {@link yfiles.hierarchic.HierarchicLayout} is used. + *

+ * @type {yfiles.layout.ILayoutAlgorithm} + */ + topLayout:yfiles.layout.ILayoutAlgorithm; + /** + * Gets or sets the spacing between two nodes representing members of the same family in one generation. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given spacing is negative + * @type {number} + */ + spacingBetweenFamilyMembers:number; + /** + * Gets or sets the offset by which a {@link yfiles.genealogy.FamilyType#FAMILY} node is shifted down if its parents are not direct + * neighbors. + *

+ * Values should be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given offset is negative + * @type {number} + */ + offsetForFamilyNodes:number; + /** + * Gets or sets whether or not {@link yfiles.genealogy.FamilyType#FAMILY} nodes of individuals that have only children but no + * partners are placed below this individual or next to it. + * @type {boolean} + */ + partnerlessBelow:boolean; + /** + * Gets or sets whether or not {@link yfiles.genealogy.FamilyType#FAMILY} nodes are placed between or below the partners. + * @see yfiles.genealogy.FamilyType#FAMILY + * @type {boolean} + */ + familyNodesAlwaysBelow:boolean; + /** + * Gets or sets the vertical alignment of the individual nodes in the same generation. + * @throws {Stubs.Exceptions.ArgumentError} if the specified alignment is unknown + * @type {yfiles.genealogy.VerticalNodeAlignment} + */ + alignment:yfiles.genealogy.VerticalNodeAlignment; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing parallel edges is activated. + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouterEnabled + * @see yfiles.layout.MultiStageLayout#parallelEdgeRouter + * @see yfiles.router.ParallelEdgeRouter + * @type {boolean} + */ + parallelEdgeRouterEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + /** + * Gets or sets the order of individuals in the same generation (siblings, partners) based on their sex. + * @throws {Stubs.Exceptions.ArgumentError} if the specified order is unknown + * @type {yfiles.genealogy.FamilyMembersSortingPolicy} + */ + familyMembersSortingPolicy:yfiles.genealogy.FamilyMembersSortingPolicy; + static $class:yfiles.lang.Class; + } + export enum FamilyType{ + /** + * Type specifier for nodes that connect partners with each other and their children. + * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY + */ + FAMILY, + /** + * Type specifier for nodes that represent men. + * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY + */ + MALE, + /** + * Type specifier for nodes that represent women. + * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY + */ + FEMALE + } + export enum VerticalNodeAlignment{ + /** + * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their top + * coordinate. + *

+ * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. + *

+ * @see yfiles.genealogy.FamilyTreeLayout#alignment + */ + TOP, + /** + * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their center + * coordinate. + *

+ * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. + *

+ * @see yfiles.genealogy.FamilyTreeLayout#alignment + */ + CENTER, + /** + * Alignment specifier that defines that all nodes in the same layer (generation) are aligned based on their bottom + * coordinate. + *

+ * The descriptions of the directions are based on {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM}. + *

+ * @see yfiles.genealogy.FamilyTreeLayout#alignment + */ + BOTTOM + } + export enum FamilyMembersSortingPolicy{ + /** + * Order specifier that disables sorting of individuals according to their sex. + * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy + */ + NO_SORTING, + /** + * Order specifier that places female individuals before their male siblings and partners, if possible. + * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy + */ + FEMALE_FIRST, + /** + * Order specifier that places female individuals before their male siblings and partners. + * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy + */ + FEMALE_ALWAYS_FIRST, + /** + * Order specifier that places male individuals before their female siblings and partners, if possible. + * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy + */ + MALE_FIRST, + /** + * Order specifier that places male individuals before their female siblings and partners. + * @see yfiles.genealogy.FamilyTreeLayout#familyMembersSortingPolicy + */ + MALE_ALWAYS_FIRST + } + /** + * Specifies custom data for the {@link yfiles.genealogy.FamilyTreeLayout}. + * @class yfiles.genealogy.FamilyTreeLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface FamilyTreeLayoutData extends yfiles.layout.LayoutData{} + export class FamilyTreeLayoutData { + constructor(); + /** + * Gets or sets the mapping from nodes to their family type. + * @see yfiles.genealogy.FamilyTreeLayout#FAMILY_TYPE_DP_KEY + * @see yfiles.genealogy.FamilyType + * @type {yfiles.layout.ItemMapping.} + */ + familyTypes:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace multipage{ + /** + * This class is a default implementation of interface {@link yfiles.multipage.IElementFactory}. + * @see yfiles.multipage.IElementFactory + * @class yfiles.multipage.DefaultElementFactory + * @implements {yfiles.multipage.IElementFactory} + */ + export interface DefaultElementFactory extends Object,yfiles.multipage.IElementFactory{} + export class DefaultElementFactory { + /** + * Creates a new instance of {@link yfiles.multipage.DefaultElementFactory}. + * @constructor + */ + constructor(); + /** + * + * @param {yfiles.multipage.LayoutContext} context + * @param {yfiles.algorithms.Node} connector + * @param {yfiles.algorithms.Node} opposite + * @param {Object} origEdgeId + * @param {boolean} atTarget + * @returns {yfiles.algorithms.Edge} + */ + createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:Object,atTarget:boolean):yfiles.algorithms.Edge; + /** + * + * @param {yfiles.multipage.LayoutContext} context + * @param {yfiles.algorithms.YList} edgeIds + * @param {Object} representedNodeId + * @returns {yfiles.algorithms.Node} + */ + createConnectorNode(context:yfiles.multipage.LayoutContext,edgeIds:yfiles.algorithms.YList,representedNodeId:Object):yfiles.algorithms.Node; + /** + * + * @param {yfiles.multipage.LayoutContext} context + * @param {yfiles.algorithms.Node} proxyNode + * @param {yfiles.algorithms.Node} opposite + * @param {Object} replacingEdgeId + * @param {Object} origNodeId + * @returns {yfiles.algorithms.Edge} + */ + createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:Object,origNodeId:Object):yfiles.algorithms.Edge; + /** + * + * @param {yfiles.multipage.LayoutContext} context + * @param {Object} origNodeId + * @returns {yfiles.algorithms.Node} + */ + createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:Object):yfiles.algorithms.Node; + /** + * + * @param {yfiles.multipage.LayoutContext} context + * @param {yfiles.algorithms.Node} proxyReference + * @param {yfiles.algorithms.Node} opposite + * @param {Object} referencingCopyId + * @returns {yfiles.algorithms.Edge} + */ + createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:Object):yfiles.algorithms.Edge; + /** + * + * @param {yfiles.multipage.LayoutContext} context + * @param {Object} referringProxyId + * @returns {yfiles.algorithms.Node} + */ + createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:Object):yfiles.algorithms.Node; + /** + * Returns the default size for nodes created by this factory. + *

+ * This method is called from {@link yfiles.multipage.DefaultElementFactory#createConnectorNode}, + * {@link yfiles.multipage.DefaultElementFactory#createProxyReferenceNode}, and/or + * {@link yfiles.multipage.DefaultElementFactory#createProxyNode}. It must return a non-null size with positive width and height. + *

+ *

+ * Subclasses may implement this method to use custom size values. + *

+ * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, the current graph as well as various information about the + * graph elements + * @param {Object} id the element ID + * @param {number} type the type of the node to be created + * @returns {yfiles.algorithms.YDimension} the default size of the new node + * @protected + */ + getDefaultNodeSize(context:yfiles.multipage.LayoutContext,id:Object,type:number):yfiles.algorithms.YDimension; + static $class:yfiles.lang.Class; + } + export enum EdgeType{ + /** + * An edge type that specifies a normal edge. + *

+ * An edge is called normal if it does not belong to any other type. + *

+ * @see yfiles.multipage.IEdgeInfo#type + */ + NORMAL, + /** + * An edge type that specifies a connector edge. + *

+ * An edge is called connector if it is connected to a connector node (a node of {@link yfiles.multipage.INodeInfo#type type} + * {@link yfiles.multipage.NodeType#CONNECTOR}), i.e., it represents an edge of the input graph whose endpoints lie on different + * pages. + *

+ * @see yfiles.multipage.IEdgeInfo#representedEdge + * @see yfiles.multipage.IEdgeInfo#type + * @see yfiles.multipage.NodeType#CONNECTOR + */ + CONNECTOR, + /** + * An edge type that specifies a proxy reference edge. + *

+ * An edge is called proxy reference if it is connected to a proxy reference node (a node of {@link yfiles.multipage.INodeInfo#type 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 yfiles.multipage.IEdgeInfo#type + * @see yfiles.multipage.NodeType#PROXY_REFERENCE + */ + PROXY_REFERENCE, + /** + * An edge type that specifies a proxy edge. + *

+ * An edge is called proxy if it is connected to a proxy node (a node of {@link yfiles.multipage.INodeInfo#type type} + * {@link yfiles.multipage.NodeType#PROXY}), i.e., a node that is a proxy of an original node lying on another page. + *

+ * @see yfiles.multipage.IEdgeInfo#type + * @see yfiles.multipage.NodeType#PROXY + */ + PROXY + } + export enum GroupingMode{ + /** + * Node grouping specifier used when group nodes should be ignored. + * @see yfiles.multipage.MultiPageLayout#groupingMode + */ + IGNORE, + /** + * Node grouping specifier used when only original nodes should be assigned to group nodes. Hence, connector and proxy + * nodes (see {@link yfiles.multipage.NodeType#CONNECTOR} and + * {@link yfiles.multipage.NodeType#PROXY}) are never assigned to group nodes even though the associated node lies within a group. + * @see yfiles.multipage.MultiPageLayout#groupingMode + */ + ORIGINAL_NODES_ONLY, + /** + * Node grouping specifier used when special nodes like, e.g., connector and proxy nodes (see {@link yfiles.multipage.NodeType#CONNECTOR} + * and {@link yfiles.multipage.NodeType#PROXY}) should be assigned to group nodes, too. + * @see yfiles.multipage.MultiPageLayout#groupingMode + */ + ALL_NODES + } + export enum EdgeBundleModes{ + /** + * Edge bundle mode constant that specifies that all multi-edges (edges with same endpoints) should be distinguished. + * Hence, if such edges connect two nodes on different pages, a separate connector pair (see + * {@link yfiles.multipage.NodeType#CONNECTOR}) is used for each of them. + * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask + */ + DISTINGUISH_MULTI_EDGES, + /** + * Edge bundle mode constant that specifies that multi-edges (edges with same endpoints) should be distinguished if they + * have different directions. Hence, two edges with the same endpoints may share a connector pair (see + * {@link yfiles.multipage.NodeType#CONNECTOR}) if they point in the same direction (i.e., both have the same source and target + * node). + * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask + */ + DISTINGUISH_DIRECTIONS, + /** + * Edge bundle mode constant that specifies that multi-edges (edges with same endpoints) should be distinguished if they + * are of different (user specified) type, see {@link yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY}. Hence, two edges with the + * same endpoints and same type may share a connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). + * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask + * @see yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY + */ + DISTINGUISH_TYPES + } + export enum NodeType{ + /** + * A node type that specifies a normal node. + *

+ * A node is called normal if it does not belong to any other type. + *

+ * @see yfiles.multipage.INodeInfo#type + */ + NORMAL, + /** + * A node type that specifies a group node. + *

+ * A group node is a node that may contain other nodes. + *

+ * @see yfiles.multipage.INodeInfo#type + */ + GROUP, + /** + * A node type that specifies a proxy node. + *

+ * A proxy node is a copy of a {@link yfiles.multipage.NodeType#NORMAL normal node}. It is created by the algorithm if a normal node and its neighbors or associated {@link yfiles.multipage.NodeType#CONNECTOR connectors} + * do not fit onto a single page. Hence, in such cases, the neighbors/connectors associated with a normal node may be + * distributed among different proxy nodes associated with this node. + *

+ * @see yfiles.multipage.INodeInfo#type + * @see yfiles.multipage.NodeType#NORMAL + * @see yfiles.multipage.NodeType#PROXY_REFERENCE + */ + PROXY, + /** + * A node type that specifies a proxy reference node. + *

+ * For each {@link yfiles.multipage.NodeType#PROXY proxy node} there is exactly one matching proxy reference node. The reference node refers to the proxy and is + * either connected to the {@link yfiles.multipage.NodeType#NORMAL normal node} associated with this proxy or one of its other proxy nodes (a normal node may be + * associated with multiple proxy nodes). Hence, for a node connected to a proxy reference node there always exists a copy + * located on another page. + *

+ * @see yfiles.multipage.INodeInfo#type + * @see yfiles.multipage.NodeType#PROXY + */ + PROXY_REFERENCE, + /** + * A node type that specifies a connector node. + *

+ * Each edge of the input graph that connects two nodes v and w that are placed on different pages is split by a pair of + * matching connector nodes (one for each of the two pages). One of the connector nodes is connected to v and the other to + * w. Hence, each connector represents a jump mark to the matching connector and guarantees that no information is lost as + * it would be the case if such edges are simply removed. + *

+ * @see yfiles.multipage.INodeInfo#type + */ + CONNECTOR + } + /** + * A class that holds all information associated with an edge. + * @interface + */ + export interface IEdgeInfo extends Object{ + /** + * Gets the unique ID of the associated edge. + * @see yfiles.multipage.MultiPageLayoutResult#getEdgeInfo + * @see yfiles.multipage.IElementInfoManager#getEdgeInfo + * @abstract + * @type {Object} + */ + id:Object; + /** + * Gets the type of the associated edge. + * @abstract + * @type {yfiles.multipage.EdgeType} + */ + type:yfiles.multipage.EdgeType; + /** + * Gets the original edge associated with this {@link yfiles.multipage.IEdgeInfo}. + *

+ * More precisely, for edges of {@link yfiles.multipage.IEdgeInfo#type type} {@link yfiles.multipage.EdgeType#CONNECTOR}, this method returns the edge of the input graph + * that was split by the connector edge. Otherwise, it returns null. + *

+ * @see yfiles.multipage.EdgeType#CONNECTOR + * @abstract + * @type {yfiles.algorithms.Edge} + */ + representedEdge:yfiles.algorithms.Edge; + } + var IEdgeInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A class that holds all information related to an edge label. + * @interface + */ + export interface IEdgeLabelInfo extends Object{ + /** + * Gets the unique ID of the associated edge label. + * @see yfiles.multipage.MultiPageLayoutResult#getEdgeLabelInfo + * @see yfiles.multipage.IElementInfoManager#getEdgeLabelInfo + * @abstract + * @type {Object} + */ + id:Object; + } + var IEdgeLabelInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Factory used by class {@link yfiles.multipage.MultiPageLayout} to create special nodes and edges. + * @interface + */ + export interface IElementFactory extends Object{ + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#CONNECTOR}. + *

+ * Such an edge connects the given {@link yfiles.multipage.NodeType#CONNECTOR connector} and opposite node. + *

+ * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, 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 true if the connector node is the target of the edge, false otherwise + * @returns {yfiles.algorithms.Edge} the created connector edge + * @see yfiles.multipage.EdgeType#CONNECTOR + * @see yfiles.multipage.NodeType#CONNECTOR + * @see yfiles.multipage.LayoutContext#createEdge + * @abstract + */ + 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}. + * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, the current graph as well as various information about the + * graph elements + * @param {yfiles.algorithms.YList} edgesIds a {@link yfiles.algorithms.YList list} that contains the IDs of edges that are split by this connector + * @param {Object} representedNodeId the ID of the node that is represented by this connector + * @returns {yfiles.algorithms.Node} the created connector node + * @see yfiles.multipage.NodeType#CONNECTOR + * @see yfiles.multipage.LayoutContext#createNode + * @see yfiles.multipage.INodeInfo#representedNode + * @abstract + */ + createConnectorNode(context:yfiles.multipage.LayoutContext,edgesIds:yfiles.algorithms.YList,representedNodeId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY}. + *

+ * Such an edge should connect the given {@link yfiles.multipage.NodeType#PROXY proxy} and opposite node. + *

+ * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, 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 + * @returns {yfiles.algorithms.Edge} the created proxy edge + * @see yfiles.multipage.EdgeType#PROXY + * @see yfiles.multipage.NodeType#PROXY + * @see yfiles.multipage.LayoutContext#createEdge + * @abstract + */ + createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:Object,origNodeId:Object):yfiles.algorithms.Edge; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY}. + * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, 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 + * @returns {yfiles.algorithms.Node} the created proxy node + * @see yfiles.multipage.LayoutContext#createNode + * @see yfiles.multipage.NodeType#PROXY_REFERENCE + * @see yfiles.multipage.NodeType#PROXY + * @abstract + */ + createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY_REFERENCE}. + *

+ * Such an (undirected) edge should connect the given {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference} and opposite node. + *

+ * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, 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 + * @returns {yfiles.algorithms.Edge} the created proxy reference edge + * @see yfiles.multipage.EdgeType#PROXY_REFERENCE + * @see yfiles.multipage.NodeType#PROXY_REFERENCE + * @see yfiles.multipage.LayoutContext#createEdge + * @abstract + */ + createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:Object):yfiles.algorithms.Edge; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY_REFERENCE}. + * @param {yfiles.multipage.LayoutContext} context an object providing relevant layout information, for example, 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 + * @returns {yfiles.algorithms.Node} the new proxy reference node + * @see yfiles.multipage.NodeType#PROXY_REFERENCE + * @see yfiles.multipage.LayoutContext#createNode + * @see yfiles.multipage.NodeType#PROXY + * @abstract + */ + createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:Object):yfiles.algorithms.Node; + } + var IElementFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that offers access to the information objects of graph elements. + * @interface + */ + export interface IElementInfoManager extends Object{ + /** + * Returns the edge information object of the given edge. + * @param {yfiles.algorithms.Edge} edge the edge for which the information object should be returned + * @returns {yfiles.multipage.IEdgeInfo} the edge information object of the given edge + * @abstract + */ + getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; + /** + * Returns the edge label information object of the given edge label layout. + * @param {yfiles.layout.IEdgeLabelLayout} edgeLabelLayout the edge label layout for which the information object should be returned + * @returns {yfiles.multipage.IEdgeLabelInfo} the edge label information object of the given edge label layout + * @abstract + */ + getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; + /** + * Returns the node information object of the given node. + * @param {yfiles.algorithms.Node} node the node for which the information object should be returned + * @returns {yfiles.multipage.INodeInfo} the node information object of the given node + * @abstract + */ + getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; + /** + * Returns the node label layout information object of the given node label layout. + * @param {yfiles.layout.INodeLabelLayout} nodeLabelLayout the node label layout for which the information object should be returned + * @returns {yfiles.multipage.INodeLabelInfo} the node label information object of the given node label layout + * @abstract + */ + getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; + } + var IElementInfoManager:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Callback that is invoked when a {@link yfiles.multipage.MultiPageLayout} has calculated a new multi-page layout. + * @interface + */ + export interface ILayoutCallback extends Object{ + /** + * Invoked from {@link yfiles.multipage.MultiPageLayout#applyLayout} when a new multi-page layout has been calculated. + * @param {yfiles.multipage.MultiPageLayoutResult} result the result of the layout calculation + * @see yfiles.multipage.MultiPageLayout#applyLayout + * @abstract + */ + layoutDone(result:yfiles.multipage.MultiPageLayoutResult):void; + } + var ILayoutCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface offers access to information associated with a node. + *

+ * The information can be either obtained from {@link yfiles.multipage.MultiPageLayoutResult#getNodeInfo} or + * {@link yfiles.multipage.LayoutContext#getNodeInfo}. + *

+ * @interface + */ + export interface INodeInfo extends Object{ + /** + * Gets the node of the input graph that is represented by the node associated with this {@link yfiles.multipage.INodeInfo info object}. + *

+ * Note that, for the special nodes inserted to guarantee that no information is lost, there are no corresponding nodes in + * the input graph. Hence, special nodes are mapped to common nodes in the following way: + *

+ *
    + *
  • A {@link yfiles.multipage.NodeType#CONNECTOR connector node} is mapped to the common node connected to the matching connector.
  • + *
  • A {@link yfiles.multipage.NodeType#PROXY proxy node} is mapped to the associated common node (i.e., the proxy is a copy of that node).
  • + *
  • A {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node} is not mapped to any node, and, thus this method returns null for such nodes.
  • + *
+ * @abstract + * @type {yfiles.algorithms.Node} + */ + representedNode:yfiles.algorithms.Node; + /** + * Gets the page number of the {@link yfiles.multipage.MultiPageLayoutResult#getPage page graph} that contains the node associated with this {@link yfiles.multipage.INodeInfo info object}. + * @abstract + * @type {number} + */ + pageNo:number; + /** + * Gets the type of the node associated with this {@link yfiles.multipage.INodeInfo info object}. + * @abstract + * @type {yfiles.multipage.NodeType} + */ + type:yfiles.multipage.NodeType; + /** + * Gets the unique ID of the node associated with this {@link yfiles.multipage.INodeInfo info object}. + * @see yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY + * @abstract + * @type {Object} + */ + id:Object; + /** + * Gets the node that refers to the one associated with this {@link yfiles.multipage.INodeInfo info object}. + *

+ * More precisely, if the node associated with this info object + *

+ *
    + *
  • is a {@link yfiles.multipage.NodeType#CONNECTOR connector node}, this method returns the matching connector node,
  • + *
  • is a {@link yfiles.multipage.NodeType#PROXY proxy node}, it returns the corresponding {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node},
  • + *
  • is a {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference node}, it returns the corresponding {@link yfiles.multipage.NodeType#PROXY proxy node},
  • + *
  • or otherwise, it returns null.
  • + *
+ * @see yfiles.multipage.NodeType#CONNECTOR + * @see yfiles.multipage.NodeType#PROXY + * @see yfiles.multipage.NodeType#PROXY_REFERENCE + * @abstract + * @type {yfiles.algorithms.Node} + */ + referencingNode:yfiles.algorithms.Node; + } + var INodeInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A class that holds all information related to a node label. + * @interface + */ + export interface INodeLabelInfo extends Object{ + /** + * Gets the unique ID of the associated node label. + * @see yfiles.multipage.MultiPageLayoutResult#getNodeLabelInfo + * @see yfiles.multipage.IElementInfoManager#getNodeLabelInfo + * @abstract + * @type {Object} + */ + id:Object; + } + var INodeLabelInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class represents the layout context. + *

+ * It provides several methods to access data as well as adding and removing elements. + *

+ * @class yfiles.multipage.LayoutContext + * @implements {yfiles.multipage.IElementInfoManager} + */ + export interface LayoutContext extends Object,yfiles.multipage.IElementInfoManager{} + export class LayoutContext { + /** + * Adds a label to a given edge. + * @param {yfiles.layout.IEdgeLabelLayout} label the label that should be added to the given edge + * @param {yfiles.algorithms.Edge} labeledElement the edge to which the label should be added + */ + addEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):void; + /** + * Adds a label to a given node. + * @param {yfiles.layout.INodeLabelLayout} label the label that should be added to the given node + * @param {yfiles.algorithms.Node} labeledElement the node to which the label should be added + */ + addNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):void; + /** + * 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) + * @returns {yfiles.algorithms.Edge} the created edge + * @see 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) + * @returns {yfiles.algorithms.Node} the created node + * @see yfiles.multipage.IElementFactory + */ + createNode(sameDataElementId:Object):yfiles.algorithms.Node; + /** + * + * @param {yfiles.algorithms.Edge} edge + * @returns {yfiles.multipage.IEdgeInfo} + */ + getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; + /** + * + * @param {yfiles.layout.IEdgeLabelLayout} edgeLabelLayout + * @returns {yfiles.multipage.IEdgeLabelInfo} + */ + getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; + /** + * + * @param {yfiles.algorithms.Node} node + * @returns {yfiles.multipage.INodeInfo} + */ + getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; + /** + * + * @param {yfiles.layout.INodeLabelLayout} nodeLabelLayout + * @returns {yfiles.multipage.INodeLabelInfo} + */ + getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; + /** + * 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 + * @returns {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 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 + * @returns {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 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 + * @returns {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 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 + * @returns {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; + /** + * Removes a label from a given edge. + * @param {yfiles.layout.IEdgeLabelLayout} label the label that should be removed + * @param {yfiles.algorithms.Edge} labeledElement the edge owning the label + * @returns {boolean} + */ + removeEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):boolean; + /** + * Removes a label from a given node. + * @param {yfiles.layout.INodeLabelLayout} label the label that should be removed + * @param {yfiles.algorithms.Node} labeledElement the node owning the label + * @returns {boolean} + */ + removeNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):boolean; + /** + * Gets the relevant graph. + * @type {yfiles.layout.LayoutGraph} + */ + graph:yfiles.layout.LayoutGraph; + /** + * Gets the layouter object that belongs to this layout context. + * @type {yfiles.multipage.MultiPageLayout} + */ + layout:yfiles.multipage.MultiPageLayout; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm subdivides the input graph into several {@link yfiles.layout.LayoutGraph}s (called page graphs) such that + * the layout (calculated by the specified {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}) of each graph fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. + *

+ * The algorithm adds special nodes to guarantee that no information is lost when splitting edges that connect nodes placed + * on different pages (for more details take a look at the concept described below). {@graph {"ann":{"s":[45,30],"d":1},"n":[[165,210,60,30,[[187.94,234.96,14.11,19.93,"G"]]],[271.88,210,30,30,[[280.18,234.96,13.39,19.93,"H"]]],[148.12,450,60,30,[[171.79,474.96,12.67,19.93,"V"]]],[166.88,375,[[183.04,399.96,12.67,19.93,"P"]]],[391.88,510,60,30,[[415.9,534.96,11.94,19.93,"Z"]]],[23.12,510,[[39.29,534.96,12.67,19.93,"Y"]]],[436.88,375,[[453.4,399.96,11.94,19.93,"T"]]],[376.88,375,30,30,[[385.54,399.96,12.67,19.93,"S"]]],[455.62,210,30,30,[[466.82,234.96,7.61,19.93,"I"]]],[30,450,60,30,[[53.31,474.96,13.39,19.93,"U"]]],[436.88,450,[[453.04,474.96,12.67,19.93,"X"]]],[15,375,30,30,[[23.31,399.96,13.39,19.93,"N"]]],[455.62,285,30,30,[[463.21,309.96,14.83,19.93,"M"]]],[350.62,285,75,30,[[382.51,309.96,11.23,19.93,"L"]]],[165,285,[[182.25,309.96,10.5,19.93,"J"]]],[166.88,135,75,30,[[198.04,159.96,12.67,19.93,"E"]]],[241.88,375,30,30,[[249.82,399.96,14.11,19.93,"Q"]]],[75,375,30,30,[[82.94,399.96,14.11,19.93,"O"]]],[120,60,60,30,[[143.31,84.96,13.39,19.93,"C"]]],[33.75,0,[[49.91,24.96,12.67,19.93,"A"]]],[358.12,450,[[372.49,474.96,16.27,19.93,"W"]]],[75,135,[[90.81,159.96,13.39,19.93,"D"]]],[256.88,285,60,30,[[280.54,309.96,12.67,19.93,"K"]]],[301.88,375,[[317.68,399.96,13.39,19.93,"R"]]],[45,60,[[61.16,84.96,12.67,19.93,"B"]]],[271.88,135,30,30,[[280.9,159.96,11.94,19.93,"F"]]]],"e":[[11,9,0,15,-20,-15,[30,420,40,420]],[13,6,25,15,-11.25,-15,[413.12,330,448.12,330]],[7,20,0,15,11.25,-15],[25,1,0,15,0,-15],[13,23,-25,15,11.25,-15,[363.12,330,335.62,330]],[10,4,0,15,20,-15,[459.38,495,441.88,495]],[1,22,0,15,0,-15],[22,16,-20,15,0,-15,[266.88,330,256.88,330]],[14,3,11.25,15,-11.25,-15,[198.75,345,178.12,345]],[0,14,0,15,11.25,-15,[195,255,198.75,255]],[17,9,0,15,20,-15,[90,420,80,420]],[3,2,-11.25,15,0,-15],[24,9,-11.25,15,0,-15,[56.25,105,60,105]],[3,20,11.25,15,-11.25,-15,[200.62,420,369.38,420]],[18,15,20,15,0,-15,[170,105,204.38,105]],[15,0,-9.38,15,0,-15],[9,5,0,15,11.25,-15,[60,495,56.88,495]],[15,2,-28.12,15,-20,-15,[176.25,180,150,180,150,420,158.12,420]],[12,6,0,15,11.25,-15],[0,13,20,15,-18.75,-15,[215,255,369.38,255]],[14,17,-11.25,15,0,-15,[176.25,330,90,330]],[15,3,9.38,15,11.25,-15,[213.75,195,240,195,240,360,200.62,360]],[24,21,11.25,15,-11.25,-15,[78.75,105,86.25,105]],[19,11,-11.25,15,0,-15,[45,45,30,45]],[15,13,28.12,15,18.75,-15,[232.5,180,406.88,180]],[22,23,20,15,-11.25,-15,[306.88,330,313.12,330]],[19,24,11.25,15,0,-15],[0,5,-20,15,-11.25,-15,[175,255,0,255,0,495,34.38,495]],[8,12,0,15,0,-15],[18,21,-20,15,11.25,-15,[130,105,108.75,105]],[18,14,0,15,-11.25,-15,[150,120,135,120,135,270,176.25,270]],[20,4,0,15,-20,-15,[380.62,495,401.88,495]],[13,4,0,15,0,-15,[388.12,345,421.88,345]],[22,2,0,15,20,-15,[286.88,435,198.12,435]]],"vp":[0.0,0.0,486.0,540.0]}} + *

+ *

+ * The input graph. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"styles":{"1":{"c": 1}},"n":[[523.12,293.69,500,500,2,[[523.12,316.06,500,22.38,"Page 2"]]],[-80.94,293.69,500,500,2,[[-80.94,316.06,500,22.38,"Page 1"]]],[261.56,588.69,45,30,[[277.73,613.65,12.67,19.93,"X"]]],[239.06,528.69,[[247.73,553.65,12.67,19.93,"S"]]],[186.56,588.69,45,30,[[200.93,613.65,16.27,19.93,"W"]]],[164.06,528.69,45,30,[[180.23,553.65,12.67,19.93,"P"]]],[15.94,458.69,75,30,[[47.1,483.65,12.67,19.93,"E"]]],[99.06,528.69,1,[[107.4,553.04,13.33,18.7,"G"]]],[29.06,528.69,1,[[38.73,553.04,10.67,18.7,"L"]]],[38.44,398.69,1,[[47.1,423.04,12.67,18.7,"C"]]],[322.81,458.69,45,30,[[340.06,483.65,10.5,19.93,"J"]]],[271.56,398.69,1,[[279.9,423.04,13.33,18.7,"G"]]],[341.56,398.69,1,[[350.23,423.04,12.67,18.7,"C"]]],[179.06,648.69,60,30,[[203.09,673.65,11.94,19.93,"Z"]]],[121.56,588.69,1,[[131.23,613.04,10.67,18.7,"L"]]],[341.56,528.69,[[349.51,553.65,14.11,19.93,"O"]]],[341.56,588.69,1,[[350.23,613.04,12.67,18.7,"U"]]],[-40.94,528.69,1,[[-31.94,553.04,12,18.7,"K"]]],[-20.94,588.69,60,30,[[2.73,613.65,12.67,19.93,"V"]]],[961.88,408.69,[[973.07,433.65,7.61,19.93,"I"]]],[961.88,468.69,[[969.46,493.65,14.83,19.93,"M"]]],[943.12,528.69,45,30,[[959.65,553.65,11.94,19.93,"T"]]],[855.62,468.69,75,30,[[887.51,493.65,11.23,19.93,"L"]]],[878.12,528.69,1,[[887.46,553.04,11.33,18.7,"Z"]]],[896.88,408.69,1,[[905.87,433.04,12,18.7,"E"]]],[775.62,408.69,60,30,[[798.57,433.65,14.11,19.93,"G"]]],[790.62,468.69,1,[[800.62,493.04,10,18.7,"J"]]],[790.62,358.69,1,[[799.62,383.04,12,18.7,"E"]]],[798.12,528.69,45,30,[[813.93,553.65,13.39,19.93,"R"]]],[620.62,468.69,60,30,[[644.29,493.65,12.67,19.93,"K"]]],[570.62,528.69,1,[[579.62,553.04,12,18.7,"V"]]],[710.62,468.69,45,30,[[726.79,493.65,12.67,19.93,"Y"]]],[635.62,408.69,[[643.93,433.65,13.39,19.93,"H"]]],[635.62,528.69,[[643.57,553.65,14.11,19.93,"Q"]]],[635.62,358.69,[[644.65,383.65,11.94,19.93,"F"]]],[615.62,728.69,60,30,[[638.93,753.65,13.39,19.93,"U"]]],[630.62,668.69,1,[[638.96,693.04,13.33,18.7,"O"]]],[695.62,668.69,45,30,[[711.79,693.65,12.67,19.93,"B"]]],[565.62,668.69,[[573.93,693.65,13.39,19.93,"N"]]],[718.12,728.69,45,30,[[733.93,753.65,13.39,19.93,"D"]]],[783.12,668.69,60,30,[[806.43,693.65,13.39,19.93,"C"]]],[798.12,728.69,1,[[807.12,753.04,12,18.7,"E"]]],[868.12,728.69,1,[[878.12,753.04,10,18.7,"J"]]],[569.38,608.69,45,30,[[585.54,633.65,12.67,19.93,"A"]]]],"e":[[9,6,0,15,0,-15],[4,13,0,15,0,-15],[15,16,0,15,0,-15],[3,4,0,15,11.25,-15,[254.06,568.69,220.31,568.69]],[12,10,0,15,11.25,-15],[6,7,9.38,15,0,-15,[62.81,508.69,114.06,508.69]],[10,15,11.25,15,0,-15],[5,4,11.25,15,-11.25,-15],[11,10,0,15,-11.25,-15,[286.56,438.69,334.06,438.69]],[17,18,0,15,-20,-15,[-25.94,568.69,-10.94,568.69]],[6,8,-9.38,15,0,-15],[14,13,0,15,-20,-15,[136.56,628.69,189.06,628.69]],[2,13,0,15,20,-15,[284.06,628.69,229.06,628.69]],[6,5,28.12,15,-11.25,-15,[81.56,498.69,175.31,498.69]],[5,18,-11.25,15,20,-15,[175.31,568.69,29.06,568.69]],[10,5,-11.25,15,11.25,-15,[334.06,498.69,197.81,498.69]],[6,18,-28.12,15,0,-15,[25.31,498.69,9.06,498.69]],[27,25,0,15,0,-15],[34,32,0,15,0,-15],[19,20,0,15,0,-15],[22,23,0,15,0,-15],[25,26,0,15,0,-15],[32,29,0,15,0,-15],[29,33,0,15,0,-15],[36,35,0,15,0,-15],[40,41,0,15,0,-15],[20,21,0,15,11.25,-15],[43,38,-11.25,15,0,-15],[24,22,0,15,18.75,-15],[37,39,11.25,15,-11.25,-15],[29,30,-20,15,0,-15,[630.62,508.69,585.62,508.69]],[38,35,0,15,-20,-15,[580.62,708.69,625.62,708.69]],[40,42,20,15,0,-15,[833.12,708.69,883.12,708.69]],[22,21,25,15,-11.25,-15,[918.12,508.69,954.38,508.69]],[22,28,-25,15,11.25,-15,[868.12,508.69,831.88,508.69]],[25,31,-20,15,11.25,-15,[785.62,448.69,744.38,448.69]],[37,35,-11.25,15,20,-15,[706.88,708.69,665.62,708.69]],[40,39,-20,15,11.25,-15,[793.12,708.69,751.88,708.69]],[25,22,20,15,-18.75,-15,[825.62,448.69,874.38,448.69]],[43,37,11.25,15,0,-15,[603.12,648.69,718.12,648.69]],[29,28,20,15,-11.25,-15,[670.62,508.69,809.38,508.69]],[35,31,-30,0,-14.5,-15,[555.62,743.69,555.62,348.69,718.62,348.69]]],"vp":[-81.0,293.0,1105.0,501.0]}} + *

+ *

+ * The input graph is subdivided into two pages with size 500x500. Circular nodes denote the so-called {@link yfiles.multipage.NodeType#CONNECTOR connectors} that + * split edges to nodes placed on other pages. The label of a connector corresponds to that of the opposite node of the + * split edge. + *

+ *

+ * Layout Style + *

+ *

+ * This multi-page layout algorithm subdivides the input graph into several smaller ones and applies existing layout + * algorithms to each of them. Hence, its layout style heavily depends on the selected {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm} used for each + * single page. Furthermore, the algorithm uses several refinement steps to produce more compact results. + *

+ *

+ * Features + *

+ *

+ * Similar to the layout style, the supported feature set mainly depends on the features supported by the specified + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. Note that due to the underlying approach of the {@link yfiles.multipage.MultiPageLayout} it doesn't + * support {@link yfiles.layout.PartitionGrid}s. + *

+ *

+ * Concept + *

+ *

+ * To guarantee that no information is lost, this layout algorithm replaces edges between nodes on different pages by + * so-called {@link yfiles.multipage.NodeType#CONNECTOR connector nodes}. Furthermore, it may replicate nodes (the clones are called {@link yfiles.multipage.NodeType#PROXY proxy nodes}) and insert special + * nodes to refer to such nodes (so-called {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference nodes}). + *

+ *

+ * Unlike other yFiles layout algorithms, {@link yfiles.multipage.MultiPageLayout} does not modify its input graph but returns its + * result as a {@link yfiles.multipage.MultiPageLayoutResult}. To be able to profit as much as possible from existing layout + * support, this layout algorithm implements the {@link yfiles.layout.ILayoutAlgorithm} interface, although method {@link yfiles.layout.ILayoutAlgorithm#applyLayout doLayout} does + * not specify a return value. Therefore, client code has to {@link yfiles.multipage.MultiPageLayout#layoutCallback register} a {@link yfiles.multipage.ILayoutCallback} that is invoked + * when the algorithm has calculated a new multi-page result. + *

+ * @class yfiles.multipage.MultiPageLayout + * @extends {yfiles.layout.LayoutStageBase} + */ + export interface MultiPageLayout extends yfiles.layout.LayoutStageBase{} + export class MultiPageLayout { + /** + * Creates a new {@link yfiles.multipage.MultiPageLayout} instance. + * @param {yfiles.layout.ILayoutAlgorithm} core the layout algorithm used for a single page + * @constructor + */ + constructor(core:yfiles.layout.ILayoutAlgorithm); + /** + * This method is called to further improve the layout results. + *

+ * The marked nodes have to be placed without changing the coordinates of the fixed (non-marked) elements and without + * exceeding the specified maximum page size. Furthermore, the basic layout properties should be maintained. + *

+ *

+ * Subclasses may implement a custom layout strategy for this step. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} incrementalNodesDP a {@link yfiles.algorithms.IDataProvider} that returns a boolean value indicating whether or not a node is marked; the positions + * of the non-marked nodes are not allowed to change + * @param {yfiles.multipage.LayoutContext} context the current layout context + * @see yfiles.multipage.LayoutContext + * @protected + */ + applyIncrementalLayout(graph:yfiles.layout.LayoutGraph,incrementalNodesDP:yfiles.algorithms.IDataProvider,context:yfiles.multipage.LayoutContext):void; + /** + * Calculates a new multi-page layout for the specified graph. + *

+ * Unlike method {@link yfiles.multipage.MultiPageLayout#applyLayout}, this method ignores the registered {@link yfiles.multipage.MultiPageLayout#layoutCallback layout callback} and + * directly returns the calculated {@link yfiles.multipage.MultiPageLayoutResult}. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph + * @returns {yfiles.multipage.MultiPageLayoutResult} an instance of {@link yfiles.multipage.MultiPageLayoutResult} that represents the result of the layout run + * @throws {Stubs.Exceptions.ArgumentError} if for one of the keys {@link yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY}, {@link yfiles.multipage.MultiPageLayout#EDGE_ID_DP_KEY}, + * {@link yfiles.multipage.MultiPageLayout#NODE_LABEL_ID_DP_KEY} and {@link yfiles.multipage.MultiPageLayout#EDGE_LABEL_ID_DP_KEY} no {@link yfiles.algorithms.IDataProvider} + * is registered with the given graph + * @see yfiles.multipage.MultiPageLayoutResult + */ + calculateLayout(graph:yfiles.layout.LayoutGraph):yfiles.multipage.MultiPageLayoutResult; + /** + * This method creates the {@link yfiles.multipage.IElementFactory element factory} for multi-page layouts. + *

+ * It is called once from {@link yfiles.multipage.MultiPageLayout#elementFactory} if no factory has been explicitly set using {@link yfiles.multipage.MultiPageLayout#elementFactory}. By default, this method returns an instance of + * {@link yfiles.multipage.DefaultElementFactory}. + *

+ *

+ * Subclasses may create a custom implementation of the element factory. + *

+ * @returns {yfiles.multipage.IElementFactory} the created element factory + * @see yfiles.multipage.MultiPageLayout#elementFactory + * @see yfiles.multipage.MultiPageLayout#elementFactory + * @see yfiles.multipage.IElementFactory + * @protected + */ + createElementFactory():yfiles.multipage.IElementFactory; + /** + * This method is 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. The method removes both + * connector nodes and restores the original edges by calling {@link yfiles.multipage.MultiPageLayout#routeRestoredEdges}. + *

+ *

+ * Subclasses may implement a custom remove/restore strategy. + *

+ * @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 + * @returns {boolean} true if the removal of the connector pair was successful, false otherwise + * @see yfiles.multipage.MultiPageLayout#routeRestoredEdges + * @protected + */ + removeConnectorPair(connector1:yfiles.algorithms.Node,connector2:yfiles.algorithms.Node,originalEdgeIds:yfiles.algorithms.YList,context:yfiles.multipage.LayoutContext):boolean; + /** + * This method is called by {@link yfiles.multipage.MultiPageLayout#removeConnectorPair} to route the restored edges. + *

+ * It has to guarantee that the routes are fully contained within the given bounding rectangle. + *

+ *

+ * Subclasses may implement a custom routing strategy for the restored edges. + *

+ * @param {yfiles.layout.LayoutGraph} graph the relevant graph + * @param {yfiles.algorithms.IDataProvider} selectedEdgesDP a {@link yfiles.algorithms.IDataProvider} that returns a boolean value indicating whether or not an edge should be rerouted + * @param {yfiles.algorithms.YRectangle} boundingRectangle the edge routes should be fully contained within this rectangle + * @see yfiles.multipage.MultiPageLayout#removeConnectorPair + * @protected + */ + routeRestoredEdges(graph:yfiles.layout.LayoutGraph,selectedEdgesDP:yfiles.algorithms.IDataProvider,boundingRectangle:yfiles.algorithms.YRectangle):void; + /** + * Data provider key for assigning a cluster ID to common (non-group) nodes. + * @see yfiles.multipage.MultiPageLayout#strictClusterSeparation + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_CLUSTER_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for mapping each node of the input graph to a unique ID. + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for mapping each edge of the input graph to a unique ID. + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_ID_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for mapping each edge label of the input graph to a unique ID. + * @const + * @static + * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} + */ + static EDGE_LABEL_ID_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; + /** + * Data provider key for mapping each node label of the input graph to a unique ID. + * @const + * @static + * @type {yfiles.algorithms.INodeLabelLayoutDpKey.} + */ + static NODE_LABEL_ID_DP_KEY:yfiles.algorithms.INodeLabelLayoutDpKey; + /** + * Data provider key for specifying the type of multi-edges. + *

+ * If {@link yfiles.multipage.MultiPageLayout#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES} == 1, multi-edges (edges with same endpoints) associated with + * different types (objects) are distinguished, i.e., they are split by different connector pairs (see + * {@link yfiles.multipage.NodeType#CONNECTOR}). + *

+ * @see yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES + * @see yfiles.multipage.MultiPageLayout#edgeBundleModeMask + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_TYPE_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets whether or not the algorithm should separate nodes with different {@link yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY cluster IDs}. + *

+ * More precisely, if this option is enabled, the algorithm doesn't place nodes with different cluster IDs onto the same + * page. Otherwise, such a placement is possible. + *

+ * @see yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY + * @type {boolean} + */ + strictClusterSeparation:boolean; + /** + * Gets or sets whether or not the given {@link yfiles.multipage.MultiPageLayout#labeling labeling algorithm} places the labels of the input graph. + *

+ * If this option is disabled, the labels are either ignored or placed by the integrated labeling approach of the + * {@link yfiles.layout.LayoutStageBase#coreLayout core layout algorithm}. + *

+ * @see yfiles.multipage.MultiPageLayout#labeling + * @type {boolean} + */ + labelingEnabled:boolean; + /** + * Gets or sets the {@link yfiles.multipage.IElementFactory element factory} for creating special nodes and edges in a multi-page layout. + *

+ * If no element factory is set explicitly (see method {@link yfiles.multipage.MultiPageLayout#elementFactory}), a new instance is created and set by method {@link yfiles.multipage.MultiPageLayout#createElementFactory} + * during the first layout run. + *

+ * @see yfiles.multipage.MultiPageLayout#createElementFactory + * @see yfiles.multipage.IElementFactory + * @type {yfiles.multipage.IElementFactory} + */ + elementFactory:yfiles.multipage.IElementFactory; + /** + * Gets or sets the {@link yfiles.multipage.ILayoutCallback callback} that is notified upon completion of multi-page layout calculation runs. + * @see yfiles.multipage.ILayoutCallback + * @type {yfiles.multipage.ILayoutCallback} + */ + layoutCallback:yfiles.multipage.ILayoutCallback; + /** + * Gets or sets the bit mask for defining 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}). + *

+ * @see yfiles.multipage.NodeType#CONNECTOR + * @type {yfiles.multipage.EdgeBundleModes} + */ + edgeBundleModeMask:yfiles.multipage.EdgeBundleModes; + /** + * Gets or sets how to handle special nodes (like connector and proxy nodes) with respect to groups. + * @throws {Stubs.Exceptions.ArgumentError} if the specified group mode is unknown + * @see yfiles.multipage.NodeType#CONNECTOR + * @see yfiles.multipage.NodeType#PROXY + * @type {yfiles.multipage.GroupingMode} + */ + groupingMode:yfiles.multipage.GroupingMode; + /** + * Gets or sets the preferred time limit (in milliseconds) for the layout algorithm. + *

+ * The specified value has to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the preferred time limit is negative + * @type {number} + */ + maximumDuration:number; + /** + * Gets or sets the {@link yfiles.layout.ILayoutStage} that places the labels of the input graph. + * @see yfiles.multipage.MultiPageLayout#labelingEnabled + * @see yfiles.labeling.GenericLabeling + * @type {yfiles.layout.ILayoutStage} + */ + labeling:yfiles.layout.ILayoutStage; + /** + * Gets or sets the maximum size of a single page. + *

+ * The layout algorithm subdivides the input graph such that each part is placed on a different page that fits the + * specified maximum size. + *

+ *

+ * Both the specified width and height have to be positive. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified width or height is not positive + * @see yfiles.multipage.MultiPageLayout#maximumDuration + * @type {yfiles.algorithms.YDimension} + */ + maximumPageSize:yfiles.algorithms.YDimension; + static $class:yfiles.lang.Class; + } + /** + * This class represents the result of a layout run of {@link yfiles.multipage.MultiPageLayout}. + *

+ * A layout run 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.MultiPageLayout#maximumPageSize specified maximum page size}. This class provides access to the different page graphs (see + * method {@link yfiles.multipage.MultiPageLayoutResult#getPage}). + *

+ *

+ * An instance of this class can be either obtained by calling {@link yfiles.multipage.MultiPageLayout#calculateLayout} or + * {@link yfiles.multipage.MultiPageLayout#applyLayout}. In the latter case, a {@link yfiles.multipage.ILayoutCallback} has to be {@link yfiles.multipage.MultiPageLayout#layoutCallback set} + * before starting the layout run. + *

+ * @class yfiles.multipage.MultiPageLayoutResult + * @implements {yfiles.multipage.IElementInfoManager} + */ + export interface MultiPageLayoutResult extends Object,yfiles.multipage.IElementInfoManager{} + export class MultiPageLayoutResult { + /** + * + * @param {yfiles.algorithms.Edge} edge + * @returns {yfiles.multipage.IEdgeInfo} + */ + getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; + /** + * + * @param {yfiles.layout.IEdgeLabelLayout} edgeLabelLayout + * @returns {yfiles.multipage.IEdgeLabelInfo} + */ + getEdgeLabelInfo(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; + /** + * + * @param {yfiles.algorithms.Node} node + * @returns {yfiles.multipage.INodeInfo} + */ + getNodeInfo(node:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; + /** + * + * @param {yfiles.layout.INodeLabelLayout} nodeLabelLayout + * @returns {yfiles.multipage.INodeLabelInfo} + */ + getNodeLabelInfo(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; + /** + * Returns the page graph associated with the given page number. + *

+ * A page graph is a subgraph of the input graph whose layout fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. + *

+ * @param {number} pageNo the given page number + * @returns {yfiles.layout.LayoutGraph} the page graph associated with the given page number + * @throws {Stubs.Exceptions.IndexOutOfRangeError} if pageNo >= pageCount or pageNo < 0 + * @see yfiles.multipage.MultiPageLayoutResult#pageCount + */ + getPage(pageNo:number):yfiles.layout.LayoutGraph; + /** + * Returns the number of pages available in this {@link yfiles.multipage.MultiPageLayoutResult}. + *

+ * Each page contains a {@link yfiles.multipage.MultiPageLayoutResult#getPage page graph} whose layout fits the {@link yfiles.multipage.MultiPageLayout#maximumPageSize specified maximum page size}. + *

+ * @returns {number} the number of available pages + * @see yfiles.multipage.MultiPageLayoutResult#getPage + */ + pageCount():number; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.multipage.MultiPageLayout}. + * @class yfiles.multipage.MultiPageLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface MultiPageLayoutData extends yfiles.layout.LayoutData{} + export class MultiPageLayoutData { + constructor(); + /** + * Gets or sets the mapping from nodes to their unique IDs. + * @see yfiles.multipage.MultiPageLayout#NODE_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to their unique IDs. + * @see yfiles.multipage.MultiPageLayout#EDGE_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from node labels to their unique IDs. + * @see yfiles.multipage.MultiPageLayout#NODE_LABEL_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeLabelIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edge labels to their unique IDs. + * @see yfiles.multipage.MultiPageLayout#EDGE_LABEL_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeLabelIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their cluster id. + *

+ * Nodes with the same cluster id should preferably be placed on the same page. + *

+ * @see yfiles.multipage.MultiPageLayout#NODE_CLUSTER_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeClusterIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from edges to their type. + *

+ * Multi-edges (edges with same endpoints) of different kind are distinguished if {@link yfiles.multipage.MultiPageLayout#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleModes#DISTINGUISH_TYPES} + * == 1. + *

+ * @see yfiles.multipage.MultiPageLayout#EDGE_TYPE_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeTypes:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + }export namespace circular{ + /** + * This layout algorithm arranges graphs in a circular fashion. + *

+ * Layout Style The nodes are arranged in circles and stars which emphasize group and tree structures inside a graph. Circular layout + * algorithms find applications in many areas such as social networking, network management, WWW visualization, eCommerce, + * telecommunications. {@graph {"ann": {"s": [30,30], "d": 0, "c": 1},"n": [[558.09,362.1], [95.35,12.18], [0,148.17], [441.83,243.3], [540.68,299.26], [142.21,0], [298.88,449.09], [347.79,497.99], [232.08,466.99], [143.67,101.87], [100.64,154.2], [137.11,211.3], [206.74,126.62], [202.69,194.26], [263.08,582.7], [329.89,564.8], [214.18,533.79], [453.2,487.29], [528.46,21.5], [587.42,54.88], [478.49,67.27], [573.89,121.27], [506.57,128.93], [603.52,281.85], [620.93,344.69], [285.81,262.6], [259.33,689.12], [213.12,676.73], [311.63,331.4], [358.3,274.64]], "e": [[4,0], [4,3], [6,7], [6,8], [8,7], [1,9], [9,5], [9,10], [10,2], [10,11], [12,9], [11,13], [13,12], [15,14], [15,7], [14,16], [16,8], [16,7], [7,17], [18,19], [20,18], [19,21], [21,20], [20,22], [22,21], [22,3], [4,23], [0,24], [24,23], [25,13], [14,26], [14,27], [25,28], [28,6], [28,29], [29,25], [29,3]], "vp": [0.0,0.0,651.0,720.0]}} Circular layout with default settings {@graph {"ann": {"s": [30,30], "d": 0, "c" : 1},"n": [[452.67,672.8], [684.06,272.02], [661.72,203.26], [518.72,643.4], [29.9,484.57], [238.95,672.8], [661.72,484.57], [238.95,15.03], [0,343.92], [309.66,0], [114.42,600.9], [29.9,203.26], [452.67,15.03], [7.56,415.81], [114.42,86.93], [309.66,687.83], [381.96,0], [625.58,140.65], [172.91,643.4], [577.2,86.93], [381.96,687.83], [691.62,343.92], [7.56,272.02], [577.2,600.9], [625.58,547.18], [66.04,140.65], [684.06,415.81], [66.04,547.18], [518.72,44.44], [172.91,44.44]], "e": [[1,0], [1,2], [3,0], [1,5], [5,4], [4,6], [8,4], [9,7], [1,12], [13,4], [4,15], [5,15], [10,18], [18,7], [18,5], [18,1], [17,19], [19,2], [15,20], [20,0], [4,21], [8,21], [21,6], [11,22], [22,8], [20,23], [23,3], [23,13], [23,4], [23,24], [6,24], [14,25], [25,11], [25,22], [22,26], [2,26], [17,26], [26,24], [26,21], [1,27], [27,10], [27,18], [12,28], [28,2], [28,19], [7,29], [12,29], [29,14], [29,16], [29,18]], "vp": [0.0,0.0,722.0,718.0]}} Circular layout with {@link yfiles.circular.LayoutStyle#SINGLE_CYCLE} + * layout style ConceptThe layout algorithm performs three steps when calculating a circular arrangement for a graph: + *

+ *
    + *
  1. + * It searches for partitions in the input graph depending on connectivity and on the given + * {@link yfiles.circular.CircularLayout#layoutStyle layout style}. Considering each partition as a node, the resulting graph has a tree-like structure. + *
  2. + *
  3. The partitions are laid out as circles using the selected {@link yfiles.circular.CircularLayout#partitionStyle partition style}.
  4. + *
  5. + * The algorithm delegates the layout calculation for the underlying tree (in which each node corresponds to a partition) + * to a specialized layout algorithm accessible by {@link yfiles.circular.CircularLayout#singleCycleLayout} or {@link yfiles.circular.CircularLayout#balloonLayout}. The partitions are moved to their final location. + *
  6. + *
+ *

+ * Features + *

+ *

+ * The layout algorithm places the nodes in circles that represent a partition. There are several ways to find partitions + * in the input graph. Which one is applied is defined using {@link yfiles.circular.CircularLayout#layoutStyle}. + *

+ *

+ * The nodes in a partition can either lie on or in the interior of a circle. The placement of the nodes affects the + * compactness of the layout and can be specified using {@link yfiles.circular.CircularLayout#partitionStyle}. + *

+ *

+ * Since edges are routed as straight lines, they may overlap with nodes or node labels. To resolve these overlaps, an edge + * routing algorithm (e.g. {@link yfiles.router.EdgeRouter} or {@link yfiles.router.OrganicEdgeRouter}) can be appended. + *

+ *

+ * This layout algorithm supports {@link yfiles.circular.CircularLayout#edgeBundling edge bundling}. In order to bundle the edges, the nodes of the graph are clustered in + * groups. Edge bundling is supported only if {@link yfiles.circular.CircularLayout#partitionStyle partition layout style} is set to {@link yfiles.circular.PartitionStyle#CYCLE} and {@link yfiles.circular.CircularLayout#layoutStyle layout style} + * is other than {@link yfiles.circular.LayoutStyle#BCC_ISOLATED}. + *

+ * @class yfiles.circular.CircularLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface CircularLayout extends yfiles.layout.MultiStageLayout{} + export class CircularLayout { + /** + * Creates a new {@link yfiles.circular.CircularLayout} instance with the default settings. + * @constructor + */ + constructor(); + /** + * Data acceptor key for publishing the final circle information + *

+ * For each node, the ID of the circle on which it was placed will be stored. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static CIRCLE_ID_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Data provider key for defining custom node partitions + *

+ * The {@link yfiles.algorithms.IDataProvider} needs to provide a mapping from {@link yfiles.algorithms.Node}s to unique {@link Object} IDs for each + * group of nodes. These groups will form the circles in the layout. + *

+ * @see yfiles.circular.LayoutStyle#CUSTOM_GROUPS + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static CUSTOM_GROUPS_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets whether or not the layout algorithm reserves space for node labels preventing possible overlaps. + *

+ * Nodes get temporarily enlarged such that they contain their labels. + *

+ *

+ * This might result in layouts that need much space. + *

+ * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets whether or not, in the underlying tree, the children of a tree node are placed on a common radius. + *

+ * Disabling this feature may produce more compact layout results. + *

+ * @type {boolean} + */ + placeChildrenOnCommonRadius:boolean; + /** + * Gets or sets 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 layout algorithm 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 layout algorithm tries to keep their circular order around + * this node. This only works as expected for {@link yfiles.circular.LayoutStyle#BCC_COMPACT} as layout style, since otherwise the + * underlying tree structure is not well defined. + *
  • + *
+ * @type {boolean} + */ + fromSketchMode:boolean; + /** + * Gets or sets the maximum deviation angle allowed for an edge. + *

+ * The deviation angle for an edge is the difference between its optimal angle away from the parent cycle and its actual + * angle. + *

+ * @type {number} + */ + maximumDeviationAngle:number; + /** + * Gets or sets the global layout style for this layout algorithm. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown layout style is set + * @type {yfiles.circular.LayoutStyle} + */ + layoutStyle:yfiles.circular.LayoutStyle; + /** + * Gets the {@link yfiles.circular.SingleCycleLayout} instance used for laying out nodes on a single cycle. + *

+ * Configuring this layout algorithm only affects layouts with only one partition. + *

+ * @see yfiles.circular.CircularLayout#layoutStyle + * @type {yfiles.circular.SingleCycleLayout} + */ + singleCycleLayout:yfiles.circular.SingleCycleLayout; + /** + * Gets the {@link yfiles.tree.BalloonLayout} instance used for arranging multiple partitions. + *

+ * Configuring this layout algorithm affects the arrangement of the partitions within the overall layout. + *

+ * @see yfiles.circular.CircularLayout#layoutStyle + * @type {yfiles.tree.BalloonLayout} + */ + balloonLayout:yfiles.tree.BalloonLayout; + /** + * Gets or sets the style for the arrangement of each partition. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown style is given + * @type {yfiles.circular.PartitionStyle} + */ + partitionStyle:yfiles.circular.PartitionStyle; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @see yfiles.layout.MultiStageLayout#hideGroupsStage + * @see yfiles.layout.HideGroupsStage + * @type {boolean} + */ + hideGroupsStageEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + /** + * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. + *

+ * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be + * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered + * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. + *

+ * @type {yfiles.layout.EdgeBundling} + */ + edgeBundling:yfiles.layout.EdgeBundling; + static $class:yfiles.lang.Class; + } + export enum LayoutStyle{ + /** + * The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as + * separate partitions. + *

+ * If a node belongs to more than one biconnected component, it will be assigned to the one that seems to be more + * suitable. + *

+ * @see yfiles.circular.CircularLayout#layoutStyle + */ + BCC_COMPACT, + /** + * The specifier for a layout style where the nodes within a biconnected component of the input graph are treated as + * separate partitions. + *

+ * If a node belongs to more than one biconnected component, it will form an isolated partition and will be laid out in + * between of all its biconnected component cycles. + *

+ * @see yfiles.circular.CircularLayout#layoutStyle + */ + BCC_ISOLATED, + /** + * The specifier for a layout style where the user can specify groups that will form separate partitions. To define the + * groups, a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.circular.CircularLayout#CUSTOM_GROUPS_DP_KEY} must be + * registered. + * @see yfiles.circular.CircularLayout#layoutStyle + */ + CUSTOM_GROUPS, + /** + * The specifier for a layout style where all nodes of the input graph will be placed on or in the interior of a single + * cycle. + * @see yfiles.circular.CircularLayout#layoutStyle + */ + SINGLE_CYCLE + } + export enum PartitionStyle{ + /** + * Specifier for a partition layout style where all nodes of a partition are placed on the boundary of a circle. + * @see yfiles.circular.CircularLayout#partitionStyle + */ + CYCLE, + /** + * Specifier for a partition style with a semi-compact layout for each partition. + *

+ * This style places nodes in the interior and on the border of a circle and arranges them in an organic manner, leading to + * a more compact layout. Only nodes with connections to other partitions are guaranteed to lie on the boundary of the + * resulting disk. + *

+ * @see yfiles.circular.CircularLayout#partitionStyle + */ + DISK, + /** + * Specifier for a partition style with a compact layout for each partition. + *

+ * This style creates an organic circular layout for each partition. Even nodes that connect to different partitions may be + * placed in the interior of the resulting disk. + *

+ * @see yfiles.circular.CircularLayout#partitionStyle + */ + ORGANIC + } + /** + * This layout algorithm places all nodes of a graph on a single cycle. + *

+ * Layout Style + *

+ *

+ * All nodes of a graph are placed on one common circle, generating circular layouts. The edges are drawn as simple, straight lines. The + * resulting layouts look like a ring. Edges connecting nodes which are not next to each other on the ring are routed inside of the + * circle. If a graph contains many edges, the number of edge crossings inside the circle may be quite high. + *

+ *

+ * Single-cycle circular layouts are suitable for the visualization of networks such as ring networks or smaller social + * networks. They are also useful to layout cyclic subgraphs of a larger graph. + *

+ *

+ * {@graph {"ann":{"s":[40,40],"d":1,"c":1},"n":[[39.45,439.2],[459.2,19.45],[336.26,-5],[39.45,193.32],[109.09,543.42],[563.42,89.09],[633.06,193.32],[15,316.26],[213.32,613.06],[563.42,543.42],[336.26,637.52],[459.2,613.06],[633.06,439.2],[657.52,316.26],[213.32,19.45],[109.09,89.09]],"e":[[2,1,0,-4.59,0,-4.59],[4,0,-6.01,0,-6.01,0],[0,4,4.16,-2.78,4.16,-2.78],[1,5],[5,6],[1,2,-0.88,4.41,-0.88,4.41],[11,9],[10,11],[9,12,-4.16,-2.78,-4.16,-2.78],[13,12],[12,9,6.01,0,6.01,0],[14,15],[15,13,0,-4.87,0,-4.87],[7,12,0.88,-4.41,0.88,-4.41],[6,8],[8,14,-5,0,-5,0],[14,8,5,0,5,0],[7,3],[3,15,-4.16,-2.78,-4.16,-2.78],[15,3,6.01,0,6.01,0],[12,7,0,4.59,0,4.59],[0,7],[10,8],[6,13],[4,8]],"vp":[15.0,-5.0,683.0,683.0]}} An example of a single cycle layoutConceptFirst, the nodes are sorted by applying either a custom or some default + * {@link yfiles.algorithms.INodeSequencer}. Then, all nodes are placed on a circle with an appropriate radius according to the + * calculated order. Features + *

+ *

+ * The order in which the nodes are placed on the circle is a crucial aspect of this algorithm. By specifying a {@link yfiles.algorithms.INodeSequencer} + * instance via {@link yfiles.circular.SingleCycleLayout#nodeSequencer}, the order can be customized. + *

+ *

+ * There are two options to determine the radius of the circle on which nodes are placed: + *

+ *
    + *
  1. The radius can be determined automatically. A specified {@link yfiles.circular.SingleCycleLayout#minimumRadius minimum radius} will be obeyed when choosing the radius.
  2. + *
  3. The radius can be chosen manually. To do so, disable the {@link yfiles.circular.SingleCycleLayout#automaticRadius automatic radius selection} and specify the custom radius via {@link yfiles.circular.SingleCycleLayout#fixedRadius}.
  4. + *
+ * @class yfiles.circular.SingleCycleLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface SingleCycleLayout extends yfiles.layout.MultiStageLayout{} + export class SingleCycleLayout { + /** + * Creates a new {@link yfiles.circular.SingleCycleLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the angle that describes the location on the circle of the first node. + *

+ * The angle is measured in radians and world coordinates, e.g., 0 means east, Pi/2 means south. + *

+ * @type {number} + */ + initialAngle:number; + /** + * Gets or sets whether or not to consider the coordinates of the input diagram when arranging the graph. + *

+ * If this feature is enabled, the original circular order of peripheral nodes around an estimated circle center will be + * preserved. + *

+ * @type {boolean} + */ + fromSketchModeEnabled:boolean; + /** + * Gets or sets the minimum distance between nodes that are next to each other on the circle. + * @throws {Stubs.Exceptions.ArgumentError} if the given distance is negative + * @type {number} + */ + minimumNodeDistance:number; + /** + * Gets or sets a fixed radius for the circle on which the nodes will be placed. + * @throws {Stubs.Exceptions.ArgumentError} if the given radius is negative + * @see yfiles.circular.SingleCycleLayout#minimumRadius + * @see yfiles.circular.SingleCycleLayout#automaticRadius + * @type {number} + */ + fixedRadius:number; + /** + * Gets or sets the minimum radius for the circle on which the nodes are placed. + * @throws {Stubs.Exceptions.ArgumentError} if the given minimum radius is negative + * @see yfiles.circular.SingleCycleLayout#fixedRadius + * @see yfiles.circular.SingleCycleLayout#automaticRadius + * @type {number} + */ + minimumRadius:number; + /** + * Gets or sets whether or not the radius of the circle should be determined automatically. + *

+ * If enabled, the radius will be chosen such that the distance between nodes which are next to each other on the circle is + * approximately the same as the {@link yfiles.circular.SingleCycleLayout#minimumNodeDistance minimum node distance}. + *

+ *

+ * If this feature is disabled, the radius specified via {@link yfiles.circular.SingleCycleLayout#fixedRadius} will be applied. + *

+ * @see yfiles.circular.SingleCycleLayout#minimumRadius + * @see yfiles.circular.SingleCycleLayout#fixedRadius + * @type {boolean} + */ + automaticRadius:boolean; + /** + * Gets or sets the {@link yfiles.algorithms.INodeSequencer} that will be used for determining the order of the nodes for the + * circle placement. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.algorithms.INodeSequencer} is null + * @type {yfiles.algorithms.INodeSequencer} + */ + nodeSequencer:yfiles.algorithms.INodeSequencer; + /** + * Gets the radius that was applied to the last layout calculated by this algorithm. + *

+ * This method is useful if one wants to know the actual radius of a layout calculated by this algorithm. + *

+ * @type {number} + */ + lastAppliedRadius:number; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.circular.CircularLayout}. + * @class yfiles.circular.CircularLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface CircularLayoutData extends yfiles.layout.LayoutData{} + export class CircularLayoutData { + constructor(); + /** + * Gets or sets the mapper from nodes to their circle id. + *

+ * If this property is set, the mapper is filled by the layout with the circle information. + *

+ * @see yfiles.circular.CircularLayout#CIRCLE_ID_DP_KEY + * @type {yfiles.collections.IMapper.} + */ + circleIds:yfiles.collections.IMapper; + /** + * Gets or sets the mapping from nodes to their custom group object. + *

+ * The custom groups are only considered if {@link yfiles.circular.CircularLayout#layoutStyle} is set to {@link yfiles.circular.LayoutStyle#CUSTOM_GROUPS} + *

+ * @see yfiles.circular.CircularLayout#CUSTOM_GROUPS_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + customGroups:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. + *

+ * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the + * source and target point, the edges are again clearly split. + *

+ *

+ * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. + *

+ * @see yfiles.layout.EdgeBundleDescriptor + * @see yfiles.circular.CircularLayout#edgeBundling + * @type {yfiles.layout.ItemMapping.} + */ + edgeBundleDescriptors:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace orthogonal{ + /** + * This class provides layout information for the edges of the graph. + *

+ * {@link yfiles.orthogonal.EdgeLayoutDescriptor} is used by {@link yfiles.orthogonal.OrthogonalLayout} to determine the routing details + * for the edges (e.g. the segment length). + *

+ *

+ * An {@link yfiles.orthogonal.EdgeLayoutDescriptor} can be specified individually for each edge by using a {@link yfiles.algorithms.IDataProvider} + * which maps from an {@link yfiles.algorithms.Edge} to an {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance. The {@link yfiles.algorithms.IDataProvider} + * is registered with the graph with key {@link yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @class yfiles.orthogonal.EdgeLayoutDescriptor + */ + export interface EdgeLayoutDescriptor extends Object{} + export class EdgeLayoutDescriptor { + /** + * Creates a new instance of {@link yfiles.orthogonal.EdgeLayoutDescriptor} with the default settings. + * @constructor + */ + constructor(); + /** + * Creates a copy of this {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance. + * @returns {yfiles.orthogonal.EdgeLayoutDescriptor} a copy of this {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance + */ + createCopy():yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * Gets or sets the minimum length of the first segment of the edge path (at the source node). + *

+ * The minimum length must be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the first segment is negative + * @type {number} + */ + minimumFirstSegmentLength:number; + /** + * Gets or sets the minimum length of the last segment of the edge path (at the target node). + *

+ * The minimum length must be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length of the last segment is negative + * @type {number} + */ + minimumLastSegmentLength:number; + /** + * Gets or sets the minimum segment length of an edge. + *

+ * The minimum length must be greater than or equal to 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the minimum length is negative + * @type {number} + */ + minimumSegmentLength:number; + static $class:yfiles.lang.Class; + } + export enum LayoutStyle{ + /** + * A layout style that produces orthogonal edges while maintaining the original node size. + * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + NORMAL, + /** + * A layout style that produces orthogonal edges and nodes of uniform size. + *

+ * Before calculating the layout, all nodes will be assigned equal sizes. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + UNIFORM, + /** + * A layout style that modifies the size of nodes to minimize the overall number of bends. + *

+ * The layout algorithm will enlarge nodes based on the number and position of their neighbors in order to minimize the + * number of required bends. The segments of all edges are either horizontal or vertical. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + BOX, + /** + * A layout style that produces non-orthogonal edges and resizes the nodes to a small uniform size. + *

+ * This layout style resembles {@link yfiles.orthogonal.LayoutStyle#BOX}, but it resizes all nodes to equal size. + *

+ *

+ * It introduces additional bends into some edges and routes the last edge segment of these edges non-orthogonally to their + * adjacent nodes. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + MIXED, + /** + * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#NORMAL} that is best-suited for tree-like structures. + *

+ * Larger subtrees are processed using a specialized tree layout algorithm which arranges all directed subtree structures + * in an optimized way. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + NORMAL_TREE, + /** + * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#MIXED} that maintains the original node size. + *

+ * This style introduces additional bends into some edges and routes the last edge segment of these edges non-orthogonally + * to their adjacent nodes. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + FIXED_MIXED, + /** + * A layout style similar to {@link yfiles.orthogonal.LayoutStyle#BOX} that maintains the original node size. + *

+ * Nodes will be placed at the same positions as with + * {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED}, but edges will be routed strictly orthogonally. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + */ + FIXED_BOX + } + /** + * This layout algorithm arranges graphs in an orthogonal fashion. + *

+ * Layout Style + *

+ *

+ * This layout algorithm arranges the nodes of a given graph such that each edge is drawn as an alternating sequence of + * horizontal and vertical segments. + *

+ *

+ * It produces compact drawings with no overlapping nodes, few crossings and few bends and is well suited for small and + * medium-sized sparse graphs. + *

+ *

+ * Orthogonal drawings are common in engineering applications since they are able to provide clear representations of + * complex networks that can also be optimal with respect to diverse objective functions such as bend minimization or area + * minimization. Application domains of orthogonal drawings include software engineering, database schema representation, + * system management, knowledge representation, VLSI circuits and floor planning applications. + *

+ *

+ * {@graph {"ann": {"s": [30,30], "d": 0},"n": [[135,160], [210,385], [210,60], [285,160], [360,60], [435,285], [60,110], [135,385], [60,435], [210,160], [-15,110], [285,335], [360,235], [360,160], [435,385]], "e": [[3,4,0,-15,-15,10,[300,85]], [0,4,0,-15,0,-15,[150,25,375,25]], [2,4,15,0,-15,0], [3,5,5,15,-15,0,[305,300]], [4,5,15,0,0,-15,[450,75]], [0,6,-15,0,10,15,[85,175]], [5,6,15,0,0,-15,[500,300,500,0,75,0]], [7,1,15,0,-15,0], [7,0,0,-15,0,15], [1,8,0,15,15,0,[225,450]], [8,6,0,-15,0,15], [0,9,15,0,-15,0], [9,6,-10,-15,15,0,[215,125]], [9,3,15,0,-15,0], [9,2,0,-15,0,15], [9,1,0,15,0,-15], [10,8,0,15,-15,0,[0,450]], [10,6,15,0,-15,0], [3,11,0,15,0,-15], [11,1,0,15,15,-10,[300,390]], [12,5,15,0,-10,-15,[440,250]], [12,3,-15,0,10,15,[310,250]], [4,13,0,15,0,-15], [13,12,0,15,0,-15], [13,3,-15,0,15,0], [14,5,0,-15,0,15], [14,1,-15,0,15,0]], "vp": [-15.0,0.0,515.0,465.0]}} Orthogonal layout with default settings + *

+ *

+ * This algorithm also optionally supports {@link yfiles.orthogonal.OrthogonalLayout#DIRECTED_EDGE_DP_KEY directed edge drawings} (although not in combination with hierarchically nested + * graphs or the non-default + * {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle layout styles}). Application domains of directed orthogonal drawings include, for example, software engineering, database + * schema and system management. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[165,-15],[205,305],[45,345],[45,65],[205,145],[105,105],[45,405],[-15,405],[285,-15],[205,225],[125,185]],"e":[[5,0,15,-0,-5,15,[175,120]],[5,4,0,15,-15,-0,[120,160]],[5,2,-15,-0,10,-15,[70,120]],[6,4,15,-0,15,-0,[280,420,280,160]],[6,2,0,-15,0,15],[6,7,-15,-0,15,-0],[7,3,0,-15,-15,-0,[0,80]],[8,0,-15,-0,15,-0],[8,7,0,15,0,15,[300,460,0,460]],[2,9,15,-0,15,-0,[260,360,260,240]],[4,10,-10,15,15,-0,[210,200]],[10,1,0,15,-15,-0,[140,320]],[0,1,0,15,-10,-15,1,[180,280,210,280]],[0,3,-10,15,0,-15,1,[170,40,60,40]],[3,2,0,15,0,-15,1],[0,4,10,15,0,-15,1,[190,120,220,120]],[4,9,0,15,0,-15,1],[9,1,0,15,0,-15,1]],"vp":[-15.0,-15.0,330.0,475.0]}} Sample output of {@link yfiles.orthogonal.OrthogonalLayout} with default settings. Marked edges are considered as directed and + * the layout orientation is top-to-bottom. {@graph {"ann":{"s":[30,30],"d":1},"n":[[85,45],[265,105],[185,-15],[-15,165],[485,165],[265,225],[365,165],[85,225]],"e":[[0,1,15,-0,-15,-0,[160,60,160,120]],[0,2,15,-0,-15,-0,[160,60,160,0]],[2,1,15,10,-15,-10,[240,10,240,110]],[3,0,15,-0,-15,-0,[60,180,60,60]],[2,4,15,-0,-15,-0,[440,0,440,180]],[5,4,15,10,-15,-0,[340,250,340,280,440,280,440,180]],[1,6,15,-0,-15,-0,[320,120,320,180]],[5,6,15,-0,-15,-0,[320,240,320,180]],[6,4,15,-0,-15,-0],[3,7,15,-0,-15,-0,[60,180,60,240]],[7,5,15,-0,-15,-0]],"vp":[-15.0,-15.0,530.0,295.0]}} Sample output of {@link yfiles.orthogonal.OrthogonalLayout} with edge grouping. All + * edges are considered directed and the layout orientation is left-to-right. + *

+ *

+ * Also this algorithm supports hierarchically nested graphs (although not in combination with the directed edge drawings, + * the {@link yfiles.orthogonal.OrthogonalLayout#fromSketchMode from sketch} option, or the non-default {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle layout styles}) feature: + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0},"n":[[165,585],[0,220,240,340,2,[[0,242.38,240,22.38,"Group 2"]]],[165,385],[165,485],[45,485],[45,385],[105,385],[260,200,200,260,2,[[260,222.38,200,22.38,"Group 3"]]],[305,325],[305,265],[365,325],[305,385],[0,0,240,200,2,[[0,22.38,240,22.38,"Group 1"]]],[165,125],[105,125],[45,125],[45,65],[165,65],[265,485]],"e":[[3,2,0,-15,0,15],[3,0,0,15,0,-15],[4,3,15,0,-15,0],[5,4,0,15,0,-15],[2,6,-15,0,15,0],[6,5,-15,0,15,0],[8,9,0,-15,0,15],[2,9,0,-15,-15,0,[180,280]],[8,10,15,0,-15,0],[10,9,0,-15,15,10,[380,290]],[9,11,15,0,15,0,[420,280,420,400]],[8,11,0,15,0,-15],[2,11,15,0,-15,0],[11,10,15,-10,0,15,[380,390]],[6,14,0,-15,0,15],[14,13,15,0,-15,0],[5,15,0,-15,0,15],[15,14,15,0,-15,0],[16,15,0,15,0,-15],[13,17,0,-15,0,15],[17,16,-15,0,15,0],[3,18,15,0,-15,0]],"vp":[0.0,0.0,460.0,615.0]}} Orthogonal layout of a grouped graph with default settings {@graph {"ann":{"s":[30,30],"d":1},"n":[[-15,-17.38,670,794.75,2,[[-15,5,670,22.38,"Group 6"]]],[0,20,620,680,2,[[0,42.38,620,22.38,"Group 5"]]],[40,460,240,200,2,[[40,482.38,240,22.38,"Group 2"]]],[205,585,[[214.66,609.35,10.67,18.7,"9"]]],[205,525,[[211.33,549.35,17.35,18.7,"10"]]],[85,525,[[91.33,549.35,17.35,18.7,"11"]]],[85,585,[[91.33,609.35,17.35,18.7,"10"]]],[120,80,460,360,2,[[120,102.38,460,22.38,"Group 4"]]],[160,140,180,260,2,[[160,162.38,180,22.38,"Group 1"]]],[265,325,[[274.66,349.35,10.67,18.7,"1"]]],[205,325,[[214.66,349.35,10.67,18.7,"2"]]],[205,205,[[214.66,229.35,10.67,18.7,"3"]]],[265,205,[[274.66,229.35,10.67,18.7,"4"]]],[265,265,[[274.66,289.35,10.67,18.7,"5"]]],[360,160,180,240,2,[[360,182.38,180,22.38,"Group 3"]]],[405,325,[[411.33,349.35,17.35,18.7,"12"]]],[405,265,[[411.33,289.35,17.35,18.7,"13"]]],[465,265,[[471.33,289.35,17.35,18.7,"14"]]],[85,725,[[91.33,749.35,17.35,18.7,"19"]]],[205,725,[[211.33,749.35,17.35,18.7,"18"]]]],"e":[[4,3,0,15,0,-15],[4,5,-15,0,15,0],[3,6,-15,0,15,0],[6,5,0,-15,0,15],[9,10,-15,0,15,0],[10,5,-15,0,0,-15,[100,340]],[10,4,0,15,0,-15],[10,11,0,-15,0,15],[11,12,15,0,-15,0],[12,13,0,15,0,-15],[13,9,0,15,0,-15],[15,16,0,-15,0,15],[16,13,-15,0,15,0],[16,12,0,-15,15,0,[420,220]],[16,17,15,0,-15,0],[6,18,0,15,0,-15],[3,19,0,15,0,-15]],"vp":[-15.0,-18.0,670.0,796.0]}} Orthogonal layout of a graph with nested + * groupsConceptThe orthogonal layout algorithm is based on the topology-shape-metrics approach and runs in three phases: + *

+ *
    + *
  • Planarization � A planar embedding is computed.
  • + *
  • Orthogonalization � The bends and the angles are computed.
  • + *
  • Compaction � The coordinates for the nodes and edges are determined.
  • + *
+ *

+ * Features + *

+ *

+ * There exist several different layout styles that the orthogonal layout algorithm supports depending on whether or not + * the edges should be routed completely orthogonal, or whether or not the original size of the nodes should be maintained. + * Such layout styles are {@link yfiles.orthogonal.LayoutStyle#NORMAL}, {@link yfiles.orthogonal.LayoutStyle#UNIFORM}, + * {@link yfiles.orthogonal.LayoutStyle#BOX}, {@link yfiles.orthogonal.LayoutStyle#NORMAL_TREE}, {@link yfiles.orthogonal.LayoutStyle#MIXED}, + * {@link yfiles.orthogonal.LayoutStyle#FIXED_BOX}, {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED} and can be applied using {@link yfiles.orthogonal.OrthogonalLayout#layoutStyle}. + *

+ *

+ * {@link yfiles.orthogonal.OrthogonalLayout} is able to consider edge label data when arranging a graph. This means that the + * layout algorithm will determine the positions of the nodes and edges such that the edge labels do not overlap with the + * rest of the layout. Integrated edge labeling can be activated using method {@link yfiles.orthogonal.OrthogonalLayout#integratedEdgeLabeling}. + *

+ *

+ * {@link yfiles.orthogonal.EdgeLayoutDescriptor} instances can be used for specifying individual information (e.g. distances) for + * each edge in the graph. The descriptors are bound to the graph using {@link yfiles.algorithms.IDataProvider}s registered with + * key {@link yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If there is no descriptor assigned to some edges, + * a default descriptor will be used. To set default descriptors, use {@link yfiles.orthogonal.OrthogonalLayout#edgeLayoutDescriptor}. + *

+ *

+ * {@link yfiles.orthogonal.OrthogonalLayout} tries to optimize diverse objective functions such as bend minimization, number of + * edge crossings, edge length minimization or face maximization. These settings can be enabled using the corresponding + * methods {@link yfiles.orthogonal.OrthogonalLayout#optimizePerceivedBends}, {@link yfiles.orthogonal.OrthogonalLayout#crossingReduction}, {@link yfiles.orthogonal.OrthogonalLayout#edgeLengthReduction}, and + * {@link yfiles.orthogonal.OrthogonalLayout#faceMaximization}, respectively. The drawback when these settings are enabled is that the running time of the algorithm may be + * drastically increased. + *

+ * @class yfiles.orthogonal.OrthogonalLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface OrthogonalLayout extends yfiles.layout.MultiStageLayout{} + export class OrthogonalLayout { + /** + * Creates a new {@link yfiles.orthogonal.OrthogonalLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Returns a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance that will be used during the various phases of the layout + * algorithm to determine the drawing details of the edges of the graph. + *

+ * This method may be overridden to create a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance with different + * configuration settings. + *

+ * @returns {yfiles.orthogonal.EdgeLayoutDescriptor} a new {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance + * @protected + */ + createEdgeLayoutDescriptor():yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * Data provider key for providing layout information for each edge + *

+ * If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained using method + * {@link yfiles.orthogonal.OrthogonalLayout#createEdgeLayoutDescriptor}. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#layoutStyle + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Data provider key for marking edges which should be routed such that they point to the main layout orientation + *

+ * The main layout orientation can be set using method {@link yfiles.layout.MultiStageLayout#layoutOrientation}. + *

+ * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static DIRECTED_EDGE_DP_KEY:yfiles.algorithms.EdgeDpKey; + /** + * Gets or sets the {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance used for all those edges that do not have a specific + * layout descriptor assigned. + *

+ * By default, this method will return an {@link yfiles.orthogonal.EdgeLayoutDescriptor} instance created with + * {@link yfiles.orthogonal.OrthogonalLayout#createEdgeLayoutDescriptor}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.orthogonal.EdgeLayoutDescriptor} is null + * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.orthogonal.EdgeLayoutDescriptor} + */ + edgeLayoutDescriptor:yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * Gets or sets whether or not the layout algorithm considers node labels when calculating node positions to avoid + * overlaps. + *

+ * This method is a convenience method that assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} + * and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to true. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though this property was enabled + * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). + * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Gets or sets whether or not the layout algorithm preserves space and places edge labels. + *

+ * To define the desired placement for each label add a {@link yfiles.layout.PreferredPlacementDescriptor} on + * {@link yfiles.layout.IEdgeLabelLayout}. + *

+ *

+ * This method also assures that the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to + * true. + *

+ * @throws {Stubs.Exceptions.InvalidOperationError} if no properly configured {@link yfiles.layout.LabelLayoutTranslator} is registered even though integrated labeling was enabled + * earlier (can happen when manually specifying the {@link yfiles.layout.MultiStageLayout#labeling labeling algorithm}). + * @type {boolean} + */ + integratedEdgeLabeling:boolean; + /** + * Gets or sets whether or not a randomization strategy should be performed. + *

+ * The randomization will increase the overall layout quality with high probability. + *

+ * @type {boolean} + */ + randomization:boolean; + /** + * Gets or sets whether or not degree-one nodes that have the same neighbor should be aligned. + * @type {boolean} + */ + alignDegreeOneNodes:boolean; + /** + * Gets or sets whether or not one face of the embedding of the graph should be maximized. + *

+ * An embedding of a graph is uniquely specified by the cyclic order of edges incident to the same node in a graph + * drawing. + *

+ *

+ * In any planar drawing of a planar graph, the edges divide the plane into different regions called faces. If one of these + * faces (the outer face) gets maximized, all other faces will be more compact. + *

+ * @see yfiles.orthogonal.OrthogonalLayout#randomization + * @type {boolean} + */ + faceMaximization:boolean; + /** + * Gets or sets whether or not the number of edge crossings should be reduced. + *

+ * The layout algorithm will try to significantly reduce the number of crossings in a post-processing step. + *

+ * @type {boolean} + */ + crossingReduction:boolean; + /** + * Gets or sets whether or not the number of perceived bends should be minimized. + *

+ * A perceived bend is not an actual bend but it is created when a helical arrangement of chains of nodes occurs. + *

+ * @type {boolean} + */ + optimizePerceivedBends:boolean; + /** + * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. + *

+ * Each node will be placed on a grid point. Edges will be routed such that all segments but the first and last one lie on + * grid lines. (The first and last segments of an edge may or may not lie on grid lines.) Edges consisting of a single + * segment always lie on grid lines. + *

+ *

+ * The grid spacing has to be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the grid spacing is negative + * @type {number} + */ + gridSpacing:number; + /** + * Gets or sets the layout style for this layout algorithm. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown layout style is given + * @type {yfiles.orthogonal.LayoutStyle} + */ + layoutStyle:yfiles.orthogonal.LayoutStyle; + /** + * Gets or sets whether or not the overall edge length should be optimized. + *

+ * The algorithm will try to significantly reduce the length of some edges. + *

+ * @type {boolean} + */ + edgeLengthReduction:boolean; + /** + * Gets or sets whether or not the existing drawing should be used as a sketch of the resulting orthogonal layout. + *

+ * The layout algorithm will try to orthogonalize the given sketch without making too many modifications with respect to + * the original drawing. + *

+ * @type {boolean} + */ + fromSketchMode:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for hiding group nodes is activated. + * @see yfiles.layout.MultiStageLayout#hideGroupsStageEnabled + * @see yfiles.layout.MultiStageLayout#hideGroupsStage + * @see yfiles.layout.HideGroupsStage + * @type {boolean} + */ + hideGroupsStageEnabled:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm arranges a graph in a compact, orthogonal fashion. + *

+ * Layout Style + *

+ *

+ * This layout algorithm is a variant of {@link yfiles.orthogonal.OrthogonalLayout} that tries to arrange nodes in a more compact + * way. It allows to specify a desired aspect ratio for the bounds of the calculated layout. Nodes of a given graph are + * arranged such that each edge is drawn as an alternating sequence of horizontal and vertical segments. + *

+ *

+ * {@link yfiles.orthogonal.CompactOrthogonalLayout} is well suited for small and medium-sized sparse graphs and produces compact + * drawings with no overlapping nodes, few crossings and few bends. It is also especially suitable for printing the diagram + * on a paper of predefined size. As a disadvantage, this algorithm will usually produce less elegant edge routes than the + * ones of {@link yfiles.orthogonal.OrthogonalLayout}. + *

+ *

+ * Application domains of orthogonal drawings are software engineering, project management, function call graphs and + * object-oriented class diagrams. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":0},"n":[[165,65],[285,405],[285,125],[225,285],[25,285],[225,365],[105,365],[285,205],[105,285],[165,205],[165,-15],[365,205]],"e":[[0,2,15,0,-5,-15,[295,80]],[4,1,-5,15,-15,0,[35,420]],[5,3,0,-15,0,15],[5,6,-15,5,15,5],[6,4,-15,0,5,15,[45,380]],[1,7,0,-15,0,15],[3,7,5,-15,-15,5,[245,225]],[2,7,0,15,0,-15],[4,8,15,0,-15,0],[3,8,-15,0,15,0],[6,8,0,-15,0,15],[4,9,-0,-15,-15,-5,[40,215]],[0,9,-5,15,-5,-15],[3,9,-5,-15,5,15,[235,261,185,261]],[8,9,-0,-15,-15,5,[120,225]],[9,5,-5,15,-15,-5,[175,375]],[9,7,15,-5,-15,-5],[9,2,5,-15,-15,0,[185,140]],[0,10,0,-15,0,15],[4,10,-15,0,-15,0,[23,300,23,0]],[10,3,15,-5,15,0,[397,-5,397,300]],[10,2,15,5,5,-15,[305,5]],[2,11,15,0,0,-15,[380,140]],[11,5,0,15,15,0,[380,380]],[11,7,-15,0,15,0]],"vp":[23.0,-15.0,374.0,450.0]}} Sample output of the layout algorithm with aspect ratio 1.0Concept + *

+ *

+ * This algorithm is implemented as a {@link yfiles.layout.PartitionLayout} and applies the following steps: + *

+ *
    + *
  • Divides the graph into smaller partitions.
  • + *
  • Arranges the nodes of each graph partition using {@link yfiles.orthogonal.OrthogonalLayout}.
  • + *
  • Arranges the partitions themselves in a compact manner.
  • + *
  • Routes the edges between partitions (inter-edges) using an edge router.
  • + *
+ *

+ * Each of these steps can be individually configured and/or replaced. To do so, use methods {@link yfiles.layout.PartitionLayout#partitionFinder}, {@link yfiles.layout.LayoutStageBase#coreLayout}, {@link yfiles.layout.PartitionLayout#partitionPlacer} and {@link yfiles.layout.PartitionLayout#interEdgeRouter}, respectively. + *

+ *

+ * Features + *

+ *

+ * The aspect ratio of the resulting layout bounds, i.e., the ratio of width/height of the layout, can be configured using + * {@link yfiles.orthogonal.CompactOrthogonalLayout#aspectRatio}. {@link yfiles.orthogonal.CompactOrthogonalLayout} tries to reach this preferred value. However, depending on the actual graph + * structure, this may not always be possible. + *

+ *

+ * Octilinear routing of edges can be supported by appending {@link yfiles.router.PolylineLayoutStage}. + *

+ * @class yfiles.orthogonal.CompactOrthogonalLayout + * @extends {yfiles.layout.PartitionLayout} + */ + export interface CompactOrthogonalLayout extends yfiles.layout.PartitionLayout{} + export class CompactOrthogonalLayout { + /** + * Creates a new {@link yfiles.orthogonal.CompactOrthogonalLayout} instance with default settings. + * @constructor + */ + constructor(); + /** + * Gets or sets the equidistant spacing between the horizontal and vertical grid lines. + *

+ * Each node will be placed on a grid point. Edges will be routed such that their segments lie on grid lines, if the + * endpoints of the edges allow to place the ports accordingly. + *

+ *

+ * The grid spacing has to be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the grid spacing is negative or zero + * @type {number} + */ + gridSpacing:number; + /** + * Gets or sets the desired aspect ratio (i.e. + *

+ * the quotient width/height) of the resulting layout bounds. + *

+ *

+ * The aspect ratio needs to be greater than 0. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given aspect ratio is less than or equal to zero + * @see yfiles.layout.PartitionLayout#partitionPlacer + * @type {number} + */ + aspectRatio:number; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.orthogonal.OrthogonalLayout}. + * @class yfiles.orthogonal.OrthogonalLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface OrthogonalLayoutData extends yfiles.layout.LayoutData{} + export class OrthogonalLayoutData { + constructor(); + /** + * Gets or sets the mapping from edges to their {@link yfiles.orthogonal.EdgeLayoutDescriptor}. + * @see yfiles.orthogonal.EdgeLayoutDescriptor + * @see yfiles.orthogonal.OrthogonalLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeLayoutDescriptors:yfiles.layout.ItemMapping; + /** + * Gets or sets the collection of edges that should be routed in a way that point in the main layout direction. + * @see yfiles.orthogonal.OrthogonalLayout#DIRECTED_EDGE_DP_KEY + * @type {yfiles.layout.ItemCollection.} + */ + directedEdges:yfiles.layout.ItemCollection; + /** + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroupIds:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; + } + }export namespace radial{ + export enum CenterNodesPolicy{ + /** + * Specifier for a center nodes policy which chooses all nodes with in-degree equal to 0 as center nodes. If no node with + * this property is present, an arbitrary node will be selected. + * @see yfiles.radial.RadialLayout#centerNodesPolicy + * @see yfiles.algorithms.Trees#getRoot + */ + DIRECTED, + /** + * Specifier for a center nodes policy which chooses the node with the highest centrality as center node. + * @see yfiles.radial.RadialLayout#centerNodesPolicy + * @see yfiles.algorithms.Trees#getCenterRoot + */ + CENTRALITY, + /** + * Specifier for a center nodes policy which chooses the node with the highest weighted centrality as center node. + * @see yfiles.radial.RadialLayout#centerNodesPolicy + */ + WEIGHTED_CENTRALITY, + /** + * Specifier for a center nodes policy which uses center nodes specified by the user. The center nodes have to be specified + * using a {@link yfiles.algorithms.IDataProvider} registered with the {@link yfiles.radial.RadialLayout#centerNodesDpKey according key}. The {@link yfiles.algorithms.IDataProvider} returns true + * for nodes that should be placed in the center. + *

+ * If there exists more than one center node, they will be placed on the innermost circle while the center position stays + * empty. + *

+ * @see yfiles.radial.RadialLayout#centerNodesPolicy + * @see yfiles.radial.RadialLayout#centerNodesDpKey + */ + CUSTOM + } + 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 yfiles.radial.RadialLayout#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 such that + * the overall sum of the layer distances of all edges in the layout is minimal. + * @see yfiles.radial.RadialLayout#layeringStrategy + */ + HIERARCHICAL + } + export enum EdgeRoutingStrategy{ + /** + * Specifier for an edge routing strategy that will route edges with polyline segments from source to target with one bend + * on each spanned circle. + * @see yfiles.radial.RadialLayout#edgeRoutingStrategy + */ + POLYLINE, + /** + * Specifier for an edge routing strategy that will route edges as arcs. 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 applied in order to calculate + * additional control points between the polar coordinates of the main control points. + * @see yfiles.radial.RadialLayout#edgeRoutingStrategy + */ + ARC + } + /** + * Info object used for retrieving information about each node from the layout algorithm. + *

+ * The information can be retrieved by registering with the graph a {@link yfiles.algorithms.IDataProvider} (which should also + * implement the {@link yfiles.algorithms.IDataAcceptor} interface) using key {@link yfiles.radial.RadialLayout#NODE_INFO_DP_KEY}. The + * layout algorithm will return a {@link yfiles.radial.RadialLayoutNodeInfo} object with appropriately filled fields for each {@link yfiles.algorithms.Node} + * when the layout is calculated. + *

+ * @class yfiles.radial.RadialLayoutNodeInfo + */ + export interface RadialLayoutNodeInfo extends Object{} + export class RadialLayoutNodeInfo { + /** + * Creates a new {@link yfiles.radial.RadialLayoutNodeInfo} instance. + * @constructor + */ + constructor(); + /** + * Gets the index of the circle the node is placed on. + *

+ * The circles used by the {@link yfiles.radial.RadialLayout} are indexed from the innermost to the outermost circle. Index 0 + * represents the center, i.e. the circle with radius 0. + *

+ * @type {number} + */ + circleIndex:number; + /** + * Gets the radius of the circle the node is placed on. + * @type {number} + */ + radius:number; + /** + * Gets the offset from the center of the circle, the node is placed on, to the center of the node. + * @type {yfiles.algorithms.YPoint} + */ + centerOffset:yfiles.algorithms.YPoint; + /** + * Gets 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 yfiles.radial.RadialLayoutNodeInfo#sectorSize + * @type {number} + */ + sectorStart:number; + /** + * Gets the size in degrees of the sector the node is placed in. + * @see yfiles.radial.RadialLayoutNodeInfo#sectorStart + * @type {number} + */ + sectorSize:number; + static $class:yfiles.lang.Class; + } + /** + * This layout algorithm arranges graphs in a radial fashion. + *

+ * Layout Style The nodes are distributed into circles (layers) around a common center based on predefined {@link yfiles.radial.RadialLayout#layeringStrategy layering strategies}. Some + * potential applications include visualization of social networks, data clustering and bioinformatics. {@graph {"ann":{"s":[30,30],"d":1, "c":1, "bg": 0}, "styles" : {"6" : {"a" : 0.5,"c" : 1,"bg" : 1,"f" : null}},"n":[[-15,-15,1],[13.93,106.61],[65.6,80.55],[109.84,-8.76],[64.87,-111.16],[-81.77,-120.67],[-13.62,-139.99],[-133.34,-55.24],[-132.35,28.06],[-74.13,95.13],[-51.74,-262.29],[27.21,-261.41],[144.74,-207.31],[217.89,-105.89],[279.81,-246.76],[224.61,-303.47],[158.73,-347.33],[207.67,98.65],[230.47,32.36],[233.97,-37.66],[-114.67,214.27],[-185.45,167.88],[-53,232.09],[-295.24,234.18],[-243.87,282.06],[-220.04,-158.04],[-251.69,-95.49],[-264.73,-26.61],[-375,-381.52,750,750,6],[-255.95,-247.77,500,500,6],[-120,-120,240.76,240,6]],"e":[[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7],[0,8],[0,9],[9,8,[-70.52,125.91,-86.2,136.85,-105.19,140.56,-124.87,135.74,-141.6,122.91,-151.95,104.54,-153.96,84.38,-147.61,66.1,-134.58,52.11]],[6,10,[-1.65,-142.85,-15.61,-195.81,-28.91,-230.34]],[6,11,[4.82,-142.78,19.94,-195.41,34,-229.64]],[4,11,[82.38,-111.82,83.32,-128.06,82.62,-144.75,80.23,-161.75,76.13,-178.92,70.29,-196.12,62.69,-213.2,53.33,-230.01]],[4,12],[4,13,[94.6,-101.69,110.18,-105.84,126.49,-108.53,143.41,-109.7,160.83,-109.28,178.62,-107.22,214.79,-98.06]],[3,13,[138.89,0.42,165.98,-15.1,191.14,-35.68,213.67,-61.05,223.74,-75.44]],[12,14,[175.06,-199.78,223.92,-217.98,276.56,-229.49]],[12,15],[12,16,[164.26,-208.75,173.19,-260.12,174.85,-313.97]],[3,17,[138.24,13.42,163.65,31.57,186.64,54.55,206.52,82.04,215.1,97.36]],[3,18,[142.51,9.99,211.87,32.11,228.78,39.39]],[3,19,[142.79,4.26,214.01,-10.83,231.56,-16.39]],[9,20,[-67.21,129.42,-94.25,208.89]],[9,21,[-72.16,123.29,-101.29,147.07,-134.19,167.07,-151.93,175.53]],[21,7,[-170.54,166.68,-181.84,45.73,-180.63,25.53,-175.63,6.64,-167.31,-9.76,-156.5,-22.85,-144.15,-32.21,-131.17,-37.89]],[9,22,[-61.2,126.61,-61.38,160.54,-56.17,195.2,-45.44,229.93]],[21,23,[-185.24,193.48,-263.69,240.87]],[21,24,[-179.99,198.37,-221.74,279.97]],[7,25,[-131.46,-49.93,-155.99,-72.16,-177.9,-98.03,-196.82,-127.26]],[7,26],[7,27,[-134.65,-40.57,-167.65,-37.89,-200.78,-30.75,-233.59,-19.11]]],"vp":[-375.0,-382.0,750.0,751.0]}} Sample output of + * the layout algorithm with default settings and one center node {@graph {"ann":{"s":[30,30],"d":1, "c":1, "bg": 0}, "styles" : {"6" : {"a" : 0.5,"c" : 1,"bg" : 1,"f" : null}},"n":[[-168.28,-179.72],[-227.35,-89.37],[195.73,63.85],[208.34,-42.28],[-239.94,-9.73],[-217.86,82.33],[154.4,133.08],[-136.84,174.15],[96.65,-210.34],[-286.03,-236.46],[-80.8,-230.16],[-216.41,-301.24],[-345.33,-130.69],[-330.56,136.4],[-204.53,279.24],[-48.25,207.53],[170.9,-141.76],[-0.72,-239.55],[59.22,197.41],[153.75,291.63],[64.99,325.74],[93.56,447.43],[158.68,-318.87],[-415.1,241.02],[-465.07,136.87],[-272.22,384.33],[332.42,-57.43],[0.83,-113.74,1],[49.15,61.71,1],[80.56,-44.46,1],[-89.99,51.16,1],[-97,-72.24,1],[-465.42,-448.52,920,920,6],[-355.1,-344.73,700,700,6],[-226.03,-218.04,445,445,6],[-97,-100.15,194,194,6]],"e":[[0,9],[0,10],[0,11],[1,12],[1,13],[13,5],[7,14],[19,18],[20,18],[20,21],[8,22],[13,23],[23,14],[13,24],[14,25],[3,26],[10,27],[16,27],[27,17],[27,8],[28,18],[28,6],[28,2],[29,28],[29,16],[29,27],[29,3],[7,30],[30,28],[30,15],[30,4],[30,5],[31,27],[31,0],[31,1],[31,30]],"vp":[-466.0,-449.0,921.0,927.0]}} Sample output of the layout algorithm with straight-line + * edges and five center nodes using {@link yfiles.radial.CenterNodesPolicy#CUSTOM} policyConcept The layout algorithm creates a virtual + * tree structure for the input graph whose root node is placed in the center of the circles. All children of a tree node + * are placed on a higher layer (i.e. on a circle of larger radius) than their parent. A sector is calculated for each node + * such that the sector of each child node in the virtual tree is a sub-sector of its parent's sector. The radii of the + * circles are calculated based on the sizes of the sectors required to accommodate each whole subtree. Features + *

+ *

+ * There are different {@link yfiles.radial.RadialLayout#centerNodesPolicy center nodes policies} that can be applied in order to determine the nodes that will be placed in the + * center (single center node) or on the innermost circle (more than one center node). The distribution of the nodes to the + * circles is specified by a {@link yfiles.radial.RadialLayout#layeringStrategy layering strategy}. + *

+ *

+ * The edges are routed based on the + * {@link yfiles.radial.RadialLayout#edgeRoutingStrategy edge routing strategy}. Note that the edge routing cannot always prevent node-edge overlaps. + *

+ *

+ * The minimum distance between nodes of the same circle is specified using + * {@link yfiles.radial.RadialLayout#minimumNodeToNodeDistance}. If there are too many nodes assigned to a circle, the radius of the particular circle will be increased until all + * nodes fit onto it. + *

+ *

+ * The distance between consecutive layers is specified using {@link yfiles.radial.RadialLayout#layerSpacing}. The radii of the circles are a multiple of this spacing + * value. If the layer spacing is 0, the radii are chosen such that all nodes fit on their corresponding circles. A minimum + * layer distance is specified by {@link yfiles.radial.RadialLayout#minimumLayerDistance}. + *

+ * @class yfiles.radial.RadialLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface RadialLayout extends yfiles.layout.MultiStageLayout{} + export class RadialLayout { + /** + * Creates a new {@link yfiles.radial.RadialLayout} instance with the default settings. + * @constructor + */ + constructor(); + /** + * Data acceptor key for publishing the circle ID and sector data + *

+ * For each node, the ID of the circle and data regarding the circular sector on which it was placed will be stored. + *

+ * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static NODE_INFO_DP_KEY:yfiles.algorithms.NodeDpKey; + /** + * Gets or sets the minimum distance between two neighboring nodes of the same circle. + * @throws {Stubs.Exceptions.ArgumentError} if the given minimum distance is negative + * @type {number} + */ + minimumNodeToNodeDistance:number; + /** + * Gets or sets the spacing between two consecutive circles (layers). + *

+ * The spacing is a non-negative value, where 0 means that no spacing is considered. + *

+ *

+ * The radius of each circle will be a multiple of this value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the spacing value is negative + * @type {number} + */ + layerSpacing:number; + /** + * Gets or sets the minimum distance between two circles. + * @throws {Stubs.Exceptions.ArgumentError} if the minimum layer distance is negative + * @type {number} + */ + minimumLayerDistance:number; + /** + * Gets or sets the maximum sector angle around a node within which the node's children will be placed. + *

+ * Based on the location of a given node, the sector of its children that lie on the next outer layer is described by this + * angle. The vertex of the angle is located in the center of the node while its sides point away from the inner circles. + * The child nodes are placed inside this angle. If there is not enough space, the radius of the child circle is + * increased. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the sector angle is negative or greater than 360 degrees + * @type {number} + */ + maximumChildSectorAngle:number; + /** + * Gets or sets the minimum bend angle (in degrees) between two adjacent edge segments. + *

+ * The minimum bend angle is defined to be a value between 0 and 90 degrees. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given minimum bend angle is negative or greater than 90 + * @type {number} + */ + minimumBendAngle:number; + /** + * Gets or sets the policy that determines which nodes are selected as roots of the (virtual) tree for the layout process + * and are set in the center of the circles. + * @throws {Stubs.Exceptions.ArgumentError} if an invalid center node policy is given + * @type {yfiles.radial.CenterNodesPolicy} + */ + centerNodesPolicy:yfiles.radial.CenterNodesPolicy; + /** + * Gets or sets the {@link yfiles.algorithms.IDataProvider} key used for looking up the selected nodes that should be placed in the + * center. + * @throws {Stubs.Exceptions.ArgumentError} if the specified key is null + * @type {Object} + */ + centerNodesDpKey:Object; + /** + * Gets or sets the layering strategy that determines how nodes are distributed into different layers. + *

+ * All nodes of a given layer will be placed on the same circle. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if an invalid layering strategy is set + * @type {yfiles.radial.LayeringStrategy} + */ + layeringStrategy:yfiles.radial.LayeringStrategy; + /** + * Gets or sets the edge routing strategy. + * @throws {Stubs.Exceptions.ArgumentError} if an invalid edge routing strategy is set + * @type {yfiles.radial.EdgeRoutingStrategy} + */ + edgeRoutingStrategy:yfiles.radial.EdgeRoutingStrategy; + /** + * Gets or sets whether or not node labels are taken into account when calculating node positions. + *

+ * Thereby, possible node/node label or node label/node label overlaps are prevented. + *

+ * @type {boolean} + */ + considerNodeLabels:boolean; + /** + * Sets whether or not the {@link yfiles.layout.ILayoutStage} that modifies the orientation of the layout is activated. + * @see yfiles.layout.MultiStageLayout#orientationLayoutEnabled + * @see yfiles.layout.MultiStageLayout#orientationLayout + * @see yfiles.layout.MultiStageLayout#layoutOrientation + * @see yfiles.layout.OrientationLayout + * @type {boolean} + */ + orientationLayoutEnabled:boolean; + /** + * Gets the {@link yfiles.layout.EdgeBundling} instance that defines the settings of the edge bundling feature. + *

+ * The specified {@link yfiles.layout.EdgeBundling} defines global bundling properties. Settings for individual edges can be + * defined by assigning an {@link yfiles.layout.EdgeBundleDescriptor} to an edge using a {@link yfiles.algorithms.IDataProvider} registered + * with key {@link yfiles.layout.EdgeBundling#EDGE_BUNDLE_DESCRIPTOR_DP_KEY}. + *

+ * @type {yfiles.layout.EdgeBundling} + */ + edgeBundling:yfiles.layout.EdgeBundling; + static $class:yfiles.lang.Class; + } + /** + * Specifies custom data for the {@link yfiles.radial.RadialLayout}. + * @class yfiles.radial.RadialLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface RadialLayoutData extends yfiles.layout.LayoutData{} + export class RadialLayoutData { + constructor(); + /** + * Gets or sets the collection of nodes that shall be placed in the center with {@link yfiles.radial.RadialLayout#centerNodesPolicy center node policy} set to {@link yfiles.radial.CenterNodesPolicy#CUSTOM} + * . + * @see yfiles.radial.RadialLayout#centerNodesDpKey + * @type {yfiles.layout.DpKeyItemCollection.} + */ + centerNodes:yfiles.layout.DpKeyItemCollection; + /** + * Gets or sets the mapping from nodes to a {@link yfiles.radial.RadialLayoutNodeInfo} describing on which circle and in which + * sector the node is placed. + *

+ * If the mapper contains a {@link yfiles.radial.RadialLayoutNodeInfo} for a node, the layout will update its property during the + * layout. + *

+ * @see yfiles.radial.RadialLayout#NODE_INFO_DP_KEY + * @type {yfiles.collections.IMapper.} + */ + nodeInfos:yfiles.collections.IMapper; + /** + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroups:yfiles.layout.ItemMapping; + /** + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroups:yfiles.layout.ItemMapping; + /** + * Gets or sets the mapping from nodes to their {@link yfiles.layout.NodeHalo}. + * @see yfiles.layout.NodeHalo#NODE_HALO_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + nodeHalos:yfiles.layout.ItemMapping; + /** + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * Gets or sets the mapping of edges to their {@link yfiles.layout.EdgeBundleDescriptor}. + *

+ * Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the + * source and target point, the edges are again clearly split. + *

+ *

+ * If an edge is mapped to null, the {@link yfiles.layout.EdgeBundling#defaultBundleDescriptor default descriptor} is used. + *

+ * @see yfiles.layout.EdgeBundleDescriptor + * @see yfiles.radial.RadialLayout#edgeBundling + * @type {yfiles.layout.ItemMapping.} + */ + edgeBundleDescriptors:yfiles.layout.ItemMapping; + static $class:yfiles.lang.Class; + } + }export namespace seriesparallel{ + /** + * {@link yfiles.seriesparallel.DefaultOutEdgeComparer} is the default implementation for the out-edge comparator used in + * {@link yfiles.seriesparallel.SeriesParallelLayout}. + *

+ * It keeps the order of the edges in the graph for edges without {@link yfiles.layout.PortConstraint}s and considers the + * {@link yfiles.layout.PortConstraint}s such that the order of the target nodes of the outgoing 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 yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer + * @class yfiles.seriesparallel.DefaultOutEdgeComparer + * @implements {yfiles.collections.IComparer.} + */ + export interface DefaultOutEdgeComparer extends Object,yfiles.collections.IComparer{} + export class DefaultOutEdgeComparer { + /** + * Creates a {@link yfiles.seriesparallel.DefaultOutEdgeComparer} instance with default settings. + * @constructor + */ + constructor(); + /** + * Compares the two given edges considering their {@link yfiles.layout.PortConstraint}s. + *

+ * The order of edges is kept unless there are + * {@link yfiles.layout.PortConstraint}s assigned. Then the edges will be sorted to avoid edge crossings. + *

+ * @param {Object} o1 the first edge + * @param {Object} o2 the second edge + * @returns {number} the order of the given two edges + */ + compare(o1:Object,o2:Object):number; + static $class:yfiles.lang.Class; + } + /** + * {@link yfiles.seriesparallel.DefaultPortAssignment} 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 {@link yfiles.layout.PortConstraint}s are handled separately and keep + * their initial location relative to the node while weak + * {@link yfiles.layout.PortConstraint}s just influence on which side of the node the port is placed. + *

+ *

+ * If there are edge groups specified, the edges which belong to the same group get the same port locations. + *

+ * @see yfiles.layout.PortConstraint + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @class yfiles.seriesparallel.DefaultPortAssignment + * @implements {yfiles.seriesparallel.IPortAssignment} + */ + export interface DefaultPortAssignment extends Object,yfiles.seriesparallel.IPortAssignment{} + export class DefaultPortAssignment { + /** + * Creates a new {@link yfiles.seriesparallel.DefaultPortAssignment} instance using the given mode and a given value for the {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio ratio} + * of the gap between the border and the ports to the gap between the ports themselves. + * @param {yfiles.seriesparallel.PortAssignmentMode} mode one of the predefined port assignment modes + * @param {number} [ratio=0.5] the ratio of the distance between outer ports and the border to the distance between any two ports + * @throws {Stubs.Exceptions.ArgumentError} if the given mode is unknown or the given ratio is negative + * @constructor + */ + constructor(mode:yfiles.seriesparallel.PortAssignmentMode,ratio?:number); + /** + * Creates a new {@link yfiles.seriesparallel.DefaultPortAssignment} with default settings. + * @constructor + */ + constructor(); + /** + * Places the ports of edges connecting to the given node according to the {@link yfiles.seriesparallel.DefaultPortAssignment#mode port assignment mode}. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be placed + * @see yfiles.seriesparallel.DefaultPortAssignment#mode + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + /** + * Determines the distance between the outer ports and the border of the node. + *

+ * This implementation calculates the gap according to the number of edges at one side of the node. It also includes the + * {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio ratio between border gap and port gap}. + *

+ *

+ * This method is called by {@link yfiles.seriesparallel.DefaultPortAssignment#assignPorts} to calculate the location of the first + * port. It may be overridden to implement a different distribution of ports on the node's side. + *

+ * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges that connect to this side + * @returns {number} the absolute gap to be used on both sides of the ports + * @see yfiles.seriesparallel.DefaultPortAssignment#assignPorts + * @see yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio + * @protected + */ + getPortBorderGap(sideLength:number,edgeCount:number):number; + /** + * Determines the distance between two adjacent ports. + *

+ * This implementation calculates the gap according to the number of edges at one side of the node. The edges are + * distributed keeping the given gap to the border of the node. + *

+ *

+ * This method is called by {@link yfiles.seriesparallel.DefaultPortAssignment#assignPorts} to calculate the distance between two + * ports. It may be overridden to implement a different distribution of ports on the node's side. + *

+ * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/ports that connect to this side + * @param {number} portBorderGap the port border gap (i.e. calculated by {@link yfiles.seriesparallel.DefaultPortAssignment#getPortBorderGap}) + * @returns {number} the absolute distance to be used between two adjacent ports + * @see yfiles.seriesparallel.DefaultPortAssignment#assignPorts + * @see yfiles.seriesparallel.DefaultPortAssignment#getPortBorderGap + * @protected + */ + getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; + /** + * Gets or sets the mode that describes how ports are placed. + * @throws {Stubs.Exceptions.ArgumentError} if an unknown mode is specified + * @type {yfiles.seriesparallel.PortAssignmentMode} + */ + mode:yfiles.seriesparallel.PortAssignmentMode; + /** + * Gets or sets the ratio of the border gap (distance between the outer ports and the node border) to the port gap (distance between adjacent + * ports). + *

+ * The ratio must have a positive value. If the ratio is + * 0, the ports will be distributed along the whole side of the node without a gap between the last port and the corner. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified ratio is negative + * @type {number} + */ + borderGapToPortGapRatio:number; + /** + * Gets or sets 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. Due to large minimum first/last segment lengths edges may overlap. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified fork style is unknown + * @type {yfiles.seriesparallel.ForkStyle} + */ + forkStyle:yfiles.seriesparallel.ForkStyle; + static $class:yfiles.lang.Class; + } + /** + * An {@link yfiles.seriesparallel.EdgeLayoutDescriptor} provides routing details for an edge that are considered by + * {@link yfiles.seriesparallel.SeriesParallelLayout}. + *

+ * Such an {@link yfiles.seriesparallel.EdgeLayoutDescriptor} can either be specified for a single edge or shared by several edges. + * It is assigned by registering a {@link yfiles.algorithms.IDataProvider} with key + * {@link yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY}. If no {@link yfiles.algorithms.IDataProvider} is + * registered with this key, {@link yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor a default descriptor} is used. + *

+ * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @see yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor + * @class yfiles.seriesparallel.EdgeLayoutDescriptor + */ + export interface EdgeLayoutDescriptor extends Object{} + export class EdgeLayoutDescriptor { + /** + * Creates a new instance of {@link yfiles.seriesparallel.EdgeLayoutDescriptor} with default settings. + * @constructor + */ + constructor(); + /** + * Creates a copy of this {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance. + * @returns {yfiles.seriesparallel.EdgeLayoutDescriptor} a copy of this {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance + */ + createCopy():yfiles.seriesparallel.EdgeLayoutDescriptor; + /** + * Gets or sets the minimum length for the associated edge. + *

+ * The minimum length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} for negative edge lengths + * @type {number} + */ + minimumLength:number; + /** + * Gets or sets the minimum length for the first segment of the associated edge. + *

+ * The minimum first segment length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} for negative minimum segment lengths + * @type {number} + */ + minimumFirstSegmentLength:number; + /** + * Gets or sets the minimum length for the last segment of the associated edge. + *

+ * The minimum last segment length needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} for negative minimum segment lengths + * @type {number} + */ + minimumLastSegmentLength:number; + static $class:yfiles.lang.Class; + } + export enum PortAssignmentMode{ + /** + * A port assignment specifier which defines that all ports are reset to the center of their nodes. + * @see yfiles.layout.PortConstraint + */ + CENTER, + /** + * A port assignment specifier which defines that 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 {@link yfiles.layout.PortConstraint}s are distributed at the side of the nodes which is specified + * in the {@link yfiles.layout.PortConstraint}. + *

+ *

+ * Grouped edges will get the same port location. + *

+ * @see yfiles.layout.PortConstraint + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + */ + DISTRIBUTED + } + export enum ForkStyle{ + /** + * Fork style specifier that defines that the edges will fork outside a node. Edges leave/enter the nodes south/north and + * bend between their source and target. + */ + OUTSIDE_NODE, + /** + * Fork style specifier that defines that the edges will fork 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{ /** - * 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} - */ + * Style constant describing an orthogonal edge style. If this style is used, edges will contain only horizontal and + * vertical segments. + * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle + */ 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 + * Style constant describing an octilinear edge style. If this style is used, edges will contain horizontal, vertical and + * 45-degree sloped segments. + * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle + */ + OCTILINEAR, + /** + * Style constant describing a polyline edge style. If this style is used, edges will contain vertical and other sloped + * segments. + * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle + */ + POLYLINE } /** - * Decorates a SubtreeShape and provides rotated access on it. - */ - export interface SubtreeShapeRotated extends Object{ - } - var SubtreeShapeRotated:{ - $class:yfiles.lang.Class; + * A {@link yfiles.seriesparallel.IPortAssignment} is used by {@link yfiles.seriesparallel.SeriesParallelLayout} for determining the + * locations of the edges' ports at their incident nodes. + * @interface + */ + export interface IPortAssignment extends Object{ /** - * For testing purposes only. - */ - new ():yfiles.tree.SubtreeShapeRotated; + * Assigns both the incoming edges' target ports as well as all source ports for the outgoing edges. + *

+ * Outgoing edges are sorted according to the specified out-edge comparator from left to right and incoming edges are in + * the order of the subgraphs they are coming from. + *

+ *

+ * This method is called by {@link yfiles.seriesparallel.SeriesParallelLayout} before the actual layout of the graph takes place. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph instance the node is part of + * @param {yfiles.algorithms.Node} node the node whose incident edges' ports are assigned + * @see yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY + * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer + * @abstract + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + } + var IPortAssignment:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; }; /** - * 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{ + * This layout algorithm arranges series-parallel graphs. + *

+ * Layout Style Series-parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node + * without outgoing edges). The layout algorithm highlights the main layout direction (from source to sink). It also + * emphasizes the paths through the graph because edges are routed with few bends. + *

+ *

+ * {@link yfiles.seriesparallel.SeriesParallelLayout} is suitable for the visualization of circuits, call trees or flowcharts. + *

+ *

+ * {@graph {"ann":{"s":[30,30],"d":1},"n":[[226,0],[226,480],[278,60],[278,420],[0,270],[360,300],[300,300],[240,300],[240,180],[60,240],[0,330],[180,120],[120,240],[0,150],[180,270],[180,210],[338,180],[300,240],[436,240],[0,210],[240,240],[180,360],[360,240]],"e":[[0,1,[241,45,481.5,45,481.5,465,241,465]],[0,2,[241,45,293,45]],[3,1,[293,465,241,465]],[5,3,[375,405,293,405]],[6,3,[315,405,293,405]],[0,9,[241,45,75,45]],[9,1,[75,465,241,465]],[4,10],[10,1,[15,465,241,465]],[2,11,[293,105,195,105]],[11,8,[195,165,255,165]],[11,12,[195,165,135,165]],[0,13,[241,45,15,45]],[11,15],[15,14],[2,16,[293,105,353,105]],[16,3,[353,225,405.5,225,405.5,405,293,405]],[16,17,[353,225,315,225]],[17,6],[2,18,[293,105,451,105]],[18,3,[451,405,293,405]],[13,19],[19,4],[8,20],[20,7],[7,21,[255,345,195,345]],[14,21],[12,21,[135,345,195,345]],[21,3,[195,405,293,405]],[16,22,[353,225,375,225]],[22,5]],"vp":[0.0,0.0,482.0,510.0]}}Concept Series-parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink (node + * without outgoing edges) that are built using only the following two rules: + *

+ *
    + *
  1. Series composition: The source of a subgraph is merged with the sink of a second subgraph.
  2. + *
  3. Parallel composition: The sources and sinks of two subgraphs are merged.
  4. + *
+ *

+ * From the recursive structure of series-parallel graphs, the layout algorithm retrieves a decomposition tree where each + * node represents one of the decomposition types. Then, this tree is traversed recursively from bottom to top, aligning + * subgraphs above (series) or next to (parallel) each other until the whole graph is arranged. The edges are routed when + * both end nodes are placed. Different {@link yfiles.seriesparallel.SeriesParallelLayout#routingStyle routing styles} can be used. + *

+ *

+ * To avoid moving all nodes several times and to be aware of the area that the subtrees occupy, the layout algorithm keeps + * track of the shape of the subtrees. These shapes are moved and merged during the layout calculation. The layout + * algorithm also stores the connections between nodes and nodes that haven't already been placed in these shapes. + *

+ *

+ * Features + *

+ *

+ * {@link yfiles.seriesparallel.SeriesParallelLayout} can take strong + * {@link yfiles.layout.PortConstraint}s into account. It will connect the edges to the specified locations, the directions, + * however, will be ignored. + *

+ *

+ * Grouping of nodes can also be handled by this layout algorithm. It is important that a group node contains a whole + * series-parallel subgraph. Otherwise, the group nodes may overlap with each other or with other nodes. Edges which are + * connected to non-empty group nodes are not allowed. Furthermore, the user may specify minimum size constraints for each + * group node using {@link yfiles.algorithms.IDataProvider} key {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. + *

+ *

+ * The layout algorithm can be configured to reserve space for node labels and to place the edge labels along the edge such + * that the labels won't overlap with other graph elements. Edge labels are placed according to the information stored in a + * {@link yfiles.layout.PreferredPlacementDescriptor} instance. However, labels that should be centered between source and target + * are placed close to the target node, unless this edge connects to the local source and sink of a subgraph. + *

+ *

+ * Parallel subgraphs can be aligned in different ways. Depending on the node sizes, a different alignment can increase the + * compactness of the layout. + *

+ *

+ * The way in which edges are distributed around their incident nodes is computed by an instance of + * {@link yfiles.seriesparallel.IPortAssignment}. The {@link yfiles.seriesparallel.DefaultPortAssignment default assignment} is able to consider + * {@link yfiles.layout.PortConstraint}s and edge groups. + *

+ *

+ * The {@link yfiles.seriesparallel.SeriesParallelLayout#fromSketchMode From Sketch mode} allows to take the initial locations of the nodes into account. However, the layout algorithm won't + * insert crossings because it maintains the order of children of each node. + *

+ *

+ * {@link yfiles.seriesparallel.SeriesParallelLayout} supports custom sorting of the outgoing edges of a node. A {@link yfiles.collections.IComparer.} can be assigned + * individually for the nodes using a {@link yfiles.algorithms.IDataProvider} registered with key + * {@link yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY}. For all nodes for which the {@link yfiles.algorithms.IDataProvider} + * returns null, the layout algorithm falls back to the {@link yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer default comparator}. + *

+ *

+ * By default, this layout algorithm can only handle graphs with a series-parallel structure. To apply it to a general + * graph, {@link yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling general graph handling} needs to be activated. Then, the layout algorithm will temporarily add and/or remove some + * edges from the input graph until a series-parallel graph is obtained. The edges that were removed will be routed + * separately afterwards. + *

+ * @class yfiles.seriesparallel.SeriesParallelLayout + * @extends {yfiles.layout.MultiStageLayout} + */ + export interface SeriesParallelLayout extends yfiles.layout.MultiStageLayout{} + export class SeriesParallelLayout { /** - * 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; + * Creates a new {@link yfiles.seriesparallel.SeriesParallelLayout} instance with default settings. + * @constructor + */ + constructor(); /** - * Assigns a new graph layout to the given layout graph. - * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. - */ - doLayout(graph:yfiles.layout.LayoutGraph):void; + * Determines whether or not the given graph has a series-parallel structure. + *

+ * The current implementation detects the series-parallel graph structure in linear time. + *

+ * @param {yfiles.algorithms.Graph} graph the input graph + * @returns {boolean} true if the given graph is series-parallel, false otherwise + * @static + */ + static isSeriesParallelGraph(graph:yfiles.algorithms.Graph):boolean; /** - * 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; + * Data provider key for storing individual settings for edges + *

+ * If no edge layout descriptor is mapped for an edge, a default edge layout descriptor will be obtained by method {@link yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor}. + *

+ * @see yfiles.seriesparallel.SeriesParallelLayout#defaultEdgeLayoutDescriptor + * @const + * @static + * @type {yfiles.algorithms.EdgeDpKey.} + */ + static EDGE_LAYOUT_DESCRIPTOR_DP_KEY:yfiles.algorithms.EdgeDpKey; /** - * The core layouter. - * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. - */ - coreLayouter:yfiles.layout.ILayouter; + * Data provider key for assigning different orderings for outgoing edges of the nodes + *

+ * If the {@link yfiles.collections.IComparer.} associated with a node is null, the outgoing edges maintain their initial order. + *

+ * @see yfiles.seriesparallel.SeriesParallelLayout#defaultOutEdgeComparer + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.>} + */ + static OUT_EDGE_COMPARER_DP_KEY:yfiles.algorithms.NodeDpKey>; /** - * The core layouter used for tree components. - */ - treeComponentCoreLayouter:yfiles.layout.ILayouter; + * Data provider key for providing an individual port distribution at nodes + *

+ * If there is no {@link yfiles.seriesparallel.IPortAssignment} specified for a node, the layout algorithm uses the + * {@link yfiles.seriesparallel.SeriesParallelLayout#defaultPortAssignment default assignment}. + *

+ * @see yfiles.seriesparallel.SeriesParallelLayout#defaultPortAssignment + * @const + * @static + * @type {yfiles.algorithms.NodeDpKey.} + */ + static PORT_ASSIGNMENT_DP_KEY:yfiles.algorithms.NodeDpKey; /** - * 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; + * Data provider key for marking edge labels of non-series-parallel edges + * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelSelectionKey + * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm + * @const + * @static + * @type {yfiles.algorithms.IEdgeLabelLayoutDpKey.} + */ + static NON_SERIES_PARALLEL_EDGE_LABELS_DP_KEY:yfiles.algorithms.IEdgeLabelLayoutDpKey; /** - * 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; + * Gets or sets whether or not the layout algorithm reserves space for node labels to avoid overlaps. + * @type {boolean} + */ + considerNodeLabels:boolean; /** - * 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. - */ + * Gets or sets whether or not the layout algorithm will place edge labels and reserve space for them. + * @type {boolean} + */ 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} - */ + * Gets or sets the vertical alignment of parallel subgraphs. + *

+ * The alignment is defined by a ratio: + *

+ *
    + *
  • Ratio 0 means that nodes are top-aligned
  • + *
  • Ratio 0.5 means that nodes are center-aligned
  • + *
  • Ratio 1 means that nodes are bottom-aligned
  • + *
+ * @type {number} + */ 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; + * Gets or sets whether or not the layout algorithm can handle general graphs. + *

+ * General graphs are required to be transformed before being laid out (by adding or removing some edges) such that they + * satisfy the criteria of a series-parallel graph. After the layout, the graph will be restored and the initial edges + * which weren't included in the series-parallel graph are routed by a separate {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeRouter edge routing algorithm}. Furthermore, the + * labels of these edges are placed by a customizable {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm edge labeling algorithm}. + *

+ * @type {boolean} + */ + generalGraphHandling:boolean; /** - * Creates a new instance of TreeLayouter. - */ - new ():yfiles.tree.TreeLayouter; - }; - export enum EdgeLayoutStyle{ + * Gets or sets the edge routing algorithm used for the edges of a general graph that are not part of the series-parallel + * subgraph whose layout is calculated. + * @throws {Stubs.Exceptions.ArgumentError} if null is specified + * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling + * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgesDpKey + * @type {yfiles.layout.ILayoutAlgorithm} + */ + nonSeriesParallelEdgeRouter:yfiles.layout.ILayoutAlgorithm; /** - * Layout style constant. Draw edges as straight lines. - */ - PLAIN, + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used for marking non-series-parallel edges. + *

+ * This key is used for determining the edges that are not part of the series-parallel structure in a general graph, such + * that the specified non-series-parallel edge router only routes marked edges. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the given key is set to null + * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling + * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeRouter + * @type {Object} + */ + nonSeriesParallelEdgesDpKey:Object; /** - * Layout style constant. Draw edges orthogonally in a bus-like fashion. - */ - ORTHOGONAL - } - export enum PortStyle{ + * Gets or sets the labeling algorithm that is applied to all edge labels that belong to non-series-parallel edges. + * @see yfiles.seriesparallel.SeriesParallelLayout#generalGraphHandling + * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelSelectionKey + * @type {yfiles.layout.ILayoutAlgorithm} + */ + nonSeriesParallelEdgeLabelingAlgorithm:yfiles.layout.ILayoutAlgorithm; /** - * Port style constant. Uses (0,0) as port offset. - */ - NODE_CENTER, + * Gets or sets the key to register a {@link yfiles.algorithms.IDataProvider} that is used by the {@link yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm non-series-parallel edge labeling algorithm} + * to determine which edge labels it should place. + *

+ * During the layout, a {@link yfiles.algorithms.IDataProvider} with this key will be registered with the graph. It will mark all + * {@link yfiles.layout.IEdgeLabelLayout}s that belong to non-series-parallel edges. A specified custom non-series-parallel edge + * labeling algorithm needs to obey this selection. If using {@link yfiles.labeling.GenericLabeling} as labeling algorithm, set + * this key as value of property {@link yfiles.labeling.LabelingBase#affectedLabelsDpKey}. + *

+ *

+ * The labeling algorithm set as default is already configured such that it uses the correct selection key. + *

+ * @see yfiles.seriesparallel.SeriesParallelLayout#nonSeriesParallelEdgeLabelingAlgorithm + * @type {Object} + */ + nonSeriesParallelEdgeLabelSelectionKey:Object; /** - * Port style constant. Ports will lie at the center of a node border. - */ - BORDER_CENTER, + * Gets or sets the default {@link yfiles.seriesparallel.IPortAssignment} used for those nodes that do not have their own specific + * instance. + *

+ * A {@link yfiles.seriesparallel.IPortAssignment} instance is defined using a {@link yfiles.algorithms.IDataProvider} registered with the + * graph with key {@link yfiles.seriesparallel.SeriesParallelLayout#PORT_ASSIGNMENT_DP_KEY}. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if null is specified + * @type {yfiles.seriesparallel.IPortAssignment} + */ + defaultPortAssignment:yfiles.seriesparallel.IPortAssignment; /** - * Port style constant. Ports will be distributed evenly on the side of a node. - */ - BORDER_DISTRIBUTED, + * Gets or sets the default {@link yfiles.collections.IComparer.} used for sorting the outgoing edges incident to nodes that do not have a specific {@link yfiles.collections.IComparer.}. + *

+ * Such a comparator is defined using a {@link yfiles.algorithms.IDataProvider} registered with the graph with key + * {@link yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY}. + *

+ * @type {yfiles.collections.IComparer.} + */ + defaultOutEdgeComparer:yfiles.collections.IComparer; /** - * Port style constant. The specified port constraints will be considered. - */ - PORT_CONSTRAINTS_AWARE - } - export enum ParentConnectorDirection{ + * Gets or sets the currently used routing style for edges. + * @type {yfiles.seriesparallel.RoutingStyle} + */ + routingStyle:yfiles.seriesparallel.RoutingStyle; /** - * Byte constant that is as argument to the main method, indicating that no connector - * should be calculated. - */ - NONE, + * Gets or sets the minimum vertical distance of the edge segments that are not orthogonal. + *

+ * The distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified length is smaller than 0 + * @see yfiles.seriesparallel.SeriesParallelLayout#minimumSlope + * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle + * @see yfiles.seriesparallel.RoutingStyle#POLYLINE + * @type {number} + */ + minimumPolylineSegmentLength:number; /** - * 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, + * Gets or sets the minimum slope which a non-orthogonal edge segment should have. + *

+ * A higher minimum slope prevents those segments in very wide graphs from becoming nearly horizontal. The slope needs to + * have a non-negative value. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified slope is smaller than 0 + * @see yfiles.seriesparallel.SeriesParallelLayout#minimumPolylineSegmentLength + * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle + * @see yfiles.seriesparallel.RoutingStyle#POLYLINE + * @type {number} + */ + minimumSlope:number; /** - * 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, + * Gets or sets the preferred length for non-orthogonal segments in octilinear edge routes. + *

+ * If there is not enough space, those segments may be shorter than the specified length. The length needs to be + * non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified length is smaller than 0 + * @see yfiles.seriesparallel.SeriesParallelLayout#routingStyle + * @see yfiles.seriesparallel.RoutingStyle#OCTILINEAR + * @type {number} + */ + preferredOctilinearSegmentLength:number; /** - * 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, + * Gets or sets the {@link yfiles.seriesparallel.EdgeLayoutDescriptor} instance used for all those edges that do not have a + * specific layout descriptor assigned. + * @throws {Stubs.Exceptions.ArgumentError} if the specified {@link yfiles.seriesparallel.EdgeLayoutDescriptor} is null + * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.seriesparallel.EdgeLayoutDescriptor} + */ + defaultEdgeLayoutDescriptor:yfiles.seriesparallel.EdgeLayoutDescriptor; /** - * 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, + * Gets or sets the minimum distance between nodes. + *

+ * This distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 + * @type {number} + */ + minimumNodeToNodeDistance:number; /** - * 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{ + * Gets or sets the minimum distance between nodes and edges. + *

+ * This distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 + * @type {number} + */ + minimumNodeToEdgeDistance:number; /** - * 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, + * Gets or sets the minimum distance between edges. + *

+ * This distance needs to be non-negative. + *

+ * @throws {Stubs.Exceptions.ArgumentError} if the specified distance is smaller than 0 + * @type {number} + */ + minimumEdgeToEdgeDistance:number; /** - * 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, + * Gets or sets whether or not to take the coordinates of the input diagram into account when arranging the nodes. + *

+ * The order of edges incident to the same source node will remain the same as in the original layout. + *

+ * @type {boolean} + */ + fromSketchMode:boolean; /** - * 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, + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for arranging the components of the graph is activated. + * @see yfiles.layout.MultiStageLayout#componentLayoutEnabled + * @see yfiles.layout.MultiStageLayout#componentLayout + * @see yfiles.layout.ComponentLayout + * @type {boolean} + */ + componentLayoutEnabled:boolean; /** - * 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 + * Sets whether or not the {@link yfiles.layout.ILayoutStage} used for routing self-loops is activated. + * @see yfiles.layout.MultiStageLayout#selfLoopRouterEnabled + * @see yfiles.layout.MultiStageLayout#selfLoopRouter + * @see yfiles.layout.SelfLoopRouter + * @type {boolean} + */ + selfLoopRouterEnabled:boolean; + static $class:yfiles.lang.Class; } /** - * 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{ + * Specifies custom data for the {@link yfiles.seriesparallel.SeriesParallelLayout}. + * @class yfiles.seriesparallel.SeriesParallelLayoutData + * @extends {yfiles.layout.LayoutData} + */ + export interface SeriesParallelLayoutData extends yfiles.layout.LayoutData{} + export class SeriesParallelLayoutData { + constructor(); /** - * Returns true. - * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} - * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. - */ - canLayout(graph:yfiles.layout.LayoutGraph):boolean; + * Gets or sets the mapping from edges to their {@link yfiles.seriesparallel.EdgeLayoutDescriptor}. + * @see yfiles.seriesparallel.EdgeLayoutDescriptor + * @see yfiles.seriesparallel.SeriesParallelLayout#EDGE_LAYOUT_DESCRIPTOR_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + edgeLayoutDescriptors:yfiles.layout.ItemMapping; /** - * 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; + * Gets or sets the mapping from nodes to their {@link yfiles.seriesparallel.IPortAssignment}. + * @see yfiles.seriesparallel.SeriesParallelLayout#PORT_ASSIGNMENT_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + portAssignments:yfiles.layout.ItemMapping; /** - * 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; + * Gets or sets the mapping from nodes to comparison functions used to sort the nodes' outgoing edges. + * @see yfiles.seriesparallel.SeriesParallelLayout#OUT_EDGE_COMPARER_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + outEdgeComparers:yfiles.layout.ItemMapping; /** - * 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; + * Gets or sets a mapping from edges to an object representing their source edge group. + * @see yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + sourceGroupIds:yfiles.layout.ItemMapping; /** - * 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; + * Gets or sets a mapping from edges to an object representing their target edge group. + * @see yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY + * @type {yfiles.layout.ItemMapping.} + */ + targetGroupIds:yfiles.layout.ItemMapping; /** - * 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; + * Gets or sets the AbortHandler used during the layout. + * @see yfiles.algorithms.AbortHandler#ABORT_HANDLER_DP_KEY + * @type {yfiles.algorithms.AbortHandler} + */ + abortHandler:yfiles.algorithms.AbortHandler; + static $class:yfiles.lang.Class; } - 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 + }} + +declare module 'yfiles/algorithms' { export = yfiles; } +declare module 'yfiles/complete' { export = yfiles; } +declare module 'yfiles/lang' { export = yfiles.lang; } +declare module 'yfiles/layout' { export = yfiles; } +declare module 'yfiles/layout-familytree' { export = yfiles; } +declare module 'yfiles/layout-hierarchic' { export = yfiles; } +declare module 'yfiles/layout-multipage' { export = yfiles; } +declare module 'yfiles/layout-organic' { export = yfiles; } +declare module 'yfiles/layout-orthogonal' { export = yfiles; } +declare module 'yfiles/layout-orthogonal-compact' { export = yfiles; } +declare module 'yfiles/layout-partial' { export = yfiles; } +declare module 'yfiles/layout-radial' { export = yfiles; } +declare module 'yfiles/layout-seriesparallel' { export = yfiles; } +declare module 'yfiles/layout-tree' { export = yfiles; } +declare module 'yfiles/router-other' { export = yfiles; } +declare module 'yfiles/router-polyline' { export = yfiles; } +declare module 'yfiles/view' { export = yfiles; } +declare module 'yfiles/view-component' { export = yfiles; } +declare module 'yfiles/view-editor' { export = yfiles; } +declare module 'yfiles/view-folding' { export = yfiles; } +declare module 'yfiles/view-graphml' { export = yfiles; } +declare module 'yfiles/view-layout-bridge' { export = yfiles; } +declare module 'yfiles/view-table' { export = yfiles; } diff --git a/yfiles/yfiles-tests.ts b/yfiles/yfiles-tests.ts index f36770967b..a399dd32f1 100644 --- a/yfiles/yfiles-tests.ts +++ b/yfiles/yfiles-tests.ts @@ -1,41 +1,41 @@ namespace yfilesTest { export class BasicTest { - private graphControl:yfiles.canvas.GraphControl; + private graphComponent:yfiles.view.GraphComponent; constructor() { - this.graphControl = new yfiles.canvas.GraphControl.ForId("graphControl"); + this.graphComponent = new yfiles.view.GraphComponent("graphControl"); - var graphEditorInputMode = new yfiles.input.GraphEditorInputMode(); + let 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(); + yfiles.lang.Class.injectInterfaces(MyHitTestable.prototype, [yfiles.input.IHitTestable]); + let myHitTestable = new MyHitTestable(); - if (yfiles.drawing.IHitTestable.isInstance(myHitTestable)) { + if (yfiles.input.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.graphComponent.inputMode = graphEditorInputMode; - this.graphControl.graph.nodeDefaults.style = new yfiles.drawing.ShinyPlateNodeStyle.WithBrush(yfiles.system.Brushes.ORANGE); + this.graphComponent.graph.nodeDefaults.style = new yfiles.styles.ShinyPlateNodeStyle(yfiles.view.Fill.ORANGE); - this.graphControl.graph.createNodeWithBoundsAndStyle(new yfiles.geometry.RectD(0, 0, 10, 10), new MyNodeStyle()); + this.graphComponent.graph.createNode(new yfiles.geometry.Rect(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)); + for (let i = 0; i < 5; i++) { + for (let j = 0; j < 5; j++) { + this.graphComponent.graph.createNodeAt(new yfiles.geometry.Point(100 * i, 100 * j)); } } - this.graphControl.graph.nodes.forEach((node) => this.graphControl.graph.addLabel(node, "Label")); - this.graphControl.fitGraphBounds(); + this.graphComponent.graph.nodes.forEach((node) => this.graphComponent.graph.addLabel(node, "Label")); + this.graphComponent.fitGraphBounds(); } @@ -43,105 +43,97 @@ namespace yfilesTest { * 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)); + let layouter = new yfiles.hierarchic.HierarchicLayout(); + let layoutExecutor = new yfiles.layout.LayoutExecutor(this.graphComponent, + new yfiles.layout.MinimumNodeSizeStage(layouter)); - layoutExecutor.duration = yfiles.system.TimeSpan.fromSeconds(1); + layoutExecutor.duration = yfiles.lang.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(); + layoutExecutor.start().then(() => { + return null; + }) + .catch(error => { + throw error; + }); } /** * Runs a shortest path analysis. */ analyze() { - var graph = this.graphControl.graph; + let graph = this.graphComponent.graph; // Create the graph model adapter to get a proper analysis graph structure. - var graphAdapter = new yfiles.graph.YGraphAdapter(graph); + let graphAdapter = new yfiles.layout.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++) { + let cost = new Array(graph.edges.size); + for (let i = 0; i < graph.edges.size; i++) { cost[i] = Math.random(); } - var pred:yfiles.algorithms.Edge[] = null; + let pred:yfiles.algorithms.Edge[] = null; // Suppose the first node from the graph is the node named "Start." - var startNode = graphAdapter.getCopiedNode(graph.nodes.getFirstElement()); + let startNode = graphAdapter.getCopiedNode(graph.nodes.first()); // Suppose the last node from the graph is the node named "Destination." - var destinationNode = graphAdapter.getCopiedNode(graph.nodes.getLastElement()); + let destinationNode = graphAdapter.getCopiedNode(graph.nodes.last()); // Run the single-source single-sink algorithm on the graph. - var result = yfiles.algorithms.ShortestPaths.singleSourceSingleSinkToArray(graphAdapter.yGraph, startNode, + let result = yfiles.algorithms.ShortestPaths.singleSourceSingleSink(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++) { + let predIGraph = new Array(pred.length); + for (let 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 {} }); + new yfiles.lang.AttributeDefinition(() => { return {} }); + new yfiles.lang.ClassDefinition(() => { return {} }); + new yfiles.lang.EnumDefinition(() => { return {} }); + new yfiles.lang.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(); + let a01 = new yfiles.algorithms.AbortHandler(); + let a02 = new yfiles.binding.AdjacentNodesGraphBuilder(this.graphComponent.graph); + let a03 = new yfiles.circular.CircularLayout(); + let a04 = new yfiles.collections.List(); + let a05 = new yfiles.genealogy.FamilyTreeLayout(); + let a06 = new yfiles.geometry.Matrix(); + let a07 = new yfiles.graph.GraphClipboard(); + let a08:yfiles.graphml.ChildParseContext; + let a09 = new yfiles.hierarchic.AsIsLayerer(); + let a10 = new yfiles.input.GraphEditorInputMode(); + let a11 = new yfiles.labeling.GenericLabeling(); + let a12 = new yfiles.lang.Attribute(); + let a13 = new yfiles.layout.BendConverter(); + let a14 = new yfiles.multipage.DefaultElementFactory(); + let a15 = new yfiles.organic.OrganicLayout(); + let a16 = new yfiles.orthogonal.CompactOrthogonalLayout(); + let a17 = new yfiles.partial.PartialLayout(); + let a18 = new yfiles.radial.RadialLayout(); + let a19 = new yfiles.router.BusRouter(); + let a20 = new yfiles.seriesparallel.SeriesParallelLayout(); + let a21 = new yfiles.styles.ArcEdgeStyle(); + let a22 = new yfiles.tree.AspectRatioTreeLayout(); + let a23 = new yfiles.view.GraphComponent(); } } - class MyHitTestable implements yfiles.drawing.IHitTestable { - isHit(p:yfiles.geometry.PointD, ctx:yfiles.canvas.ICanvasContext):boolean { + class MyHitTestable extends yfiles.lang.BaseClass(yfiles.input.IHitTestable) implements yfiles.input.IHitTestable { + isHit(ctx:yfiles.input.IInputModeContext, p:yfiles.geometry.Point):boolean { return false; } } - class MyNodeStyle extends yfiles.drawing.SimpleAbstractNodeStyle { - constructor() { - super(null); - } - 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)); + class MyNodeStyle extends yfiles.styles.NodeStyleBase { + createVisual(renderContext:yfiles.view.IRenderContext, node:yfiles.graph.INode):yfiles.view.SvgVisual { + let g = document.createElementNS("http://www.w3.org/2000/svg", "g"); + return new yfiles.view.SvgVisual(g); } } } From 20c296cac728c8c7113d79a1c438ffd331f2d87e Mon Sep 17 00:00:00 2001 From: Chad Burggraf Date: Tue, 20 Dec 2016 07:17:24 -0700 Subject: [PATCH 043/101] Add redux-batched-actions typings. (#13054) --- redux-batched-actions/index.d.ts | 23 +++++++++++++++++++ redux-batched-actions/package.json | 5 ++++ .../redux-batched-actions-tests.ts | 14 +++++++++++ redux-batched-actions/tsconfig.json | 19 +++++++++++++++ redux-batched-actions/tslint.json | 3 +++ 5 files changed, 64 insertions(+) create mode 100644 redux-batched-actions/index.d.ts create mode 100644 redux-batched-actions/package.json create mode 100644 redux-batched-actions/redux-batched-actions-tests.ts create mode 100644 redux-batched-actions/tsconfig.json create mode 100644 redux-batched-actions/tslint.json diff --git a/redux-batched-actions/index.d.ts b/redux-batched-actions/index.d.ts new file mode 100644 index 0000000000..3d3970a0f5 --- /dev/null +++ b/redux-batched-actions/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for redux-batched-actions 0.1 +// Project: https://github.com/tshelburne/redux-batched-actions +// Definitions by: Chad Burggraf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = ReduxBatchedActions; +export as namespace ReduxBatchedActions; + +import { Action, Reducer } from 'redux'; + +declare namespace ReduxBatchedActions { + /** + * Batching action creator that creates a higher-order + * action from an array of actions. + */ + export function batchActions(actions: A[]): Action; + + /** + * Creates a higher-order reducer that enables batching + * actions for the given reducer. + */ + export function enableBatching(reducer: Reducer): Reducer; +} diff --git a/redux-batched-actions/package.json b/redux-batched-actions/package.json new file mode 100644 index 0000000000..6cfd8dc05c --- /dev/null +++ b/redux-batched-actions/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} \ No newline at end of file diff --git a/redux-batched-actions/redux-batched-actions-tests.ts b/redux-batched-actions/redux-batched-actions-tests.ts new file mode 100644 index 0000000000..51e6966010 --- /dev/null +++ b/redux-batched-actions/redux-batched-actions-tests.ts @@ -0,0 +1,14 @@ +import { Reducer, createStore } from 'redux'; +import { Action, createAction } from 'redux-actions'; +import { enableBatching, batchActions } from 'redux-batched-actions'; + +const doThing = createAction('DO_THING'); +const doOther = createAction('DO_OTHER'); + +const reducer = (state: any = {}, action: Action): any => { + return state; +}; + +const store = createStore(enableBatching(reducer), {}); + +store.dispatch(batchActions([doThing(), doOther()])); diff --git a/redux-batched-actions/tsconfig.json b/redux-batched-actions/tsconfig.json new file mode 100644 index 0000000000..26205680f8 --- /dev/null +++ b/redux-batched-actions/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redux-batched-actions-tests.ts" + ] +} \ No newline at end of file diff --git a/redux-batched-actions/tslint.json b/redux-batched-actions/tslint.json new file mode 100644 index 0000000000..192203ab54 --- /dev/null +++ b/redux-batched-actions/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From d80069d043d67ba08b7019a9e986816e11fd462e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ki=E1=BB=87t=20Th=C3=A0nh=20V=C3=B5?= Date: Tue, 20 Dec 2016 21:27:09 +0700 Subject: [PATCH 044/101] Add types for mailgen (#13080) --- mailgen/index.d.ts | 57 ++++++++++++++++++++++++++++++++++++++++ mailgen/mailgen-tests.ts | 20 ++++++++++++++ mailgen/tsconfig.json | 19 ++++++++++++++ mailgen/tslint.json | 1 + 4 files changed, 97 insertions(+) create mode 100644 mailgen/index.d.ts create mode 100644 mailgen/mailgen-tests.ts create mode 100644 mailgen/tsconfig.json create mode 100644 mailgen/tslint.json diff --git a/mailgen/index.d.ts b/mailgen/index.d.ts new file mode 100644 index 0000000000..1db097ffad --- /dev/null +++ b/mailgen/index.d.ts @@ -0,0 +1,57 @@ +// Type definitions for mailgen 2.0 +// Project: https://github.com/eladnava/mailgen#readme +// Definitions by: Kiet Thanh Vo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import Option = Mailgen.Option; +import Content = Mailgen.Content; +/** + * Created by kiettv on 7/24/16. + */ +declare class Mailgen { + constructor(opts: Option); + + cacheThemes(): void; + + generate(params: Content): any; + + generatePlaintext(params: Content): any; + + parseParams(params: any): any; +} + +declare namespace Mailgen { + interface Option { + theme: string; + product: Product; + } + + interface Product { + name: string; + link: string; + logo?: string; + } + + interface Content { + body: ContentBody; + } + + interface ContentBody { + name: string; + intro: string; + action?: Action; + outro: string; + } + + interface Action { + instructions: string; + button: Button; + } + + interface Button { + color: string; + text: string; + link: string; + } +} + +export = Mailgen; diff --git a/mailgen/mailgen-tests.ts b/mailgen/mailgen-tests.ts new file mode 100644 index 0000000000..87d04ee943 --- /dev/null +++ b/mailgen/mailgen-tests.ts @@ -0,0 +1,20 @@ +import * as Mailgen from "mailgen" + +const generator: Mailgen = new Mailgen({ + theme: "default", + product: { + name: "test", + link: "http://localhost", + } +}); + +let content: Mailgen.Content = { + body: { + name: "Hi", + intro: "test", + outro: "test", + }, +}; + +let html = generator.generate(content); +html = generator.generatePlaintext(content); diff --git a/mailgen/tsconfig.json b/mailgen/tsconfig.json new file mode 100644 index 0000000000..0cb8974bf2 --- /dev/null +++ b/mailgen/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mailgen-tests.ts" + ] +} diff --git a/mailgen/tslint.json b/mailgen/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/mailgen/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 88259e57b48ed885ffcf014748a3dcbe2d509d7b Mon Sep 17 00:00:00 2001 From: rafw87 Date: Tue, 20 Dec 2016 15:27:48 +0100 Subject: [PATCH 045/101] Typings for cordova-sqlite-storage (#13081) --- .../cordova-sqlite-storage-tests.ts | 217 ++++++++++++++++++ cordova-sqlite-storage/index.d.ts | 68 ++++++ cordova-sqlite-storage/tsconfig.json | 19 ++ cordova-sqlite-storage/tslint.json | 1 + 4 files changed, 305 insertions(+) create mode 100644 cordova-sqlite-storage/cordova-sqlite-storage-tests.ts create mode 100644 cordova-sqlite-storage/index.d.ts create mode 100644 cordova-sqlite-storage/tsconfig.json create mode 100644 cordova-sqlite-storage/tslint.json diff --git a/cordova-sqlite-storage/cordova-sqlite-storage-tests.ts b/cordova-sqlite-storage/cordova-sqlite-storage-tests.ts new file mode 100644 index 0000000000..31c334afca --- /dev/null +++ b/cordova-sqlite-storage/cordova-sqlite-storage-tests.ts @@ -0,0 +1,217 @@ +/// + +// examples taken from https://github.com/litehelpers/Cordova-sqlite-storage +function echoTestFunction() { + function successCallback(value: string) { + + } + function errorCallback() { + + } + window.sqlitePlugin.echoTest(successCallback, errorCallback); +} +function selfTestFunction() { + function successCallback() { + + } + function errorCallback() { + + } + window.sqlitePlugin.selfTest(successCallback, errorCallback); +} + +function openingDatabase() { + function successcb(db: SQLitePlugin.Database) { + + } + function errorcb(err: Error) { + + } + + var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'}, successcb, errorcb); + var db = window.sqlitePlugin.openDatabase({name: 'my.db', iosDatabaseLocation: 'Library'}, successcb, errorcb); +} + +function openingDatabase2() { + window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'}, function(db) { + db.transaction(function(tx) { + // ... + }, function(err) { + console.log('Open database ERROR: ' + JSON.stringify(err)); + }); + }); +} + +function singleStatementTransactions(db: SQLitePlugin.Database) { + db.executeSql('INSERT INTO MyTable VALUES (?)', ['test-value'], function (resultSet) { + console.log('resultSet.insertId: ' + resultSet.insertId); + console.log('resultSet.rowsAffected: ' + resultSet.rowsAffected); + }, function(error) { + console.log('SELECT error: ' + error.message); + }); + + db.executeSql("SELECT LENGTH('tenletters') AS stringlength", [], function (resultSet) { + console.log('got stringlength: ' + resultSet.rows.item(0).stringlength); + }, function(error) { + console.log('SELECT error: ' + error.message); + }); +} + +function sqlBatchTransactions(db: SQLitePlugin.Database) { + db.sqlBatch([ + 'DROP TABLE IF EXISTS MyTable', + 'CREATE TABLE MyTable (SampleColumn)', + [ 'INSERT INTO MyTable VALUES (?)', ['test-value'] ], + ], function() { + db.executeSql('SELECT * FROM MyTable', [], function (resultSet) { + console.log('Sample column value: ' + resultSet.rows.item(0).SampleColumn); + }); + }, function(error) { + console.log('Populate table error: ' + error.message); + }); +} + +function asynchronousTransaction(db: SQLitePlugin.Database) { + db.transaction(function(tx) { + tx.executeSql('DROP TABLE IF EXISTS MyTable'); + tx.executeSql('CREATE TABLE MyTable (SampleColumn)'); + tx.executeSql('INSERT INTO MyTable VALUES (?)', ['test-value'], function(tx, resultSet) { + console.log('resultSet.insertId: ' + resultSet.insertId); + console.log('resultSet.rowsAffected: ' + resultSet.rowsAffected); + }, function(tx, error) { + console.log('INSERT error: ' + error.message); + }); + }, function(error) { + console.log('transaction error: ' + error.message); + }, function() { + console.log('transaction ok'); + }); + + db.readTransaction(function(tx) { + tx.executeSql("SELECT UPPER('Some US-ASCII text') AS uppertext", [], function(tx, resultSet) { + console.log("resultSet.rows.item(0).uppertext: " + resultSet.rows.item(0).uppertext); + }, function(tx, error) { + console.log('SELECT error: ' + error.message); + }); + }, function(error) { + console.log('transaction error: ' + error.message); + }, function() { + console.log('transaction ok'); + }); +} + +function sampleWithPRAGMA() { + // Wait for Cordova to load + document.addEventListener('deviceready', onDeviceReady, false); + + // Cordova is ready + function onDeviceReady() { + var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'}); + + db.transaction(function(tx) { + tx.executeSql('DROP TABLE IF EXISTS test_table'); + tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)'); + + // demonstrate PRAGMA: + db.executeSql("pragma table_info (test_table);", [], function(res) { + console.log("PRAGMA res: " + JSON.stringify(res)); + }); + + tx.executeSql("INSERT INTO test_table (data, data_num) VALUES (?,?)", ["test", 100], function(tx, res) { + console.log("insertId: " + res.insertId + " -- probably 1"); + console.log("rowsAffected: " + res.rowsAffected + " -- should be 1"); + + db.transaction(function(tx) { + tx.executeSql("select count(id) as cnt from test_table;", [], function(tx, res) { + console.log("res.rows.length: " + res.rows.length + " -- should be 1"); + console.log("res.rows.item(0).cnt: " + res.rows.item(0).cnt + " -- should be 1"); + }); + }); + +// }, function(e) { // probably example in https://github.com/litehelpers/Cordova-sqlite-storage is broken + }, function(_tx, e) { + console.log("ERROR: " + e.message); + }); + }); + } +} + + +function sampleWithTransactionLevelNesting() { + // Wait for Cordova to load + document.addEventListener('deviceready', onDeviceReady, false); + + // Cordova is ready + function onDeviceReady() { + var db = window.sqlitePlugin.openDatabase({name: 'my.db', location: 'default'}); + + db.transaction(function(tx) { + tx.executeSql('DROP TABLE IF EXISTS test_table'); + tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)'); + + tx.executeSql("INSERT INTO test_table (data, data_num) VALUES (?,?)", ["test", 100], function(tx, res) { + console.log("insertId: " + res.insertId + " -- probably 1"); + console.log("rowsAffected: " + res.rowsAffected + " -- should be 1"); + + tx.executeSql("select count(id) as cnt from test_table;", [], function(tx, res) { + console.log("res.rows.length: " + res.rows.length + " -- should be 1"); + console.log("res.rows.item(0).cnt: " + res.rows.item(0).cnt + " -- should be 1"); + }); + + }, function(tx, e) { + console.log("ERROR: " + e.message); + }); + }); + } +} + + +function dbClose(db: SQLitePlugin.Database) { + function successcb() { + + } + function errorcb(err: Error) { + + } + + db.close(successcb, errorcb); + + + db.transaction(function (tx) { + tx.executeSql("SELECT LENGTH('tenletters') AS stringlength", [], function (tx, res) { + console.log('got stringlength: ' + res.rows.item(0).stringlength); + }); + }, function (error) { + // OK to close here: + console.log('transaction error: ' + error.message); + db.close(); + }, function () { + // OK to close here: + console.log('transaction ok'); + db.close(function () { + console.log('database is closed ok'); + }); + }); +} + +function deleteDatabase() { + function successcb() { + + } + function errorcb(err: Error) { + + } + + window.sqlitePlugin.deleteDatabase({name: 'my.db', location: 'default'}, successcb, errorcb); +} + + +function quickInstallationTest() { + window.sqlitePlugin.openDatabase({ name: 'hello-world.db', location: 'default' }, function (db) { + db.executeSql("select length('tenletters') as stringlength", [], function (res) { + var stringlength = res.rows.item(0).stringlength; + console.log('got stringlength: ' + stringlength); + //document.getElementById('deviceready').querySelector('.received').innerHTML = 'stringlength: ' + stringlength; + }); + }); +} diff --git a/cordova-sqlite-storage/index.d.ts b/cordova-sqlite-storage/index.d.ts new file mode 100644 index 0000000000..7759ab5ad2 --- /dev/null +++ b/cordova-sqlite-storage/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for cordova-sqlite-storage 1.5 +// Project: https://github.com/litehelpers/Cordova-sqlite-storage +// Definitions by: rafw87 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Window { + sqlitePlugin: SQLitePlugin.SQLite; +} + +declare var sqlitePlugin: SQLitePlugin.SQLite; + +declare namespace SQLitePlugin { + type TransactionFunction = (tx: Transaction) => void; + + type SuccessCallback = () => void; + type DatabaseSuccessCallback = (db: Database) => void; + type StatementSuccessCallback = (results: Results) => void; + type TransactionStatementSuccessCallback = (tx: Transaction, results: Results) => void; + + type ErrorCallback = (err: Error) => void; + type TransactionStatementErrorCallback = (tx: Transaction, err: Error) => boolean|void; + + interface OpenArgs { + name: string; + location?: string; + iosDatabaseLocation?: string; + androidDatabaseImplementation?: number; + androidLockWorkaround?: number; + createFromLocation?: number; + [key: string]: any; + } + interface DeleteArgs { + name: string; + location?: string; + iosDatabaseLocation?: string; + } + + interface Results { + rowsAffected: number; + insertId?: number; + rows: { + length: number; + item(i: number): any; + }; + } + + interface Transaction { + executeSql(statement: string, params?: any[], success?: TransactionStatementSuccessCallback, error?: TransactionStatementErrorCallback): void; + } + + interface Database { + transaction(fn: TransactionFunction, error?: ErrorCallback, success?: SuccessCallback): void; + readTransaction(fn: TransactionFunction, error?: ErrorCallback, success?: SuccessCallback): void; + + executeSql(statement: string, params?: any[], success?: StatementSuccessCallback, error?: ErrorCallback): void; + sqlBatch (sqlStatements: Array, success?: SuccessCallback, error?: ErrorCallback): void; + + close(success?: SuccessCallback, error?: ErrorCallback): void; + } + + interface SQLite { + openDatabase(args: OpenArgs, success?: DatabaseSuccessCallback, error?: ErrorCallback): Database; + deleteDatabase(args: DeleteArgs, success?: SuccessCallback, error?: ErrorCallback): void; + selfTest(success?: SuccessCallback, error?: ErrorCallback): void; + echoTest(ok?: (value: string) => void, error?: (msg: string) => void): void; + } +} + diff --git a/cordova-sqlite-storage/tsconfig.json b/cordova-sqlite-storage/tsconfig.json new file mode 100644 index 0000000000..5659bf7626 --- /dev/null +++ b/cordova-sqlite-storage/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova-sqlite-storage-tests.ts" + ] +} diff --git a/cordova-sqlite-storage/tslint.json b/cordova-sqlite-storage/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/cordova-sqlite-storage/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 3676f9340d29a97842fa6f90779eda697ca0b5d0 Mon Sep 17 00:00:00 2001 From: James Birtles Date: Tue, 20 Dec 2016 14:29:27 +0000 Subject: [PATCH 046/101] Add flatpickr definitions (#13083) --- flatpickr/flatpickr-tests.ts | 15 ++++++++ flatpickr/index.d.ts | 68 ++++++++++++++++++++++++++++++++++++ flatpickr/tsconfig.json | 19 ++++++++++ flatpickr/tslint.json | 1 + 4 files changed, 103 insertions(+) create mode 100644 flatpickr/flatpickr-tests.ts create mode 100644 flatpickr/index.d.ts create mode 100644 flatpickr/tsconfig.json create mode 100644 flatpickr/tslint.json diff --git a/flatpickr/flatpickr-tests.ts b/flatpickr/flatpickr-tests.ts new file mode 100644 index 0000000000..9f0211c79d --- /dev/null +++ b/flatpickr/flatpickr-tests.ts @@ -0,0 +1,15 @@ +import * as Flatpickr from 'flatpickr'; + +const picker1 = new Flatpickr('input'); + +const input = document.querySelector('input'); +if (input != null) { + const picker2 = new Flatpickr(input, { + mode: 'range', + onChange: dates => null + }); + picker2.setDate(['2016-11-15T00:00:00.000Z', new Date()]); +} + +picker1.destroy(); + diff --git a/flatpickr/index.d.ts b/flatpickr/index.d.ts new file mode 100644 index 0000000000..fc3de85a53 --- /dev/null +++ b/flatpickr/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for flatpickr 2.2 +// Project: https://github.com/chmln/flatpickr +// Definitions by: James Birtles +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare class Flatpickr { + constructor(element: string | Element, options?: Flatpickr.Options); + + changeMonth(month: number, isOffset: boolean): void; + clear(): void; + close(): void; + destroy(): void; + formatDate(format: string, date: Date): string; + jumpToDate(date?: Flatpickr.DateString): void; + open(): void; + parseDate(date: string): Date; + redraw(): void; + set(option: string, value: any): void; + setDate(date: Flatpickr.DateString | Flatpickr.DateString[]): void; + toggle(): void; +} + +declare namespace Flatpickr { + interface Options { + altFormat?: string; + altInput?: boolean; + altInputClass?: string; + allowInput?: boolean; + clickOpens?: boolean; + dateFormat?: string | null; + defaultDate?: DateString | DateString[]; + disable?: DateRange[]; + enable?: DateRange[]; + enableTime?: boolean; + enableSeconds?: boolean; + hourIncrement?: number; + inline?: boolean; + maxDate?: DateString; + minDate?: DateString; + minuteIncrement?: number; + mode?: Mode; + nextArrow?: string; + noCalendar?: boolean; + onChange?: EventCallback | EventCallback[]; + onClose?: EventCallback | EventCallback[]; + onOpen?: EventCallback | EventCallback[]; + onReady?: EventCallback | EventCallback[]; + onMonthChange?: EventCallback | EventCallback[]; + onYearChange?: EventCallback | EventCallback[]; + onValueUpdate?: EventCallback | EventCallback[]; + onDayCreate?: EventCallback | EventCallback[]; + parseDate?: (date: string) => Date; + prevArrow?: string; + shorthandCurrentMonth?: boolean; + static?: boolean; + time_24hr?: boolean; + utc?: boolean; + weekNumbers?: boolean; + wrap?: boolean; + } + + type DateString = Date | string; + type DateRange = DateString | { from: DateString, to: DateString } | ((date: Date) => boolean); + type Mode = 'single' | 'multiple' | 'range'; + type EventCallback = (selectedDates: Date[], dateStr: string, instance: Flatpickr, elem: HTMLElement) => void; +} + +export = Flatpickr; diff --git a/flatpickr/tsconfig.json b/flatpickr/tsconfig.json new file mode 100644 index 0000000000..cc9b182a98 --- /dev/null +++ b/flatpickr/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "flatpickr-tests.ts" + ] +} diff --git a/flatpickr/tslint.json b/flatpickr/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/flatpickr/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From cf2712a66f391d18882da4af7ddc5b59d1513330 Mon Sep 17 00:00:00 2001 From: Adam Charron Date: Tue, 20 Dec 2016 09:33:32 -0500 Subject: [PATCH 047/101] Add pouch-redux-middleware typing (#13071) * Add pouch-redux-middleware typing * Fix <> in comment --- pouch-redux-middleware/index.d.ts | 34 +++++++++++++++++++ pouch-redux-middleware/package.json | 5 +++ .../pouch-redux-middleware-tests.ts | 22 ++++++++++++ pouch-redux-middleware/tsconfig.json | 19 +++++++++++ 4 files changed, 80 insertions(+) create mode 100644 pouch-redux-middleware/index.d.ts create mode 100644 pouch-redux-middleware/package.json create mode 100644 pouch-redux-middleware/pouch-redux-middleware-tests.ts create mode 100644 pouch-redux-middleware/tsconfig.json diff --git a/pouch-redux-middleware/index.d.ts b/pouch-redux-middleware/index.d.ts new file mode 100644 index 0000000000..2e940e819d --- /dev/null +++ b/pouch-redux-middleware/index.d.ts @@ -0,0 +1,34 @@ +// Type definitions for pouch-redux-middleware 0.5.0 +// Project: https://github.com/pgte/pouch-redux-middleware +// Definitions by: Adam Charron +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Dispatch, Action, Middleware } from 'redux' +import * as PouchDB from 'pouchdb' + +export interface Document { + _id: any; + [field: string]: any +} + +export interface Path { + path: string + db: PouchDB.Database + scheduleRemove?: (doc: Document) => void + scheduleInset?: (doc: Document) => void + propagateDelete?: (doc: Document, dispatch: Dispatch) => void + propagateInsert?: (doc: Document, dispatch: Dispatch) => void + propagateUpdate?: (doc: Document, dispatch: Dispatch) => void + handleResponse?: (err: Error, data: any, errorCallback: (err: Error) => void) => void + queue?: Function + docs?: any + actions: { + remove: (doc: Document) => Action + update: (doc: Document) => Action + insert: (doc: Document) => Action + } +} + +export default function PouchMiddlewareFactory(paths?: Path[] | Path): Middleware + + diff --git a/pouch-redux-middleware/package.json b/pouch-redux-middleware/package.json new file mode 100644 index 0000000000..36ce503807 --- /dev/null +++ b/pouch-redux-middleware/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "redux": "^3.6.0" + } +} diff --git a/pouch-redux-middleware/pouch-redux-middleware-tests.ts b/pouch-redux-middleware/pouch-redux-middleware-tests.ts new file mode 100644 index 0000000000..1ae6493175 --- /dev/null +++ b/pouch-redux-middleware/pouch-redux-middleware-tests.ts @@ -0,0 +1,22 @@ +import * as redux from 'redux' +import makePouchMiddleware, { Document, Path } from 'pouch-redux-middleware' +import * as PouchDB from 'pouchdb'; + +const types = { + DELETE_TODO: 'delete-todo', + INSERT_TODO: 'insert-todo', + UPDATE_TODO: 'update-todo' +} + +const path: Path = { + path: "/test", + db: new PouchDB('test'), + actions: { + remove: doc => { return { type: types.DELETE_TODO, id: doc._id } }, + insert: doc => { return { type: types.INSERT_TODO, todo: doc } }, + update: doc => { return { type: types.UPDATE_TODO, todo: doc } }, + } +} + +const middleware: redux.Middleware = makePouchMiddleware(path) +const otherMiddleware: redux.Middleware = makePouchMiddleware([path, path, path]) diff --git a/pouch-redux-middleware/tsconfig.json b/pouch-redux-middleware/tsconfig.json new file mode 100644 index 0000000000..0c5d1d3b19 --- /dev/null +++ b/pouch-redux-middleware/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pouch-redux-middleware-tests.ts" + ] +} From 45ff4733fc3027cc2c997a35631f057ccebd5173 Mon Sep 17 00:00:00 2001 From: Yu Jianrong Date: Tue, 20 Dec 2016 22:34:37 +0800 Subject: [PATCH 048/101] Add declaration for crc (#13068) --- crc/crc-tests.ts | 17 +++++++++++++++++ crc/index.d.ts | 17 +++++++++++++++++ crc/tsconfig.json | 19 +++++++++++++++++++ crc/tslint.json | 1 + 4 files changed, 54 insertions(+) create mode 100644 crc/crc-tests.ts create mode 100644 crc/index.d.ts create mode 100644 crc/tsconfig.json create mode 100644 crc/tslint.json diff --git a/crc/crc-tests.ts b/crc/crc-tests.ts new file mode 100644 index 0000000000..b279bc6fad --- /dev/null +++ b/crc/crc-tests.ts @@ -0,0 +1,17 @@ +import * as crc from "crc" +import * as fs from "fs" + +// tests move from the readme of the module + +crc.crc32('hello').toString(16); +// "3610a686" + +crc.crc32(fs.readFileSync('README.md', 'utf8')).toString(16); +// "127ad531" +crc.crc32(fs.readFileSync('README.md')).toString(16); +// "127ad531" + +let value = crc.crc32('one'); +value = crc.crc32('two', value); +value = crc.crc32('three', value); +value.toString(16); diff --git a/crc/index.d.ts b/crc/index.d.ts new file mode 100644 index 0000000000..02db0e40b6 --- /dev/null +++ b/crc/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for crc 3.4 +// Project: https://github.com/alexgorbatchev/node-crc/ +// Definitions by: Jianrong Yu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export function crc1(buf: string | Buffer, previous?: number): number; +export function crc8(buf: string | Buffer, previous?: number): number; +export function crc81wire(buf: string | Buffer, previous?: number): number; +export function crc16(buf: string | Buffer, previous?: number): number; +export function crc16ccitt(buf: string | Buffer, previous?: number): number; +export function crc16modbus(buf: string | Buffer, previous?: number): number; +export function crc16xmodem(buf: string | Buffer, previous?: number): number; +export function crc16kermit(buf: string | Buffer, previous?: number): number; +export function crc24(buf: string | Buffer, previous?: number): number; +export function crc32(buf: string | Buffer, previous?: number): number; diff --git a/crc/tsconfig.json b/crc/tsconfig.json new file mode 100644 index 0000000000..982af47274 --- /dev/null +++ b/crc/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "crc-tests.ts" + ] +} diff --git a/crc/tslint.json b/crc/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/crc/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 5ed3a5be31f36dfef4fe460a5bbea368f1f14bbe Mon Sep 17 00:00:00 2001 From: Craig Boland Date: Tue, 20 Dec 2016 08:36:09 -0600 Subject: [PATCH 049/101] Updated jquery.dataTables for 1.10.9 (#13099) Release Notes: https://cdn.datatables.net/1.10.9/ * Moved legacy browser settings to its own data type. * Added 'aIds' property on legacy settings object for mapping row ids to data indexes. * Added 'rowIdFn' function to legacy settings object to get a row's id from the row's data. --- jquery.datatables/index.d.ts | 15 ++++++++++++--- jquery.datatables/jquery.dataTables-tests.ts | 13 ++++++++++++- jquery.datatables/tsconfig.json | 10 +++++----- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/jquery.datatables/index.d.ts b/jquery.datatables/index.d.ts index bca787fe8d..c7c4bd8682 100644 --- a/jquery.datatables/index.d.ts +++ b/jquery.datatables/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for JQuery DataTables 1.10.8 +// Type definitions for JQuery DataTables 1.10.9 // Project: http://www.datatables.net // Definitions by: Kiarash Ghiaseddin , Omid Rad , Armin Sander // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,7 +8,7 @@ // - Plugin and extension definitions are not typed. // - Some return types are not fully wokring -/// +/// interface JQuery { DataTable(param?: DataTables.Settings): DataTables.DataTable; @@ -1752,9 +1752,10 @@ declare namespace DataTables { oFeatures: FeaturesLegacy; oScroll: ScrollingLegacy; oLanguage: LanguageLegacy; // | { fnInfoCallback: FunctionInfoCallback; }; - oBrowser: { bScrollOversize: boolean; }; + oBrowser: BrowserLegacy; aanFeatures: ArrayStringNode[][]; aoData: RowLegacy[]; + aIds: any; aiDisplay: number[]; aiDisplayMaster: number[]; aoColumns: ColumnLegacy[]; @@ -1827,6 +1828,14 @@ declare namespace DataTables { iTabIndex: number; nScrollHead: Node; nScrollFoot: Node; + rowIdFn: (mSource: string | number | Function) => Function; + } + + export interface BrowserLegacy { + barWidth: number, + bBounding: boolean, + bScrollbarLeft: boolean, + bScrollOversize: boolean } export interface FeaturesLegacy { diff --git a/jquery.datatables/jquery.dataTables-tests.ts b/jquery.datatables/jquery.dataTables-tests.ts index 591b875cdb..1bf6e26593 100644 --- a/jquery.datatables/jquery.dataTables-tests.ts +++ b/jquery.datatables/jquery.dataTables-tests.ts @@ -1,4 +1,4 @@ -/// +/// $(document).ready(function () { @@ -268,6 +268,17 @@ $(document).ready(function () { //#endregion "Settings" + //#region "Settings-Legacy" + + var browserLegacy: DataTables.BrowserLegacy = { + barWidth: 10, + bBounding: true, + bScrollbarLeft: true, + bScrollOversize: true + } + + //#endregion + //#region "Init" var dt = $('#example').DataTable(); diff --git a/jquery.datatables/tsconfig.json b/jquery.datatables/tsconfig.json index eeaf42b334..91bf41e437 100644 --- a/jquery.datatables/tsconfig.json +++ b/jquery.datatables/tsconfig.json @@ -1,8 +1,4 @@ { - "files": [ - "index.d.ts", - "jquery.dataTables-tests.ts" - ], "compilerOptions": { "module": "commonjs", "target": "es6", @@ -15,5 +11,9 @@ "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true - } + }, + "files": [ + "index.d.ts", + "jquery.dataTables-tests.ts" + ] } \ No newline at end of file From bfd9af02cacc195286d3a0ed1f0ae895f15cbf26 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Tue, 20 Dec 2016 10:57:18 -0800 Subject: [PATCH 050/101] chore(lint): change vis typing to external module (#13399) --- vis/index.d.ts | 3270 +++++++++++++++++++++++----------------------- vis/tslint.json | 6 +- vis/vis-tests.ts | 2 - 3 files changed, 1634 insertions(+), 1644 deletions(-) diff --git a/vis/index.d.ts b/vis/index.d.ts index 5d813affac..68c054820f 100644 --- a/vis/index.d.ts +++ b/vis/index.d.ts @@ -3,1744 +3,1740 @@ // Definitions by: Michaël Bitard , Adrian Caballero , Severin , kaktus40 , Matthieu Maitre // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace vis { - type IdType = string | number; - type SubgroupType = IdType; - type DateType = Date | number | string; - type HeightWidthType = IdType; - type TimelineTimeAxisScaleType = 'millisecond' | 'second' | 'minute' | 'hour' | - 'weekday' | 'day' | 'month' | 'year'; - type TimelineEventPropertiesResultWhatType = 'item' | 'background' | 'axis' | - 'group-label' | 'custom-time' | 'current-time'; - type TimelineEvents = - 'currentTimeTick' | - 'click' | - 'contextmenu' | - 'doubleClick' | - 'groupDragged' | - 'changed' | - 'rangechange' | - 'rangechanged' | - 'select' | - 'itemover' | - 'itemout' | - 'timechange' | - 'timechanged'; +type IdType = string | number; +type SubgroupType = IdType; +type DateType = Date | number | string; +type HeightWidthType = IdType; +type TimelineTimeAxisScaleType = 'millisecond' | 'second' | 'minute' | 'hour' | + 'weekday' | 'day' | 'month' | 'year'; +type TimelineEventPropertiesResultWhatType = 'item' | 'background' | 'axis' | + 'group-label' | 'custom-time' | 'current-time'; +type TimelineEvents = + 'currentTimeTick' | + 'click' | + 'contextmenu' | + 'doubleClick' | + 'groupDragged' | + 'changed' | + 'rangechange' | + 'rangechanged' | + 'select' | + 'itemover' | + 'itemout' | + 'timechange' | + 'timechanged'; - interface DataItem { - className?: string; - content: string; - end?: DateType; - group?: any; - id?: IdType; - start: DateType; - style?: string; - subgroup?: SubgroupType; - title?: string; - type?: string; - editable?: boolean; - } +interface DataItem { + className?: string; + content: string; + end?: DateType; + group?: any; + id?: IdType; + start: DateType; + style?: string; + subgroup?: SubgroupType; + title?: string; + type?: string; + editable?: boolean; +} - interface DataGroup { - className?: string; - content: string; - id: IdType; - style?: string; - subgroupOrder?: string | (() => void); - title?: string; - } +interface DataGroup { + className?: string; + content: string; + id: IdType; + style?: string; + subgroupOrder?: string | (() => void); + title?: string; +} - interface TimelineEditableOption { - add?: boolean; - remove?: boolean; - updateGroup?: boolean; - updateTime?: boolean; - } +interface TimelineEditableOption { + add?: boolean; + remove?: boolean; + updateGroup?: boolean; + updateTime?: boolean; +} - interface TimelineGroupEditableOption { - add?: boolean; - remove?: boolean; - order?: boolean; - } +interface TimelineGroupEditableOption { + add?: boolean; + remove?: boolean; + order?: boolean; +} - interface TimelineMarginItem { - horizontal?: number; - vertical?: number; - } +interface TimelineMarginItem { + horizontal?: number; + vertical?: number; +} - type TimelineMarginItemType = number | TimelineMarginItem; +type TimelineMarginItemType = number | TimelineMarginItem; - interface TimelineMarginOption { - axis?: number; - item?: TimelineMarginItemType; - } +interface TimelineMarginOption { + axis?: number; + item?: TimelineMarginItemType; +} - interface TimelineOrientationOption { - axis?: string; - item?: string; - } +interface TimelineOrientationOption { + axis?: string; + item?: string; +} - interface TimelineTimeAxisOption { - scale?: TimelineTimeAxisScaleType; - step?: number; - } +interface TimelineTimeAxisOption { + scale?: TimelineTimeAxisScaleType; + step?: number; +} - type TimelineOptionsConfigureFunction = (option: string, path: string[]) => boolean; - type TimelineOptionsConfigureType = boolean | TimelineOptionsConfigureFunction; - type TimelineOptionsDataAttributesType = boolean | string | string[]; - type TimelineOptionsEditableType = boolean | TimelineEditableOption; - type TimelineOptionsGroupEditableType = boolean | TimelineGroupEditableOption; - type TimelineOptionsGroupOrderType = string | (() => void); // TODO - type TimelineOptionsGroupOrderSwapFunction = (fromGroup: any, toGroup: any, groups: DataSet) => void; - type TimelineOptionsMarginType = number | TimelineMarginOption; - type TimelineOptionsOrientationType = string | TimelineOrientationOption; - type TimelineOptionsSnapFunction = (date: Date, scale: string, step: number) => Date | number; - // type TimelineOptions = +type TimelineOptionsConfigureFunction = (option: string, path: string[]) => boolean; +type TimelineOptionsConfigureType = boolean | TimelineOptionsConfigureFunction; +type TimelineOptionsDataAttributesType = boolean | string | string[]; +type TimelineOptionsEditableType = boolean | TimelineEditableOption; +type TimelineOptionsGroupEditableType = boolean | TimelineGroupEditableOption; +type TimelineOptionsGroupOrderType = string | (() => void); // TODO +type TimelineOptionsGroupOrderSwapFunction = (fromGroup: any, toGroup: any, groups: DataSet) => void; +type TimelineOptionsMarginType = number | TimelineMarginOption; +type TimelineOptionsOrientationType = string | TimelineOrientationOption; +type TimelineOptionsSnapFunction = (date: Date, scale: string, step: number) => Date | number; +// type TimelineOptions = - interface TimelineOptions { - align?: string; - autoResize?: boolean; - clickToUse?: boolean; - configure?: TimelineOptionsConfigureType; - dataAttributes?: TimelineOptionsDataAttributesType; - editable?: TimelineOptionsEditableType; - end?: DateType; - format?: any; // TODO - groupEditable?: TimelineOptionsGroupEditableType; - groupOrder?: TimelineOptionsGroupOrderType; - groupOrderSwap?: TimelineOptionsGroupOrderSwapFunction; - groupTemplate?: () => void; // TODO - height?: HeightWidthType; - hiddenDates?: any; // TODO - horizontalScroll?: boolean; - itemsAlwaysDraggable?: boolean; - locale?: string; - locales?: any; // TODO - moment?: () => void; // TODO - margin?: TimelineOptionsMarginType; - max?: DateType; - maxHeight?: HeightWidthType; - maxMinorChars?: number; - min?: DateType; - minHeight?: HeightWidthType; - moveable?: boolean; - multiselect?: boolean; - multiselectPerGroup?: boolean; - onAdd?: () => void; // TODO - onAddGroup?: () => void; // TODO - onUpdate?: () => void; // TODO - onMove?: () => void; // TODO - onMoveGroup?: () => void; // TODO - onMoving?: () => void; // TODO - onRemove?: () => void; // TODO - onRemoveGroup?: () => void; // TODO - order?: () => void; // TODO - orientation?: TimelineOptionsOrientationType; - selectable?: boolean; - showCurrentTime?: boolean; - showMajorLabels?: boolean; - showMinorLabels?: boolean; - stack?: boolean; - snap?: TimelineOptionsSnapFunction; - start?: DateType; - template?: () => void; // TODO - throttleRedraw?: number; - timeAxis?: TimelineTimeAxisOption; - type?: string; - tooltipOnItemUpdateTime?: boolean | { template: (item: any) => any }; - verticalScroll?: boolean; - width?: HeightWidthType; - zoomable?: boolean; - zoomKey?: string; - zoomMax?: number; - zoomMin?: number; - } +interface TimelineOptions { + align?: string; + autoResize?: boolean; + clickToUse?: boolean; + configure?: TimelineOptionsConfigureType; + dataAttributes?: TimelineOptionsDataAttributesType; + editable?: TimelineOptionsEditableType; + end?: DateType; + format?: any; // TODO + groupEditable?: TimelineOptionsGroupEditableType; + groupOrder?: TimelineOptionsGroupOrderType; + groupOrderSwap?: TimelineOptionsGroupOrderSwapFunction; + groupTemplate?: () => void; // TODO + height?: HeightWidthType; + hiddenDates?: any; // TODO + horizontalScroll?: boolean; + itemsAlwaysDraggable?: boolean; + locale?: string; + locales?: any; // TODO + moment?: () => void; // TODO + margin?: TimelineOptionsMarginType; + max?: DateType; + maxHeight?: HeightWidthType; + maxMinorChars?: number; + min?: DateType; + minHeight?: HeightWidthType; + moveable?: boolean; + multiselect?: boolean; + multiselectPerGroup?: boolean; + onAdd?: () => void; // TODO + onAddGroup?: () => void; // TODO + onUpdate?: () => void; // TODO + onMove?: () => void; // TODO + onMoveGroup?: () => void; // TODO + onMoving?: () => void; // TODO + onRemove?: () => void; // TODO + onRemoveGroup?: () => void; // TODO + order?: () => void; // TODO + orientation?: TimelineOptionsOrientationType; + selectable?: boolean; + showCurrentTime?: boolean; + showMajorLabels?: boolean; + showMinorLabels?: boolean; + stack?: boolean; + snap?: TimelineOptionsSnapFunction; + start?: DateType; + template?: () => void; // TODO + throttleRedraw?: number; + timeAxis?: TimelineTimeAxisOption; + type?: string; + tooltipOnItemUpdateTime?: boolean | { template: (item: any) => any }; + verticalScroll?: boolean; + width?: HeightWidthType; + zoomable?: boolean; + zoomKey?: string; + zoomMax?: number; + zoomMin?: number; +} - interface TimelineFitAnimation { - duration?: number; - easingFunction?: string; - } +interface TimelineFitAnimation { + duration?: number; + easingFunction?: string; +} - type TimelineFitAnimationType = boolean | TimelineFitAnimation; +type TimelineFitAnimationType = boolean | TimelineFitAnimation; - interface TimelineFitOptions { - animation?: TimelineFitAnimationType; - } +interface TimelineFitOptions { + animation?: TimelineFitAnimationType; +} - interface TimelineEventPropertiesResult { - group?: number; - item?: number; - pageX: number; - pageY: number; - x: number; - y: number; - time: Date; - snappedTime: Date; - what?: TimelineEventPropertiesResultWhatType; - event: Event; - } +interface TimelineEventPropertiesResult { + group?: number; + item?: number; + pageX: number; + pageY: number; + x: number; + y: number; + time: Date; + snappedTime: Date; + what?: TimelineEventPropertiesResultWhatType; + event: Event; +} + +/** + * Options that can be passed to a DataSet. + * + * @interface DataSetOptions + */ +interface DataSetOptions extends DataSetQueueOptions { + /** + * The name of the field containing the id of the items. + * When data is fetched from a server which uses some specific field to identify items, + * this field name can be specified in the DataSet using the option fieldId. + * For example CouchDB uses the field "_id" to identify documents. + * + * @type {string} + * @memberOf DataSetOptions + */ + fieldId?: string; /** - * Options that can be passed to a DataSet. - * - * @interface DataSetOptions + * An object containing field names as key, and data types as value. + * By default, the type of the properties of items are left unchanged. + * Item properties can be normalized by specifying a field type. + * This is useful for example to automatically convert stringified dates coming + * from a server into JavaScript Date objects. + * The available data types are listed in section Data Types. + * + * @type {*} + * @memberOf DataSetOptions */ - interface DataSetOptions extends DataSetQueueOptions { - /** - * The name of the field containing the id of the items. - * When data is fetched from a server which uses some specific field to identify items, - * this field name can be specified in the DataSet using the option fieldId. - * For example CouchDB uses the field "_id" to identify documents. - * - * @type {string} - * @memberOf DataSetOptions - */ - fieldId?: string; + type?: any; +} - /** - * An object containing field names as key, and data types as value. - * By default, the type of the properties of items are left unchanged. - * Item properties can be normalized by specifying a field type. - * This is useful for example to automatically convert stringified dates coming - * from a server into JavaScript Date objects. - * The available data types are listed in section Data Types. - * - * @type {*} - * @memberOf DataSetOptions - */ - type?: any; - } +interface DataSetQueueOptions { + /** + * Queue data changes ('add', 'update', 'remove') and flush them at once. + * The queue can be flushed manually by calling DataSet.flush(), + * or can be flushed after a configured delay or maximum number of entries. + * When queue is true, a queue is created with default options. + * Options can be specified by providing an object: + * delay: number - The queue will be flushed automatically after an inactivity of this delay in milliseconds. Default value is null. + * Default value is null. + * max: number - When the queue exceeds the given maximum number of entries, the queue is flushed automatically. Default value is Infinity. + * Default value is Infinity. + * + * @type {(any | boolean)} + * @memberOf DataSetOptions + */ + queue?: any | boolean; +} - interface DataSetQueueOptions { - /** - * Queue data changes ('add', 'update', 'remove') and flush them at once. - * The queue can be flushed manually by calling DataSet.flush(), - * or can be flushed after a configured delay or maximum number of entries. - * When queue is true, a queue is created with default options. - * Options can be specified by providing an object: - * delay: number - The queue will be flushed automatically after an inactivity of this delay in milliseconds. Default value is null. - * Default value is null. - * max: number - When the queue exceeds the given maximum number of entries, the queue is flushed automatically. Default value is Infinity. - * Default value is Infinity. - * - * @type {(any | boolean)} - * @memberOf DataSetOptions - */ - queue?: any | boolean; - } - - export class DataSet { - - /** - * Creates an instance of DataSet. - * - * @param {DataSetOptions} [options] DataSet options. - * - * @memberOf DataSet - */ - constructor(options: DataSetOptions); - - /** - * Creates an instance of DataSet. - * - * @param {T[]} [data] An Array with items. - * @param {DataSetOptions} [options] DataSet options. - * - * @memberOf DataSet - */ - constructor(data?: T[], options?: DataSetOptions); - - /** - * The number of items in the DataSet. - * - * @type {number} - * @memberOf DataSet - */ - length: number; - - /** - * Add one or multiple items to the DataSet. - * Adding an item will fail when there already is an item with the same id. - * - * @param {(T | T[])} data data can be a single item or an array with items. - * @param {IdType} [senderId] Optional sender id. - * @returns {IdType[]} The function returns an array with the ids of the added items. - * - * @memberOf DataSet - */ - add(data: T | T[], senderId?: IdType): IdType[]; - - /** - * Clear all data from the DataSet. - * - * @param {IdType} [senderId] Optional sender id. - * @returns {IdType[]} The function returns an array with the ids of the removed items. - * - * @memberOf DataSet - */ - clear(senderId?: IdType): IdType[]; - - /** - * Find all distinct values of a specified field. - * If data items do not contain the specified field are ignored. - * - * @param {string} field The search term. - * @returns {any[]} Returns an unordered array containing all distinct values. - * - * @memberOf DataSet - */ - distinct(field: string): any[]; - - /** - * Flush queued changes. - * Only available when the DataSet is configured with the option queue. - * - * @memberOf DataSet - */ - flush(): void; - - /** - * Execute a callback function for every item in the dataset. - * - * @param {(item: T, id: IdType) => void} callback The item callback. - * @param {DataSelectionOptions} [options] Optional options - * - * @memberOf DataSet - */ - forEach(callback: (item: T, id: IdType) => void, options?: DataSelectionOptions): void; - - /** - * Get all items from the DataSet. - * - * @param {DataSelectionOptions} [options] Optional options. - * @returns {T[]} When no item is found, null is returned when a single item was requested, - * and and empty Array is returned in case of multiple id's. - * - * @memberOf DataSet - */ - get(options?: DataSelectionOptions): T[]; - - /** - * Get a single item from the DataSet. - * - * @param {IdType} id The item id. - * @param {DataSelectionOptions} [options] - * @returns {T} When no item is found, null is returned when a single item was requested, - * and and empty Array is returned in case of multiple id's. - * - * @memberOf DataSet - */ - get(id: IdType, options?: DataSelectionOptions): T; - - /** - * Get multiple items from the DataSet. - * - * @param {IdType[]} ids Array of item ids. - * @param {DataSelectionOptions} [options] Optional options. - * @returns {T[]} When no item is found, null is returned when a single item was requested, - * and and empty Array is returned in case of multiple id's. - * - * @memberOf DataSet - */ - get(ids: IdType[], options?: DataSelectionOptions): T[]; - - /** - * Get the DataSet itself. - * In case of a DataView, this function does not return the DataSet - * to which the DataView is connected. - * - * @returns {DataSet} The DataSet itself. - * - * @memberOf DataSet - */ - getDataSet(): DataSet; - - /** - * Get ids of all items or of a filtered set of items. - * - * @param {DataSelectionOptions} [options] - * @returns {IdType[]} ids of all items or of a filtered set of items. - * - * @memberOf DataSet - */ - getIds(options?: DataSelectionOptions): IdType[]; - - /** - * Map every item in the DataSet. - * - * @param {(item: T, id: IdType) => T} callback The mapping callback. - * @param {DataSelectionOptions} [options] Optional options. - * @returns {T[]} The mapped items. - * - * @memberOf DataSet - */ - map(callback: (item: T, id: IdType) => any, options?: DataSelectionOptions): any[]; - - /** - * Find the item with maximum value of specified field. - * - * @param {string} field - * @returns {T} Returns null if no item is found. - * - * @memberOf DataSet - */ - max(field: string): T; - - /** - * Find the item with minimum value of specified field. - * - * @param {string} field - * @returns {T} Returns null if no item is found. - * - * @memberOf DataSet - */ - min(field: string): T; - - /** - * Subscribe from an event. - * - * @param {string} event The event name. - * @param {((event: string, properties: any, senderId: IdType) => void)} callback - * a callback function which will be called each time the event occurs. - * - * @memberOf DataSet - */ - on(event: string, callback: (event: string, properties: any, senderId: IdType) => void): void; - - /** - * Unsubscribe to an event. - * - * @param {string} event The event name. - * @param {((event: string, properties: any, senderId: IdType) => void)} callback - * The exact same callback that was used when calling 'on'. - * - * @memberOf DataSet - */ - off(event: string, callback: (event: string, properties: any, senderId: IdType) => void): void; - - /** - * Remove one or more items by id. - * - * @param {IdType} id The item id. - * @param {IdType} [senderId] The sender id. - * @returns {IdType[]} Returns an array with the ids of the removed items. - * - * @memberOf DataSet - */ - remove(id: IdType | IdType[], senderId?: IdType): IdType[]; - - /** - * Set options for the DataSet. - * - * @param {DataSetQueueOptions} [options] - * - * @memberOf DataSet - */ - setOptions(options?: DataSetQueueOptions): void; - - /** - * Update one or multiple existing items. - * When an item doesn't exist, it will be created. - * - * @param {(T | T[])} data a single item or an array with items. - * @param {IdType} [senderId] - * @returns {IdType[]} Returns an array with the ids of the updated items. - * - * @memberOf DataSet - */ - update(data: T | T[], senderId?: IdType): IdType[]; - } +export class DataSet { /** - * The DataSet contains functionality to format, filter, and sort data retrieved - * via the methods get, getIds, forEach, and map. - * These methods can have these options as a parameter. - * - * @interface DataSelectionOptions + * Creates an instance of DataSet. + * + * @param {DataSetOptions} [options] DataSet options. + * + * @memberOf DataSet */ - interface DataSelectionOptions { - /** - * An array with field names, or an object with current field name - * and new field name that the field is returned as. - * By default, all properties of the items are emitted. - * When fields is defined, only the properties whose name is specified - * in fields will be included in the returned items. - * - * @type {(string[] | any)} - * @memberOf DataSelectionOptions - */ - fields?: string[] | any; - - /** - * An object containing field names as key, and data types as value. - * By default, the type of the properties of an item are left unchanged. - * When a field type is specified, this field in the items will be converted to the specified type. - * This can be used for example to convert ISO strings containing a date to a JavaScript Date object, - * or convert strings to numbers or vice versa. The available data types are listed in section Data Types. - * - * @type {*} - * @memberOf DataSelectionOptions - */ - type?: any; - - /** - * Items can be filtered on specific properties by providing a filter function. - * A filter function is executed for each of the items in the DataSet, - * and is called with the item as parameter. - * The function must return a boolean. - * All items for which the filter function returns true will be emitted. - * See section Data Filtering. - * - * @memberOf DataSelectionOptions - */ - filter?: (item: T) => boolean; - - /** - * Order the items by a field name or custom sort function. - * - * @type {(string | any)} - * @memberOf DataSelectionOptions - */ - order?: string | any; - - /** - * Determine the type of output of the get function. - * Allowed values are 'Array' | 'Object'. - * The default returnType is an Array. - * The Object type will return a JSON object with the ID's as keys. - * - * @type {string} - * @memberOf DataSelectionOptions - */ - returnType?: string; - } - - export class DataView { - length: number; - constructor(items: T[]); - } - - type DataItemCollectionType = DataItem[] | DataSet | DataView; - type DataGroupCollectionType = DataGroup[] | DataSet | DataView; - - export class Timeline { - constructor( - container: HTMLElement, - items: DataItemCollectionType, - groups: DataGroupCollectionType, - options?: TimelineOptions - ); - constructor( - container: HTMLElement, - items: DataItemCollectionType, - options?: TimelineOptions - ); - - addCustomTime(time: DateType, id?: IdType): IdType; - destroy(): void; - fit(options?: TimelineFitOptions): void; - focus(ids: IdType | IdType[], options?: TimelineFitOptions): void; - getCurrentTime(): Date; - getCustomTime(id?: IdType): Date; - getEventProperties(event: Event): TimelineEventPropertiesResult; - getItemRange(): any; // TODO - getSelection(): IdType[]; - getVisibleItems(): IdType[]; - getWindow(): { start: Date, end: Date }; - moveTo(time: DateType, options?: TimelineFitOptions): void; - on(event: TimelineEvents, callback: () => void): void; - off(event: TimelineEvents, callback: () => void): void; - redraw(): void; - removeCustomTime(id: IdType): void; - setCurrentTime(time: DateType): void; - setCustomTime(time: DateType, id?: IdType): void; - setCustomTimeTitle(title: string, id?: IdType): void; - setData(data: { groups?: DataGroupCollectionType; items?: DataItemCollectionType }): void; - setGroups(groups?: DataGroupCollectionType): void; - setItems(items: DataItemCollectionType): void; - setOptions(options: TimelineOptions): void; - setSelection(ids: IdType | IdType[]): void; - setWindow(start: DateType, end: DateType, options?: TimelineFitOptions): void; - } - - export interface ITimelineStatic { - new (id: HTMLElement, data: any, options?: any): vis.ITimeline; - } - - export interface ITimeline { - setGroups(groups?: ITimelineGroup[]): void; - setItems(items?: ITimelineItem[]): void; - getWindow(): ITimelineWindow; - setWindow(start: any, date: any): void; - focus(selection: any): void; - on(event?: string, callback?: (properties: any) => void): void; - } - - export interface ITimelineWindow { - start: Date; - end: Date; - } - - export interface ITimelineItem { - id: number; - content: string; - group?: number; - start: number; - end?: number; - editable?: boolean; - } - - export interface ITimelineOptions { - stack?: boolean; - start?: any; - end?: any; - orientation?: string; - } - - export interface ITimelineGroup { - id: number; - content: string; - style?: string; - } - - export interface IVisSelectProperties { - items: number[]; - } - - export interface INetwork { - network?: any; - selectNodes?(nodeIds: string[], highlightEdges?: boolean): void; - unselectAll?(): void; - fit?(): void; - } - type NetworkEvents = - 'click' | - 'doubleClick' | - 'oncontext' | - 'hold' | - 'release' | - 'select' | - 'selectNode' | - 'selectEdge' | - 'deselectNode' | - 'deselectEdge' | - 'dragStart' | - 'dragging' | - 'dragEnd' | - 'hoverNode' | - 'blurNode' | - 'hoverEdge' | - 'blurEdge' | - 'zoom' | - 'showPopup' | - 'hidePopup' | - 'startStabilizing' | - 'stabilizationProgress' | - 'stabilizationIterationsDone' | - 'stabilized' | - 'resize' | - 'initRedraw' | - 'beforeDrawing' | - 'afterDrawing' | - 'animationFinished' | - 'configChange'; + constructor(options: DataSetOptions); /** - * Network is a visualization to display networks and networks consisting of nodes and edges. - * The visualization is easy to use and supports custom shapes, styles, colors, sizes, images, and more. - * The network visualization works smooth on any modern browser for up to a few thousand nodes and edges. - * To handle a larger amount of nodes, Network has clustering support. Network uses HTML canvas for rendering. - * - * @export - * @class Network - * @implements {INetwork} + * Creates an instance of DataSet. + * + * @param {T[]} [data] An Array with items. + * @param {DataSetOptions} [options] DataSet options. + * + * @memberOf DataSet */ - export class Network { - - /** - * Creates an instance of Network. - * - * @param {HTMLElement} container the HTML element representing the network container - * @param {IData} data network data - * @param {IOptions} [options] optional network options - * - * @memberOf Network - */ - constructor(container: HTMLElement, data: IData, options?: IOptions); - - /** - * Remove the network from the DOM and remove all Hammer bindings and references. - * - * @memberOf Network - */ - destroy(): void; - - /** - * Override all the data in the network. - * If stabilization is enabled in the physics module, - * the network will stabilize again. - * This method is also performed when first initializing the network. - * - * @param {IData} data network data - * - * @memberOf Network - */ - setData(data: IData): void; - - /** - * Set the options. - * All available options can be found in the modules above. - * Each module requires it's own container with the module name to contain its options. - * - * @param {IOptions} options network options - * - * @memberOf Network - */ - setOptions(options: IOptions): void; - - /** - * Set an event listener. - * Depending on the type of event you get different parameters for the callback function. - * - * @param {string} eventName the name of the event, f.e. 'click' - * @param {(params?: any) => void} callback the callback function that will be raised - * - * @memberOf Network - */ - on(eventName: NetworkEvents, callback: (params?: any) => void): void; - - /** - * Remove an event listener. - * The function you supply has to be the exact same as the one you used in the on function. - * If no function is supplied, all listeners will be removed. - * - * @param {string} eventName the name of the event, f.e. 'click' - * @param {(params?: any) => void} [callback] the exact same callback function that was used when calling 'on' - * - * @memberOf Network - */ - off(eventName: NetworkEvents, callback?: (params?: any) => void): void; - - /** - * Set an event listener only once. - * After it has taken place, the event listener will be removed. - * Depending on the type of event you get different parameters for the callback function. - * - * @param {string} eventName the name of the event, f.e. 'click' - * @param {(params?: any) => void} callback the callback function that will be raised once - * - * @memberOf Network - */ - once(eventName: NetworkEvents, callback: (params?: any) => void): void; - - /** - * This function converts canvas coordinates to coordinates on the DOM. - * Input and output are in the form of {x:Number, y:Number} (IPosition interface). - * The DOM values are relative to the network container. - * - * @param {IPosition} position the canvas coordinates - * @returns {IPosition} the DOM coordinates - * - * @memberOf Network - */ - canvasToDOM(position: IPosition): IPosition; - - /** - * This function converts DOM coordinates to coordinates on the canvas. - * Input and output are in the form of {x:Number,y:Number} (IPosition interface). - * The DOM values are relative to the network container. - * - * @param {IPosition} position the DOM coordinates - * @returns {IPosition} the canvas coordinates - * - * @memberOf Network - */ - DOMtoCanvas(position: IPosition): IPosition; - - /** - * Redraw the network. - * - * @memberOf Network - */ - redraw(): void; - - /** - * Set the size of the canvas. - * This is automatically done on a window resize. - * - * @param {string} width width in a common format, f.e. '100px' - * @param {string} height height in a common format, f.e. '100px' - * - * @memberOf Network - */ - setSize(width: string, height: string): void; - - /** - * The joinCondition function is presented with all nodes. - * - * @param {IClusterOptions} [options] - * - * @memberOf Network - */ - cluster(options?: IClusterOptions): void; - - /** - * This method looks at the provided node and makes a cluster of it and all it's connected nodes. - * The behaviour can be customized by proving the options object. - * All options of this object are explained below. - * The joinCondition is only presented with the connected nodes. - * - * @param {string} nodeId the id of the node - * @param {IClusterOptions} [options] the cluster options - * - * @memberOf Network - */ - clusterByConnection(nodeId: string, options?: IClusterOptions): void; - - /** - * This method checks all nodes in the network and those with a equal or higher - * amount of edges than specified with the hubsize qualify. - * If a hubsize is not defined, the hubsize will be determined as the average - * value plus two standard deviations. - * For all qualifying nodes, clusterByConnection is performed on each of them. - * The options object is described for clusterByConnection and does the same here. - * - * @param {number} [hubsize] optional hubsize - * @param {IClusterOptions} [options] optional cluster options - * - * @memberOf Network - */ - clusterByHubsize(hubsize?: number, options?: IClusterOptions): void; - - /** - * This method will cluster all nodes with 1 edge with their respective connected node. - * - * @param {IClusterOptions} [options] optional cluster options - * - * @memberOf Network - */ - clusterOutliers(options?: IClusterOptions): void; - - /** - * Nodes can be in clusters. - * Clusters can also be in clusters. - * This function returns an array of nodeIds showing where the node is. - * - * Example: - * cluster 'A' contains cluster 'B', cluster 'B' contains cluster 'C', - * cluster 'C' contains node 'fred'. - * - * network.clustering.findNode('fred') will return ['A','B','C','fred']. - * - * @param {IdType} nodeId the node id. - * @returns {IdType[]} an array of nodeIds showing where the node is - * - * @memberOf Network - */ - findNode(nodeId: IdType): IdType[]; - - /** - * Similar to findNode in that it returns all the edge ids that were - * created from the provided edge during clustering. - * - * @param {IdType} baseEdgeId the base edge id - * @returns {IdType[]} an array of edgeIds - */ - getClusteredEdges(baseEdgeId: IdType): IdType[]; - - /** - * When a clusteredEdgeId is available, this method will return the original - * baseEdgeId provided in data.edges ie. - * After clustering the 'SelectEdge' event is fired but provides only the clustered edge. - * This method can then be used to return the baseEdgeId. - * - * @param {IdType} clusteredEdgeId - * @returns {IdType} - */ - getBaseEdge(clusteredEdgeId: IdType): IdType; - - /** - * Visible edges between clustered nodes are not the same edge as the ones provided - * in data.edges passed on network creation. With each layer of clustering, copies of - * the edges between clusters are created and the previous edges are hidden, - * until the cluster is opened. This method takes an edgeId (ie. a base edgeId from data.edges) - * and applys the options to it and any edges that were created from it while clustering. - * - * @param {IdType} startEdgeId - * @param {IEdgeOptions} [options] - */ - updateEdge(startEdgeId: IdType, options?: IEdgeOptions): void; - - /** - * Clustered Nodes when created are not contained in the original data.nodes - * passed on network creation. This method updates the cluster node. - */ - updateClusteredNode(clusteredNodeId: IdType, options?: INodeOptions): void; - - /** - * Returns true if the node whose ID has been supplied is a cluster. - * - * @param {IdType} nodeId the node id. - * @returns {boolean} - * - * @memberOf Network - */ - isCluster(nodeId: IdType): boolean; - - /** - * Returns an array of all nodeIds of the nodes that - * would be released if you open the cluster. - * - * @param {IdType} clusterNodeId the id of the cluster node - * @returns {IdType[]} - * - * @memberOf Network - */ - getNodesInCluster(clusterNodeId: IdType): IdType[]; - - /** - * Opens the cluster, releases the contained nodes and edges, - * removing the cluster node and cluster edges. - * The options object is optional and currently supports one option, - * releaseFunction, which is a function that can be used to manually - * position the nodes after the cluster is opened. - * - * @param {IdType} nodeId the node id - * @param {IOpenClusterOptions} [options] optional open cluster options - * - * @memberOf Network - */ - openCluster(nodeId: IdType, options?: IOpenClusterOptions): void; - - /** - * If you like the layout of your network - * and would like it to start in the same way next time, - * ask for the seed using this method and put it in the layout.randomSeed option. - * - * @returns {number} the current seed of the network. - * - * @memberOf Network - */ - getSeed(): number; - - /** - * Programatically enable the edit mode. - * Similar effect to pressing the edit button. - * - * @memberOf Network - */ - enableEditMode(): void; - - /** - * Programatically disable the edit mode. - * Similar effect to pressing the close icon (small cross in the corner of the toolbar). - * - * @memberOf Network - */ - disableEditMode(): void; - - /** - * Go into addNode mode. Having edit mode or manipulation enabled is not required. - * To get out of this mode, call disableEditMode(). - * The callback functions defined in handlerFunctions still apply. - * To use these methods without having the manipulation GUI, make sure you set enabled to false. - * - * @memberOf Network - */ - addNodeMode(): void; - - /** - * Edit the selected node. - * The explaination from addNodeMode applies here as well. - * - * @memberOf Network - */ - editNode(): void; - - /** - * Go into addEdge mode. - * The explaination from addNodeMode applies here as well. - * - * @memberOf Network - */ - addEdgeMode(): void; - - /** - * Go into editEdge mode. - * The explaination from addNodeMode applies here as well. - * - * @memberOf Network - */ - editEdgeMode(): void; - - /** - * Delete selected. - * Having edit mode or manipulation enabled is not required. - * - * @memberOf Network - */ - deleteSelected(): void; - - /** - * Returns the x y positions in canvas space of the nodes with the supplied nodeIds as an object. - * - * Alternative inputs are a String containing a nodeId or nothing. - * When a String is supplied, the position of the node corresponding to the ID is returned. - * When nothing is supplied, the positions of all nodes are returned. - * - * @param {string[]} nodeIds - * @returns {{[nodeId: IdType]: IPosition}} - * - * @memberOf Network - */ - getPositions(nodeIds?: IdType[]): { [nodeId: string]: IPosition }; - getPositions(nodeId: IdType): IPosition; - - /** - * When using the vis.DataSet to load your nodes into the network, - * this method will put the X and Y positions of all nodes into that dataset. - * If you're loading your nodes from a database and have this dynamically coupled with the DataSet, - * you can use this to stablize your network once, then save the positions in that database - * through the DataSet so the next time you load the nodes, stabilization will be near instantaneous. - * - * If the nodes are still moving and you're using dynamic smooth edges (which is on by default), - * you can use the option stabilization.onlyDynamicEdges in the physics module to improve initialization time. - * - * This method does not support clustering. - * At the moment it is not possible to cache positions when using clusters since - * they cannot be correctly initialized from just the positions. - * - * @memberOf Network - */ - storePositions(): void; - - /** - * You can use this to programatically move a node. - * The supplied x and y positions have to be in canvas space! - * - * @param {IdType} nodeId the node that will be moved - * @param {number} x new canvas space x position - * @param {number} y new canvas space y position - * - * @memberOf Network - */ - moveNode(nodeId: IdType, x: number, y: number): void; - - /** - * Returns a bounding box for the node including label. - * - * @param {IdType} nodeId - * @returns {IBoundingBox} - * - * @memberOf Network - */ - getBoundingBox(nodeId: IdType): IBoundingBox; - - /** - * Returns an array of nodeIds of the all the nodes that are directly connected to this node. - * If you supply an edgeId, vis will first match the id to nodes. - * If no match is found, it will search in the edgelist and return an array: [fromId, toId]. - * - * @param {IdType} nodeOrEdgeId a node or edge id - * @returns {(IdType[] | {fromId: IdType, toId: IdType}[])} - * - * @memberOf Network - */ - getConnectedNodes(nodeOrEdgeId: IdType): IdType[] | Array<{ fromId: IdType, toId: IdType }>; - - /** - * Returns an array of edgeIds of the edges connected to this node. - * - * @param {IdType} nodeId the node id - * @returns {IdType[]} - * - * @memberOf Network - */ - getConnectedEdges(nodeId: IdType): IdType[]; - - /** - * Start the physics simulation. - * This is normally done whenever needed and is only really useful - * if you stop the simulation yourself and wish to continue it afterwards. - * - * @memberOf Network - */ - startSimulation(): void; - - /** - * This stops the physics simulation and triggers a stabilized event. - * Tt can be restarted by dragging a node, - * altering the dataset or calling startSimulation(). - * - * @memberOf Network - */ - stopSimulation(): void; - - /** - * You can manually call stabilize at any time. - * All the stabilization options above are used. - * You can optionally supply the number of iterations it should do. - * - * @param {number} [iterations] the number of iterations it should do - * - * @memberOf Network - */ - stabilize(iterations?: number): void; - - /** - * Returns an object with selected nodes and edges ids. - * - * @returns {{ nodes: IdType[], edges: IdType[] }} - * - * @memberOf Network - */ - getSelection(): { nodes: IdType[], edges: IdType[] }; - - /** - * Returns an array of selected node ids like so: - * [nodeId1, nodeId2, ..]. - * - * @returns {IdType[]} - * - * @memberOf Network - */ - getSelectedNodes(): IdType[]; - - /** - * Returns an array of selected edge ids like so: - * [edgeId1, edgeId2, ..]. - * - * @returns {IdType[]} - * - * @memberOf Network - */ - getSelectedEdges(): IdType[]; - - /** - * Returns a nodeId or undefined. - * The DOM positions are expected to be in pixels from the top left corner of the canvas. - * - * @param {IPosition} position - * @returns {IdType} - * - * @memberOf Network - */ - getNodeAt(position: IPosition): IdType; - - /** - * Returns a edgeId or undefined. - * The DOM positions are expected to be in pixels from the top left corner of the canvas. - * - * @param {IPosition} position - * @returns {IdType} - * - * @memberOf Network - */ - getEdgeAt(position: IPosition): IdType; - - /** - * Selects the nodes corresponding to the id's in the input array. - * If highlightEdges is true or undefined, the neighbouring edges will also be selected. - * This method unselects all other objects before selecting its own objects. Does not fire events. - * - * @param {IdType[]} nodeIds - * @param {boolean} [highlightEdges] - * - * @memberOf Network - */ - selectNodes(nodeIds: IdType[], highlightEdges?: boolean): void; - - /** - * Selects the edges corresponding to the id's in the input array. - * This method unselects all other objects before selecting its own objects. - * Does not fire events. - * - * @param {IdType[]} edgeIds - * - * @memberOf Network - */ - selectEdges(edgeIds: IdType[]): void; - - /** - * Sets the selection. - * You can also pass only nodes or edges in selection object. - * - * @param {{ nodes: IdType[], edges: IdType[] }} selection - * @param {ISelectionOptions} [options] - * - * @memberOf Network - */ - setSelection(selection: { nodes: IdType[], edges: IdType[] }, options?: ISelectionOptions): void; - - /** - * Unselect all objects. - * Does not fire events. - * - * @memberOf Network - */ - unselectAll(): void; - - /** - * Returns the current scale of the network. - * 1.0 is comparible to 100%, 0 is zoomed out infinitely. - * - * @returns {number} the current scale of the network - * - * @memberOf Network - */ - getScale(): number; - - /** - * Returns the current central focus point of the view in the form: { x: {Number}, y: {Number} } - * - * @returns {IPosition} the view position; - * - * @memberOf Network - */ - getViewPosition(): IPosition; - - /** - * Zooms out so all nodes fit on the canvas. - * - * @param {IFitOptions} [options] All options are optional for the fit method - * - * @memberOf Network - */ - fit(options?: IFitOptions): void; - - /** - * You can focus on a node with this function. - * What that means is the view will lock onto that node, if it is moving, the view will also move accordingly. - * If the view is dragged by the user, the focus is broken. You can supply options to customize the effect. - * - * @param {IdType} nodeId - * @param {IFocusOptions} [options] - * - * @memberOf Network - */ - focus(nodeId: IdType, options?: IFocusOptions): void; - - /** - * You can animate or move the camera using the moveTo method. - * - * @param {IMoveToOptions} options - * - * @memberOf Network - */ - moveTo(options: IMoveToOptions): void; - - /** - * Programatically release the focussed node. - * - * @memberOf Network - */ - releaseNode(): void; - - /** - * If you use the configurator, you can call this method to get an options object that contains - * all differences from the default options caused by users interacting with the configurator. - * - * @returns {*} - * - * @memberOf Network - */ - getOptionsFromConfigurator(): any; - } + constructor(data?: T[], options?: DataSetOptions); /** - * Options interface for focus function. - * - * @export - * @interface IFocusOptions - * @extends {IViewPortOptions} + * The number of items in the DataSet. + * + * @type {number} + * @memberOf DataSet */ - export interface IFocusOptions extends IViewPortOptions { - /** - * Locked denotes whether or not the view remains locked to - * the node once the zoom-in animation is finished. - * Default value is true. - * - * @type {boolean} - * @memberOf IFocusOptions - */ - locked?: boolean; - } + length: number; /** - * Base options interface for some viewport functions. - * - * @export - * @interface IViewPortOptions + * Add one or multiple items to the DataSet. + * Adding an item will fail when there already is an item with the same id. + * + * @param {(T | T[])} data data can be a single item or an array with items. + * @param {IdType} [senderId] Optional sender id. + * @returns {IdType[]} The function returns an array with the ids of the added items. + * + * @memberOf DataSet */ - export interface IViewPortOptions { - /** - * The scale is the target zoomlevel. - * Default value is 1.0. - * - * @type {number} the scale. - * @memberOf IFocusOptions - */ - scale?: number; - - /** - * The offset (in DOM units) is how many pixels from the center the view is focussed. - * Default value is {x:0,y:0} - * - * @type {IPosition} - * @memberOf IFocusOptions - */ - offset?: IPosition; - - /** - * For animation you can either use a Boolean to use it with the default options or - * disable it or you can define the duration (in milliseconds) and easing function manually. - * - * @type {(IAnimationOptions | boolean)} - * @memberOf IFitOptions - */ - animation?: IAnimationOptions | boolean; - } + add(data: T | T[], senderId?: IdType): IdType[]; /** - * You will have to define at least a scale, position or offset. - * Otherwise, there is nothing to move to. - * - * @export - * @interface IMoveToOptions - * @extends {IViewPortOptions} + * Clear all data from the DataSet. + * + * @param {IdType} [senderId] Optional sender id. + * @returns {IdType[]} The function returns an array with the ids of the removed items. + * + * @memberOf DataSet */ - export interface IMoveToOptions extends IViewPortOptions { - /** - * The position (in canvas units!) is the position of the central focus point of the camera. - * - * @type {IPosition} - * @memberOf IMoveToOptions - */ - position?: IPosition; - } + clear(senderId?: IdType): IdType[]; /** - * Animation options interface. - * - * @export - * @interface IAnimationOptions + * Find all distinct values of a specified field. + * If data items do not contain the specified field are ignored. + * + * @param {string} field The search term. + * @returns {any[]} Returns an unordered array containing all distinct values. + * + * @memberOf DataSet */ - export interface IAnimationOptions { - - /** - * The duration (in milliseconds). - * - * @type {number} - * @memberOf IAnimationOptions - */ - duration: number; - /** - * The easing function. - * - * Available are: - * linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, - * easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, - * easeInQuint, easeOutQuint, easeInOutQuint. - * - * @type {string} - * @memberOf IAnimationOptions - */ - easingFunction: string; - } + distinct(field: string): any[]; /** - * Optional options for the fit method. - * - * @export - * @interface IFitOptions + * Flush queued changes. + * Only available when the DataSet is configured with the option queue. + * + * @memberOf DataSet */ - export interface IFitOptions { - - /** - * The nodes can be used to zoom to fit only specific nodes in the view. - * - * @type {string[]} - * @memberOf IFitOptions - */ - nodes?: string[]; - - /** - * For animation you can either use a Boolean to use it with the default options or - * disable it or you can define the duration (in milliseconds) and easing function manually. - * - * @type {(IAnimationOptions | boolean)} - * @memberOf IFitOptions - */ - animation: IAnimationOptions | boolean; - } - - export interface ISelectionOptions { - unselectAll?: boolean; - highlightEdges?: boolean; - } + flush(): void; /** - * These values are in canvas space. - * - * @export - * @interface IBoundingBox + * Execute a callback function for every item in the dataset. + * + * @param {(item: T, id: IdType) => void} callback The item callback. + * @param {DataSelectionOptions} [options] Optional options + * + * @memberOf DataSet */ - export interface IBoundingBox { - top: number; - left: number; - right: number; - bottom: number; - } + forEach(callback: (item: T, id: IdType) => void, options?: DataSelectionOptions): void; /** - * Cluster methods options interface. - * - * @export - * @interface IClusterOptions + * Get all items from the DataSet. + * + * @param {DataSelectionOptions} [options] Optional options. + * @returns {T[]} When no item is found, null is returned when a single item was requested, + * and and empty Array is returned in case of multiple id's. + * + * @memberOf DataSet */ - export interface IClusterOptions { - - /** - * Optional for all but the cluster method. - * The cluster module loops over all nodes that are selected to be in the cluster - * and calls this function with their data as argument. If this function returns true, - * this node will be added to the cluster. You have access to all options (including the default) - * as well as any custom fields you may have added to the node to determine whether or not to include it in the cluster. - * - * @memberOf IClusterOptions - */ - joinCondition?: (nodeOptions: any) => boolean; - - /** - * Optional. - * Before creating the new cluster node, this (optional) function will be called with the properties - * supplied by you (clusterNodeProperties), all contained nodes and all contained edges. - * You can use this to update the properties of the cluster based on which items it contains. - * The function should return the properties to create the cluster node. - * - * @type {(clusterOptions: any, childNodesOptions: any[], childEdgesOptions: any[])} - * @memberOf IClusterOptions - */ - processProperties?: (clusterOptions: any, childNodesOptions: any[], childEdgesOptions: any[]) => any; - - /** - * Optional. - * This is an object containing the options for the cluster node. - * All options described in the nodes module are allowed. - * This allows you to style your cluster node any way you want. - * This is also the style object that is provided in the processProperties function for fine tuning. - * If undefined, default node options will be used. - * - * @type {INodeOptions} - * @memberOf IClusterOptions - */ - clusterNodeProperties?: INodeOptions; - - /** - * Optional. - * This is an object containing the options for the edges connected to the cluster. - * All options described in the edges module are allowed. - * Using this, you can style the edges connecting to the cluster any way you want. - * If none are provided, the options from the edges that are replaced are used. - * If undefined, default edge options will be used. - * - * @type {IEdgeOptions} - * @memberOf IClusterOptions - */ - clusterEdgeProperties?: IEdgeOptions; - } + get(options?: DataSelectionOptions): T[]; /** - * Options for the openCluster function of Network. - * - * @export - * @interface IOpenClusterOptions + * Get a single item from the DataSet. + * + * @param {IdType} id The item id. + * @param {DataSelectionOptions} [options] + * @returns {T} When no item is found, null is returned when a single item was requested, + * and and empty Array is returned in case of multiple id's. + * + * @memberOf DataSet */ - export interface IOpenClusterOptions { + get(id: IdType, options?: DataSelectionOptions): T; - /** - * A function that can be used to manually position the nodes after the cluster is opened. - * The containedNodesPositions contain the positions of the nodes in the cluster at the - * moment they were clustered. This function is expected to return the newPositions, - * which can be the containedNodesPositions (altered) or a new object. - * This has to be an object with keys equal to the nodeIds that exist in the - * containedNodesPositions and an {x:x,y:y} position object. - * - * For all nodeIds not listed in this returned object, - * we will position them at the location of the cluster. - * This is also the default behaviour when no releaseFunction is defined. - * - * @memberOf IOpenClusterOptions - */ - releaseFunction: ( - clusterPosition: IPosition, - containedNodesPositions: { [nodeId: string]: IPosition }) => { [nodeId: string]: IPosition }; - } + /** + * Get multiple items from the DataSet. + * + * @param {IdType[]} ids Array of item ids. + * @param {DataSelectionOptions} [options] Optional options. + * @returns {T[]} When no item is found, null is returned when a single item was requested, + * and and empty Array is returned in case of multiple id's. + * + * @memberOf DataSet + */ + get(ids: IdType[], options?: DataSelectionOptions): T[]; - export interface IPosition { - x: number; - y: number; - } + /** + * Get the DataSet itself. + * In case of a DataView, this function does not return the DataSet + * to which the DataView is connected. + * + * @returns {DataSet} The DataSet itself. + * + * @memberOf DataSet + */ + getDataSet(): DataSet; - export interface IProperties { + /** + * Get ids of all items or of a filtered set of items. + * + * @param {DataSelectionOptions} [options] + * @returns {IdType[]} ids of all items or of a filtered set of items. + * + * @memberOf DataSet + */ + getIds(options?: DataSelectionOptions): IdType[]; + /** + * Map every item in the DataSet. + * + * @param {(item: T, id: IdType) => T} callback The mapping callback. + * @param {DataSelectionOptions} [options] Optional options. + * @returns {T[]} The mapped items. + * + * @memberOf DataSet + */ + map(callback: (item: T, id: IdType) => any, options?: DataSelectionOptions): any[]; + + /** + * Find the item with maximum value of specified field. + * + * @param {string} field + * @returns {T} Returns null if no item is found. + * + * @memberOf DataSet + */ + max(field: string): T; + + /** + * Find the item with minimum value of specified field. + * + * @param {string} field + * @returns {T} Returns null if no item is found. + * + * @memberOf DataSet + */ + min(field: string): T; + + /** + * Subscribe from an event. + * + * @param {string} event The event name. + * @param {((event: string, properties: any, senderId: IdType) => void)} callback + * a callback function which will be called each time the event occurs. + * + * @memberOf DataSet + */ + on(event: string, callback: (event: string, properties: any, senderId: IdType) => void): void; + + /** + * Unsubscribe to an event. + * + * @param {string} event The event name. + * @param {((event: string, properties: any, senderId: IdType) => void)} callback + * The exact same callback that was used when calling 'on'. + * + * @memberOf DataSet + */ + off(event: string, callback: (event: string, properties: any, senderId: IdType) => void): void; + + /** + * Remove one or more items by id. + * + * @param {IdType} id The item id. + * @param {IdType} [senderId] The sender id. + * @returns {IdType[]} Returns an array with the ids of the removed items. + * + * @memberOf DataSet + */ + remove(id: IdType | IdType[], senderId?: IdType): IdType[]; + + /** + * Set options for the DataSet. + * + * @param {DataSetQueueOptions} [options] + * + * @memberOf DataSet + */ + setOptions(options?: DataSetQueueOptions): void; + + /** + * Update one or multiple existing items. + * When an item doesn't exist, it will be created. + * + * @param {(T | T[])} data a single item or an array with items. + * @param {IdType} [senderId] + * @returns {IdType[]} Returns an array with the ids of the updated items. + * + * @memberOf DataSet + */ + update(data: T | T[], senderId?: IdType): IdType[]; +} + +/** + * The DataSet contains functionality to format, filter, and sort data retrieved + * via the methods get, getIds, forEach, and map. + * These methods can have these options as a parameter. + * + * @interface DataSelectionOptions + */ +interface DataSelectionOptions { + /** + * An array with field names, or an object with current field name + * and new field name that the field is returned as. + * By default, all properties of the items are emitted. + * When fields is defined, only the properties whose name is specified + * in fields will be included in the returned items. + * + * @type {(string[] | any)} + * @memberOf DataSelectionOptions + */ + fields?: string[] | any; + + /** + * An object containing field names as key, and data types as value. + * By default, the type of the properties of an item are left unchanged. + * When a field type is specified, this field in the items will be converted to the specified type. + * This can be used for example to convert ISO strings containing a date to a JavaScript Date object, + * or convert strings to numbers or vice versa. The available data types are listed in section Data Types. + * + * @type {*} + * @memberOf DataSelectionOptions + */ + type?: any; + + /** + * Items can be filtered on specific properties by providing a filter function. + * A filter function is executed for each of the items in the DataSet, + * and is called with the item as parameter. + * The function must return a boolean. + * All items for which the filter function returns true will be emitted. + * See section Data Filtering. + * + * @memberOf DataSelectionOptions + */ + filter?: (item: T) => boolean; + + /** + * Order the items by a field name or custom sort function. + * + * @type {(string | any)} + * @memberOf DataSelectionOptions + */ + order?: string | any; + + /** + * Determine the type of output of the get function. + * Allowed values are 'Array' | 'Object'. + * The default returnType is an Array. + * The Object type will return a JSON object with the ID's as keys. + * + * @type {string} + * @memberOf DataSelectionOptions + */ + returnType?: string; +} + +export class DataView { + length: number; + constructor(items: T[]); +} + +type DataItemCollectionType = DataItem[] | DataSet | DataView; +type DataGroupCollectionType = DataGroup[] | DataSet | DataView; + +export class Timeline { + constructor( + container: HTMLElement, + items: DataItemCollectionType, + groups: DataGroupCollectionType, + options?: TimelineOptions + ); + constructor( + container: HTMLElement, + items: DataItemCollectionType, + options?: TimelineOptions + ); + + addCustomTime(time: DateType, id?: IdType): IdType; + destroy(): void; + fit(options?: TimelineFitOptions): void; + focus(ids: IdType | IdType[], options?: TimelineFitOptions): void; + getCurrentTime(): Date; + getCustomTime(id?: IdType): Date; + getEventProperties(event: Event): TimelineEventPropertiesResult; + getItemRange(): any; // TODO + getSelection(): IdType[]; + getVisibleItems(): IdType[]; + getWindow(): { start: Date, end: Date }; + moveTo(time: DateType, options?: TimelineFitOptions): void; + on(event: TimelineEvents, callback: () => void): void; + off(event: TimelineEvents, callback: () => void): void; + redraw(): void; + removeCustomTime(id: IdType): void; + setCurrentTime(time: DateType): void; + setCustomTime(time: DateType, id?: IdType): void; + setCustomTimeTitle(title: string, id?: IdType): void; + setData(data: { groups?: DataGroupCollectionType; items?: DataItemCollectionType }): void; + setGroups(groups?: DataGroupCollectionType): void; + setItems(items: DataItemCollectionType): void; + setOptions(options: TimelineOptions): void; + setSelection(ids: IdType | IdType[]): void; + setWindow(start: DateType, end: DateType, options?: TimelineFitOptions): void; +} + +export interface ITimelineStatic { + new (id: HTMLElement, data: any, options?: any): vis.ITimeline; +} + +export interface ITimeline { + setGroups(groups?: ITimelineGroup[]): void; + setItems(items?: ITimelineItem[]): void; + getWindow(): ITimelineWindow; + setWindow(start: any, date: any): void; + focus(selection: any): void; + on(event?: string, callback?: (properties: any) => void): void; +} + +export interface ITimelineWindow { + start: Date; + end: Date; +} + +export interface ITimelineItem { + id: number; + content: string; + group?: number; + start: number; + end?: number; + editable?: boolean; +} + +export interface ITimelineOptions { + stack?: boolean; + start?: any; + end?: any; + orientation?: string; +} + +export interface ITimelineGroup { + id: number; + content: string; + style?: string; +} + +export interface IVisSelectProperties { + items: number[]; +} + +export interface INetwork { + network?: any; + selectNodes?(nodeIds: string[], highlightEdges?: boolean): void; + unselectAll?(): void; + fit?(): void; +} +type NetworkEvents = + 'click' | + 'doubleClick' | + 'oncontext' | + 'hold' | + 'release' | + 'select' | + 'selectNode' | + 'selectEdge' | + 'deselectNode' | + 'deselectEdge' | + 'dragStart' | + 'dragging' | + 'dragEnd' | + 'hoverNode' | + 'blurNode' | + 'hoverEdge' | + 'blurEdge' | + 'zoom' | + 'showPopup' | + 'hidePopup' | + 'startStabilizing' | + 'stabilizationProgress' | + 'stabilizationIterationsDone' | + 'stabilized' | + 'resize' | + 'initRedraw' | + 'beforeDrawing' | + 'afterDrawing' | + 'animationFinished' | + 'configChange'; + +/** + * Network is a visualization to display networks and networks consisting of nodes and edges. + * The visualization is easy to use and supports custom shapes, styles, colors, sizes, images, and more. + * The network visualization works smooth on any modern browser for up to a few thousand nodes and edges. + * To handle a larger amount of nodes, Network has clustering support. Network uses HTML canvas for rendering. + * + * @export + * @class Network + * @implements {INetwork} + */ +export class Network { + + /** + * Creates an instance of Network. + * + * @param {HTMLElement} container the HTML element representing the network container + * @param {IData} data network data + * @param {IOptions} [options] optional network options + * + * @memberOf Network + */ + constructor(container: HTMLElement, data: IData, options?: IOptions); + + /** + * Remove the network from the DOM and remove all Hammer bindings and references. + * + * @memberOf Network + */ + destroy(): void; + + /** + * Override all the data in the network. + * If stabilization is enabled in the physics module, + * the network will stabilize again. + * This method is also performed when first initializing the network. + * + * @param {IData} data network data + * + * @memberOf Network + */ + setData(data: IData): void; + + /** + * Set the options. + * All available options can be found in the modules above. + * Each module requires it's own container with the module name to contain its options. + * + * @param {IOptions} options network options + * + * @memberOf Network + */ + setOptions(options: IOptions): void; + + /** + * Set an event listener. + * Depending on the type of event you get different parameters for the callback function. + * + * @param {string} eventName the name of the event, f.e. 'click' + * @param {(params?: any) => void} callback the callback function that will be raised + * + * @memberOf Network + */ + on(eventName: NetworkEvents, callback: (params?: any) => void): void; + + /** + * Remove an event listener. + * The function you supply has to be the exact same as the one you used in the on function. + * If no function is supplied, all listeners will be removed. + * + * @param {string} eventName the name of the event, f.e. 'click' + * @param {(params?: any) => void} [callback] the exact same callback function that was used when calling 'on' + * + * @memberOf Network + */ + off(eventName: NetworkEvents, callback?: (params?: any) => void): void; + + /** + * Set an event listener only once. + * After it has taken place, the event listener will be removed. + * Depending on the type of event you get different parameters for the callback function. + * + * @param {string} eventName the name of the event, f.e. 'click' + * @param {(params?: any) => void} callback the callback function that will be raised once + * + * @memberOf Network + */ + once(eventName: NetworkEvents, callback: (params?: any) => void): void; + + /** + * This function converts canvas coordinates to coordinates on the DOM. + * Input and output are in the form of {x:Number, y:Number} (IPosition interface). + * The DOM values are relative to the network container. + * + * @param {IPosition} position the canvas coordinates + * @returns {IPosition} the DOM coordinates + * + * @memberOf Network + */ + canvasToDOM(position: IPosition): IPosition; + + /** + * This function converts DOM coordinates to coordinates on the canvas. + * Input and output are in the form of {x:Number,y:Number} (IPosition interface). + * The DOM values are relative to the network container. + * + * @param {IPosition} position the DOM coordinates + * @returns {IPosition} the canvas coordinates + * + * @memberOf Network + */ + DOMtoCanvas(position: IPosition): IPosition; + + /** + * Redraw the network. + * + * @memberOf Network + */ + redraw(): void; + + /** + * Set the size of the canvas. + * This is automatically done on a window resize. + * + * @param {string} width width in a common format, f.e. '100px' + * @param {string} height height in a common format, f.e. '100px' + * + * @memberOf Network + */ + setSize(width: string, height: string): void; + + /** + * The joinCondition function is presented with all nodes. + * + * @param {IClusterOptions} [options] + * + * @memberOf Network + */ + cluster(options?: IClusterOptions): void; + + /** + * This method looks at the provided node and makes a cluster of it and all it's connected nodes. + * The behaviour can be customized by proving the options object. + * All options of this object are explained below. + * The joinCondition is only presented with the connected nodes. + * + * @param {string} nodeId the id of the node + * @param {IClusterOptions} [options] the cluster options + * + * @memberOf Network + */ + clusterByConnection(nodeId: string, options?: IClusterOptions): void; + + /** + * This method checks all nodes in the network and those with a equal or higher + * amount of edges than specified with the hubsize qualify. + * If a hubsize is not defined, the hubsize will be determined as the average + * value plus two standard deviations. + * For all qualifying nodes, clusterByConnection is performed on each of them. + * The options object is described for clusterByConnection and does the same here. + * + * @param {number} [hubsize] optional hubsize + * @param {IClusterOptions} [options] optional cluster options + * + * @memberOf Network + */ + clusterByHubsize(hubsize?: number, options?: IClusterOptions): void; + + /** + * This method will cluster all nodes with 1 edge with their respective connected node. + * + * @param {IClusterOptions} [options] optional cluster options + * + * @memberOf Network + */ + clusterOutliers(options?: IClusterOptions): void; + + /** + * Nodes can be in clusters. + * Clusters can also be in clusters. + * This function returns an array of nodeIds showing where the node is. + * + * Example: + * cluster 'A' contains cluster 'B', cluster 'B' contains cluster 'C', + * cluster 'C' contains node 'fred'. + * + * network.clustering.findNode('fred') will return ['A','B','C','fred']. + * + * @param {IdType} nodeId the node id. + * @returns {IdType[]} an array of nodeIds showing where the node is + * + * @memberOf Network + */ + findNode(nodeId: IdType): IdType[]; + + /** + * Similar to findNode in that it returns all the edge ids that were + * created from the provided edge during clustering. + * + * @param {IdType} baseEdgeId the base edge id + * @returns {IdType[]} an array of edgeIds + */ + getClusteredEdges(baseEdgeId: IdType): IdType[]; + + /** + * When a clusteredEdgeId is available, this method will return the original + * baseEdgeId provided in data.edges ie. + * After clustering the 'SelectEdge' event is fired but provides only the clustered edge. + * This method can then be used to return the baseEdgeId. + * + * @param {IdType} clusteredEdgeId + * @returns {IdType} + */ + getBaseEdge(clusteredEdgeId: IdType): IdType; + + /** + * Visible edges between clustered nodes are not the same edge as the ones provided + * in data.edges passed on network creation. With each layer of clustering, copies of + * the edges between clusters are created and the previous edges are hidden, + * until the cluster is opened. This method takes an edgeId (ie. a base edgeId from data.edges) + * and applys the options to it and any edges that were created from it while clustering. + * + * @param {IdType} startEdgeId + * @param {IEdgeOptions} [options] + */ + updateEdge(startEdgeId: IdType, options?: IEdgeOptions): void; + + /** + * Clustered Nodes when created are not contained in the original data.nodes + * passed on network creation. This method updates the cluster node. + */ + updateClusteredNode(clusteredNodeId: IdType, options?: INodeOptions): void; + + /** + * Returns true if the node whose ID has been supplied is a cluster. + * + * @param {IdType} nodeId the node id. + * @returns {boolean} + * + * @memberOf Network + */ + isCluster(nodeId: IdType): boolean; + + /** + * Returns an array of all nodeIds of the nodes that + * would be released if you open the cluster. + * + * @param {IdType} clusterNodeId the id of the cluster node + * @returns {IdType[]} + * + * @memberOf Network + */ + getNodesInCluster(clusterNodeId: IdType): IdType[]; + + /** + * Opens the cluster, releases the contained nodes and edges, + * removing the cluster node and cluster edges. + * The options object is optional and currently supports one option, + * releaseFunction, which is a function that can be used to manually + * position the nodes after the cluster is opened. + * + * @param {IdType} nodeId the node id + * @param {IOpenClusterOptions} [options] optional open cluster options + * + * @memberOf Network + */ + openCluster(nodeId: IdType, options?: IOpenClusterOptions): void; + + /** + * If you like the layout of your network + * and would like it to start in the same way next time, + * ask for the seed using this method and put it in the layout.randomSeed option. + * + * @returns {number} the current seed of the network. + * + * @memberOf Network + */ + getSeed(): number; + + /** + * Programatically enable the edit mode. + * Similar effect to pressing the edit button. + * + * @memberOf Network + */ + enableEditMode(): void; + + /** + * Programatically disable the edit mode. + * Similar effect to pressing the close icon (small cross in the corner of the toolbar). + * + * @memberOf Network + */ + disableEditMode(): void; + + /** + * Go into addNode mode. Having edit mode or manipulation enabled is not required. + * To get out of this mode, call disableEditMode(). + * The callback functions defined in handlerFunctions still apply. + * To use these methods without having the manipulation GUI, make sure you set enabled to false. + * + * @memberOf Network + */ + addNodeMode(): void; + + /** + * Edit the selected node. + * The explaination from addNodeMode applies here as well. + * + * @memberOf Network + */ + editNode(): void; + + /** + * Go into addEdge mode. + * The explaination from addNodeMode applies here as well. + * + * @memberOf Network + */ + addEdgeMode(): void; + + /** + * Go into editEdge mode. + * The explaination from addNodeMode applies here as well. + * + * @memberOf Network + */ + editEdgeMode(): void; + + /** + * Delete selected. + * Having edit mode or manipulation enabled is not required. + * + * @memberOf Network + */ + deleteSelected(): void; + + /** + * Returns the x y positions in canvas space of the nodes with the supplied nodeIds as an object. + * + * Alternative inputs are a String containing a nodeId or nothing. + * When a String is supplied, the position of the node corresponding to the ID is returned. + * When nothing is supplied, the positions of all nodes are returned. + * + * @param {string[]} nodeIds + * @returns {{[nodeId: IdType]: IPosition}} + * + * @memberOf Network + */ + getPositions(nodeIds?: IdType[]): { [nodeId: string]: IPosition }; + getPositions(nodeId: IdType): IPosition; + + /** + * When using the vis.DataSet to load your nodes into the network, + * this method will put the X and Y positions of all nodes into that dataset. + * If you're loading your nodes from a database and have this dynamically coupled with the DataSet, + * you can use this to stablize your network once, then save the positions in that database + * through the DataSet so the next time you load the nodes, stabilization will be near instantaneous. + * + * If the nodes are still moving and you're using dynamic smooth edges (which is on by default), + * you can use the option stabilization.onlyDynamicEdges in the physics module to improve initialization time. + * + * This method does not support clustering. + * At the moment it is not possible to cache positions when using clusters since + * they cannot be correctly initialized from just the positions. + * + * @memberOf Network + */ + storePositions(): void; + + /** + * You can use this to programatically move a node. + * The supplied x and y positions have to be in canvas space! + * + * @param {IdType} nodeId the node that will be moved + * @param {number} x new canvas space x position + * @param {number} y new canvas space y position + * + * @memberOf Network + */ + moveNode(nodeId: IdType, x: number, y: number): void; + + /** + * Returns a bounding box for the node including label. + * + * @param {IdType} nodeId + * @returns {IBoundingBox} + * + * @memberOf Network + */ + getBoundingBox(nodeId: IdType): IBoundingBox; + + /** + * Returns an array of nodeIds of the all the nodes that are directly connected to this node. + * If you supply an edgeId, vis will first match the id to nodes. + * If no match is found, it will search in the edgelist and return an array: [fromId, toId]. + * + * @param {IdType} nodeOrEdgeId a node or edge id + * @returns {(IdType[] | {fromId: IdType, toId: IdType}[])} + * + * @memberOf Network + */ + getConnectedNodes(nodeOrEdgeId: IdType): IdType[] | Array<{ fromId: IdType, toId: IdType }>; + + /** + * Returns an array of edgeIds of the edges connected to this node. + * + * @param {IdType} nodeId the node id + * @returns {IdType[]} + * + * @memberOf Network + */ + getConnectedEdges(nodeId: IdType): IdType[]; + + /** + * Start the physics simulation. + * This is normally done whenever needed and is only really useful + * if you stop the simulation yourself and wish to continue it afterwards. + * + * @memberOf Network + */ + startSimulation(): void; + + /** + * This stops the physics simulation and triggers a stabilized event. + * Tt can be restarted by dragging a node, + * altering the dataset or calling startSimulation(). + * + * @memberOf Network + */ + stopSimulation(): void; + + /** + * You can manually call stabilize at any time. + * All the stabilization options above are used. + * You can optionally supply the number of iterations it should do. + * + * @param {number} [iterations] the number of iterations it should do + * + * @memberOf Network + */ + stabilize(iterations?: number): void; + + /** + * Returns an object with selected nodes and edges ids. + * + * @returns {{ nodes: IdType[], edges: IdType[] }} + * + * @memberOf Network + */ + getSelection(): { nodes: IdType[], edges: IdType[] }; + + /** + * Returns an array of selected node ids like so: + * [nodeId1, nodeId2, ..]. + * + * @returns {IdType[]} + * + * @memberOf Network + */ + getSelectedNodes(): IdType[]; + + /** + * Returns an array of selected edge ids like so: + * [edgeId1, edgeId2, ..]. + * + * @returns {IdType[]} + * + * @memberOf Network + */ + getSelectedEdges(): IdType[]; + + /** + * Returns a nodeId or undefined. + * The DOM positions are expected to be in pixels from the top left corner of the canvas. + * + * @param {IPosition} position + * @returns {IdType} + * + * @memberOf Network + */ + getNodeAt(position: IPosition): IdType; + + /** + * Returns a edgeId or undefined. + * The DOM positions are expected to be in pixels from the top left corner of the canvas. + * + * @param {IPosition} position + * @returns {IdType} + * + * @memberOf Network + */ + getEdgeAt(position: IPosition): IdType; + + /** + * Selects the nodes corresponding to the id's in the input array. + * If highlightEdges is true or undefined, the neighbouring edges will also be selected. + * This method unselects all other objects before selecting its own objects. Does not fire events. + * + * @param {IdType[]} nodeIds + * @param {boolean} [highlightEdges] + * + * @memberOf Network + */ + selectNodes(nodeIds: IdType[], highlightEdges?: boolean): void; + + /** + * Selects the edges corresponding to the id's in the input array. + * This method unselects all other objects before selecting its own objects. + * Does not fire events. + * + * @param {IdType[]} edgeIds + * + * @memberOf Network + */ + selectEdges(edgeIds: IdType[]): void; + + /** + * Sets the selection. + * You can also pass only nodes or edges in selection object. + * + * @param {{ nodes: IdType[], edges: IdType[] }} selection + * @param {ISelectionOptions} [options] + * + * @memberOf Network + */ + setSelection(selection: { nodes: IdType[], edges: IdType[] }, options?: ISelectionOptions): void; + + /** + * Unselect all objects. + * Does not fire events. + * + * @memberOf Network + */ + unselectAll(): void; + + /** + * Returns the current scale of the network. + * 1.0 is comparible to 100%, 0 is zoomed out infinitely. + * + * @returns {number} the current scale of the network + * + * @memberOf Network + */ + getScale(): number; + + /** + * Returns the current central focus point of the view in the form: { x: {Number}, y: {Number} } + * + * @returns {IPosition} the view position; + * + * @memberOf Network + */ + getViewPosition(): IPosition; + + /** + * Zooms out so all nodes fit on the canvas. + * + * @param {IFitOptions} [options] All options are optional for the fit method + * + * @memberOf Network + */ + fit(options?: IFitOptions): void; + + /** + * You can focus on a node with this function. + * What that means is the view will lock onto that node, if it is moving, the view will also move accordingly. + * If the view is dragged by the user, the focus is broken. You can supply options to customize the effect. + * + * @param {IdType} nodeId + * @param {IFocusOptions} [options] + * + * @memberOf Network + */ + focus(nodeId: IdType, options?: IFocusOptions): void; + + /** + * You can animate or move the camera using the moveTo method. + * + * @param {IMoveToOptions} options + * + * @memberOf Network + */ + moveTo(options: IMoveToOptions): void; + + /** + * Programatically release the focussed node. + * + * @memberOf Network + */ + releaseNode(): void; + + /** + * If you use the configurator, you can call this method to get an options object that contains + * all differences from the default options caused by users interacting with the configurator. + * + * @returns {*} + * + * @memberOf Network + */ + getOptionsFromConfigurator(): any; +} + +/** + * Options interface for focus function. + * + * @export + * @interface IFocusOptions + * @extends {IViewPortOptions} + */ +export interface IFocusOptions extends IViewPortOptions { + /** + * Locked denotes whether or not the view remains locked to + * the node once the zoom-in animation is finished. + * Default value is true. + * + * @type {boolean} + * @memberOf IFocusOptions + */ + locked?: boolean; +} + +/** + * Base options interface for some viewport functions. + * + * @export + * @interface IViewPortOptions + */ +export interface IViewPortOptions { + /** + * The scale is the target zoomlevel. + * Default value is 1.0. + * + * @type {number} the scale. + * @memberOf IFocusOptions + */ + scale?: number; + + /** + * The offset (in DOM units) is how many pixels from the center the view is focussed. + * Default value is {x:0,y:0} + * + * @type {IPosition} + * @memberOf IFocusOptions + */ + offset?: IPosition; + + /** + * For animation you can either use a Boolean to use it with the default options or + * disable it or you can define the duration (in milliseconds) and easing function manually. + * + * @type {(IAnimationOptions | boolean)} + * @memberOf IFitOptions + */ + animation?: IAnimationOptions | boolean; +} + +/** + * You will have to define at least a scale, position or offset. + * Otherwise, there is nothing to move to. + * + * @export + * @interface IMoveToOptions + * @extends {IViewPortOptions} + */ +export interface IMoveToOptions extends IViewPortOptions { + /** + * The position (in canvas units!) is the position of the central focus point of the camera. + * + * @type {IPosition} + * @memberOf IMoveToOptions + */ + position?: IPosition; +} + +/** + * Animation options interface. + * + * @export + * @interface IAnimationOptions + */ +export interface IAnimationOptions { + + /** + * The duration (in milliseconds). + * + * @type {number} + * @memberOf IAnimationOptions + */ + duration: number; + /** + * The easing function. + * + * Available are: + * linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, + * easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, + * easeInQuint, easeOutQuint, easeInOutQuint. + * + * @type {string} + * @memberOf IAnimationOptions + */ + easingFunction: string; +} + +/** + * Optional options for the fit method. + * + * @export + * @interface IFitOptions + */ +export interface IFitOptions { + + /** + * The nodes can be used to zoom to fit only specific nodes in the view. + * + * @type {string[]} + * @memberOf IFitOptions + */ + nodes?: string[]; + + /** + * For animation you can either use a Boolean to use it with the default options or + * disable it or you can define the duration (in milliseconds) and easing function manually. + * + * @type {(IAnimationOptions | boolean)} + * @memberOf IFitOptions + */ + animation: IAnimationOptions | boolean; +} + +export interface ISelectionOptions { + unselectAll?: boolean; + highlightEdges?: boolean; +} + +/** + * These values are in canvas space. + * + * @export + * @interface IBoundingBox + */ +export interface IBoundingBox { + top: number; + left: number; + right: number; + bottom: number; +} + +/** + * Cluster methods options interface. + * + * @export + * @interface IClusterOptions + */ +export interface IClusterOptions { + + /** + * Optional for all but the cluster method. + * The cluster module loops over all nodes that are selected to be in the cluster + * and calls this function with their data as argument. If this function returns true, + * this node will be added to the cluster. You have access to all options (including the default) + * as well as any custom fields you may have added to the node to determine whether or not to include it in the cluster. + * + * @memberOf IClusterOptions + */ + joinCondition?: (nodeOptions: any) => boolean; + + /** + * Optional. + * Before creating the new cluster node, this (optional) function will be called with the properties + * supplied by you (clusterNodeProperties), all contained nodes and all contained edges. + * You can use this to update the properties of the cluster based on which items it contains. + * The function should return the properties to create the cluster node. + * + * @type {(clusterOptions: any, childNodesOptions: any[], childEdgesOptions: any[])} + * @memberOf IClusterOptions + */ + processProperties?: (clusterOptions: any, childNodesOptions: any[], childEdgesOptions: any[]) => any; + + /** + * Optional. + * This is an object containing the options for the cluster node. + * All options described in the nodes module are allowed. + * This allows you to style your cluster node any way you want. + * This is also the style object that is provided in the processProperties function for fine tuning. + * If undefined, default node options will be used. + * + * @type {INodeOptions} + * @memberOf IClusterOptions + */ + clusterNodeProperties?: INodeOptions; + + /** + * Optional. + * This is an object containing the options for the edges connected to the cluster. + * All options described in the edges module are allowed. + * Using this, you can style the edges connecting to the cluster any way you want. + * If none are provided, the options from the edges that are replaced are used. + * If undefined, default edge options will be used. + * + * @type {IEdgeOptions} + * @memberOf IClusterOptions + */ + clusterEdgeProperties?: IEdgeOptions; +} + +/** + * Options for the openCluster function of Network. + * + * @export + * @interface IOpenClusterOptions + */ +export interface IOpenClusterOptions { + + /** + * A function that can be used to manually position the nodes after the cluster is opened. + * The containedNodesPositions contain the positions of the nodes in the cluster at the + * moment they were clustered. This function is expected to return the newPositions, + * which can be the containedNodesPositions (altered) or a new object. + * This has to be an object with keys equal to the nodeIds that exist in the + * containedNodesPositions and an {x:x,y:y} position object. + * + * For all nodeIds not listed in this returned object, + * we will position them at the location of the cluster. + * This is also the default behaviour when no releaseFunction is defined. + * + * @memberOf IOpenClusterOptions + */ + releaseFunction: ( + clusterPosition: IPosition, + containedNodesPositions: { [nodeId: string]: IPosition }) => { [nodeId: string]: IPosition }; +} + +export interface IPosition { + x: number; + y: number; +} + +export interface IProperties { + + nodes: string[]; + + edges: string[]; + + event: string[]; + + pointer: { + DOM: IPosition; + canvas: IPosition; + }; + + previousSelection?: { nodes: string[]; - edges: string[]; + }; +} - event: string[]; +export interface Callback { + callback?: (params?: any) => void; +} - pointer: { - DOM: IPosition; - canvas: IPosition; - }; +export interface IData { + nodes?: INode[] | DataSet; + edges?: IEdge[] | DataSet; +} - previousSelection?: { - nodes: string[]; - edges: string[]; - }; - } +export interface INode { + id?: IdType; + label?: string; + x?: number; + y?: number; + fixed?: boolean; + image?: string; + shape?: string; +} - export interface Callback { - callback?: (params?: any) => void; - } +export interface IEdge { + from?: IdType; + to?: IdType; + id?: IdType; +} - export interface IData { - nodes?: INode[] | DataSet; - edges?: IEdge[] | DataSet; - } +export interface IOptions { + autoResize?: boolean; - export interface INode { - id?: IdType; - label?: string; - x?: number; - y?: number; - fixed?: boolean; - image?: string; - shape?: string; - } + width?: string; - export interface IEdge { - from?: IdType; - to?: IdType; - id?: IdType; - } + height?: string; - export interface IOptions { - autoResize?: boolean; + locale?: string; - width?: string; + locales?: string[]; - height?: string; + clickToUse?: boolean; - locale?: string; + configure?: any; // http://visjs.org/docs/network/configure.html# - locales?: string[]; + edges?: IEdgeOptions; - clickToUse?: boolean; + nodes?: INodeOptions; - configure?: any; // http://visjs.org/docs/network/configure.html# + groups?: any; - edges?: IEdgeOptions; + layout?: any; // http://visjs.org/docs/network/layout.html - nodes?: INodeOptions; + interaction?: any; // visjs.org/docs/network/interaction.html?keywords=edges - groups?: any; + manipulation?: any; // http://visjs.org/docs/network/manipulation.html# - layout?: any; // http://visjs.org/docs/network/layout.html + physics?: any; // http://visjs.org/docs/network/physics.html# +} - interaction?: any; // visjs.org/docs/network/interaction.html?keywords=edges +export interface INodeOptions { + borderWidth?: number; - manipulation?: any; // http://visjs.org/docs/network/manipulation.html# + borderWidthSelected?: number; - physics?: any; // http://visjs.org/docs/network/physics.html# - } + brokenImage?: string; - export interface INodeOptions { - borderWidth?: number; - - borderWidthSelected?: number; - - brokenImage?: string; - - color?: { + color?: { + border?: string, + background?: string, + highlight?: string | { border?: string, background?: string, - highlight?: string | { - border?: string, - background?: string, - }, - hover?: string | { - border?: string, - background?: string, - } - }; - - fixed?: boolean | { - x?: boolean, - y?: boolean, - }; - - font?: string | { - color: string, - size: number, // px - face: string, - background: string, - strokeWidth: number, // px - strokeColor: string, - align: string, - }; - - group?: string; - - hidden?: boolean; - - icon?: { - face?: string, - code?: string, - size?: number, // 50, - color?: string, - }; - - id?: string; - - image?: string; - - label?: string; - - labelHighlightBold?: boolean; - - level?: number; - - mass?: number; - - physics?: boolean; - - scaling?: IOptionsScaling; - - shadow?: boolean | IOptionsShadow; - - shape?: string; - - shapeProperties?: { - borderDashes: boolean | number[], // only for borders - borderRadius: number, // only for box shape - interpolation: boolean, // only for image and circularImage shapes - useImageSize: boolean, // only for image and circularImage shapes - useBorderWithImage: boolean // only for image shape - }; - - size?: number; - - title?: string; - - value?: number; - - x?: number; - - y?: number; - } - - export interface IEdgeOptions { - arrows?: string | { - to?: boolean | { - enabled?: boolean, - scaleFactor?: number, - }, - middle?: boolean | { - enabled?: boolean, - scaleFactor?: number, - }, - from: boolean | { - enabled?: boolean, - scaleFactor?: number, - } - }; - - arrowStrikethrough?: boolean; - - color?: string | { - color?: string, - highlight?: string, - hover?: string, - inherit?: boolean | string, - opacity?: number, - }; - - dashes?: boolean | number[]; - - font?: string | { - color?: string, - size?: number, // px - face?: string, + }, + hover?: string | { + border?: string, background?: string, - strokeWidth?: number, // px - strokeColor?: string, - align?: string, - }; + } + }; - from?: number | string; + fixed?: boolean | { + x?: boolean, + y?: boolean, + }; - hidden?: boolean; + font?: string | { + color: string, + size: number, // px + face: string, + background: string, + strokeWidth: number, // px + strokeColor: string, + align: string, + }; - hoverWidth?: number; // please note, hoverWidth could be also a function. This case is not represented here + group?: string; - id?: string; + hidden?: boolean; - label?: string; + icon?: { + face?: string, + code?: string, + size?: number, // 50, + color?: string, + }; - labelHighlightBold?: boolean; + id?: string; - length?: number; + image?: string; - physics?: boolean; + label?: string; - scaling?: IOptionsScaling; + labelHighlightBold?: boolean; - selectionWidth?: number; // please note, selectionWidth could be also a function. This case is not represented here + level?: number; - selfReferenceSize?: number; + mass?: number; - shadow?: boolean | IOptionsShadow; + physics?: boolean; - smooth?: boolean | { - enabled: boolean, - type: string, - forceDirection?: string | boolean, - roundness: number, - }; + scaling?: IOptionsScaling; - title?: string; + shadow?: boolean | IOptionsShadow; - to?: number | string; + shape?: string; - value?: number; + shapeProperties?: { + borderDashes: boolean | number[], // only for borders + borderRadius: number, // only for box shape + interpolation: boolean, // only for image and circularImage shapes + useImageSize: boolean, // only for image and circularImage shapes + useBorderWithImage: boolean // only for image shape + }; - width?: number; - } + size?: number; - export interface IOptionsScaling { - min?: number; - max?: number; - label?: boolean | { + title?: string; + + value?: number; + + x?: number; + + y?: number; +} + +export interface IEdgeOptions { + arrows?: string | { + to?: boolean | { enabled?: boolean, - min?: number, - max?: number, - maxVisible?: number, - drawThreshold?: number - }; - customScalingFunction?(min?: number, max?: number, total?: number, value?: number): number; - } + scaleFactor?: number, + }, + middle?: boolean | { + enabled?: boolean, + scaleFactor?: number, + }, + from: boolean | { + enabled?: boolean, + scaleFactor?: number, + } + }; - export interface IOptionsShadow { - enabled: boolean; - color: string; - size: number; - x: number; - y: number; - } + arrowStrikethrough?: boolean; + + color?: string | { + color?: string, + highlight?: string, + hover?: string, + inherit?: boolean | string, + opacity?: number, + }; + + dashes?: boolean | number[]; + + font?: string | { + color?: string, + size?: number, // px + face?: string, + background?: string, + strokeWidth?: number, // px + strokeColor?: string, + align?: string, + }; + + from?: number | string; + + hidden?: boolean; + + hoverWidth?: number; // please note, hoverWidth could be also a function. This case is not represented here + + id?: string; + + label?: string; + + labelHighlightBold?: boolean; + + length?: number; + + physics?: boolean; + + scaling?: IOptionsScaling; + + selectionWidth?: number; // please note, selectionWidth could be also a function. This case is not represented here + + selfReferenceSize?: number; + + shadow?: boolean | IOptionsShadow; + + smooth?: boolean | { + enabled: boolean, + type: string, + forceDirection?: string | boolean, + roundness: number, + }; + + title?: string; + + to?: number | string; + + value?: number; + + width?: number; } -declare module "vis" { - export = vis; +export interface IOptionsScaling { + min?: number; + max?: number; + label?: boolean | { + enabled?: boolean, + min?: number, + max?: number, + maxVisible?: number, + drawThreshold?: number + }; + customScalingFunction?(min?: number, max?: number, total?: number, value?: number): number; } + +export interface IOptionsShadow { + enabled: boolean; + color: string; + size: number; + x: number; + y: number; +} + +export as namespace vis; diff --git a/vis/tslint.json b/vis/tslint.json index 5bf00f4459..fdc7cdc370 100644 --- a/vis/tslint.json +++ b/vis/tslint.json @@ -1,7 +1,3 @@ { - "extends": "../tslint.json", - "rules": { - // Needed for ambient 'vis' namespace - "no-single-declare-module": false - } + "extends": "../tslint.json" } \ No newline at end of file diff --git a/vis/vis-tests.ts b/vis/vis-tests.ts index 39773cf9ca..804e69d96e 100644 --- a/vis/vis-tests.ts +++ b/vis/vis-tests.ts @@ -1,5 +1,3 @@ -/// - // Test DataSet constructor new vis.DataSet(); new vis.DataSet({}); From b3d0adf9561a83e1998524f23ea530c20965ae16 Mon Sep 17 00:00:00 2001 From: Robert Coie Date: Tue, 20 Dec 2016 18:09:19 -0800 Subject: [PATCH 051/101] additional markdown-it interfaces (#13282) --- markdown-it/index.d.ts | 45 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/markdown-it/index.d.ts b/markdown-it/index.d.ts index 5bbd977d17..6af0b7dc90 100644 --- a/markdown-it/index.d.ts +++ b/markdown-it/index.d.ts @@ -1,14 +1,14 @@ // Type definitions for markdown-it // Project: https://github.com/markdown-it/markdown-it -// Definitions by: York Yao +// Definitions by: York Yao , Robert Coie // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface MarkdownItStatic { new (): MarkdownIt.MarkdownIt; - new (presetName: "commonmark" | "zero" | "default"): MarkdownIt.MarkdownIt; + new (presetName: "commonmark" | "zero" | "default", options?: MarkdownIt.Options): MarkdownIt.MarkdownIt; new (options: MarkdownIt.Options): MarkdownIt.MarkdownIt; (): MarkdownIt.MarkdownIt; - (presetName: "commonmark" | "zero" | "default"): MarkdownIt.MarkdownIt; + (presetName: "commonmark" | "zero" | "default", options ?: MarkdownIt.Options): MarkdownIt.MarkdownIt; (options: MarkdownIt.Options): MarkdownIt.MarkdownIt; } @@ -19,6 +19,8 @@ declare module MarkdownIt { interface MarkdownIt { render(md: string, env?: any): string; renderInline(md: string, env?: any): string; + parse(src: string, env: any): Token[]; + parseInline(src: string, env: any): Token[]; use(plugin: any, ...params: any[]): MarkdownIt; utils: { assign(obj: any): any; @@ -43,10 +45,10 @@ declare module MarkdownIt { normalizeLink(url: string): string; normalizeLinkText(url: string): string; validateLink(url: string): boolean; - block: any; - core: any; + block: ParserBlock; + core: Core; helpers: any; - inline: any; + inline: ParserInline; linkify: LinkifyIt; renderer: Renderer; } @@ -92,4 +94,35 @@ declare module MarkdownIt { } type TokenRender = (tokens: Token[], index: number, options: any, env: any, self: Renderer) => void; + + interface Rule { + (state: any): void; + } + + interface Ruler { + after(afterName: string, ruleName: string, rule: Rule, options?: any): void; + at(name: string, rule: Rule, options?: any): void; + before(beforeName: string, ruleName: string, rule: Rule, options?: any): void; + disable(rules: string | string[], ignoreInvalid?: boolean): string[]; + enable(rules: string | string[], ignoreInvalid?: boolean): string[]; + enableOnly(rule: string, ignoreInvalid?: boolean): void; + getRules(chain: string): Rule[]; + push(ruleName: string, rule: Rule, options?: any): void; + } + + interface ParserBlock { + parse(src: string, md: MarkdownIt, env: any, outTokens: Token[]): void; + ruler: Ruler; + } + + interface Core { + process(state: any): void; + ruler: Ruler; + } + + interface ParserInline { + parse(src: string, md: MarkdownIt, env: any, outTokens: Token[]): void; + ruler: Ruler; + ruler2: Ruler; + } } From 183856b6b91faacd5d8c9e2c6c73208e925e3956 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Wed, 21 Dec 2016 12:29:38 +0900 Subject: [PATCH 052/101] fix: fix lint error --- passport/index.d.ts | 123 +++++++++++++++++-------------------- passport/passport-tests.ts | 14 ++--- passport/tsconfig.json | 5 +- 3 files changed, 68 insertions(+), 74 deletions(-) diff --git a/passport/index.d.ts b/passport/index.d.ts index 5aeccc7f7b..39ec5ee09c 100644 --- a/passport/index.d.ts +++ b/passport/index.d.ts @@ -1,10 +1,8 @@ -// Type definitions for Passport v0.2.0 +// Type definitions for Passport 0.3 // Project: http://passportjs.org // Definitions by: Horiuchi_H // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - declare namespace Express { export interface Request { authInfo?: any; @@ -12,9 +10,9 @@ declare namespace Express { // These declarations are merged into express's Request type login(user: any, done: (err: any) => void): void; - login(user: any, options: Object, done: (err: any) => void): void; + login(user: any, options: any, done: (err: any) => void): void; logIn(user: any, done: (err: any) => void): void; - logIn(user: any, options: Object, done: (err: any) => void): void; + logIn(user: any, options: any, done: (err: any) => void): void; logout(): void; logOut(): void; @@ -29,77 +27,72 @@ declare module 'passport' { namespace passport { - interface AuthenticateOptions { - authInfo?:boolean; - assignProperty?:string; - failureFlash?: string|boolean|Object; - failureMessage?: boolean|string; - failureRedirect?:string; - failWithError?:boolean; - session?: boolean; - scope?: string|string[]; - successFlash?: string|boolean|Object; - successMessage?: boolean|string; - successRedirect?:string; - successReturnToOrRedirect?:string; - pauseStream?:boolean; - userProperty?:string; - } + interface AuthenticateOptions { + authInfo?: boolean; + assignProperty?: string; + failureFlash?: string|boolean|any; + failureMessage?: boolean|string; + failureRedirect?: string; + failWithError?: boolean; + session?: boolean; + scope?: string|string[]; + successFlash?: string|boolean|any; + successMessage?: boolean|string; + successRedirect?: string; + successReturnToOrRedirect?: string; + pauseStream?: boolean; + userProperty?: string; + } - interface Passport { - use(strategy: passport.Strategy): Passport; - use(name: string, strategy: passport.Strategy): Passport; - unuse(name: string): Passport; - framework(fw: passport.Framework): Passport; - initialize(options?: { userProperty: string; }): express.Handler; - session(options?: { pauseStream: boolean; }): express.Handler; + interface Passport { + use(strategy: passport.Strategy): this; + use(name: string, strategy: passport.Strategy): this; + unuse(name: string): this; + framework(fw: passport.Framework): this; + initialize(options?: { userProperty: string; }): express.Handler; + session(options?: { pauseStream: boolean; }): express.Handler; - authenticate(strategy: string, callback?: Function): express.Handler; - authenticate(strategy: string, options: AuthenticateOptions, callback?: Function): express.Handler; - authenticate(strategies: string[], callback?: Function): express.Handler; - authenticate(strategies: string[], options: AuthenticateOptions, callback?: Function): express.Handler; - authorize(strategy: string, callback?: Function): express.Handler; - authorize(strategy: string, options: Object, callback?: Function): express.Handler; - authorize(strategies: string[], callback?: Function): express.Handler; - authorize(strategies: string[], options: Object, callback?: Function): express.Handler; - serializeUser(fn: (user: any, done: (err: any, id: any) => void) => void): void; - serializeUser(fn: (user: TUser, done: (err: any, id: TID) => void) => void): void; - deserializeUser(fn: (id: any, done: (err: any, user: any) => void) => void): void; - deserializeUser(fn: (id: TID, done: (err: any, user: TUser) => void) => void): void; - transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; - } + authenticate(strategy: string|string[], callback?: Function): express.Handler; + authenticate(strategy: string|string[], options: AuthenticateOptions, callback?: Function): express.Handler; + authorize(strategy: string|string[], callback?: Function): express.Handler; + authorize(strategy: string|string[], options: any, callback?: Function): express.Handler; + serializeUser(fn: (user: TUser, done: (err: any, id: TID) => void) => void): void; + deserializeUser(fn: (id: TID, done: (err: any, user: TUser) => void) => void): void; + transformAuthInfo(fn: (info: any, done: (err: any, info: any) => void) => void): void; + } - interface Strategy { - name?: string; - authenticate(req: express.Request, options?: Object): void; - } + interface Strategy { + name?: string; + authenticate(req: express.Request, options?: any): void; + } - interface Profile { - provider: string; - id: string; - displayName: string; + interface Profile { + provider: string; + id: string; + displayName: string; username?: string; name?: { - familyName: string; - givenName: string; - middleName?: string; - }; - emails?: { - value: string; - type?: string; - }[]; - photos?: { - value: string; - }[]; - } + familyName: string; + givenName: string; + middleName?: string; + }; + emails?: Array<{ + value: string; + type?: string; + }>; + photos?: Array<{ + value: string; + }>; + } interface Framework { - initialize(passport: Passport, options?: Object): Function; - authenticate(passport: Passport, name: string, options?: Object, callback?: Function): Function; - authorize?(passport: Passport, name: string, options?: Object, callback?: Function): Function; + initialize(passport: Passport, options?: any): Function; + authenticate(passport: Passport, name: string, options?: any, callback?: Function): Function; + authorize?(passport: Passport, name: string, options?: any, callback?: Function): Function; } } const passport: passport.Passport; export = passport; } + diff --git a/passport/passport-tests.ts b/passport/passport-tests.ts index 06fd9cd692..c4b0ccb596 100644 --- a/passport/passport-tests.ts +++ b/passport/passport-tests.ts @@ -1,10 +1,8 @@ +import * as express from 'express'; +import 'express-session'; +import * as passport from 'passport'; -/// - -import express = require('express'); -import passport = require('passport'); - class TestStrategy implements passport.Strategy { public name: string = 'test'; constructor() { } @@ -45,7 +43,7 @@ app.configure(() => { app.use(passport.session()); }); -app.post('/login', +app.post('/login', passport.authenticate('local', { failureRedirect: '/login', failureFlash: true }), function (req, res) { res.redirect('/'); @@ -55,7 +53,9 @@ app.post('/login', function (req, res, next) { passport.authenticate('local', function (err: any, user: { username: string; }, info: { message: string; }) { if (err) { return next(err) } if (!user) { - req.session['error'] = info.message; + if (req.session) { + req.session['error'] = info.message; + } return res.redirect('/login') } req.logIn(user, function (err) { diff --git a/passport/tsconfig.json b/passport/tsconfig.json index 9b5cecd0ff..6b9ad22c50 100644 --- a/passport/tsconfig.json +++ b/passport/tsconfig.json @@ -3,7 +3,8 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,4 +17,4 @@ "index.d.ts", "passport-tests.ts" ] -} \ No newline at end of file +} From 3df6ff88690872a23c285982da495743366cdd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marenco?= Date: Wed, 21 Dec 2016 17:43:18 -0500 Subject: [PATCH 053/101] Update index.d.ts to import * (#13381) * Update index.d.ts to import * `export default Dropzone;` was leading me to have some issues with importing the module in my code. I changed it to `export = Dropzone` so now we can do `import * as Dropzone from "react-dropzone";` like the others package importations in a tsx file. * Reconfigure the import in test file --- react-dropzone/index.d.ts | 2 +- react-dropzone/react-dropzone-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react-dropzone/index.d.ts b/react-dropzone/index.d.ts index 16d92a0d68..b4ed4ded43 100644 --- a/react-dropzone/index.d.ts +++ b/react-dropzone/index.d.ts @@ -36,5 +36,5 @@ declare module "react-dropzone" { } let Dropzone: React.ClassicComponentClass; - export default Dropzone; + export = Dropzone; } diff --git a/react-dropzone/react-dropzone-tests.tsx b/react-dropzone/react-dropzone-tests.tsx index c258072ec1..322fd82e8c 100644 --- a/react-dropzone/react-dropzone-tests.tsx +++ b/react-dropzone/react-dropzone-tests.tsx @@ -1,7 +1,7 @@ /// /// import * as React from 'react'; -import Dropzone from 'react-dropzone'; +import * as Dropzone from 'react-dropzone'; class Test extends React.Component { constructor(props: any) { From 634f7c5af558d9d615f9dce1b6931104e90c9735 Mon Sep 17 00:00:00 2001 From: Jason Jarrett Date: Fri, 23 Dec 2016 13:59:24 -0800 Subject: [PATCH 054/101] note about NuGet --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b1474cd75..eb7873c0e2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ or just look for any ".d.ts" files in the package and manually include them with These can be used by TypeScript 1.0. * [Typings](https://github.com/typings/typings) -* [NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped) +* ~~[NuGet](http://nuget.org/Tpackages?q=DefinitelyTyped)~~ (use preferred alternatives, nuget DT type publishing has been turned off) * Manually download from the `master` branch of this repository You may need to add manual [references](http://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). From 39c67df85ae3ee32565148bdcd174d48f5f3f91a Mon Sep 17 00:00:00 2001 From: d-ph Date: Sat, 24 Dec 2016 08:05:14 +0000 Subject: [PATCH 055/101] Add bluebird-global typings for bluebird.js. (#13100) * Add bluebird-global typings for bluebird.js. `bluebird-global` uses `bluebird` typings in order to expose its functions on the global Promise symbol. This is generally how devs use bluebird.js in the browser. * Sort methods alphabetically in `bluebird-global` and apply some code style fixes. * Apply code style fixes in `bluebird-global`. --- bluebird-global/bluebird-global-tests.ts | 31 +++++++++ bluebird-global/index.d.ts | 82 ++++++++++++++++++++++++ bluebird-global/tsconfig.json | 19 ++++++ bluebird-global/tslint.json | 6 ++ bluebird/index.d.ts | 5 +- 5 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 bluebird-global/bluebird-global-tests.ts create mode 100644 bluebird-global/index.d.ts create mode 100644 bluebird-global/tsconfig.json create mode 100644 bluebird-global/tslint.json diff --git a/bluebird-global/bluebird-global-tests.ts b/bluebird-global/bluebird-global-tests.ts new file mode 100644 index 0000000000..9087e57d08 --- /dev/null +++ b/bluebird-global/bluebird-global-tests.ts @@ -0,0 +1,31 @@ +function testSomeStaticMethods() { + Promise.config({}); + Promise.delay(100).then(() => {}); + Promise.all([]).finally(() => {}); +} + +function testFunctionReturningPromise() { + function functionReturningPromise(): Promise { + return new Promise((resolve, reject, onCancel) => { + + if (onCancel) { + onCancel(() => { + console.log("onCancel cleanup"); + }); + } + + resolve("lorem ipsum"); + }) + .then((value) => { + return value + " dolor"; + }); + } + + functionReturningPromise() + .then((value) => { + console.log("then callback: " + value); + }) + .finally(() => { + console.log("finally callback"); + }); +} diff --git a/bluebird-global/index.d.ts b/bluebird-global/index.d.ts new file mode 100644 index 0000000000..81a352ce5a --- /dev/null +++ b/bluebird-global/index.d.ts @@ -0,0 +1,82 @@ +// Type definitions for bluebird 3.0 +// Project: https://github.com/petkaantonov/bluebird +// Definitions by: d-ph +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* + * 1. Why use `bluebird-global` instead of `bluebird`? + * + * If you want to leverage the fact, that bluebird polyfills the global Promise in the browser, then + * you need to tell TypeScript about this. The following declaration file does exactly that. + * + * 2. How to use it? + * + * Add `bluebird-global` to the `types` array in your `tsconfig.json` like this: + * + * { + * "compilerOptions": { + * "types": [ + * "bluebird-global" + * ], + * } + * } + * + * 3. Why so much effort? + * + * If a promise-polyfilling library wants to play nicely with TypeScript, it needs to augment + * the Promise and PromiseConstructor interfaces defined in the standard ts library. + * For various reasons this couldn't be done in The `bluebird` typings. + * + */ + +import * as Bluebird from "bluebird"; + +declare global { + /* + * Patch all instance method + */ + interface Promise extends Bluebird {} + + /* + * Patch all static methods and the constructor + */ + interface PromiseConstructor { + new (callback: (resolve: (thenableOrResult?: T | Bluebird.Thenable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise; + + all: typeof Bluebird.all; + any: typeof Bluebird.any; + attempt: typeof Bluebird.attempt; + bind: typeof Bluebird.bind; + cast: typeof Bluebird.cast; + config: typeof Bluebird.config; + coroutine: typeof Bluebird.coroutine; + defer: typeof Bluebird.defer; + delay: typeof Bluebird.delay; + each: typeof Bluebird.each; + filter: typeof Bluebird.filter; + fromCallback: typeof Bluebird.fromCallback; + fromNode: typeof Bluebird.fromNode; + is: typeof Bluebird.is; + join: typeof Bluebird.join; + longStackTraces: typeof Bluebird.longStackTraces; + map: typeof Bluebird.map; + mapSeries: typeof Bluebird.mapSeries; + method: typeof Bluebird.method; + onPossiblyUnhandledRejection: typeof Bluebird.onPossiblyUnhandledRejection; + promisify: typeof Bluebird.promisify; + promisifyAll: typeof Bluebird.promisifyAll; + props: typeof Bluebird.props; + race: typeof Bluebird.race; + reduce: typeof Bluebird.reduce; + reject: typeof Bluebird.reject; + resolve: typeof Bluebird.resolve; + some: typeof Bluebird.some; + try: typeof Bluebird.try; + using: typeof Bluebird.using; + } + + /* + * Declare the `Promise` variable. This is needed for es5 only and is a no-op for all other targets. + */ + var Promise: PromiseConstructor; +} diff --git a/bluebird-global/tsconfig.json b/bluebird-global/tsconfig.json new file mode 100644 index 0000000000..8deacd0a4a --- /dev/null +++ b/bluebird-global/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bluebird-global-tests.ts" + ] +} diff --git a/bluebird-global/tslint.json b/bluebird-global/tslint.json new file mode 100644 index 0000000000..9b7feabed9 --- /dev/null +++ b/bluebird-global/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "no-empty-interface": false + } +} diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts index 3087abb2e5..2faa74e285 100644 --- a/bluebird/index.d.ts +++ b/bluebird/index.d.ts @@ -7,6 +7,9 @@ * The code following this comment originates from: * https://github.com/types/npm-bluebird * + * Note for browser users: use bluebird-global typings instead of this one + * if you want to use Bluebird via the global Promise symbol. + * * Licensed under: * The MIT License (MIT) * @@ -777,4 +780,4 @@ declare namespace Bluebird { export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; } -export = Bluebird; \ No newline at end of file +export = Bluebird; From 9411d01977f40a9bf757041185364615474126d9 Mon Sep 17 00:00:00 2001 From: Masahiro Wakame Date: Sat, 24 Dec 2016 17:05:49 +0900 Subject: [PATCH 056/101] Revert "Add bluebird-global typings for bluebird.js." (#13535) --- bluebird-global/bluebird-global-tests.ts | 31 --------- bluebird-global/index.d.ts | 82 ------------------------ bluebird-global/tsconfig.json | 19 ------ bluebird-global/tslint.json | 6 -- bluebird/index.d.ts | 5 +- 5 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 bluebird-global/bluebird-global-tests.ts delete mode 100644 bluebird-global/index.d.ts delete mode 100644 bluebird-global/tsconfig.json delete mode 100644 bluebird-global/tslint.json diff --git a/bluebird-global/bluebird-global-tests.ts b/bluebird-global/bluebird-global-tests.ts deleted file mode 100644 index 9087e57d08..0000000000 --- a/bluebird-global/bluebird-global-tests.ts +++ /dev/null @@ -1,31 +0,0 @@ -function testSomeStaticMethods() { - Promise.config({}); - Promise.delay(100).then(() => {}); - Promise.all([]).finally(() => {}); -} - -function testFunctionReturningPromise() { - function functionReturningPromise(): Promise { - return new Promise((resolve, reject, onCancel) => { - - if (onCancel) { - onCancel(() => { - console.log("onCancel cleanup"); - }); - } - - resolve("lorem ipsum"); - }) - .then((value) => { - return value + " dolor"; - }); - } - - functionReturningPromise() - .then((value) => { - console.log("then callback: " + value); - }) - .finally(() => { - console.log("finally callback"); - }); -} diff --git a/bluebird-global/index.d.ts b/bluebird-global/index.d.ts deleted file mode 100644 index 81a352ce5a..0000000000 --- a/bluebird-global/index.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -// Type definitions for bluebird 3.0 -// Project: https://github.com/petkaantonov/bluebird -// Definitions by: d-ph -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - * 1. Why use `bluebird-global` instead of `bluebird`? - * - * If you want to leverage the fact, that bluebird polyfills the global Promise in the browser, then - * you need to tell TypeScript about this. The following declaration file does exactly that. - * - * 2. How to use it? - * - * Add `bluebird-global` to the `types` array in your `tsconfig.json` like this: - * - * { - * "compilerOptions": { - * "types": [ - * "bluebird-global" - * ], - * } - * } - * - * 3. Why so much effort? - * - * If a promise-polyfilling library wants to play nicely with TypeScript, it needs to augment - * the Promise and PromiseConstructor interfaces defined in the standard ts library. - * For various reasons this couldn't be done in The `bluebird` typings. - * - */ - -import * as Bluebird from "bluebird"; - -declare global { - /* - * Patch all instance method - */ - interface Promise extends Bluebird {} - - /* - * Patch all static methods and the constructor - */ - interface PromiseConstructor { - new (callback: (resolve: (thenableOrResult?: T | Bluebird.Thenable) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void): Promise; - - all: typeof Bluebird.all; - any: typeof Bluebird.any; - attempt: typeof Bluebird.attempt; - bind: typeof Bluebird.bind; - cast: typeof Bluebird.cast; - config: typeof Bluebird.config; - coroutine: typeof Bluebird.coroutine; - defer: typeof Bluebird.defer; - delay: typeof Bluebird.delay; - each: typeof Bluebird.each; - filter: typeof Bluebird.filter; - fromCallback: typeof Bluebird.fromCallback; - fromNode: typeof Bluebird.fromNode; - is: typeof Bluebird.is; - join: typeof Bluebird.join; - longStackTraces: typeof Bluebird.longStackTraces; - map: typeof Bluebird.map; - mapSeries: typeof Bluebird.mapSeries; - method: typeof Bluebird.method; - onPossiblyUnhandledRejection: typeof Bluebird.onPossiblyUnhandledRejection; - promisify: typeof Bluebird.promisify; - promisifyAll: typeof Bluebird.promisifyAll; - props: typeof Bluebird.props; - race: typeof Bluebird.race; - reduce: typeof Bluebird.reduce; - reject: typeof Bluebird.reject; - resolve: typeof Bluebird.resolve; - some: typeof Bluebird.some; - try: typeof Bluebird.try; - using: typeof Bluebird.using; - } - - /* - * Declare the `Promise` variable. This is needed for es5 only and is a no-op for all other targets. - */ - var Promise: PromiseConstructor; -} diff --git a/bluebird-global/tsconfig.json b/bluebird-global/tsconfig.json deleted file mode 100644 index 8deacd0a4a..0000000000 --- a/bluebird-global/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "noImplicitAny": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "bluebird-global-tests.ts" - ] -} diff --git a/bluebird-global/tslint.json b/bluebird-global/tslint.json deleted file mode 100644 index 9b7feabed9..0000000000 --- a/bluebird-global/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "no-empty-interface": false - } -} diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts index 2faa74e285..3087abb2e5 100644 --- a/bluebird/index.d.ts +++ b/bluebird/index.d.ts @@ -7,9 +7,6 @@ * The code following this comment originates from: * https://github.com/types/npm-bluebird * - * Note for browser users: use bluebird-global typings instead of this one - * if you want to use Bluebird via the global Promise symbol. - * * Licensed under: * The MIT License (MIT) * @@ -780,4 +777,4 @@ declare namespace Bluebird { export function setScheduler(scheduler: (callback: (...args: any[]) => void) => void): void; } -export = Bluebird; +export = Bluebird; \ No newline at end of file From 51f11a1d6667b3b4908959ed39c4857e1b6b9c18 Mon Sep 17 00:00:00 2001 From: Titan Date: Sat, 24 Dec 2016 16:12:22 +0800 Subject: [PATCH 057/101] Make tslint happy in nanomsg types (#13104) --- nanomsg/index.d.ts | 32 +++++++++++++++----------------- nanomsg/tslint.json | 1 + 2 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 nanomsg/tslint.json diff --git a/nanomsg/index.d.ts b/nanomsg/index.d.ts index c2fb7e7f1f..ec2a1d366b 100644 --- a/nanomsg/index.d.ts +++ b/nanomsg/index.d.ts @@ -1,22 +1,20 @@ -// Type definitions for nanomsg 3.2.3 -// Project: https://github.com/nickdesaulniers/node-nanomsg +// Type definitions for nanomsg 3.2 +// Project: https://github.com/nickdesaulniers/node-nanomsg#readme // Definitions by: Titan -// Definitions: https://github.com/DefinitelyTyped/nanomsg +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare module "nanomsg" { - export interface EventCallback { - (data: Buffer): void; - } - export class Socket { - constructor(type: string, opts: Object); - shutdown(addr: string): void; - bind(addr: string): void; - connect(addr: string): void; - close(): void; - send(buf: Buffer | string): number; - on(event: string, cb: EventCallback): void; - } - export function socket(type: string, opts?: Object): Socket; +export type EventCallback = (data: Buffer) => void; + +export class Socket { + constructor(type: string, opts: {}); + shutdown(addr: string): void; + bind(addr: string): void; + connect(addr: string): void; + close(): void; + send(buf: Buffer | string): number; + on(event: string, cb: EventCallback): void; } + +export function socket(type: string, opts?: {}): Socket; diff --git a/nanomsg/tslint.json b/nanomsg/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/nanomsg/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 3918d87556b9f89e5c329f2acecac18b19917ac7 Mon Sep 17 00:00:00 2001 From: long_long_float Date: Sat, 24 Dec 2016 17:14:53 +0900 Subject: [PATCH 058/101] add send method to Channel (#13109) --- actioncable/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/actioncable/index.d.ts b/actioncable/index.d.ts index 8d42c4d17a..8815bcf88b 100644 --- a/actioncable/index.d.ts +++ b/actioncable/index.d.ts @@ -7,6 +7,7 @@ declare module ActionCable { interface Channel { unsubscribe(): void; perform(action: string, data: {}): void; + send(data: Object): boolean; } interface Subscriptions { From 6cf46289ea45ec73a9686fd3b3e7e5ac3f8cd03a Mon Sep 17 00:00:00 2001 From: Shaun Luttin Date: Sat, 24 Dec 2016 01:48:42 -0800 Subject: [PATCH 059/101] Add oidc-client-js to not needed packages (#13116) --- notNeededPackages.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notNeededPackages.json b/notNeededPackages.json index 2566a6fac6..2f6c397a36 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -100,6 +100,12 @@ "typingsPackageName": "ajv", "sourceRepoURL": "https://github.com/epoberezkin/ajv", "asOfVersion": "1.0.0" + }, + { + "libraryName": "oidc-client", + "typingsPackageName": "oidc-client", + "sourceRepoURL": "https://github.com/IdentityModel/oidc-client-js", + "asOfVersion": "1.2.2" } ] } From ac6c27723209cbd9b5265cf08a80cb12e3b50bd2 Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Sat, 24 Dec 2016 09:50:27 +0000 Subject: [PATCH 060/101] Add typings for node-fetch extensions, remove unsupported options (#13114) --- node-fetch/index.d.ts | 32 +++++++++++++++++++++++++------- node-fetch/node-fetch-tests.ts | 15 +++++++++++---- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/node-fetch/index.d.ts b/node-fetch/index.d.ts index 733e25639e..d39b6db22e 100644 --- a/node-fetch/index.d.ts +++ b/node-fetch/index.d.ts @@ -5,6 +5,8 @@ /// +import { Agent } from "http"; + export class Request extends Body { constructor(input: string | Request, init?: RequestInit); method: string; @@ -12,20 +14,35 @@ export class Request extends Body { headers: Headers; context: RequestContext; referrer: string; - mode: RequestMode; redirect: RequestRedirect; - credentials: RequestCredentials; - cache: RequestCache; + + //node-fetch extensions to the whatwg/fetch spec + compress: boolean; + agent?: Agent; + counter: number; + follow: number; + hostname: string; + protocol: string; + port?: number; + timeout: number; + size: number; } interface RequestInit { + //whatwg/fetch standard options method?: string; headers?: HeaderInit | { [index: string]: string }; body?: BodyInit; - mode?: RequestMode; redirect?: RequestRedirect; - credentials?: RequestCredentials; - cache?: RequestCache; + + //node-fetch extensions + timeout?: number; //=0 req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) + compress?: boolean; //=true support gzip/deflate content encoding. false to disable + size?: number; //=0 maximum response body size in bytes. 0 to disable + agent?: Agent; //=null http.Agent instance, allows custom proxy, certificate etc. + follow?: number; //=20 maximum redirect count. 0 to not follow redirect + + //node-fetch does not support mode, cache or credentials options } type RequestContext = @@ -56,7 +73,6 @@ export class Headers { export class Body { bodyUsed: boolean; body: NodeJS.ReadableStream; - arrayBuffer(): Promise; json(): Promise; json(): Promise; text(): Promise; @@ -71,7 +87,9 @@ export class Response extends Body { url: string; status: number; ok: boolean; + size: number; statusText: string; + timeout: number; headers: Headers; clone(): Response; } diff --git a/node-fetch/node-fetch-tests.ts b/node-fetch/node-fetch-tests.ts index e72b3db8e2..dbf140225f 100644 --- a/node-fetch/node-fetch-tests.ts +++ b/node-fetch/node-fetch-tests.ts @@ -1,4 +1,5 @@ import fetch, { Headers, Request, RequestInit, Response } from 'node-fetch'; +import { Agent } from "http"; function test_fetchUrlWithOptions() { var headers = new Headers(); @@ -6,10 +7,11 @@ function test_fetchUrlWithOptions() { var requestOptions: RequestInit = { method: "POST", headers: headers, - mode: 'same-origin', - credentials: 'omit', - cache: 'default', - redirect: 'manual' + compress: true, + follow: 10, + redirect: 'manual', + size: 100, + timeout: 5000 }; handlePromise(fetch("http://www.andlabs.net/html5/uCOR.php", requestOptions)); } @@ -36,6 +38,11 @@ function test_fetchUrlWithRequestObject() { } }; var request: Request = new Request("http://www.andlabs.net/html5/uCOR.php", requestOptions); + var timeout: number = request.timeout; + var size: number = request.size; + var agent: Agent = request.agent; + var protocol: string = request.protocol + handlePromise(fetch(request)); } From 6b5837b46702b51559d37ff06459b927370b444c Mon Sep 17 00:00:00 2001 From: ysgk Date: Sat, 24 Dec 2016 18:50:50 +0900 Subject: [PATCH 061/101] Googlemaps: Added support for LatLngBoundsLiteral (#13107) * Added support for LatLngBoundsLiteral * Added definition for LatLngBounds::toJSON() --- googlemaps/index.d.ts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index dff5c1cd90..28feff6d03 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -31,7 +31,7 @@ declare namespace google.maps { /***** Map *****/ export class Map extends MVCObject { constructor(mapDiv: Element, opts?: MapOptions); - fitBounds(bounds: LatLngBounds): void; + fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; getBounds(): LatLngBounds; getCenter(): LatLng; getDiv(): Element; @@ -43,7 +43,7 @@ declare namespace google.maps { getZoom(): number; panBy(x: number, y: number): void; panTo(latLng: LatLng|LatLngLiteral): void; - panToBounds(latLngBounds: LatLngBounds): void; + panToBounds(latLngBounds: LatLngBounds|LatLngBoundsLiteral): void; setCenter(latlng: LatLng|LatLngLiteral): void; setHeading(heading: number): void; setMapTypeId(mapTypeId: MapTypeId|string): void; @@ -769,7 +769,7 @@ declare namespace google.maps { getEditable(): boolean; getMap(): Map; getVisible(): boolean; - setBounds(bounds: LatLngBounds): void; + setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; setDraggable(draggable: boolean): void; setEditable(editable: boolean): void; setMap(map: Map): void; @@ -778,7 +778,7 @@ declare namespace google.maps { } export interface RectangleOptions { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; clickable?: boolean; draggable?: boolean; editable?: boolean; @@ -844,7 +844,7 @@ declare namespace google.maps { } export class GroundOverlay extends MVCObject { - constructor(url: string, bounds: LatLngBounds, opts?: GroundOverlayOptions); + constructor(url: string, bounds: LatLngBounds|LatLngBoundsLiteral, opts?: GroundOverlayOptions); getBounds(): LatLngBounds; getMap(): Map; getOpacity(): number; @@ -895,7 +895,7 @@ declare namespace google.maps { export interface GeocoderRequest { address?: string; - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: GeocoderComponentRestrictions; location?: LatLng|LatLngLiteral; placeId?: string; @@ -1817,6 +1817,7 @@ declare namespace google.maps { getSouthWest(): LatLng; intersects(other: LatLngBounds|LatLngBoundsLiteral): boolean; isEmpty(): boolean; + toJSON(): LatLngBoundsLiteral; toSpan(): LatLng; toString(): string; toUrlValue(precision?: number): string; @@ -2004,13 +2005,13 @@ declare namespace google.maps { constructor(inputField: HTMLInputElement, opts?: AutocompleteOptions); getBounds(): LatLngBounds; getPlace(): PlaceResult; - setBounds(bounds: LatLngBounds): void; + setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; setComponentRestrictions(restrictions: ComponentRestrictions): void; setTypes(types: string[]): void; } export interface AutocompleteOptions { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; types?: string[]; } @@ -2040,7 +2041,7 @@ declare namespace google.maps { } export interface AutocompletionRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; input: string; location?: LatLng; @@ -2115,7 +2116,7 @@ declare namespace google.maps { } export interface PlaceSearchRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; keyword?: string; location?: LatLng|LatLngLiteral; maxPriceLevel?: number; @@ -2153,7 +2154,7 @@ declare namespace google.maps { } export interface QueryAutocompletionRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; input?: string; location?: LatLng; offset?: number; @@ -2161,7 +2162,7 @@ declare namespace google.maps { } export interface RadarSearchRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; keyword?: string; location?: LatLng|LatLngLiteral; name?: string; @@ -2179,15 +2180,15 @@ declare namespace google.maps { constructor(inputField: HTMLInputElement, opts?: SearchBoxOptions); getBounds(): LatLngBounds; getPlaces(): PlaceResult[]; - setBounds(bounds: LatLngBounds): void; + setBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void; } export interface SearchBoxOptions { - bounds: LatLngBounds; + bounds: LatLngBounds|LatLngBoundsLiteral; } export interface TextSearchRequest { - bounds?: LatLngBounds; + bounds?: LatLngBounds|LatLngBoundsLiteral; location?: LatLng|LatLngLiteral; query: string; radius?: number; From a6f263d331654552dff6c299e6a9424d02d4b4db Mon Sep 17 00:00:00 2001 From: Gabriel Zimmermann Date: Sat, 24 Dec 2016 06:51:14 -0300 Subject: [PATCH 062/101] Adds `delete` method to request object. (#13121) * Adds `delete` method to request object. Request accepts both `request.del` and `request.delete`. The type definition is missing the latter. * Adds entries in test file --- request/index.d.ts | 4 ++++ request/request-tests.ts | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/request/index.d.ts b/request/index.d.ts index 0dff82cfa3..1a2e57404e 100644 --- a/request/index.d.ts +++ b/request/index.d.ts @@ -50,6 +50,10 @@ declare namespace request { del(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; del(uri: string, callback?: RequestCallback): TRequest; del(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; + + delete(uri: string, options?: TOptions, callback?: RequestCallback): TRequest; + delete(uri: string, callback?: RequestCallback): TRequest; + delete(options: TUriUrlOptions & TOptions, callback?: RequestCallback): TRequest; forever(agentOptions: any, optionsArg: any): TRequest; jar(): CookieJar; diff --git a/request/request-tests.ts b/request/request-tests.ts index 0d3be3b8be..21f8306a12 100644 --- a/request/request-tests.ts +++ b/request/request-tests.ts @@ -203,6 +203,13 @@ req = request.del(uri, callback); req = request.del(options); req = request.del(options, callback); +req = request.delete(uri); +req = request.delete(uri, options); +req = request.delete(uri, options, callback); +req = request.delete(uri, callback); +req = request.delete(options); +req = request.delete(options, callback); + req = request.forever(value, value); jar = request.jar(); cookie = request.cookie(str); @@ -560,6 +567,7 @@ request.patch(url); request.post(url); request.head(url); request.del(url); +request.delete(url); request.get(url); request.cookie('key1=value1'); request.jar(); From e3885ed339aaa8b4fdf4a4380416c8d70b6929ef Mon Sep 17 00:00:00 2001 From: Kevin Smathers Date: Sat, 24 Dec 2016 04:55:40 -0500 Subject: [PATCH 063/101] Add moveAsync definition (#13019) --- fs-extra-promise/fs-extra-promise-tests.ts | 2 ++ fs-extra-promise/index.d.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fs-extra-promise/fs-extra-promise-tests.ts b/fs-extra-promise/fs-extra-promise-tests.ts index 51ae5b1140..112a27109c 100644 --- a/fs-extra-promise/fs-extra-promise-tests.ts +++ b/fs-extra-promise/fs-extra-promise-tests.ts @@ -62,6 +62,8 @@ fs.mkdirsSync(dir); fs.mkdirp(dir, errorCallback); fs.mkdirpSync(dir); +fs.move(src, dest, errorCallback); + fs.outputFile(file, data, errorCallback); fs.outputFileSync(file, data); fs.outputJson(file, data, errorCallback); diff --git a/fs-extra-promise/index.d.ts b/fs-extra-promise/index.d.ts index 871105f769..e04f0f0688 100644 --- a/fs-extra-promise/index.d.ts +++ b/fs-extra-promise/index.d.ts @@ -10,7 +10,7 @@ import * as stream from 'stream'; import { Stats } from 'fs'; import * as Promise from 'bluebird'; -import { CopyFilter, CopyOptions, OpenOptions, MkdirOptions } from 'fs-extra'; +import { CopyFilter, CopyOptions, OpenOptions, MkdirOptions, MoveOptions } from 'fs-extra'; export * from 'fs-extra'; @@ -24,6 +24,8 @@ export declare function createFileAsync(file: string): Promise; export declare function mkdirsAsync(dir: string, options?: MkdirOptions): Promise; export declare function mkdirpAsync(dir: string, options?: MkdirOptions): Promise; +export declare function moveAsync(src: string, dest: string, options?: MoveOptions): Promise; + export declare function outputFileAsync(file: string, data: any): Promise; export declare function outputJsonAsync(file: string, data: any): Promise; From c32938577f05626c07a27ad2227adfe38463e1d9 Mon Sep 17 00:00:00 2001 From: Ryan Southgate Date: Sat, 24 Dec 2016 09:56:12 +0000 Subject: [PATCH 064/101] added "initDate" to IDatePickerConfig (#13136) --- angular-ui-bootstrap/angular-ui-bootstrap-tests.ts | 1 + angular-ui-bootstrap/index.d.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index 84ddd63790..16eaff3b39 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -38,6 +38,7 @@ testApp.config(( $datepickerConfig.formatMonth = 'M'; $datepickerConfig.formatMonthTitle = 'yy'; $datepickerConfig.formatYear = 'y'; + $datepickerConfig.initDate = '1389586124979'; $datepickerConfig.maxDate = '1389586124979'; $datepickerConfig.maxMode = 'month'; $datepickerConfig.minDate = '1389586124979'; diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index 24f8405125..73043c4e7a 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -42,7 +42,6 @@ declare module 'angular' { closeOthers?: boolean; } - interface IButtonConfig { /** * @default: 'active' @@ -55,7 +54,6 @@ declare module 'angular' { toggleEvent?: string; } - interface IDatepickerConfig { /** * Format of day in month. @@ -155,6 +153,13 @@ declare module 'angular' { */ maxDate?: any; + /** + * Defines the initial date, when no model value is specified. + * + * @default null + */ + initDate?: any; + /** * An option to disable or enable shortcut's event propagation * From 60d039d626c4ff8ee72b15fb751acd5bbe485a83 Mon Sep 17 00:00:00 2001 From: Ulrich Heiniger Date: Sat, 24 Dec 2016 10:57:41 +0100 Subject: [PATCH 065/101] Add type definitions for chai-json-schema (#13036) * Add type definitions for chai-json-schema * Change to types-2.0 style * Change reference path * Fix namespace name * Fix should example in tests --- chai-json-schema/chai-json-schema-tests.ts | 56 ++++++++++++++++++++++ chai-json-schema/index.d.ts | 24 ++++++++++ chai-json-schema/tsconfig.json | 19 ++++++++ chai-json-schema/tslint.json | 5 ++ 4 files changed, 104 insertions(+) create mode 100644 chai-json-schema/chai-json-schema-tests.ts create mode 100644 chai-json-schema/index.d.ts create mode 100644 chai-json-schema/tsconfig.json create mode 100644 chai-json-schema/tslint.json diff --git a/chai-json-schema/chai-json-schema-tests.ts b/chai-json-schema/chai-json-schema-tests.ts new file mode 100644 index 0000000000..8559d3caae --- /dev/null +++ b/chai-json-schema/chai-json-schema-tests.ts @@ -0,0 +1,56 @@ +/// + +import { expect } from 'chai'; +import { assert } from 'chai'; + +import chai = require('chai'); +import ChaiJsonSchema = require('chai-json-schema'); + +chai.use(ChaiJsonSchema); +chai.should(); + +let goodApple = { + skin: 'thin', + colors: ['red', 'green', 'yellow'], + taste: 10 +}; + +let badApple = { + colors: ['brown'], + taste: 0, + worms: 2 +}; + +let fruitSchema = { + title: 'fresh fruit schema v1', + type: 'object', + required: ['skin', 'colors', 'taste'], + properties: { + colors: { + type: 'array', + minItems: 1, + uniqueItems: true, + items: { + type: 'string' + } + }, + skin: { + type: 'string' + }, + taste: { + type: 'number', + minimum: 5 + } + } +}; + +//bdd style +expect(goodApple).to.be.jsonSchema(fruitSchema); +expect(badApple).to.not.be.jsonSchema(fruitSchema); + +goodApple.should.be.jsonSchema(fruitSchema); +badApple.should.not.be.jsonSchema(fruitSchema); + +//tdd style +assert.jsonSchema(goodApple, fruitSchema); +assert.notJsonSchema(badApple, fruitSchema); diff --git a/chai-json-schema/index.d.ts b/chai-json-schema/index.d.ts new file mode 100644 index 0000000000..e3e4934c76 --- /dev/null +++ b/chai-json-schema/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for chai-json-schema 1.4 +// Project: https://github.com/chaijs/chai-json-schema/ +// Definitions by: Ulrich Heiniger +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// +// + +declare namespace Chai { + export interface Assert { + jsonSchema(value: any, schema: any, msg?: string): void; + notJsonSchema(value: any, schema: any, msg?: string): void; + } + + export interface LanguageChains { + jsonSchema(schema: any, msg?: string): void; + } +} + +declare module "chai-json-schema" { + function chaiJsonSchema(chai: any, utils: any): void; + namespace chaiJsonSchema {} + export = chaiJsonSchema; +} diff --git a/chai-json-schema/tsconfig.json b/chai-json-schema/tsconfig.json new file mode 100644 index 0000000000..1ac8b87c7a --- /dev/null +++ b/chai-json-schema/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-json-schema-tests.ts" + ] +} diff --git a/chai-json-schema/tslint.json b/chai-json-schema/tslint.json new file mode 100644 index 0000000000..83a03ce890 --- /dev/null +++ b/chai-json-schema/tslint.json @@ -0,0 +1,5 @@ +{ "extends": "../tslint.json", + "rules": { + "no-single-declare-module": false + } +} From b5a1e2498ad93e3c9de243c97c6fd94dc05ce5ba Mon Sep 17 00:00:00 2001 From: Caleb Meredith Date: Sat, 24 Dec 2016 05:04:42 -0500 Subject: [PATCH 066/101] add `NullValueNode` (#13152) In the most recent update to GraphQL, the null literal was added to the AST. This PR adds the types for the new AST node. For reference, see: - https://github.com/graphql/graphql-js/blob/e49df4980396ed40d9b43bad738c53e001d8f0e5/src/language/ast.js#L129 - https://github.com/graphql/graphql-js/blob/e49df4980396ed40d9b43bad738c53e001d8f0e5/src/language/ast.js#L264 - https://github.com/graphql/graphql-js/blob/e49df4980396ed40d9b43bad738c53e001d8f0e5/src/language/ast.js#L293-L296 --- graphql/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/graphql/index.d.ts b/graphql/index.d.ts index a865687eb1..0d53747800 100644 --- a/graphql/index.d.ts +++ b/graphql/index.d.ts @@ -319,6 +319,7 @@ declare module "graphql/language/ast" { | FloatValueNode | StringValueNode | BooleanValueNode + | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode @@ -450,6 +451,7 @@ declare module "graphql/language/ast" { | FloatValueNode | StringValueNode | BooleanValueNode + | NullValueNode | EnumValueNode | ListValueNode | ObjectValueNode @@ -478,6 +480,11 @@ declare module "graphql/language/ast" { value: boolean; } + export type NullValueNode = { + kind: 'NullValue'; + loc?: Location; + } + export type EnumValueNode = { kind: 'EnumValue'; loc?: Location; From 2913e93eab0976a83f18ee6d218a870246083953 Mon Sep 17 00:00:00 2001 From: Stephan Date: Sat, 24 Dec 2016 11:11:45 +0100 Subject: [PATCH 067/101] Add data property (#13166) --- chart.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index e9186035c7..b62f3143ba 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -394,6 +394,7 @@ interface RadialLinearScale { declare class Chart { constructor (context: CanvasRenderingContext2D | HTMLCanvasElement, options: ChartConfiguration); config: ChartConfiguration; + data: ChartData; destroy: () => {}; update: (duration?: any, lazy?: any) => {}; render: (duration?: any, lazy?: any) => {}; From 7d3e77aa3039c205170a6055f9a007d0fa403b2c Mon Sep 17 00:00:00 2001 From: Kamran Ayub Date: Sat, 24 Dec 2016 04:14:31 -0600 Subject: [PATCH 068/101] [minimist] Update with JSDoc and generic overloads (#13169) * Update minimist with JSDoc and generic overloads * Clean up docs to match original better --- minimist/index.d.ts | 80 ++++++++++++++++++++++++++++++++------ minimist/minimist-tests.ts | 22 +++++++++++ 2 files changed, 90 insertions(+), 12 deletions(-) diff --git a/minimist/index.d.ts b/minimist/index.d.ts index 4ab52d76ff..143727ed76 100644 --- a/minimist/index.d.ts +++ b/minimist/index.d.ts @@ -1,33 +1,89 @@ -// Type definitions for minimist 1.1.3 +// Type definitions for minimist 1.2.0 // Project: https://github.com/substack/minimist -// Definitions by: Bart van der Schoor , Necroskillz +// Definitions by: Bart van der Schoor , Necroskillz , kamranayub // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +/** + * Return an argument object populated with the array arguments from args + * + * @param args An optional argument array (typically `process.argv.slice(2)`) + * @param opts An optional options object to customize the parsing + */ declare function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs; +/** + * Return an argument object populated with the array arguments from args. Strongly-typed + * to be the intersect of type T with minimist.ParsedArgs. + * + * @type T The type that will be intersected with minimist.ParsedArgs to represent the argument object + * @param args An optional argument array (typically `process.argv.slice(2)`) + * @param opts An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): T & minimist.ParsedArgs; + +/** + * Return an argument object populated with the array arguments from args. Strongly-typed + * to be the the type T which should extend minimist.ParsedArgs + * + * @type T The type that extends minimist.ParsedArgs and represents the argument object + * @param args An optional argument array (typically `process.argv.slice(2)`) + * @param opts An optional options object to customize the parsing + */ +declare function minimist(args?: string[], opts?: minimist.Opts): T; + declare namespace minimist { export interface Opts { - // a string or array of strings argument names to always treat as strings + /** + * A string or array of strings argument names to always treat as strings + */ string?: string | string[]; - // a string or array of strings to always treat as booleans + + /** + * A boolean, string or array of strings to always treat as booleans. If true will treat + * all double hyphenated arguments without equals signs as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`) + */ boolean?: boolean | string | string[]; - // an object mapping string names to strings or arrays of string argument names to use + + /** + * An object mapping string names to strings or arrays of string argument names to use as aliases + */ alias?: { [key: string]: string | string[] }; - // an object mapping string argument names to default values + + /** + * An object mapping string argument names to default values + */ default?: { [key: string]: any }; - // when true, populate argv._ with everything after the first non-option + + /** + * When true, populate argv._ with everything after the first non-option + */ stopEarly?: boolean; - // a function which is invoked with a command line parameter not defined in the opts configuration object. - // If the function returns false, the unknown option is not added to argv + + /** + * A function which is invoked with a command line parameter not defined in the opts + * configuration object. If the function returns false, the unknown option is not added to argv + */ unknown?: (arg: string) => boolean; - // when true, populate argv._ with everything before the -- and argv['--'] with everything after the -- + + /** + * When true, populate argv._ with everything before the -- and argv['--'] with everything after the --. + * Note that with -- set, parsing for arguments still stops after the `--`. + */ '--'?: boolean; } export interface ParsedArgs { [arg: string]: any; - _: string[]; + + /** + * If opts['--'] is true, populated with everything after the -- + */ + '--'?: string[]; + + /** + * Contains all the arguments that didn't have an option associated with them + */ + _: string[]; } } diff --git a/minimist/minimist-tests.ts b/minimist/minimist-tests.ts index 6e63590462..bf8fb34564 100644 --- a/minimist/minimist-tests.ts +++ b/minimist/minimist-tests.ts @@ -2,11 +2,21 @@ import minimist = require('minimist'); import Opts = minimist.Opts; +interface CustomArgs { + foo: boolean; +} + +interface CustomArgs2 extends minimist.ParsedArgs { + foo: boolean; +} + var num: string; var str: string; var strArr: string[]; var args: string[]; var obj: minimist.ParsedArgs; +var iobj: minimist.ParsedArgs & CustomArgs; +var eobj: CustomArgs2; var opts: Opts; var arg: any; @@ -40,6 +50,18 @@ opts['--'] = true; obj = minimist(); obj = minimist(strArr); obj = minimist(strArr, opts); +iobj = minimist(); +iobj = minimist(strArr); +iobj = minimist(strArr, opts); +eobj = minimist(); +eobj = minimist(strArr); +eobj = minimist(strArr, opts); var remainingArgCount = obj._.length; arg = obj['foo']; + +arg = iobj.foo; +remainingArgCount = iobj._.length; + +arg = eobj.foo; +remainingArgCount = eobj._.length; \ No newline at end of file From 9d32e229ba87f2bc2b1d6618f6639a87807402fa Mon Sep 17 00:00:00 2001 From: Morgan Benton Date: Sat, 24 Dec 2016 05:14:57 -0500 Subject: [PATCH 069/101] fixed fit options (#13175) * fixed fit options * linted --- d3kit/d3kit-tests.ts | 12 ++++++------ d3kit/index.d.ts | 27 +++++++++++---------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts index 8e524a1f69..c8a447ecda 100644 --- a/d3kit/d3kit-tests.ts +++ b/d3kit/d3kit-tests.ts @@ -5,7 +5,7 @@ function test_abstract_chart() { chart: d3kit.AbstractChart, options: d3kit.ChartOptions, margins: d3kit.ChartMargin, - offsets: d3kit.ChartOffset, + offsets: [number, number], defopts: d3kit.ChartOptions, fitopts: d3kit.FitOptions, watchop: d3kit.WatchOptions, @@ -17,7 +17,7 @@ function test_abstract_chart() { // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = { x: 0.5, y: 0.5 }; + offsets = [0.5, 0.5]; options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; fitopts = { mode: 'basic', width: '90%', ratio: 4/3 }; watchop = { mode: 'window', target: null, interval: 500 }; @@ -85,7 +85,7 @@ function test_svgchart() { chart: d3kit.SvgChart, options: d3kit.ChartOptions, margins: d3kit.ChartMargin, - offsets: d3kit.ChartOffset, + offsets: [number, number], svg: d3.Selection, rootg: d3.Selection, layers: d3kit.LayerOrganizer; @@ -95,7 +95,7 @@ function test_svgchart() { // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = { x: 0.5, y: 0.5 }; + offsets = [0.5, 0.5]; options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets }; /** @@ -119,7 +119,7 @@ function test_canvaschart() { chart: d3kit.CanvasChart, options: d3kit.ChartOptions, margins: d3kit.ChartMargin, - offsets: d3kit.ChartOffset, + offsets: [number, number], context: CanvasRenderingContext2D; // create a div, append to body, return Node as type Element @@ -127,7 +127,7 @@ function test_canvaschart() { // create examples of margins, offsets, options, fit options, watch options margins = { top: 20, right: 20, bottom: 20, left: 20}; - offsets = { x: 0.5, y: 0.5 }; + offsets = [0.5, 0.5]; options = { initialWidth: 400, initialHeight: 300, margin: margins, offset: offsets, pixelRatio: 1 }; /** diff --git a/d3kit/index.d.ts b/d3kit/index.d.ts index 18adf3c6c0..8d0d468a3c 100644 --- a/d3kit/index.d.ts +++ b/d3kit/index.d.ts @@ -26,8 +26,8 @@ export class AbstractChart { data(): any; margin(margins: ChartMargin): this; margin(): ChartMargin; - offset(offset: ChartOffset): this; - offset(): ChartOffset; + offset(offset: [number, number]): this; + offset(): [number, number]; options(options: ChartOptions): this; options(): ChartOptions; updateDimensionNow(): this; @@ -47,16 +47,11 @@ export interface ChartMargin { left?: number; } -export interface ChartOffset { - x: number; - y: number; -} - export interface ChartOptions { initialWidth?: number; initialHeight?: number; margin?: ChartMargin; - offset?: ChartOffset; + offset?: [number, number]; pixelRatio?: number; } @@ -93,23 +88,23 @@ export class CanvasChart extends AbstractChart { export class LayerOrganizer { constructor(container: d3.Selection, defaultTag?: string); - create(layerNames: string|Array|LayerConfig|Array): d3.Selection|Array>; + create(layerNames: string|string[]|LayerConfig|LayerConfig[]): d3.Selection|Array>; get(name: string): d3.Selection; has(name: string): boolean; } export interface LayerConfig { - [layerName: string]: string|string[]|LayerConfig|Array; + [layerName: string]: string|string[]|LayerConfig|LayerConfig[]; } export namespace helper { - function debounce(fn: (...args: Array) => void, delay: number): (...args: Array) => void; - function deepExtend(dest: Object, ...args: Object[]): Object; - function extend(dest: Object, ...args: Object[]): Object; - function functor(value: any): (...args: Array) => any; - function rebind(target: Object, source: Object): Object; + function debounce(fn: (...args: any[]) => void, delay: number): (...args: any[]) => void; + function deepExtend(dest: any, ...args: any[]): any; + function extend(dest: any, ...args: any[]): any; + function functor(value: any): (...args: any[]) => any; + function rebind(target: any, source: any): any; function isFunction(value: any): boolean; function isObject(value: any): boolean; function kebabCase(str: string): string; - function throttle(fn: (...args: Array) => void, delay: number): (...args: Array) => void; + function throttle(fn: (...args: any[]) => void, delay: number): (...args: any[]) => void; } From 99dc0a40f9442915219a46d6539bafd8d470b7c1 Mon Sep 17 00:00:00 2001 From: Stefan Dobrev Date: Sat, 24 Dec 2016 12:15:36 +0200 Subject: [PATCH 070/101] [material-ui] Snackbar optional onRequestClose (#13179) Make `Snackbar`'s `onRequestClose` property optional. See [here](https://github.com/callemall/material-ui/blob/master/src/Snackbar/Snackbar.js#L90) for more details. --- material-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index fd586cf2f7..a52385b41c 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -1496,7 +1496,7 @@ declare namespace __MaterialUI { contentStyle?: React.CSSProperties; message: React.ReactNode; onActionTouchTap?: React.TouchEventHandler<{}>; - onRequestClose: (reason: string) => void; + onRequestClose?: (reason: string) => void; open: boolean; style?: React.CSSProperties; } From 99dd18a7a1a689d9fa9731be2d4d460831ea4a5f Mon Sep 17 00:00:00 2001 From: Panagiotis Rikarnto Siavelis Date: Sat, 24 Dec 2016 12:16:24 +0200 Subject: [PATCH 071/101] Filter.numberComparators (#13044) numberComparators field of Filter interface, should be optional --- react-bootstrap-table/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index b0b250f8c3..4ecf93573c 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -557,7 +557,7 @@ export interface Filter { /** * Only work on NumberFilter. Accept an array which conatin the filter condition, like: ['<','>','='] */ - numberComparators: string[]; + numberComparators?: string[]; } export interface TableHeaderColumn extends ComponentClass { } From 28f528ffabd7bb4c91e86ebf6f57632d200551eb Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Sat, 24 Dec 2016 05:35:21 -0500 Subject: [PATCH 072/101] Add `zscanStream` redis command (#13212) This exists as a command in `ioredis` but was missing from the type definition. --- ioredis/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ioredis/index.d.ts b/ioredis/index.d.ts index 9fa66ad2b6..16b33400c3 100644 --- a/ioredis/index.d.ts +++ b/ioredis/index.d.ts @@ -338,6 +338,7 @@ declare module IORedis { scanStream(options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; hscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; + zscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; } interface Pipeline { @@ -719,4 +720,4 @@ declare module IORedis { retryDelayOnTryAgain?: number; redisOptions?: RedisOptions; } -} \ No newline at end of file +} From 383fca5ed7974a90c3f3af6425949cc442ec1cd5 Mon Sep 17 00:00:00 2001 From: Danny Cochran Date: Sat, 24 Dec 2016 02:42:14 -0800 Subject: [PATCH 073/101] add scroll handlers to ScrollView (#13237) --- react-native/index.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 195015b09e..0fb9c19550 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -5576,7 +5576,17 @@ declare module "react" { * Fires at most once per frame during scrolling. * The frequency of the events can be contolled using the scrollEventThrottle prop. */ - onScroll?: (event?: { nativeEvent: NativeScrollEvent }) => void + onScroll?: (event?: NativeSyntheticEvent) => void + + /** + * Fires if a user initiates a scroll gesture. + */ + onScrollBeginDrag?: (event?: NativeSyntheticEvent) => void + + /** + * Fires when a user has finished scrolling. + */ + onScrollEndDrag?: (event?: NativeSyntheticEvent) => void /** * When true the scroll view stops on multiples of the scroll view's size From c78a0154b578166c8836e67b92d15f1332940a61 Mon Sep 17 00:00:00 2001 From: Stephen Lautier Date: Sat, 24 Dec 2016 17:51:59 +0100 Subject: [PATCH 074/101] lodash-es: fix dep to point properly to `@types/lodash` (#13213) * feat(lodash-es): fix dep to point properly to `@types/lodash` instead of `lodash` * lodash: removed `package.json` as packages deps are inferred automatically --- lodash-es/package.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 lodash-es/package.json diff --git a/lodash-es/package.json b/lodash-es/package.json deleted file mode 100644 index 27f0917342..0000000000 --- a/lodash-es/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "dependencies": { - "lodash": ">=4.14.0" - } -} From a8cfbbd573e26787e51a41781714e5a349423dc8 Mon Sep 17 00:00:00 2001 From: Erin Coughlan Date: Sat, 24 Dec 2016 11:46:22 -0800 Subject: [PATCH 075/101] Update angular-material typings for IPanelRef (#13238) From a0bc1d544cc277613a3e571d49a7d610db305dc8 Mon Sep 17 00:00:00 2001 From: Russell Black Date: Sat, 24 Dec 2016 12:48:45 -0700 Subject: [PATCH 076/101] restify: added requestTimeout to client options (#13208) See http://restify.com/#createjsonclientoptions --- restify/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/restify/index.d.ts b/restify/index.d.ts index 2a99479d7c..b1350660d0 100644 --- a/restify/index.d.ts +++ b/restify/index.d.ts @@ -456,6 +456,7 @@ interface ServerOptions { interface ClientOptions { accept?: string; connectTimeout?: number; + requestTimeout?: number; dtrace?: Object; gzip?: Object; headers?: Object; From d2c72d7337163e43b995f785345adb8ac30c5971 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 24 Dec 2016 13:49:22 -0600 Subject: [PATCH 077/101] improve jade typings (#13075) --- jade/index.d.ts | 40 +++++++++++++++++++++++++++++++++------- jade/jade-tests.ts | 2 +- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/jade/index.d.ts b/jade/index.d.ts index bc97c52839..9d34b07350 100644 --- a/jade/index.d.ts +++ b/jade/index.d.ts @@ -3,13 +3,39 @@ // Definitions by: Panu Horsmalahti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export type JadeCustomFilterFunction = (text: string, options: { + [key: string]: boolean; +}) => string; -export declare function compile(template: string, options?: any): (locals?: any) => string; -export declare function compileFile(path: string, options?: any): (locals?: any) => string; -export declare function compileClient(template: string, options?: any): (locals?: any) => string; -export declare function compileClientWithDependenciesTracked(template: string, options?: any): { - body: (locals?: any) => string; +export interface JadeOptions { + filename?: string; + basedir?: string; + doctype?: string; + pretty?: boolean | string; + filters?: { + [key: string]: JadeCustomFilterFunction + }; + self?: boolean; + debug?: boolean; + compileDebug?: boolean; + globals?: string[]; + cache?: boolean; + inlineRuntimeFunctions?: boolean; + name?: string; +} + +export interface TemplateLocals { + [key: string]: any; +} + +export type JadeGenerationFunction = (locals?: TemplateLocals) => string; + +export declare function compile(template: string, options?: JadeOptions): JadeGenerationFunction; +export declare function compileFile(path: string, options?: JadeOptions): JadeGenerationFunction; +export declare function compileClient(template: string, options?: JadeOptions): JadeGenerationFunction; +export declare function compileClientWithDependenciesTracked(template: string, options?: JadeOptions): { + body: JadeGenerationFunction; dependencies: string[]; }; -export declare function render(template: string, options?: any): string; -export declare function renderFile(path: string, options?: any): string; +export declare function render(template: string, options?: JadeOptions): string; +export declare function renderFile(path: string, options?: JadeOptions): string; diff --git a/jade/jade-tests.ts b/jade/jade-tests.ts index 2f8fd9d70e..2a17cc0c92 100644 --- a/jade/jade-tests.ts +++ b/jade/jade-tests.ts @@ -4,5 +4,5 @@ jade.compile("b")(); jade.compileFile("foo.jade", {})(); jade.compileClient("a")({ a: 1 }); jade.compileClientWithDependenciesTracked("test").body(); -jade.render("h1",{}); +jade.render("h1", {}); jade.renderFile("foo.jade"); From 94c44cad2eddccb8bdcb077a8c56a79658632cbc Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Sat, 24 Dec 2016 11:54:35 -0800 Subject: [PATCH 078/101] Fix dgram.Socket#ref and #unref (#13242) These two methods both return the socket, than being void. --- node/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/index.d.ts b/node/index.d.ts index a428c3a6ad..f37b6d3cd5 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -2067,8 +2067,8 @@ declare module "dgram" { setMulticastLoopback(flag: boolean): void; addMembership(multicastAddress: string, multicastInterface?: string): void; dropMembership(multicastAddress: string, multicastInterface?: string): void; - ref(): void; - unref(): void; + ref(): this; + unref(): this; /** * events.EventEmitter From 2157d75e67ac1015bf8182ac4581fffa2fb5e29f Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Sun, 25 Dec 2016 03:57:38 +0800 Subject: [PATCH 079/101] Add method `describe` to `Client`. (#13266) --- soap/index.d.ts | 1 + soap/soap-tests.ts | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/soap/index.d.ts b/soap/index.d.ts index 0ec9549058..4262bdb64c 100644 --- a/soap/index.d.ts +++ b/soap/index.d.ts @@ -23,6 +23,7 @@ interface Client extends events.EventEmitter { [method: string]: (args: any, fn: (err: any, result: any) => void, options?: any, extraHeaders?: any) => void; addSoapHeader(headJSON: any): void; setEndpoint(endpoint: string): void; + describe(): any; } export interface Server extends events.EventEmitter { diff --git a/soap/soap-tests.ts b/soap/soap-tests.ts index fe84c6a959..c0d902a642 100644 --- a/soap/soap-tests.ts +++ b/soap/soap-tests.ts @@ -8,9 +8,9 @@ const url = 'http://example.com/wsdl?wsdl'; const wsdlOptions = { name: 'value' }; soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { - let securityOptions = { 'hasTimeStamp': false }; + let securityOptions = { hasTimeStamp: false }; client.setSecurity(new soap.WSSecurity('user', 'password', securityOptions)); - let defaults = {'rejectUnauthorized': false}; + let defaults = {rejectUnauthorized: false}; client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca',defaults)); client.addSoapHeader({}); client.setEndpoint('http://localhost'); @@ -23,6 +23,7 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { client.on('request', function(obj: any) { //obj is an object }); + client.describe(); }); var myService = { @@ -33,23 +34,23 @@ var myService = { name: args.name }; }, - - // This is how to define an asynchronous function. + + // This is how to define an asynchronous function. MyAsyncFunction: function(args: any, callback: any) { - // do some work + // do some work callback({ name: args.name }); }, - - // This is how to receive incoming headers + + // This is how to receive incoming headers HeadersAwareFunction: function(args: any, cb: any, headers: any) { return { name: headers.Token }; }, - - // You can also inspect the original `req` + + // You can also inspect the original `req` reallyDeatailedFunction: function(args: any, cb: any, headers: any, req: any) { console.log('SOAP `reallyDeatailedFunction` request from ' + req.connection.remoteAddress); return { @@ -59,11 +60,11 @@ var myService = { } } }; - + var xml = fs.readFileSync('myservice.wsdl', 'utf8'), server = http.createServer(function(request,response) { response.end("404: Not Found: " + request.url); }); - + server.listen(8000); soap.listen(server, '/wsdl', myService, xml); From a9156baa379cb7b3133954a7a0c69eb24845ebaa Mon Sep 17 00:00:00 2001 From: Mizunashi Mana Date: Sun, 25 Dec 2016 04:58:26 +0900 Subject: [PATCH 080/101] Fix csv-stringify types (#13252) --- csv-stringify/csv-stringify-tests.ts | 9 ++++++--- csv-stringify/index.d.ts | 28 ++++++++++++---------------- csv-stringify/tslint.json | 1 + 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 csv-stringify/tslint.json diff --git a/csv-stringify/csv-stringify-tests.ts b/csv-stringify/csv-stringify-tests.ts index 5dd14d459c..7ffd1f6e3e 100644 --- a/csv-stringify/csv-stringify-tests.ts +++ b/csv-stringify/csv-stringify-tests.ts @@ -1,6 +1,8 @@ +/// import stringify = require("csv-stringify"); +let stream: stringify.Stringifier; stringify([["1", "2", "3"], ["4", "5", "6"]], (error: Error, output: string): void => { // nothing @@ -13,9 +15,10 @@ stringify([["1", "2", "3"], ["4", "5", "6"]], { }); -var s = stringify({ delimiter: "," }); -s.write(["1", "2", "3"]); - +stream = stringify({ delimiter: "," }); +stream.write(["1", "2", "3"]); +let transform: NodeJS.ReadWriteStream = stream; +stream = stringify(); diff --git a/csv-stringify/index.d.ts b/csv-stringify/index.d.ts index 6525bd9e15..fcf3321319 100644 --- a/csv-stringify/index.d.ts +++ b/csv-stringify/index.d.ts @@ -1,12 +1,10 @@ -// Type definitions for csv-stringify 0.0.6 +// Type definitions for csv-stringify 1.0 // Project: https://github.com/wdavidw/node-csv-stringify // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// - - declare namespace stringify { interface StringifyOpts { /** @@ -57,26 +55,24 @@ declare namespace stringify { } interface Stringifier extends NodeJS.ReadWriteStream { - - // Stringifier stream takes array of strings or Object - write(line: string[] | Object): boolean; + // Stringifier stream takes array of strings or Object + write(line: string[] | any): boolean; // repeat declarations from NodeJS.WritableStream to avoid compile error - write(buffer: Buffer, cb?: Function): boolean; - write(str: string, cb?: Function): boolean; - write(str: string, encoding?: string, cb?: Function): boolean; + write(buffer: string | Buffer, cb?: () => void): boolean; + write(str: string, encoding?: string, cb?: () => void): boolean; } } -/** - * Callback version: string in --> callback with string out - */ -declare function stringify(input: any[][], opts: stringify.StringifyOpts, callback: (error: Error, output: string) => void): void; -declare function stringify(input: any[][], callback: (error: Error, output: string) => void): void; - /** * Streaming stringifier */ -declare function stringify(opts: stringify.StringifyOpts): stringify.Stringifier; +declare function stringify(opts?: stringify.StringifyOpts): stringify.Stringifier; + +/** + * Callback version: string in --> callback with string out + */ +declare function stringify(input: any[][], opts: stringify.StringifyOpts, callback: (error: Error | undefined, output: string) => void): void; +declare function stringify(input: any[][], callback: (error: Error | undefined, output: string) => void): void; export = stringify; diff --git a/csv-stringify/tslint.json b/csv-stringify/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/csv-stringify/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 72d0113cbd29fc0f0a2efed83bc4210584885c45 Mon Sep 17 00:00:00 2001 From: Mizunashi Mana Date: Sun, 25 Dec 2016 04:58:58 +0900 Subject: [PATCH 081/101] Add is-windows type definition (#13006) --- is-windows/index.d.ts | 8 ++++++++ is-windows/is-windows-tests.ts | 3 +++ is-windows/tsconfig.json | 19 +++++++++++++++++++ is-windows/tslint.json | 1 + 4 files changed, 31 insertions(+) create mode 100644 is-windows/index.d.ts create mode 100644 is-windows/is-windows-tests.ts create mode 100644 is-windows/tsconfig.json create mode 100644 is-windows/tslint.json diff --git a/is-windows/index.d.ts b/is-windows/index.d.ts new file mode 100644 index 0000000000..cd0b8d83b3 --- /dev/null +++ b/is-windows/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for is-windows 0.2 +// Project: https://github.com/jonschlinkert/is-windows +// Definitions by: Mizunashi Mana +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function isWindows(): boolean; +declare namespace isWindows {} +export = isWindows; diff --git a/is-windows/is-windows-tests.ts b/is-windows/is-windows-tests.ts new file mode 100644 index 0000000000..79ada21511 --- /dev/null +++ b/is-windows/is-windows-tests.ts @@ -0,0 +1,3 @@ +import * as isWindows from 'is-windows'; + +var bool: boolean = isWindows(); diff --git a/is-windows/tsconfig.json b/is-windows/tsconfig.json new file mode 100644 index 0000000000..de9fd876dd --- /dev/null +++ b/is-windows/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "is-windows-tests.ts" + ] +} diff --git a/is-windows/tslint.json b/is-windows/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/is-windows/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 7e9d61b7882acc2278bfe2c7b7b843e587af6d85 Mon Sep 17 00:00:00 2001 From: Stephan Date: Sat, 24 Dec 2016 21:00:41 +0100 Subject: [PATCH 082/101] Fixed typo (#13270) ChartElementsOptions.arg -> ChartElementsOptions.arc ChartArcOtpions ->ChartArcOptions --- chart.js/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index b62f3143ba..bf23a1cc52 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -172,11 +172,11 @@ interface ChartAnimationOptions { interface ChartElementsOptions { point?: ChartPointOptions; line?: ChartLineOptions; - arg?: ChartArcOtpions; + arc?: ChartArcOptions; rectangle?: ChartRectangleOptions; } -interface ChartArcOtpions { +interface ChartArcOptions { backgroundColor?: ChartColor; borderColor?: ChartColor; borderWidth?: number; From f81674ce59724dae8fc0541a13f41c6bad2eff95 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sun, 25 Dec 2016 09:04:00 +1300 Subject: [PATCH 083/101] Update Raygun4JS definition to version 2.4.2 (#13281) * Updated raygun4js definition to match version 2.4.2 * Tests updated * Raygun function interface created for the V2 api * Added window definition. V2 user details interface added. Refactored V2 declaration. * V2 api tests added * Documentation added to options. --- raygun4js/index.d.ts | 391 +++++++++++++++++++++++++++-------- raygun4js/raygun4js-tests.ts | 57 ++++- raygun4js/tsconfig.json | 4 +- 3 files changed, 351 insertions(+), 101 deletions(-) diff --git a/raygun4js/index.d.ts b/raygun4js/index.d.ts index 9c97b17ce6..6acae0a8dd 100644 --- a/raygun4js/index.d.ts +++ b/raygun4js/index.d.ts @@ -1,96 +1,311 @@ -// Type definitions for raygun4js 1.18.3 +// Type definitions for raygun4js 2.4.2 // Project: https://github.com/MindscapeHQ/raygun4js -// Definitions by: Brian Surowiec +// Definitions by: Brian Surowiec , Benjamin Harding // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace raygun { - - // https://github.com/MindscapeHQ/raygun4js/blob/c7d8880045214ab6d403d5cc613c207f696a3cdd/src/raygun.js#L533-539 - interface IStackTrace { - LineNumber: number; - ColumnNumber: number; - ClassName: string; - FileName: string; - MethodName: string; - } - - // https://github.com/MindscapeHQ/raygun4js/blob/c7d8880045214ab6d403d5cc613c207f696a3cdd/src/raygun.js#L598-637 - interface IPayload { - OccurredOn: Date; - Details: { - Error: { - ClassName: string; - Message: string; - StackTrace: IStackTrace[]; - }; - Environment: { - UtcOffset: number; - 'User-Language': string; - 'Document-Mode': number; - 'Browser-Width': number; - 'Browser-Height': number; - 'Screen-Width': number; - 'Screen-Height': number; - 'Color-Depth': number; - Browser: string; - 'Browser-Name': string; - 'Browser-Version': string; - Platform: string; - }; - Client: { - Name: string; - Version: string; - }; - UserCustomData: any; - Tags: string[]; - Request: { - Url: string; - QueryString: string; - Headers: { - 'User-Agent': string; - Referer: string; - Host: string; - }; - }; - Version: string; - }; - } - - // https://github.com/MindscapeHQ/raygun4js/blob/c7d8880045214ab6d403d5cc613c207f696a3cdd/src/raygun.js#L61-82 - interface IRaygunOptions { - allowInsecureSubmissions?: boolean; - ignoreAjaxAbort?: boolean; - ignoreAjaxError?: boolean; - disableAnonymousUserTracking?: boolean; - excludedHostnames?: (string|RegExp)[]; - excludedUserAgents?: (string|RegExp)[]; - wrapAsynchronousCallbacks?: boolean; - debugMode?: boolean; - ignore3rdPartyErrors?: boolean; - } - - interface RaygunStatic { - noConflict(): RaygunStatic; - constructNewRaygun(): RaygunStatic; - init(apiKey: string, options?: IRaygunOptions, customdata?: any): RaygunStatic; - withCustomData(customdata: any): RaygunStatic; - withTags(tags: string[]): RaygunStatic; - attach(): RaygunStatic; - detach(): RaygunStatic; - send(e: Error, customData?: any, tags?: string[]): RaygunStatic; - setUser(user: string, isAnonymous?: boolean, email?: string, fullName?: string, firstName?: string, uuid?: string): RaygunStatic; - resetAnonymousUser(): void; - setVersion(version: string): RaygunStatic; - saveIfOffline(enableOffline: boolean): RaygunStatic; - filterSensitiveData(filteredKeys: string[]): RaygunStatic; - setFilterScope(scope: string): RaygunStatic; - whitelistCrossOriginDomains(whitelist: string[]): RaygunStatic; - onBeforeSend(callback: (payload: IPayload) => IPayload): RaygunStatic; - } - +interface TracekitStackTrace { + message: string; + mode: string; + name: string; + stack: TracekitStack[]; + url: string; + useragent: string; } -declare var Raygun: raygun.RaygunStatic; +interface TracekitStack { + column: number; + context: any; + func: string; + line: number; + url: string; +} + + +interface RaygunStackTrace { + LineNumber: number; + ColumnNumber: number; + ClassName: string; + FileName: string; + MethodName: string; +} + +interface RaygunOptions { + /** + * Posts error payloads over HTTP. This allows IE8 to send JS errors. + */ + allowInsecureSubmissions?: boolean; + + /** + * User-aborted Ajax calls result in errors. If this option is true, these errors will not be sent. + */ + ignoreAjaxAbort?: boolean; + + /** + * Ajax requests that return error codes will not be sent as errors to Raygun if this options is true. + */ + ignoreAjaxError?: boolean; + + /** + * Disabling anonymous user tracking. + */ + disableAnonymousUserTracking?: boolean; + + /** + * Prevent uncaught errors from being sent. + */ + disableErrorTracking?: boolean; + + /** + * Prevent Pulse real user monitoring events from being sent. + */ + disablePulse?: boolean; + + /** + * Prevents errors from being sent from certain hostnames (domains) by providing an array of strings or RegExp objects (for partial matches). Each should match the hostname or TLD that you want to exclude. Note that protocols are not tested. + */ + excludedHostnames?: (string|RegExp)[]; + + /** + * Prevents errors from being sent from certain user agents by providing an array of strings. This is very helpful to exclude errors reported by certain browsers or test automation with CasperJS, PhantomJS or any other testing utility that sends a custom user agent. If a part of the client's navigator.userAgent matches one of the given strings in the array, then the client will be excluded from error reporting. + */ + excludedUserAgents?: (string|RegExp)[]; + + /** + * The maximum time a virtual page can be considered viewed, in milliseconds (defaults to 30 minutes). + */ + pulseMaxVirtualPageDuration?: number; + + /** + * Ignore URL casing when sending data to Pulse. + */ + pulseIgnoreUrlCasing?: boolean; + + /** + * A string URI containing the protocol, domain and port (optional) where all payloads will be sent to. This can be used to proxy payloads to the Raygun API through your own server. When not set this defaults internally to the Raygun API, and for most usages you won't need to set this. + */ + apiUrl?: string; + + /** + * If false, async callback functions triggered by setTimeout/setInterval will not be wrapped when attach() is called. Defaults to true + */ + wrapAsynchronousCallbacks?: boolean; + + /** + * Raygun4JS will log to the console when sending errors. + */ + debugMode?: boolean; + + /** + * Ignores any errors that have no stack trace information. This will discard any errors that occur completely within 3rd party scripts - if code loaded from the current domain called the 3rd party function, it will have at least one stack line and will still be sent. + */ + ignore3rdPartyErrors?: boolean; + + /** + * A string URI containing the protocol, domain and port (optional) where all payloads will be sent to. This can be used to proxy payloads to the Raygun API through your own server. When not set this defaults internally to the Raygun API, and for most usages you won't need to set this. + */ + apiEndpoint?: string; +} + +interface RaygunPayload { + OccurredOn: Date; + Details: { + Error: { + ClassName: string; + Message: string; + StackTrace: RaygunStackTrace[]; + }; + Environment: { + UtcOffset: number; + 'User-Language': string; + 'Document-Mode': number; + 'Browser-Width': number; + 'Browser-Height': number; + 'Screen-Width': number; + 'Screen-Height': number; + 'Color-Depth': number; + Browser: string; + 'Browser-Name': string; + 'Browser-Version': string; + Platform: string; + }; + Client: { + Name: string; + Version: string; + }; + UserCustomData: any; + Tags: string[]; + Request: { + Url: string; + QueryString: string; + Headers: { + 'User-Agent': string; + Referer: string; + Host: string; + }; + }; + Version: string; + User: { + Identifier?: string; + IsAnonymous?: boolean; + Email?: string; + FullName?: string; + FirstName?: string; + UUID?: any; + }; + GroupingKey?: string; + }; +} + +interface RaygunStatic { + + /** + * Prevents Raygun from overwriting anything bound to `window.Raygun`. + */ + noConflict(): RaygunStatic; + + /** + * Creates a new Raygun object. Allows the sending of errors to different applications. + */ + constructNewRaygun(): RaygunStatic; + + /** + * Configures the Raygun provider. + */ + init(apiKey: string, options?: RaygunOptions, customdata?: any): RaygunStatic; + + /** + * Attaches custom data to any errors sent to Raygun. + */ + withCustomData(customdata: any): RaygunStatic; + + /** + * Allows errors to be filtered by tag in the Raygun Dashboard. + */ + withTags(tags: string[]): RaygunStatic; + + /** + * Attaches to the `window.onerror` handler. Enables unhandled errors to be automatically tracked. + */ + attach(): RaygunStatic; + + /** + * Detaches the handler from the window.onerror method. Unhandled errors will no longer be tracked. + */ + detach(): RaygunStatic; + + /** + * Sends an error/exception to the Raygun Api. + */ + send(ex: Error, customData?: any, tags?: string[]): RaygunStatic; + + /** + * Provides additional information about the current user. + */ + setUser(user: string, isAnonymous?: boolean, email?: string, fullName?: string, firstName?: string, uuid?: string): RaygunStatic; + + /** + * Resets the information about the current user. + */ + resetAnonymousUser(): void; + + /** + * Allows errors to be filtered by version in the Raygun Dashboard. Versions should be in the format `x.x.x` + */ + setVersion(version: string): RaygunStatic; + + /** + * Whether caught errors should be saved in Local Storage when there is no network activity. Saved errors will be send when another error occurs, and activity is regained. Disabled by default. + */ + saveIfOffline(enableOffline: boolean): RaygunStatic; + + /** + * Blacklist keys to prevent their values from being sent to Raygun. + */ + filterSensitiveData(filteredKeys: (string|RegExp)[]): RaygunStatic; + + /** + * Change the scope at which filters are applied. Defaults to `customData` by default. + */ + setFilterScope(scope: "all"|"customData"): RaygunStatic; + + /** + * Whitelist damains which should transmit errors to Raygun. + */ + whitelistCrossOriginDomains(whitelist: string[]): RaygunStatic; + + /** + * Executed before the payload is sent. If a truthy object is returned, Raygun will attempt to use that as the payload. Raygun will abort the send if `false` is returned. + */ + onBeforeSend(callback: (payload: RaygunPayload) => RaygunPayload|boolean): RaygunStatic; + + /** + * Overrides the default automatic grouping and instead group errors together by the string returned by the callback. + */ + groupingKey(callback: (payload: RaygunPayload, stackTrace: TracekitStackTrace, options: any) => string|void): RaygunStatic; + onBeforeXHR(callback: (xhr: XMLHttpRequest) => void): RaygunStatic; + onAfterSend(callback: (response: XMLHttpRequest) => void): RaygunStatic; + endSession(): void; + + /** + * Track Single Page Application route events. + */ + trackEvent(type: "pageView", options: { path: string }): void; +} + +interface RaygunV2UserDetails { + /** + * Uniquely identifies the user within Raygun. + */ + identifier: string; + + /** + * Indicates whether the user is anonymous or has a user account. Even if this is set to true, you should still give the user a unique identifier of some kind. + */ + isAnonymous?: string; + + /** + * The user's email address. + */ + email?: string; + + /** + * The user's full name. + */ + fullName?: string; + + /** + * The user's first or preferred name. + */ + firstName?: string; + + /** + * Identifier of the device the app is running on. This could be used to correlate user accounts over multiple machines. + */ + uuid?: string; +} + + +interface RaygunV2 { + (key: "options", value:RaygunOptions):void; + (key: "setUser", value: RaygunV2UserDetails):void; + (key: "onBeforeSend", callback: (payload: RaygunPayload) => RaygunPayload|boolean):void; + (key: "onBeforeXHR"|"onAfterSend", callback: (xhr: XMLHttpRequest) => void): void; + (key: "groupingKey", value:(payload: RaygunPayload, stackTrace: TracekitStackTrace, options: any) => string|void):void; + (key: "trackEvent", value: { type: string, path: string }): void; + (key: "apiKey"|"setVersion"|"setFilterScope", value:string):void; + (key: "attach"|"enableCrashReporting"|"enablePulse"|"noConflict"|"saveIfOffline", value: boolean):void; + (key: "filterSensitiveData"|"whitelistCrossOriginDomains"|"withTags", values: string[]): void; + (key: "send"|"withCustomData", value: any): void; + (key: "getRaygunInstance"):RaygunStatic; + (key: "detach"): void; + (key: string):void; +} + +interface Window { + Raygun: RaygunStatic; +} + +declare var Raygun: RaygunStatic; declare module 'raygun4js' { export = Raygun; diff --git a/raygun4js/raygun4js-tests.ts b/raygun4js/raygun4js-tests.ts index f3c3c9c1ed..34ffeafbfb 100644 --- a/raygun4js/raygun4js-tests.ts +++ b/raygun4js/raygun4js-tests.ts @@ -1,19 +1,38 @@ -var client: raygun.RaygunStatic = Raygun.noConflict(); +// V2 Api -var newClient: raygun.RaygunStatic = client.constructNewRaygun(); +// To use the V2 api you will need to declare a `rg4js` variable +// This is because `rg4js` name is configurable by users +declare var rg4js: RaygunV2; + +rg4js("apiKey", "api-key"); +rg4js("enableCrashReporting", true); +rg4js("enablePulse", true); +rg4js('setUser', { + identifier: "username", + firstName: "Robert", + fullName: "Robert Raygun" +}); + +// V1 Api +var client: RaygunStatic = Raygun.noConflict(); +var newClient: RaygunStatic = client.constructNewRaygun(); client.init('api-key'); -client.init('api-key', { allowInsecureSubmissions: true }); -client.init('api-key', { allowInsecureSubmissions: true }, { some: 'data' }); +client.init('api-key', { allowInsecureSubmissions: true, disablePulse: false }); +client.init('api-key', { allowInsecureSubmissions: true, disablePulse: false }, { some: 'data' }); client.withCustomData({ some: 'data' }); +client.withCustomData(function() { + return { some: 'data' }; +}); client.withTags(['tag1', 'tag2']); client.attach().detach(); client.send(new Error('a error')); -client.send(new Error('a error'), ['tag1', 'tag2']); +client.send(new Error('a error'), { some: 'data' }); +client.send(new Error('a error'), { some: 'data' }, ['tag1', 'tag2']); try { throw new Error('oops'); @@ -24,14 +43,12 @@ catch (e) { client.setUser('username'); client.setUser('username', true); -client.setUser('username', false, 'user@email.com', 'Robbie Robot'); -client.setUser('username', false, 'user@email.com', 'Robbie Robot', 'Robbie'); -client.setUser('username', false, 'user@email.com', 'Robbie Robot', 'Robbie', '8ae89fc9-1144-42d6-9629-bf085dab18d2'); +client.setUser('username', false, 'user@email.com', 'Robert Raygun'); +client.setUser('username', false, 'user@email.com', 'Robert Raygun', 'Robert'); +client.setUser('username', false, 'user@email.com', 'Robert Raygun', 'Robert', '8ae89fc9-1144-42d6-9629-bf085dab18d2'); client.resetAnonymousUser(); - client.setVersion('1.2.3.4'); - client.saveIfOffline(true); client.filterSensitiveData(['field1', 'field2']); @@ -43,4 +60,22 @@ client.whitelistCrossOriginDomains(['domain1', 'domain2']); client.onBeforeSend(payload=> { payload.OccurredOn = new Date(); return payload; -}); \ No newline at end of file +}); + +client.groupingKey(payload => { + return payload.Details.Error.Message; +}); + +client.onBeforeXHR(xhr => { + console.log(xhr.response); +}); + +client.onAfterSend(xhr => { + console.log(xhr.response); +}); + +client.endSession(); + +client.trackEvent('pageView', { + path: '/url' +}); diff --git a/raygun4js/tsconfig.json b/raygun4js/tsconfig.json index d727437071..c187ce3971 100644 --- a/raygun4js/tsconfig.json +++ b/raygun4js/tsconfig.json @@ -3,7 +3,7 @@ "module": "commonjs", "target": "es6", "noImplicitAny": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,4 +16,4 @@ "index.d.ts", "raygun4js-tests.ts" ] -} \ No newline at end of file +} From fd12651685b0096f90827c7a0a113cf428ac5de1 Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Sat, 24 Dec 2016 15:04:58 -0500 Subject: [PATCH 084/101] Add datatables.net select and fixedheader extensions (#13286) --- .../datatables.net-fixedheader-tests.ts | 15 ++++++ datatables.net-fixedheader/index.d.ts | 40 ++++++++++++++++ datatables.net-fixedheader/tsconfig.json | 19 ++++++++ datatables.net-fixedheader/tslint.json | 1 + .../datatables.net-select-tests.ts | 17 +++++++ datatables.net-select/index.d.ts | 47 +++++++++++++++++++ datatables.net-select/tsconfig.json | 19 ++++++++ datatables.net-select/tslint.json | 1 + 8 files changed, 159 insertions(+) create mode 100644 datatables.net-fixedheader/datatables.net-fixedheader-tests.ts create mode 100644 datatables.net-fixedheader/index.d.ts create mode 100644 datatables.net-fixedheader/tsconfig.json create mode 100644 datatables.net-fixedheader/tslint.json create mode 100644 datatables.net-select/datatables.net-select-tests.ts create mode 100644 datatables.net-select/index.d.ts create mode 100644 datatables.net-select/tsconfig.json create mode 100644 datatables.net-select/tslint.json diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts new file mode 100644 index 0000000000..8b3b2ab70f --- /dev/null +++ b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -0,0 +1,15 @@ +/// +/// + +$(document).ready(function() { + + var config: DataTables.Settings = { + // FixedHeader extension options + fixedHeader: { + footer: true, + footerOffset: 4, + header: true, + headerOffset: 3 + } + }; +}); diff --git a/datatables.net-fixedheader/index.d.ts b/datatables.net-fixedheader/index.d.ts new file mode 100644 index 0000000000..e72360f933 --- /dev/null +++ b/datatables.net-fixedheader/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for datatables.net-fixedheader 3.1 +// Project: https://datatables.net/extensions/fixedheader/ +// Definitions by: Jared Szechy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// + +declare namespace DataTables { + export interface Settings { + /* + * FixedHeader extension options + */ + fixedHeader?: boolean | FixedHeaderSettings; + } + + /* + * FixedHeader extension options + */ + interface FixedHeaderSettings { + /* + * Enable / disable fixed footer + */ + footer?: boolean; + + /* + * Offset the table's fixed footer + */ + footerOffset?: number; + + /* + * Enable / disable fixed header + */ + header?: boolean; + + /* + * Offset the table's fixed header + */ + headerOffset?: number; + } +} diff --git a/datatables.net-fixedheader/tsconfig.json b/datatables.net-fixedheader/tsconfig.json new file mode 100644 index 0000000000..0cbc559ca2 --- /dev/null +++ b/datatables.net-fixedheader/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-fixedheader-tests.ts" + ] +} diff --git a/datatables.net-fixedheader/tslint.json b/datatables.net-fixedheader/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/datatables.net-fixedheader/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/datatables.net-select/datatables.net-select-tests.ts b/datatables.net-select/datatables.net-select-tests.ts new file mode 100644 index 0000000000..02c3249cf7 --- /dev/null +++ b/datatables.net-select/datatables.net-select-tests.ts @@ -0,0 +1,17 @@ +/// +/// + +$(document).ready(function() { + + var config: DataTables.Settings = { + // Select extension options + select: { + blurable: true, + className: "selectClass", + info: true, + items: "row", + selector: "td:first-child", + style: "os" + } + }; +}); diff --git a/datatables.net-select/index.d.ts b/datatables.net-select/index.d.ts new file mode 100644 index 0000000000..1365ab991e --- /dev/null +++ b/datatables.net-select/index.d.ts @@ -0,0 +1,47 @@ +// Type definitions for datatables.net-select 1.2 +// Project: https://datatables.net/extensions/select/ +// Definitions by: Jared Szechy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +/// + +declare namespace DataTables { + export interface Settings { + /* + * Select extension options + */ + select?: boolean | string | SelectSettings; + } + + interface SelectSettings { + /* + * Indicate if the selected items will be removed when clicking outside of the table + */ + blurable?: boolean; + + /* + * Set the class name that will be applied to selected items + */ + className?: string; + + /* + * Enable / disable the display for item selection information in the table summary + */ + info?: boolean; + + /* + * Set which table items to select (rows, columns or cells) + */ + items?: string; + + /* + * Set the element selector used for mouse event capture to select items + */ + selector?: string; + + /* + * Set the selection style for end user interaction with the table + */ + style?: string; + } +} diff --git a/datatables.net-select/tsconfig.json b/datatables.net-select/tsconfig.json new file mode 100644 index 0000000000..e31ad091c8 --- /dev/null +++ b/datatables.net-select/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "datatables.net-select-tests.ts" + ] +} diff --git a/datatables.net-select/tslint.json b/datatables.net-select/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/datatables.net-select/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 7aa967b4ae6aa384557166081bf943933ba628e2 Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Sat, 24 Dec 2016 12:05:41 -0800 Subject: [PATCH 085/101] Update chrome.sockets.udp and chrome.sockets.tcpServer in chrome package (#13289) * Update chrome.sockets.udp * Update chrome.sockets.tcpServer --- chrome/chrome-app.d.ts | 403 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 395 insertions(+), 8 deletions(-) diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index a38d0c7724..f80b335125 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -355,6 +355,14 @@ declare namespace chrome.sockets.tcp { var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } +/** + * Use the chrome.sockets.udp API to send and receive data over the network + * using UDP connections. This API supersedes the UDP functionality previously + * found in the "socket" API. + * + * @since Chrome 33 + * @see https://developer.chrome.com/apps/sockets_udp + */ declare namespace chrome.sockets.udp { interface CreateInfo { socketId: number; @@ -377,43 +385,278 @@ declare namespace chrome.sockets.udp { resultCode: number; } + /** + * @see https://developer.chrome.com/apps/sockets_udp#type-SocketProperties + */ interface SocketProperties { + /** + * Flag indicating if the socket is left open when the event page of the + * application is unloaded. The default value is "false." When the + * application is loaded, any sockets previously opened with + * persistent=true can be fetched with getSockets. + * @see http://developer.chrome.com/apps/app_lifecycle.html + */ persistent?: boolean; + + /** An application-defined string associated with the socket. */ name?: string; + + /** + * The size of the buffer used to receive data. If the buffer is too + * small to receive the UDP packet, data is lost. The default value is + * 4096. + */ bufferSize?: number; } + /** + * @see https://developer.chrome.com/apps/sockets_udp#type-SocketInfo + */ interface SocketInfo { + /** The socket identifier. */ socketId: number; + + /** + * Flag indicating whether the socket is left open when the application + * is suspended (see SocketProperties.persistent). + */ persistent: boolean; + + /** Application-defined string associated with the socket. */ name?: string; + + /** + * The size of the buffer used to receive data. If no buffer size ha + * been specified explictly, the value is not provided. + */ bufferSize?: number; + + /** + * Flag indicating whether the socket is blocked from firing onReceive + * events. + */ paused: boolean; + + /** + * If the underlying socket is bound, contains its local IPv4/6 address. + */ localAddress?: string; + + /** + * If the underlying socket is bound, contains its local port. + */ localPort?: number; } + /** + * Creates a UDP socket with default properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-create + * @param createInfo.socketId The ID of the newly created socket. + */ export function create(callback: (createInfo: CreateInfo) => void): void; - export function create(properties: SocketProperties, - callback: (createInfo: CreateInfo) => void): void; + /** + * Creates a UDP socket with the given properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-create + * @param properties The socket properties. + * @param createInfo.socketId The ID of the newly created socket. + */ + export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + + /** + * Updates the socket properties. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-update + * @param socketId The socket ID. + * @param properties The properties to update. + * @param callback Called when the properties are updated. + */ export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + + /** + * Pauses or unpauses a socket. A paused socket is blocked from firing + * onReceive events. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setPaused + * @param socketId The socket ID. + * @param paused Flag to indicate whether to pause or unpause. + * @param callback Called when the socket has been successfully paused or + * unpaused. + */ export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; + + /** + * Binds the local address and port for the socket. For a client socket, it + * is recommended to use port 0 to let the platform pick a free port. + * + * Once the bind operation completes successfully, onReceive events are + * raised when UDP packets arrive on the address/port specified -- unless + * the socket is paused. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-bind + * @param socketId The socket ID. + * @param address The address of the local machine. DNS name, IPv4 and IPv6 + * formats are supported. Use "0.0.0.0" to accept packets + * from all local available network interfaces. + * @param port The port of the local machine. Use "0" to bind to a free + * port. + * @param callback Called when the bind operation completes. + */ export function bind(socketId: number, address: string, port: number, callback: (result: number) => void): void; + + /** + * Sends data on the given socket to the given address and port. The socket + * must be bound to a local port before calling this method. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-send + * @param socketId The socket ID. + * @param data The data to send. + * @param address The address of the remote machine. + * @param port The port of the remote machine. + * @param callback Called when the send operation completes. + */ export function send(socketId: number, data: ArrayBuffer, address: string, port: number, callback: (sendInfo: SendInfo) => void): void; + + /** + * Closes the socket and releases the address/port the socket is bound to. + * Each socket created should be closed after use. The socket id is no + * longer valid as soon at the function is called. However, the socket is + * guaranteed to be closed only when the callback is invoked. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-close + * @param socketId The socket ID. + * @param callback Called when the close operation completes. + */ export function close(socketId: number, callback?: () => void): void; + + /** + * Retrieves the state of the given socket. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getInfo + * @param socketId The socket ID. + * @param callback Called when the socket state is available. + */ export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + + /** + * Retrieves the list of currently opened sockets owned by the application. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getSockets + * @param callback Called when the list of sockets is available. + */ export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + + /** + * Joins the multicast group and starts to receive packets from that group. + * The socket must be bound to a local port before calling this method. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-joinGroup + * @param socketId The socket ID. + * @param address The group address to join. Domain names are not supported. + * @param callback Called when the joinGroup operation completes. + */ export function joinGroup(socketId: number, address: string, callback: (result: number) => void): void; + + /** + * Leaves the multicast group previously joined using joinGroup. This is + * only necessary to call if you plan to keep using the socket afterwards, + * since it will be done automatically by the OS when the socket is closed. + * + * Leaving the group will prevent the router from sending multicast + * datagrams to the local host, presuming no other process on the host is + * still joined to the group. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-leaveGroup + * @param socketId The socket ID. + * @param address The group address to leave. Domain names are not + * supported. + * @param callback Called when the leaveGroup operation completes. + */ export function leaveGroup(socketId: number, address: string, callback: (result: number) => void): void; + + /** + * Sets the time-to-live of multicast packets sent to the multicast group. + * + * Calling this method does not require multicast permissions. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastTimeToLive + * @param socketId The socket ID. + * @param ttl The time-to-live value. + * @param callback Called when the configuration operation completes. + */ export function setMulticastTimeToLive(socketId: number, ttl: number, callback: (result: number) => void): void; + + /** + * Sets whether multicast packets sent from the host to the multicast group + * will be looped back to the host. + * + * Note: the behavior of setMulticastLoopbackMode is slightly different + * between Windows and Unix-like systems. The inconsistency happens only + * when there is more than one application on the same host joined to the + * same multicast group while having different settings on multicast + * loopback mode. On Windows, the applications with loopback off will not + * RECEIVE the loopback packets; while on Unix-like systems, the + * applications with loopback off will not SEND the loopback packets to + * other applications on the same host. + * @see MSDN: http://goo.gl/6vqbj + * + * Calling this method does not require multicast permissions. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-setMulticastLoopbackMode + * @param socketId The socket ID. + * @param enabled Indicate whether to enable loopback mode. + * @param callback Called when the configuration operation completes. + */ export function setMulticastLoopbackMode(socketId: number, enabled: boolean, callback: (result: number) => void): void; + + /** + * Gets the multicast group addresses the socket is currently joined to. + * + * @see https://developer.chrome.com/apps/sockets_udp#method-getJoinedGroups + * @param socketId The socket ID. + * @param callback Called with an array of strings of the result. + */ export function getJoinedGroups(socketId: number, callback: (groups: string[]) => void): void; + /** + * Enables or disables broadcast packets on this socket. + * + * @since Chrome 44 + * @see https://developer.chrome.com/apps/sockets_udp#method-setBroadcast + * @param socketId The socket ID. + * @param enabled true to enable broadcast packets, false to disable them. + * @param callback Callback from the setBroadcast method. + */ + export function setBroadcast(socketId: number, enabled: boolean, callback?: (result: number) => void): void; + + /** + * Event raised when a UDP packet has been received for the given socket. + * + * @see https://developer.chrome.com/apps/sockets_udp#event-onReceive + */ var onReceive: chrome.events.Event<(args: ReceiveEventArgs) => void>; + + /** + * Event raised when a network error occured while the runtime was waiting + * for data on the socket address and port. Once this event is raised, the + * socket is paused and no more onReceive events will be raised for this + * socket until the socket is resumed. + * + * @see https://developer.chrome.com/apps/sockets_udp#event-onReceiveError + */ var onReceiveError: chrome.events.Event<(args: ReceiveErrorEventArgs) => void>; } +/** + * Use the chrome.sockets.tcpServer API to create server applications using TCP + * connections. This API supersedes the TCP functionality previously found in + * the chrome.socket API. + * + * @since Chrome 33 + * @see https://developer.chrome.com/apps/sockets_tcpServer + */ declare namespace chrome.sockets.tcpServer { interface CreateInfo { socketId: number; @@ -429,36 +672,180 @@ declare namespace chrome.sockets.tcpServer { resultCode: number; } + /** + * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketProperties + */ interface SocketProperties { + /** + * Flag indicating if the socket remains open when the event page of the + * application is unloaded. The default value is "false." When the + * application is loaded, any sockets previously opened with + * persistent=true can be fetched with getSockets. + * + * @see http://developer.chrome.com/apps/app_lifecycle.html + */ persistent?: boolean; + + /** An application-defined string associated with the socket. */ name?: string; } + /** + * @see https://developer.chrome.com/apps/sockets_tcpServer#type-SocketInfo + */ interface SocketInfo { + /** The socket identifier. */ socketId: number; + + /** + * Flag indicating if the socket remains open when the event page of the + * application is unloaded (see SocketProperties.persistent). The + * default value is "false". + */ persistent: boolean; + + /** Application-defined string associated with the socket. */ name?: string; + + /** + * Flag indicating whether connection requests on a listening socket are + * dispatched through the onAccept event or queued up in the listen + * queue backlog. See setPaused. The default value is "false" + */ paused: boolean; + + /** If the socket is listening, contains its local IPv4/6 address. */ localAddress?: string; + + /** If the socket is listening, contains its local port. */ localPort?: number; } + /** + * Creates a TCP server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create + * @param callback Called when the socket has been created. + */ export function create(callback: (createInfo: CreateInfo) => void): void; + + /** + * Creates a TCP server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-create + * @param properties The socket properties. + * @param callback Called when the socket has been created. + */ export function create(properties: SocketProperties, callback: (createInfo: CreateInfo) => void): void; + /** + * Updates the socket properties. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-update + * @param socketId The socket identifier. + * @param properties The properties to update. + * @param callback Called when the properties are updated. + */ export function update(socketId: number, properties: SocketProperties, callback?: () => void): void; + + /** + * Enables or disables a listening socket from accepting new connections. + * When paused, a listening socket accepts new connections until its backlog + * (see listen function) is full then refuses additional connection + * requests. onAccept events are raised only when the socket is un-paused. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-setPaused + * @param callback Callback from the setPaused method. + */ export function setPaused(socketId: number, paused: boolean, callback?: () => void): void; - export function listen(socketId: number, address: string, - port: number, backlog: number, callback: (result: number) => void): void; - export function listen(socketId: number, address: string, - port: number, callback: (result: number) => void): void; + /** + * Listens for connections on the specified port and address. If the + * port/address is in use, the callback indicates a failure. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen + * @param socketId The socket identifier. + * @param address The address of the local machine. + * @param port The port of the local machine. When set to 0, a free port + * is chosen dynamically. The dynamically allocated port can + * be found by calling getInfo. + * @param backlog Length of the socket's listen queue. The default value + * depends on the Operating System (SOMAXCONN), which + * ensures a reasonable queue length for most applications. + * @param callback Called when listen operation completes. + */ + export function listen(socketId: number, address: string, port: number, backlog: number, callback: (result: number) => void): void; + /** + * Listens for connections on the specified port and address. If the + * port/address is in use, the callback indicates a failure. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-listen + * @param socketId The socket identifier. + * @param address The address of the local machine. + * @param port The port of the local machine. When set to 0, a free port + * is chosen dynamically. The dynamically allocated port can + * be found by calling getInfo. + * @param callback Called when listen operation completes. + */ + export function listen(socketId: number, address: string, port: number, callback: (result: number) => void): void; + + /** + * Disconnects the listening socket, i.e. stops accepting new connections + * and releases the address/port the socket is bound to. The socket + * identifier remains valid, e.g. it can be used with listen to accept + * connections on a new port and address. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-disconnect + * @param socketId The socket identifier. + * @param callback Called when the disconnect attempt is complete. + */ export function disconnect(socketId: number, callback?: () => void): void; - export function close(socketId: number, callback?: () => void): void; - export function getInfo(socketId: number, callback: (socketInfos: SocketInfo[]) => void): void; + /** + * Disconnects and destroys the socket. Each socket created should be closed + * after use. The socket id is no longer valid as soon at the function is + * called. However, the socket is guaranteed to be closed only when the + * callback is invoked. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-close + * @param socketId The socket identifier. + * @param callback Called when the close operation completes. + */ + export function close(socketId: number, callback?: () => void): void; + + /** + * Retrieves the state of the given socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getInfo + * @param socketId The socket identifier. + * @param callback Called when the socket state is available. + */ + export function getInfo(socketId: number, callback: (socketInfo: SocketInfo) => void): void; + + /** + * Retrieves the list of currently opened sockets owned by the application. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#method-getSockets + * @param callback Called when the list of sockets is available. + */ + export function getSockets(callback: (socketInfos: SocketInfo[]) => void): void; + + /** + * Event raised when a connection has been made to the server socket. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAccept + */ var onAccept: chrome.events.Event<(args: AcceptEventArgs) => void>; + + /** + * Event raised when a network error occured while the runtime was waiting + * for new connections on the socket address and port. Once this event is + * raised, the socket is set to paused and no more onAccept events are + * raised for this socket until the socket is resumed. + * + * @see https://developer.chrome.com/apps/sockets_tcpServer#event-onAcceptError + */ var onAcceptError: chrome.events.Event<(args: AcceptErrorEventArgs) => void>; } From 30528a61d9a96efec9f4e214d79d1bd8e20df305 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Sun, 25 Dec 2016 06:35:55 +1030 Subject: [PATCH 086/101] added the documented lineAtHeight function (#13287) --- codemirror/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codemirror/index.d.ts b/codemirror/index.d.ts index 83c45e93ab..4af27f5f12 100644 --- a/codemirror/index.d.ts +++ b/codemirror/index.d.ts @@ -178,6 +178,13 @@ declare namespace CodeMirror { class can be left off to remove all classes for the specified node, or be a string to remove only a specific class. */ removeLineClass(line: any, where: string, class_: string): CodeMirror.LineHandle; + /** + * Compute the line at the given pixel height. + * + * `mode` is the relative element to use to compute this line - defaults to 'page' if not specified + */ + lineAtHeight(height: number, mode?: 'window' | 'page' | 'local'): number + /** Returns the line number, text content, and marker status of the given line, which can be either a number or a line handle. */ lineInfo(line: any): { line: any; From fce4624320fe2df2826204f19e56b7a00b48f77c Mon Sep 17 00:00:00 2001 From: Jason Healy Date: Sat, 24 Dec 2016 20:08:19 +0000 Subject: [PATCH 087/101] Adding union types to transform style to fix type issues (#13295) --- react-native/index.d.ts | 49 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 0fb9c19550..5adba15835 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -741,10 +741,57 @@ declare module "react" { timestamp: number } + interface PerpectiveTransform { + perspective: number; + } + + interface RotateTransform { + rotate: string; + } + + interface RotateXTransform { + rotateX: string; + } + + interface RotateYTransform { + rotateY: string; + } + + interface RotateZTransform { + rotateZ: string; + } + + interface ScaleTransform { + scale: number; + } + + interface ScaleXTransform { + scaleX: number; + } + + interface ScaleYTransform { + scaleY: number; + } + + interface TranslateXTransform { + translateX: number; + } + + interface TranslateYTransform { + translateY: number; + } + + interface SkewXTransform { + skewX: string; + } + + interface SkewYTransform { + skewY: string; + } export interface TransformsStyle { - transform?: [{ perspective: number }, { rotate: string }, { rotateX: string }, { rotateY: string }, { rotateZ: string }, { scale: number }, { scaleX: number }, { scaleY: number }, { translateX: number }, { translateY: number }, { skewX: string }, { skewY: string }] + transform?: (PerpectiveTransform|RotateTransform|RotateXTransform|RotateYTransform|RotateZTransform|ScaleTransform|ScaleXTransform|ScaleYTransform|TranslateXTransform|TranslateYTransform|SkewXTransform|SkewYTransform)[] transformMatrix?: Array rotation?: number scaleX?: number From 526666ccd56c9b18b6f532ab3399c33fbe219bae Mon Sep 17 00:00:00 2001 From: Skuriles Date: Sat, 24 Dec 2016 21:16:32 +0100 Subject: [PATCH 088/101] export module for highstock, renamed __Highstock to Highstock (#13312) --- highcharts/highstock.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/highcharts/highstock.d.ts b/highcharts/highstock.d.ts index 6784e83eb1..bd7f0bffd4 100644 --- a/highcharts/highstock.d.ts +++ b/highcharts/highstock.d.ts @@ -5,7 +5,7 @@ import * as Highcharts from "highcharts"; -declare namespace __Highstock { +declare namespace Highstock { interface ChartObject extends Highcharts.ChartObject { options: Options; } @@ -100,14 +100,14 @@ declare namespace __Highstock { declare global { interface JQuery { - highcharts(type: "StockChart"): __Highstock.ChartObject; + highcharts(type: "StockChart"): Highstock.ChartObject; /** * Creates a new Highcharts.Chart for the current JQuery selector; usually * a div selected by $('#container') * @param {Highcharts.Options} options Options for this chart * @return current {JQuery} selector the current JQuery selector **/ - highcharts(type: "StockChart", options: __Highstock.Options): JQuery; + highcharts(type: "StockChart", options: Highstock.Options): JQuery; /** * Creates a new Highcharts.Chart for the current JQuery selector; usually * a div selected by $('#container') @@ -115,7 +115,7 @@ declare global { * @param callback Callback function used to manipulate the constructed chart instance * @return current {JQuery} selector the current JQuery selector **/ - highcharts(type: "StockChart", options: __Highstock.Options, callback: (chart: __Highstock.ChartObject) => void): JQuery; + highcharts(type: "StockChart", options: Highstock.Options, callback: (chart: Highstock.ChartObject) => void): JQuery; highcharts(type: string): Highcharts.ChartObject; @@ -124,3 +124,6 @@ declare global { } } +declare var Highstock: Highstock.Static; +export = Highstock; +export as namespace Highstock; \ No newline at end of file From 8f4c8d6c5b67f963cdb9a08a4f2286bd6d5707d0 Mon Sep 17 00:00:00 2001 From: Ryan Blace Date: Sat, 24 Dec 2016 15:25:09 -0500 Subject: [PATCH 089/101] [types/leaflet-draw] Fixes and updated to work with Leaflet 1.x and Leaflet Draw 0.4.6 (#13262) * Updating to work with Leaflet 1.x and Leaflet Draw 4.x * Removing the I in the interfaces to be consistent with Leaflet * Just updating a missing semicolon --- leaflet-draw/index.d.ts | 55 ++++++++++++++++++++---------- leaflet-draw/leaflet-draw-tests.ts | 13 +++---- leaflet-draw/package.json | 4 +-- 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/leaflet-draw/index.d.ts b/leaflet-draw/index.d.ts index 269215eef1..3cced930c2 100644 --- a/leaflet-draw/index.d.ts +++ b/leaflet-draw/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for leaflet-draw 0.2.4 +// Type definitions for leaflet-draw 0.4.6 // Project: https://github.com/Leaflet/Leaflet.draw -// Definitions by: Matt Guest +// Definitions by: Matt Guest , Ryan Blace // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -10,17 +10,9 @@ declare namespace L { drawControl?: boolean; } - export interface ControlStatic { - Draw: Control.DrawStatic; - } - namespace Control { - export interface DrawStatic { - new (options?: IDrawConstructorOptions): Draw; - } - - export interface IDrawConstructorOptions { + export interface DrawConstructorOptions { /** * The initial position of the control (one of the map corners). @@ -91,7 +83,7 @@ declare namespace L { * * Default value: null */ - featureGroup: FeatureGroup; + featureGroup: FeatureGroup; /** * Edit handler options. Set to false to disable handler. @@ -108,9 +100,14 @@ declare namespace L { remove?: DrawOptions.DeleteHandlerOptions; } - export interface Draw extends IControl { - + export interface Draw extends Control { + setDrawingOptions(options: DrawOptions): void; } + + export class Draw { + constructor(options?: DrawConstructorOptions); + } + } @@ -252,6 +249,28 @@ declare namespace L { } + namespace Draw { + + namespace Event { + + export const CREATED: string; + export const EDITED: string; + export const DELETED: string; + export const DRAWSTART: string; + export const DRAWSTOP: string; + export const DRAWVERTEX: string; + export const EDITSTART: string; + export const EDITMOVE: string; + export const EDITRESIZE: string; + export const EDITVERTEX: string; + export const EDITSTOP: string; + export const DELETESTART: string; + export const DELETESTOP: string; + + } + + } + namespace DrawEvents { export interface Created { @@ -259,7 +278,7 @@ declare namespace L { /** * Layer that was just created. */ - layer: ILayer; + layer: Layer; /** * The type of layer this is. One of: polyline, polygon, rectangle, circle, marker. @@ -272,7 +291,7 @@ declare namespace L { /** * List of all layers just edited on the map. */ - layers: LayerGroup; + layers: LayerGroup; } /** @@ -283,7 +302,7 @@ declare namespace L { /** * List of all layers just removed from the map. */ - layers: LayerGroup; + layers: LayerGroup; } export interface DrawStart { @@ -302,7 +321,7 @@ declare namespace L { layerType: string; } - export interface EditStart { + export interface EditStart { /** * The type of edit this is. One of: edit */ diff --git a/leaflet-draw/leaflet-draw-tests.ts b/leaflet-draw/leaflet-draw-tests.ts index 885f576d1b..98d3681789 100644 --- a/leaflet-draw/leaflet-draw-tests.ts +++ b/leaflet-draw/leaflet-draw-tests.ts @@ -3,9 +3,9 @@ var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© OpenStreetMap contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), - map = new L.Map('map', {layers: [osm], center: new L.LatLng(-37.7772, 175.2756), zoom: 15 }); + map = L.map('map', {layers: [osm], center: L.latLng(-37.7772, 175.2756), zoom: 15 }); -var drawnItems = new L.FeatureGroup(); +var drawnItems = L.featureGroup(); map.addLayer(drawnItems); var drawControl = new L.Control.Draw({ @@ -37,9 +37,10 @@ var drawControl = new L.Control.Draw({ }); map.addControl(drawControl); -map.on('draw:created', function (e: L.DrawEvents.Created) { - var type = e.layerType, - layer = e.layer; +map.on('draw:created', function (e: any) { + var drawEvent = (e as L.DrawEvents.Created); + var type = drawEvent.layerType, + layer = drawEvent.layer; drawnItems.addLayer(layer); -}); \ No newline at end of file +}); diff --git a/leaflet-draw/package.json b/leaflet-draw/package.json index 711ba15e43..fa93c2516c 100644 --- a/leaflet-draw/package.json +++ b/leaflet-draw/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "@types/leaflet": "^0.7" + "@types/leaflet": "^1.0" } -} \ No newline at end of file +} From 695104c848c53f4766007f8f2b92b42da08a48d9 Mon Sep 17 00:00:00 2001 From: Nicolas Goy Date: Sat, 24 Dec 2016 21:34:45 +0100 Subject: [PATCH 090/101] Add contentLabel property (#13249) As per https://github.com/reactjs/react-modal/commit/3d8e5a07466ed8ad367eed1f6a6c26a7516ab183 --- react-modal/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react-modal/index.d.ts b/react-modal/index.d.ts index 2c49d7ab1d..59842fe99a 100644 --- a/react-modal/index.d.ts +++ b/react-modal/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-modal v1.3.0 +// Type definitions for react-modal v1.6.1 // Project: https://github.com/reactjs/react-modal // Definitions by: Rajab Shakirov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -24,6 +24,7 @@ declare module "react-modal" { shouldCloseOnOverlayClick?: boolean, overlayClassName?: string, className?: string + contentLabel?: string } let ReactModal: React.ClassicComponentClass; export = ReactModal; From 06d0604426e645f620bc995a11ee532dad2437b7 Mon Sep 17 00:00:00 2001 From: Jeff Jacobson Date: Sat, 24 Dec 2016 12:47:05 -0800 Subject: [PATCH 091/101] Types 2.0 (#13145) * Added type definitions * arcgis-to-geojson-utils * arcgis-rest-api (dependency of arcgis-to-geojson-utils) * Fixed tslint errors * Added version numbers to headers * Fixed other errors reported by TSLint. * Added forceConsistentCasingInFileNames to tsconfig * Modified arcgis-rest-api to be module Definition file for arcgis-rest-api converted from namespace to module as suggested by @andy-ms. See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/13145#discussion_r91566132 * (lint) Added missing semicolon :bug: --- arcgis-rest-api/arcgis-rest-api-tests.ts | 11 + arcgis-rest-api/index.d.ts | 219 ++++++++++++++++++ arcgis-rest-api/tsconfig.json | 20 ++ arcgis-rest-api/tslint.json | 3 + .../arcgis-to-geojson-utils-tests.ts | 20 ++ arcgis-to-geojson-utils/index.d.ts | 18 ++ arcgis-to-geojson-utils/tsconfig.json | 19 ++ arcgis-to-geojson-utils/tslint.json | 3 + 8 files changed, 313 insertions(+) create mode 100644 arcgis-rest-api/arcgis-rest-api-tests.ts create mode 100644 arcgis-rest-api/index.d.ts create mode 100644 arcgis-rest-api/tsconfig.json create mode 100644 arcgis-rest-api/tslint.json create mode 100644 arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts create mode 100644 arcgis-to-geojson-utils/index.d.ts create mode 100644 arcgis-to-geojson-utils/tsconfig.json create mode 100644 arcgis-to-geojson-utils/tslint.json diff --git a/arcgis-rest-api/arcgis-rest-api-tests.ts b/arcgis-rest-api/arcgis-rest-api-tests.ts new file mode 100644 index 0000000000..0f4cf3d926 --- /dev/null +++ b/arcgis-rest-api/arcgis-rest-api-tests.ts @@ -0,0 +1,11 @@ +import { Point } from "arcgis-rest-api"; + +let point: Point; + +point = { + x: -122.6764, + y: 45.5165, + spatialReference: { + wkid: 4326 + } +}; \ No newline at end of file diff --git a/arcgis-rest-api/index.d.ts b/arcgis-rest-api/index.d.ts new file mode 100644 index 0000000000..2b28b32fac --- /dev/null +++ b/arcgis-rest-api/index.d.ts @@ -0,0 +1,219 @@ +// Type definitions for arcgis-to-geojson-utils 10.4 +// Project: http://resources.arcgis.com/en/help/arcgis-rest-api/ +// Definitions by: Jeff Jacobson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Feature { + geometry: Geometry; + attributes: any; +} + +export interface Field { + name: string; + type: string; + alias?: string; + length?: number; +} + +export interface FeatureSet extends HasZM { + objectIdFieldName?: string; // optional + globalIdFieldName?: string; // optional + displayFieldName?: string; // optional + geometryType?: esriGeometryType; // for feature layers only + spatialReference?: SpatialReference; // for feature layers only. + fields?: Field[]; + features: Feature[]; +} + +export type Position2D = [number, number]; +export type Position = Position2D | [number, number, number] | [number, number, number, number]; + +export interface CircularArc { + "c": [Position, Position2D]; +} + +export interface Arc { + "a": [ + Position, // End point: x, y, , + Position2D, // Center point: center_x, center_y + number, // minor + number, // clockwise + number, // rotation + number, // axis + number // ratio + ]; +} + +export type ElipticArc = Arc; + +export interface OldCircularArc { + "a": [ + Position, // End point: x, y, , + Position2D, // Center point: center_x, center_y + number, // minor + number // clockwise + ]; +} + +export interface BezierCurve { + "b": [ + Position, + Position2D, + Position2D + ]; +} + +export type JsonCurve = CircularArc | Arc | OldCircularArc | BezierCurve; + + +export interface SpatialReferenceWkid { + wkid?: number; + latestWkid?: number; + vcsWkid?: number; + latestVcsWkid?: number; +} + +export interface SpatialReferenceWkt { + wkt?: string; + latestWkt?: string; +} + +export type SpatialReference = SpatialReferenceWkt | SpatialReferenceWkid; + +export interface Geometry { + spatialReference?: SpatialReference; +} + +export interface HasZM { + hasZ?: boolean; + hasM?: boolean; +} + +export interface Point extends Geometry { + x: number; + y: number; + z?: number; + m?: number; +} + +export interface Polyline extends HasZM, Geometry { + paths: Position[][]; +} + +export interface PolylineWithCurves extends HasZM, Geometry { + curvePaths: Array>; +} + +export interface Polygon extends HasZM, Geometry { + rings: Position[][]; +} + +export interface PolygonWithCurves extends HasZM, Geometry { + curveRings: Array>; +} + +export interface Multipoint extends HasZM, Geometry { + points: Position[]; +} + +export interface Envelope extends Geometry { + xmin: number; + xmax: number; + ymin: number; + ymax: number; + + zmin?: number; + zmax?: number; + + mmin?: number; + mmax?: number; +} + +export type esriGeometryType = "esriGeometryPoint" | "esriGeometryMultipoint" | "esriGeometryPolyline" | "esriGeometryPolygon" | "esriGeometryEnvelope"; + + +export type Color = [number, number, number, number]; +export type SimpleMarkerSymbolStyle = "esriSMSCircle" | "esriSMSCross" | "esriSMSDiamond" | "esriSMSSquare" | "esriSMSX" | "esriSMSTriangle"; +export type SimpleLineSymbolStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSNull" | "esriSLSSolid"; +export type SimpleFillSymbolStyle = "esriSFSBackwardDiagonal" | "esriSFSCross" | "esriSFSDiagonalCross" | "esriSFSForwardDiagonal" | "esriSFSHorizontal" | "esriSFSNull" | "esriSFSSolid" | "esriSFSVertical"; +export type SymbolType = "esriSLS" | "esriSMS" | "esriSFS" | "esriPMS" | "esriPFS" | "esriTS"; + +export interface Symbol { + "type": SymbolType; + "style"?: string; +} + +export interface SimpleLineSymbol extends Symbol { + "type": "esriSLS"; + "style"?: SimpleLineSymbolStyle; + "color"?: Color; + "width"?: number; +} + +export interface MarkerSymbol extends Symbol { + "angle"?: number; + "xoffset"?: number; + "yoffset"?: number; +} + +export interface SimpleMarkerSymbol extends MarkerSymbol { + "type": "esriSMS"; + "style"?: SimpleMarkerSymbolStyle; + "color"?: Color; + "size"?: number; + "outline"?: SimpleLineSymbol; +} + +export interface SimpleFillSymbol extends Symbol { + "type": "esriSFS"; + "style"?: SimpleFillSymbolStyle; + "color"?: Color; + "outline"?: SimpleLineSymbol; //if outline has been specified +} + +export interface PictureSourced { + "url"?: string; //Relative URL for static layers and full URL for dynamic layers. Access relative URL using http:////images/ + "imageData"?: string; //""; + "contentType"?: string; + "width"?: number; + "height"?: number; + "angle"?: number; + "xoffset"?: number; + "yoffset"?: number; + +} + +export interface PictureMarkerSymbol extends MarkerSymbol, PictureSourced { + "type": "esriPMS"; +} + +export interface PictureFillSymbol extends Symbol, PictureSourced { + "type": "esriPFS"; + "outline"?: SimpleLineSymbol; //if outline has been specified + "xscale"?: number; + "yscale"?: number; +} + +export interface Font { + "family"?: string; //""; + "size"?: number; //; + "style"?: "italic" | "normal" | "oblique"; + "weight"?: "bold" | "bolder" | "lighter" | "normal"; + "decoration"?: "line-through" | "underline" | "none"; +} + +export interface TextSymbol extends MarkerSymbol { + "type": "esriTS"; + "color"?: Color; + "backgroundColor"?: Color; + "borderLineSize"?: number; // ; + "borderLineColor"?: Color; + "haloSize"?: number; // ; + "haloColor"?: Color; + "verticalAlignment"?: "baseline" | "top" | "middle" | "bottom"; + "horizontalAlignment"?: "left" | "right" | "center" | "justify"; + "rightToLeft"?: boolean; + "kerning"?: boolean; + "font"?: Font; + "text"?: string; //only applicable when specified as a client-side graphic. +} \ No newline at end of file diff --git a/arcgis-rest-api/tsconfig.json b/arcgis-rest-api/tsconfig.json new file mode 100644 index 0000000000..ac74de6345 --- /dev/null +++ b/arcgis-rest-api/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [ + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arcgis-rest-api-tests.ts" + ] +} \ No newline at end of file diff --git a/arcgis-rest-api/tslint.json b/arcgis-rest-api/tslint.json new file mode 100644 index 0000000000..2149d13884 --- /dev/null +++ b/arcgis-rest-api/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file diff --git a/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts b/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts new file mode 100644 index 0000000000..48a06fcd02 --- /dev/null +++ b/arcgis-to-geojson-utils/arcgis-to-geojson-utils-tests.ts @@ -0,0 +1,20 @@ +import utils = require("arcgis-to-geojson-utils"); +import arcgisApi = require("arcgis-rest-api"); + +let arcgisPoint: arcgisApi.Point = { + x: -122.6764, + y: 45.5165, + spatialReference: { + wkid: 4326 + } +}; +let geojsonPoint: GeoJSON.Point = { + type: "Point", + coordinates: [45.5165, -122.6764] +}; + +// parse ArcGIS JSON, convert it to GeoJSON +var geojson = utils.arcgisToGeoJSON(arcgisPoint); + +// take GeoJSON and convert it to ArcGIS JSON +var arcgis = utils.geojsonToArcGIS(geojsonPoint); \ No newline at end of file diff --git a/arcgis-to-geojson-utils/index.d.ts b/arcgis-to-geojson-utils/index.d.ts new file mode 100644 index 0000000000..94a86022a3 --- /dev/null +++ b/arcgis-to-geojson-utils/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for arcgis-to-geojson-utils 1.0 +// Project: https://github.com/Esri/arcgis-to-geojson-utils +// Definitions by: Jeff Jacobson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as ArcGis from "arcgis-rest-api"; + +/** + * Converts an ArcGIS geometry into a GeoJSON geometry. + */ +export function arcgisToGeoJSON(arcgis: T): GeoJSON.GeometryObject; + +/** + * Converts a GeoJSON geometry into a ArcGIS geometry. + */ +export function geojsonToArcGIS(geojson: GeoJSON.GeometryObject): ArcGis.Geometry; \ No newline at end of file diff --git a/arcgis-to-geojson-utils/tsconfig.json b/arcgis-to-geojson-utils/tsconfig.json new file mode 100644 index 0000000000..2ef6376fee --- /dev/null +++ b/arcgis-to-geojson-utils/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "arcgis-to-geojson-utils-tests.ts" + ] +} \ No newline at end of file diff --git a/arcgis-to-geojson-utils/tslint.json b/arcgis-to-geojson-utils/tslint.json new file mode 100644 index 0000000000..2149d13884 --- /dev/null +++ b/arcgis-to-geojson-utils/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From 13048015ca1a22634711d383204f3bece238f003 Mon Sep 17 00:00:00 2001 From: alelode Date: Tue, 27 Dec 2016 23:31:41 +0100 Subject: [PATCH 092/101] Updated React-bootstrap-table typings from version 2.3.0 to 2.6.0 (#13151) * Added onRowDoubleClick, hideSizePerPage, pageStartIndex, defaultSearch and expandRowBgColor to options object * Added missing props --- react-bootstrap-table/index.d.ts | 41 ++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index 4ecf93573c..72db1aaf40 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-bootstrap-table v2.3.0 +// Type definitions for react-bootstrap-table v2.6.0 // Project: https://github.com/AllenFang/react-bootstrap-table -// Definitions by: Frank Laub +// Definitions by: Frank Laub , Aleksander Lode // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -115,12 +115,18 @@ export interface BootstrapTableProps extends Props { */ options?: Options; fetchInfo?: FetchInfo; - + printable?: boolean; tableStyle?: any; containerStyle?: any; headerStyle?: any; bodyStyle?: any; ignoreSinglePage?: boolean; + containerClass?: string; + tableContainerClass?: string + headerContainerClass?: string; + bodyContainerClass?: string; + expandableRow?: (row: any) => boolean; + expandComponent?: (row: any) => any; } export type SelectRowMode = 'none' | 'radio' | 'checkbox'; @@ -166,7 +172,7 @@ export interface SelectRow { `row`: is the row data which you wanted to select or unselect. `isSelected`: it's a boolean value means "whether or not that row will be selected?". `event`: The event target object. - If return value of this function is false, the select or deselect action will not be applied. + If return value of this (function) is false, the select or deselect action will not be applied. */ onSelect?: (row: any, isSelected: Boolean, event: any) => boolean; /** @@ -178,6 +184,10 @@ export interface SelectRow { */ onSelectAll?: (isSelected: boolean, currentSelectedAndDisplayData: any) => boolean; + /** + * Provide a list of unselectable row keys. + */ + unselectable?: number[]; } export type CellEditClickMode = 'none' | 'click' | 'dbclick'; @@ -293,6 +303,10 @@ export interface Options { /** To define the pagination bar length, default is 5. */ + /** + To define where to start counting the pages. + */ + pageStartIndex?: string; paginationSize?: number; /** Assign a callback function which will be called after page changed. @@ -333,6 +347,15 @@ export interface Options { This function taking one argument: row which is the row data which you click on. */ onRowClick?: (row: any) => void; + /** + Assign a callback function which will be called after a row double click. + This function taking one argument: row which is the row data which you double click on. + */ + onRowDoubleClick?: (row:any)=>void; + /** + Background color on expanded rows. + */ + expandRowBgColor?: string; /** Assign a callback function which will be called when mouse enter into the table. */ @@ -362,7 +385,7 @@ export interface Options { `rowKeys` is the row keys which been deleted, you can call next function to apply this deletion. */ handleConfirmDeleteRow?: (next: Function, rowKeys: any[]) => void; - paginationShowsTotal?: boolean; + paginationShowsTotal?: boolean | ReactElement; onSearchChange?: Function; onAddRow?: Function; onExportToCSV?: Function; @@ -442,6 +465,10 @@ export interface TableHeaderColumnProps extends Props { True to enable table sorting. Default is disabled. */ dataSort?: boolean; + /** + Default search string. + */ + defaultSearch?: string; /** Allow user to render a custom sort caret. You should give a function and should return a JSX. This function taking one arguments: order which present the sort order currently. @@ -460,6 +487,10 @@ export interface TableHeaderColumnProps extends Props { True to hide column. */ hidden?: boolean; + /** + True to hide the dropdown for sizePerPage. + */ + hideSizePerPage?: boolean /** False to disable search functionality on column, default is true. */ From 93afca9217c7987a8167b3ed505ee58e0dff0fd1 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 27 Dec 2016 17:33:18 -0500 Subject: [PATCH 093/101] Lint `lodash` (#13158) * Formatting fixes * Replace `T[]|List` with `List`, since that's a supertype to `T[]`. * Replace `T|T[]` with `Many` for convenience --- lodash/fb/index.d.ts | 7 +- lodash/generate-modules.ts | 2 + lodash/index.d.ts | 1108 +++++++++++++++++------------------- lodash/meanBy/index.d.ts | 7 +- lodash/tslint.json | 8 + 5 files changed, 541 insertions(+), 591 deletions(-) create mode 100644 lodash/tslint.json diff --git a/lodash/fb/index.d.ts b/lodash/fb/index.d.ts index 5f90e9e920..df9796d7d7 100644 --- a/lodash/fb/index.d.ts +++ b/lodash/fb/index.d.ts @@ -1,7 +1,2 @@ -// Type definitions for Lo-Dash 4.14 -// Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as _ from "../index" +import * as _ from "../index"; export = _; diff --git a/lodash/generate-modules.ts b/lodash/generate-modules.ts index 716f3bb23f..127f1f44c6 100644 --- a/lodash/generate-modules.ts +++ b/lodash/generate-modules.ts @@ -66,6 +66,7 @@ function allModuleNames() { "every", "extend", "extendWith", + "fb", "fill", "filter", "find", @@ -168,6 +169,7 @@ function allModuleNames() { "max", "maxBy", "mean", + "meanBy", "memoize", "merge", "mergeWith", diff --git a/lodash/index.d.ts b/lodash/index.d.ts index bf19508fa6..2e0796930d 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -241,7 +241,9 @@ export as namespace _; declare var _: _.LoDashStatic; -declare module _ { +declare namespace _ { + type Many = T | T[]; + interface LoDashStatic { /** * Creates a lodash object which wraps the given value to enable intuitive method chaining. @@ -277,8 +279,8 @@ declare module _ { (value: number): LoDashImplicitWrapper; (value: string): LoDashImplicitStringWrapper; (value: boolean): LoDashImplicitWrapper; - (value: Array): LoDashImplicitNumberArrayWrapper; - (value: Array): LoDashImplicitArrayWrapper; + (value: number[]): LoDashImplicitNumberArrayWrapper; + (value: T[]): LoDashImplicitArrayWrapper; (value: T): LoDashImplicitObjectWrapper; (value: any): LoDashImplicitWrapper; @@ -515,7 +517,7 @@ declare module _ { * console.log(array); * // => [1] */ - concat(array: T[]|List, ...values: (T|T[]|List)[]) : T[]; + concat(array: List, ...values: Array>): T[]; } //_.difference @@ -529,8 +531,8 @@ declare module _ { * @return Returns the new array of filtered values. */ difference( - array: T[]|List, - ...values: Array> + array: List, + ...values: Array> ): T[]; } @@ -538,28 +540,28 @@ declare module _ { /** * @see _.difference */ - difference(...values: (T[]|List)[]): LoDashImplicitArrayWrapper; + difference(...values: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.difference */ - difference(...values: (TValue[]|List)[]): LoDashImplicitArrayWrapper; + difference(...values: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.difference */ - difference(...values: (T[]|List)[]): LoDashExplicitArrayWrapper; + difference(...values: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.difference */ - difference(...values: (TValue[]|List)[]): LoDashExplicitArrayWrapper; + difference(...values: Array>): LoDashExplicitArrayWrapper; } //_.differenceBy @@ -575,8 +577,8 @@ declare module _ { * @returns Returns the new array of filtered values. */ differenceBy( - array: T[]|List, - values?: T[]|List, + array: List, + values?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -584,8 +586,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values?: T[]|List, + array: List, + values?: List, iteratee?: W ): T[]; @@ -593,9 +595,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, + array: List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -603,9 +605,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, + array: List, + values1?: List, + values2?: List, iteratee?: W ): T[]; @@ -613,10 +615,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -624,10 +626,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): T[]; @@ -635,11 +637,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): T[]; @@ -647,11 +649,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -659,12 +661,12 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): T[]; @@ -672,12 +674,12 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + array: List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): T[]; @@ -685,7 +687,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - array: T[]|List, + array: List, ...values: any[] ): T[]; } @@ -695,7 +697,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -703,7 +705,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -711,8 +713,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -720,8 +722,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -729,9 +731,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -739,9 +741,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -749,10 +751,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -760,10 +762,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -771,11 +773,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -783,11 +785,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -804,7 +806,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -812,7 +814,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -820,8 +822,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -829,8 +831,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -838,9 +840,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -848,9 +850,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -858,10 +860,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -869,10 +871,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -880,11 +882,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashImplicitArrayWrapper; @@ -892,11 +894,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -913,7 +915,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -921,7 +923,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -929,8 +931,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -938,8 +940,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -947,9 +949,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -957,9 +959,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -967,10 +969,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -978,10 +980,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -989,11 +991,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1001,11 +1003,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1022,7 +1024,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1030,7 +1032,7 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values?: T[]|List, + values?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1038,8 +1040,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1047,8 +1049,8 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, + values1?: List, + values2?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1056,9 +1058,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1066,9 +1068,9 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, + values1?: List, + values2?: List, + values3?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1076,10 +1078,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1087,10 +1089,10 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1098,11 +1100,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: ((value: T) => any)|string ): LoDashExplicitArrayWrapper; @@ -1110,11 +1112,11 @@ declare module _ { * @see _.differenceBy */ differenceBy( - values1?: T[]|List, - values2?: T[]|List, - values3?: T[]|List, - values4?: T[]|List, - values5?: T[]|List, + values1?: List, + values2?: List, + values3?: List, + values4?: List, + values5?: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -1145,7 +1147,7 @@ declare module _ { * // => [3, 1] */ differenceWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -1159,7 +1161,7 @@ declare module _ { * @param n The number of elements to drop. * @return Returns the slice of array. */ - drop(array: T[]|List, n?: number): T[]; + drop(array: List, n?: number): T[]; } interface LoDashImplicitArrayWrapper { @@ -1941,7 +1943,7 @@ declare module _ { /** * @see _.flatten */ - flatten(array: List): T[]; + flatten(array: List>): T[]; /** * @see _.flatten @@ -2250,7 +2252,7 @@ declare module _ { * // => [{ 'x': 1 }] */ intersectionBy( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2277,7 +2279,7 @@ declare module _ { * // => [{ 'x': 1, 'y': 2 }] */ intersectionWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2361,7 +2363,7 @@ declare module _ { * // => [1, 1] */ pullAll( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2391,7 +2393,7 @@ declare module _ { * // => [{ 'x': 2 }] */ pullAllBy( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2419,7 +2421,7 @@ declare module _ { * // => [3, 2, 1] */ reverse( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -2531,35 +2533,35 @@ declare module _ { * @param arrays The arrays to inspect. * @return Returns the new array of shared values. */ - intersection(...arrays: (T[]|List)[]): T[]; + intersection(...arrays: Array>): T[]; } interface LoDashImplicitArrayWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; + intersection(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; + intersection(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + intersection(...arrays: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.intersection */ - intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + intersection(...arrays: Array>): LoDashExplicitArrayWrapper; } //_.last @@ -2739,7 +2741,7 @@ declare module _ { */ pullAt( array: List, - ...indexes: (number|number[])[] + ...indexes: Array> ): T[]; } @@ -2747,28 +2749,28 @@ declare module _ { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.pullAt */ - pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper; + pullAt(...indexes: Array>): LoDashExplicitArrayWrapper; } //_.remove @@ -3768,7 +3770,7 @@ declare module _ { * // => 3 */ sortedLastIndexOf( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -4172,45 +4174,45 @@ declare module _ { * @param arrays The arrays to inspect. * @return Returns the new array of combined values. */ - union(...arrays: List[]): T[]; + union(...arrays: Array>): T[]; } interface LoDashImplicitArrayWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; + union(...arrays: Array>): LoDashImplicitArrayWrapper; /** * @see _.union */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; + union(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashImplicitArrayWrapper; + union(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; + union(...arrays: Array>): LoDashExplicitArrayWrapper; /** * @see _.union */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; + union(...arrays: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.union */ - union(...arrays: List[]): LoDashExplicitArrayWrapper; + union(...arrays: Array>): LoDashExplicitArrayWrapper; } //_.unionBy @@ -4225,7 +4227,7 @@ declare module _ { * @return Returns the new array of combined values. */ unionBy( - arrays: T[]|List, + arrays: List, iteratee?: (value: T) => any ): T[]; @@ -4233,7 +4235,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays: T[]|List, + arrays: List, iteratee?: W ): T[]; @@ -4241,8 +4243,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, + arrays1: List, + arrays2: List, iteratee?: (value: T) => any ): T[]; @@ -4250,8 +4252,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, + arrays1: List, + arrays2: List, iteratee?: W ): T[]; @@ -4259,9 +4261,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): T[]; @@ -4269,9 +4271,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, iteratee?: W ): T[]; @@ -4279,10 +4281,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): T[]; @@ -4290,10 +4292,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): T[]; @@ -4301,11 +4303,11 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): T[]; @@ -4313,11 +4315,11 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays1: T[]|List, - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays1: List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): T[]; @@ -4325,7 +4327,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays: T[]|List, + arrays: List, ...iteratee: any[] ): T[]; } @@ -4349,7 +4351,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4357,7 +4359,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4365,8 +4367,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4374,8 +4376,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4383,9 +4385,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4393,9 +4395,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4403,10 +4405,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4414,10 +4416,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4448,7 +4450,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4456,7 +4458,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4464,8 +4466,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4473,8 +4475,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4482,9 +4484,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4492,9 +4494,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4502,10 +4504,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashImplicitArrayWrapper; @@ -4513,10 +4515,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashImplicitArrayWrapper; @@ -4547,7 +4549,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4555,7 +4557,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4563,8 +4565,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4572,8 +4574,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4581,9 +4583,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4591,9 +4593,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4601,10 +4603,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4612,10 +4614,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4646,7 +4648,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4654,7 +4656,7 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, + arrays2: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4662,8 +4664,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4671,8 +4673,8 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, + arrays2: List, + arrays3: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4680,9 +4682,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4690,9 +4692,9 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -4700,10 +4702,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: (value: T) => any ): LoDashExplicitArrayWrapper; @@ -4711,10 +4713,10 @@ declare module _ { * @see _.unionBy */ unionBy( - arrays2: T[]|List, - arrays3: T[]|List, - arrays4: T[]|List, - arrays5: T[]|List, + arrays2: List, + arrays3: List, + arrays4: List, + arrays5: List, iteratee?: W ): LoDashExplicitArrayWrapper; @@ -5315,7 +5317,7 @@ declare module _ { * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ unionWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5341,7 +5343,7 @@ declare module _ { * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ uniqWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5473,35 +5475,35 @@ declare module _ { * @param arrays The arrays to inspect. * @return Returns the new array of values. */ - xor(...arrays: List[]): T[]; + xor(...arrays: Array>): T[]; } interface LoDashImplicitArrayWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; + xor(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashImplicitArrayWrapper; + xor(...arrays: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashExplicitArrayWrapper; + xor(...arrays: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.xor */ - xor(...arrays: List[]): LoDashExplicitArrayWrapper; + xor(...arrays: Array>): LoDashExplicitArrayWrapper; } //_.xorBy DUMMY @@ -5527,7 +5529,7 @@ declare module _ { * // => [{ 'x': 2 }] */ xorBy( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5554,7 +5556,7 @@ declare module _ { * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ xorWith( - array: any[]|List, + array: List, ...values: any[] ): any[]; } @@ -5568,35 +5570,35 @@ declare module _ { * @param arrays The arrays to process. * @return Returns the new array of grouped elements. */ - zip(...arrays: List[]): T[][]; + zip(...arrays: Array>): T[][]; } interface LoDashImplicitArrayWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashImplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.zip */ - zip(...arrays: List[]): _.LoDashExplicitArrayWrapper; + zip(...arrays: Array>): _.LoDashExplicitArrayWrapper; } //_.zipObject @@ -5939,24 +5941,24 @@ declare module _ { * @param items * @return Returns the new concatenated array. */ - concat(...items: Array>): LoDashImplicitArrayWrapper; + concat(...items: Array>): LoDashImplicitArrayWrapper; /** * @see _.concat */ - concat(...items: Array>): LoDashImplicitArrayWrapper; + concat(...items: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitWrapperBase { /** * @see _.concat */ - concat(...items: Array>): LoDashExplicitArrayWrapper; + concat(...items: Array>): LoDashExplicitArrayWrapper; /** * @see _.concat */ - concat(...items: Array>): LoDashExplicitArrayWrapper; + concat(...items: Array>): LoDashExplicitArrayWrapper; } //_.prototype.plant @@ -6110,7 +6112,7 @@ declare module _ { */ at( collection: List|Dictionary, - ...props: (number|string|(number|string)[])[] + ...props: Array> ): T[]; } @@ -6118,28 +6120,28 @@ declare module _ { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + at(...props: Array>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper; + at(...props: Array>): LoDashImplicitArrayWrapper; } interface LoDashExplicitArrayWrapper { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + at(...props: Array>): LoDashExplicitArrayWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.at */ - at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper; + at(...props: Array>): LoDashExplicitArrayWrapper; } //_.countBy @@ -6931,7 +6933,7 @@ declare module _ { * @return The found element, else undefined. **/ findLast( - collection: Array, + collection: T[], callback: ListIterator, fromIndex?: number ): T; @@ -6959,7 +6961,7 @@ declare module _ { * @param _.pluck style callback **/ findLast( - collection: Array, + collection: T[], whereValue: W, fromIndex?: number ): T; @@ -6989,7 +6991,7 @@ declare module _ { * @param _.where style callback **/ findLast( - collection: Array, + collection: T[], pluckValue: string, fromIndex?: number ): T; @@ -7055,7 +7057,7 @@ declare module _ { */ flatMap( collection: List, - iteratee?: ListIterator + iteratee?: ListIterator> ): TResult[]; /** @@ -7063,7 +7065,7 @@ declare module _ { */ flatMap( collection: List, - iteratee?: ListIterator + iteratee?: ListIterator> ): TResult[]; /** @@ -7071,7 +7073,7 @@ declare module _ { */ flatMap( collection: Dictionary, - iteratee?: DictionaryIterator + iteratee?: DictionaryIterator> ): TResult[]; /** @@ -7079,7 +7081,7 @@ declare module _ { */ flatMap( collection: Dictionary, - iteratee?: DictionaryIterator + iteratee?: DictionaryIterator> ): TResult[]; /** @@ -7087,7 +7089,7 @@ declare module _ { */ flatMap( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator + iteratee?: NumericDictionaryIterator> ): TResult[]; /** @@ -7095,7 +7097,7 @@ declare module _ { */ flatMap( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator + iteratee?: NumericDictionaryIterator> ): TResult[]; /** @@ -7103,7 +7105,7 @@ declare module _ { */ flatMap( collection: TObject, - iteratee?: ObjectIterator + iteratee?: ObjectIterator> ): TResult[]; /** @@ -7111,7 +7113,7 @@ declare module _ { */ flatMap( collection: Object, - iteratee?: ObjectIterator + iteratee?: ObjectIterator> ): TResult[]; /** @@ -7159,7 +7161,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator + iteratee: ListIterator> ): LoDashImplicitArrayWrapper; /** @@ -7173,7 +7175,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|string + iteratee: ListIterator>|string ): LoDashImplicitArrayWrapper; /** @@ -7201,14 +7203,14 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator> ): LoDashImplicitArrayWrapper; /** * @see _.flatMap */ flatMap( - iteratee: ObjectIterator|string + iteratee: ObjectIterator>|string ): LoDashImplicitArrayWrapper; /** @@ -7236,7 +7238,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator + iteratee: ListIterator> ): LoDashExplicitArrayWrapper; /** @@ -7250,7 +7252,7 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|string + iteratee: ListIterator>|string ): LoDashExplicitArrayWrapper; /** @@ -7278,14 +7280,14 @@ declare module _ { * @see _.flatMap */ flatMap( - iteratee: ListIterator|DictionaryIterator|NumericDictionaryIterator + iteratee: ListIterator>|DictionaryIterator>|NumericDictionaryIterator> ): LoDashExplicitArrayWrapper; /** * @see _.flatMap */ flatMap( - iteratee: ObjectIterator|string + iteratee: ObjectIterator>|string ): LoDashExplicitArrayWrapper; /** @@ -8044,7 +8046,7 @@ declare module _ { **/ invoke( object: TObject, - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; /** @@ -8052,7 +8054,7 @@ declare module _ { **/ invoke( object: Dictionary|TValue[], - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; /** @@ -8060,7 +8062,7 @@ declare module _ { **/ invoke( object: any, - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8069,7 +8071,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8078,7 +8080,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8087,7 +8089,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8096,7 +8098,7 @@ declare module _ { * @see _.invoke **/ invoke( - path: StringRepresentable|StringRepresentable[], + path: Many, ...args: any[]): TResult; } @@ -8128,7 +8130,7 @@ declare module _ { * @see _.invokeMap **/ invokeMap( - collection: {}[], + collection: Array<{}>, methodName: string, ...args: any[]): TResult[]; @@ -8160,7 +8162,7 @@ declare module _ { * @see _.invokeMap **/ invokeMap( - collection: {}[], + collection: Array<{}>, method: (...args: any[]) => TResult, ...args: any[]): TResult[]; @@ -8549,7 +8551,7 @@ declare module _ { * @return Returns the accumulated value. **/ reduce( - collection: Array, + collection: T[], callback: MemoIterator, accumulator: TResult): TResult; @@ -8581,7 +8583,7 @@ declare module _ { * @see _.reduce **/ reduce( - collection: Array, + collection: T[], callback: MemoIterator): TResult; /** @@ -8679,7 +8681,7 @@ declare module _ { * @return The accumulated value. **/ reduceRight( - collection: Array, + collection: T[], callback: MemoIterator, accumulator: TResult): TResult; @@ -8703,7 +8705,7 @@ declare module _ { * @see _.reduceRight **/ reduceRight( - collection: Array, + collection: T[], callback: MemoIterator): TResult; /** @@ -9391,15 +9393,15 @@ declare module _ { * @see _.sortBy */ sortBy( - collection: (Array|List), - iteratees: (ListIterator|string|Object)[]): T[]; + collection: List, + iteratees: Array|string|Object>): T[]; /** * @see _.sortBy */ sortBy( - collection: (Array|List), - ...iteratees: (ListIterator|Object|string)[]): T[]; + collection: List, + ...iteratees: Array|Object|string>): T[]; } interface LoDashImplicitArrayWrapper { @@ -9428,12 +9430,12 @@ declare module _ { /** * @see _.sortBy */ - sortBy(...iteratees: (ListIterator|Object|string)[]): LoDashImplicitArrayWrapper; + sortBy(...iteratees: Array|Object|string>): LoDashImplicitArrayWrapper; /** * @see _.sortBy **/ - sortBy(iteratees: (ListIterator|string|Object)[]): LoDashImplicitArrayWrapper; + sortBy(iteratees: Array|string|Object>): LoDashImplicitArrayWrapper; } interface LoDashImplicitObjectWrapper { @@ -9539,8 +9541,8 @@ declare module _ { */ orderBy( collection: List, - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): T[]; /** @@ -9548,8 +9550,8 @@ declare module _ { */ orderBy( collection: List, - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): T[]; /** @@ -9557,8 +9559,8 @@ declare module _ { */ orderBy( collection: NumericDictionary, - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): T[]; /** @@ -9566,8 +9568,8 @@ declare module _ { */ orderBy( collection: NumericDictionary, - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): T[]; /** @@ -9575,8 +9577,8 @@ declare module _ { */ orderBy( collection: Dictionary, - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): T[]; /** @@ -9584,8 +9586,8 @@ declare module _ { */ orderBy( collection: Dictionary, - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): T[]; } @@ -9594,8 +9596,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|(ListIterator|string)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string>, + orders?: Many ): LoDashImplicitArrayWrapper; } @@ -9604,8 +9606,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; } @@ -9614,48 +9616,48 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashImplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashImplicitArrayWrapper; } @@ -9664,8 +9666,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|(ListIterator|string)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string>, + orders?: Many ): LoDashExplicitArrayWrapper; } @@ -9674,8 +9676,8 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W|(ListIterator|string|W)>, + orders?: Many ): LoDashExplicitArrayWrapper; } @@ -9684,48 +9686,48 @@ declare module _ { * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|W|(ListIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: ListIterator|string|Object|(ListIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|W|(NumericDictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: NumericDictionaryIterator|string|Object|(NumericDictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|W|(DictionaryIterator|string|W)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|W>, + orders?: Many ): LoDashExplicitArrayWrapper; /** * @see _.orderBy */ orderBy( - iteratees: DictionaryIterator|string|Object|(DictionaryIterator|string|Object)[], - orders?: boolean|string|(boolean|string)[] + iteratees: Many|string|Object>, + orders?: Many ): LoDashExplicitArrayWrapper; } @@ -9926,7 +9928,7 @@ declare module _ { */ bindAll( object: T, - ...methodNames: (string|string[])[] + ...methodNames: Array> ): T; } @@ -9934,14 +9936,14 @@ declare module _ { /** * @see _.bindAll */ - bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper; + bindAll(...methodNames: Array>): LoDashImplicitObjectWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.bindAll */ - bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper; + bindAll(...methodNames: Array>): LoDashExplicitObjectWrapper; } //_.bindKey @@ -10472,7 +10474,7 @@ declare module _ { memoize: { (func: T, resolver?: Function): T & MemoizedFunction; Cache: MapCacheConstructor; - } + }; } interface LoDashImplicitObjectWrapper { @@ -10619,21 +10621,11 @@ declare module _ { type PH = LoDashStatic; - interface Function0 { - (): R; - } - interface Function1 { - (t1: T1): R; - } - interface Function2 { - (t1: T1, t2: T2): R; - } - interface Function3 { - (t1: T1, t2: T2, t3: T3): R; - } - interface Function4 { - (t1: T1, t2: T2, t3: T3, t4: T4): R; - } + type Function0 = () => R; + type Function1 = (t1: T1) => R; + type Function2 = (t1: T1, t2: T2) => R; + type Function3 = (t1: T1, t2: T2, t3: T3) => R; + type Function4 = (t1: T1, t2: T2, t3: T3, t4: T4) => R; interface Partial { // arity 0 @@ -10685,7 +10677,7 @@ declare module _ { * @param args Arguments to be partially applied. * @return The new partially applied function. **/ - partialRight: PartialRight + partialRight: PartialRight; } interface PartialRight { @@ -11039,7 +11031,7 @@ declare module _ { * @param value The value to inspect. * @return Returns the cast array. */ - castArray(value?: T | T[]): T[]; + castArray(value?: Many): T[]; } interface LoDashImplicitWrapper { @@ -11198,9 +11190,7 @@ declare module _ { } //_.cloneDeepWith - interface CloneDeepWithCustomizer { - (value: TValue): TResult; - } + type CloneDeepWithCustomizer = (value: TValue) => TResult; interface LoDashStatic { /** @@ -11321,9 +11311,7 @@ declare module _ { } //_.cloneWith - interface CloneWithCustomizer { - (value: TValue): TResult; - } + type CloneWithCustomizer = (value: TValue) => TResult; interface LoDashStatic { /** @@ -11594,14 +11582,14 @@ declare module _ { isArray(value?: any): value is T[]; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.isArray */ isArray(): boolean; } - interface LoDashExplicitWrapperBase { + interface LoDashExplicitWrapperBase { /** * @see _.isArray */ @@ -11663,14 +11651,14 @@ declare module _ { isArrayLike(value?: any): value is T[]; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.isArrayLike */ isArrayLike(): boolean; } - interface LoDashExplicitWrapperBase { + interface LoDashExplicitWrapperBase { /** * @see _.isArrayLike */ @@ -11706,14 +11694,14 @@ declare module _ { isArrayLikeObject(value?: any): value is T[]; } - interface LoDashImplicitWrapperBase { + interface LoDashImplicitWrapperBase { /** * @see _.isArrayLikeObject */ isArrayLikeObject(): boolean; } - interface LoDashExplicitWrapperBase { + interface LoDashExplicitWrapperBase { /** * @see _.isArrayLikeObject */ @@ -11900,9 +11888,7 @@ declare module _ { } // _.isEqualWith - interface IsEqualCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } + type IsEqualCustomizer = (value: any, other: any, indexOrKey?: number|string) => boolean; interface LoDashStatic { /** @@ -12153,9 +12139,7 @@ declare module _ { } //_.isMatch - interface isMatchCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } + type isMatchCustomizer = (value: any, other: any, indexOrKey?: number|string) => boolean; interface LoDashStatic { /** @@ -12191,9 +12175,7 @@ declare module _ { } //_.isMatchWith - interface isMatchWithCustomizer { - (value: any, other: any, indexOrKey?: number|string): boolean; - } + type isMatchWithCustomizer = (value: any, other: any, indexOrKey?: number|string) => boolean; interface LoDashStatic { /** @@ -14060,11 +14042,6 @@ declare module _ { assign(...otherArgs: any[]): LoDashExplicitObjectWrapper; } - //_.assignWith - interface AssignCustomizer { - (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; - } - interface LoDashStatic { /** * This method is like `_.assign` except that it accepts `customizer` which @@ -14418,9 +14395,7 @@ declare module _ { } //_.assignInWith - interface AssignCustomizer { - (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any; - } + type AssignCustomizer = (objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}) => any; interface LoDashStatic { /** @@ -14805,7 +14780,7 @@ declare module _ { /** * @see _.defaultsDeep **/ - defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper + defaultsDeep(...sources: any[]): LoDashImplicitObjectWrapper; } // _.extend @@ -15595,7 +15570,7 @@ declare module _ { */ get( object: TObject, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; @@ -15604,7 +15579,7 @@ declare module _ { */ get( object: any, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15614,7 +15589,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15624,7 +15599,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15634,7 +15609,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult ): TResult; } @@ -15644,7 +15619,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -15654,7 +15629,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -15664,7 +15639,7 @@ declare module _ { * @see _.get */ get( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -15699,7 +15674,7 @@ declare module _ { */ has( object: T, - path: StringRepresentable|StringRepresentable[] + path: Many ): boolean; } @@ -15707,14 +15682,14 @@ declare module _ { /** * @see _.has */ - has(path: StringRepresentable|StringRepresentable[]): boolean; + has(path: Many): boolean; } interface LoDashExplicitObjectWrapper { /** * @see _.has */ - has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + has(path: Many): LoDashExplicitWrapper; } //_.hasIn @@ -15746,7 +15721,7 @@ declare module _ { */ hasIn( object: T, - path: StringRepresentable|StringRepresentable[] + path: Many ): boolean; } @@ -15754,14 +15729,14 @@ declare module _ { /** * @see _.hasIn */ - hasIn(path: StringRepresentable|StringRepresentable[]): boolean; + hasIn(path: Many): boolean; } interface LoDashExplicitObjectWrapper { /** * @see _.hasIn */ - hasIn(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + hasIn(path: Many): LoDashExplicitWrapper; } //_.invert @@ -15803,9 +15778,7 @@ declare module _ { } //_.inverBy - interface InvertByIterator { - (value: T): any; - } + type InvertByIterator = (value: T) => any; interface LoDashStatic { /** @@ -16347,9 +16320,7 @@ declare module _ { } //_.mergeWith - interface MergeWithCustomizer { - (value: any, srcValue: any, key?: string, object?: Object, source?: Object): any; - } + type MergeWithCustomizer = (value: any, srcValue: any, key?: string, object?: Object, source?: Object) => any; interface LoDashStatic { /** @@ -16505,7 +16476,7 @@ declare module _ { omit( object: T, - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): TResult; } @@ -16515,7 +16486,7 @@ declare module _ { * @see _.omit */ omit( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashImplicitObjectWrapper; } @@ -16525,7 +16496,7 @@ declare module _ { * @see _.omit */ omit( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashExplicitObjectWrapper; } @@ -16594,7 +16565,7 @@ declare module _ { */ pick( object: T, - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): TResult; } @@ -16603,7 +16574,7 @@ declare module _ { * @see _.pick */ pick( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashImplicitObjectWrapper; } @@ -16612,7 +16583,7 @@ declare module _ { * @see _.pick */ pick( - ...predicate: (StringRepresentable|StringRepresentable[])[] + ...predicate: Array> ): LoDashExplicitObjectWrapper; } @@ -16672,7 +16643,7 @@ declare module _ { */ result( object: TObject, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; @@ -16681,7 +16652,7 @@ declare module _ { */ result( object: any, - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16691,7 +16662,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16701,7 +16672,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16711,7 +16682,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: TResult|((...args: any[]) => TResult) ): TResult; } @@ -16721,7 +16692,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -16731,7 +16702,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -16741,7 +16712,7 @@ declare module _ { * @see _.result */ result( - path: StringRepresentable|StringRepresentable[], + path: Many, defaultValue?: any ): TResultWrapper; } @@ -16760,7 +16731,7 @@ declare module _ { */ set( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: any ): TResult; @@ -16769,7 +16740,7 @@ declare module _ { */ set( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): TResult; @@ -16778,7 +16749,7 @@ declare module _ { */ set( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): TResult; } @@ -16788,7 +16759,7 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any ): LoDashImplicitObjectWrapper; @@ -16796,7 +16767,7 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): LoDashImplicitObjectWrapper; } @@ -16806,7 +16777,7 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any ): LoDashExplicitObjectWrapper; @@ -16814,15 +16785,13 @@ declare module _ { * @see _.set */ set( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V ): LoDashExplicitObjectWrapper; } //_.setWith - interface SetWithCustomizer { - (nsValue: any, key: string, nsObject: T): any; - } + type SetWithCustomizer = (nsValue: any, key: string, nsObject: T) => any; interface LoDashStatic { /** @@ -16838,7 +16807,7 @@ declare module _ { */ setWith( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: any, customizer?: SetWithCustomizer ): TResult; @@ -16848,7 +16817,7 @@ declare module _ { */ setWith( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): TResult; @@ -16858,7 +16827,7 @@ declare module _ { */ setWith( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): TResult; @@ -16869,7 +16838,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any, customizer?: SetWithCustomizer ): LoDashImplicitObjectWrapper; @@ -16878,7 +16847,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): LoDashImplicitObjectWrapper; @@ -16889,7 +16858,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: any, customizer?: SetWithCustomizer ): LoDashExplicitObjectWrapper; @@ -16898,7 +16867,7 @@ declare module _ { * @see _.setWith */ setWith( - path: StringRepresentable|StringRepresentable[], + path: Many, value: V, customizer?: SetWithCustomizer ): LoDashExplicitObjectWrapper; @@ -17055,7 +17024,7 @@ declare module _ { */ unset( object: T, - path: StringRepresentable|StringRepresentable[] + path: Many ): boolean; } @@ -17063,14 +17032,14 @@ declare module _ { /** * @see _.unset */ - unset(path: StringRepresentable|StringRepresentable[]): LoDashImplicitWrapper; + unset(path: Many): LoDashImplicitWrapper; } interface LoDashExplicitObjectWrapper { /** * @see _.unset */ - unset(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper; + unset(path: Many): LoDashExplicitWrapper; } //_.update @@ -17086,7 +17055,7 @@ declare module _ { */ update( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: Function ): TResult; @@ -17095,7 +17064,7 @@ declare module _ { */ update( object: Object, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): TResult; @@ -17104,7 +17073,7 @@ declare module _ { */ update( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: Function ): TResult; @@ -17113,7 +17082,7 @@ declare module _ { */ update( object: O, - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): TResult; } @@ -17123,7 +17092,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: any ): LoDashImplicitObjectWrapper; @@ -17131,7 +17100,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): LoDashImplicitObjectWrapper; } @@ -17141,7 +17110,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: any ): LoDashExplicitObjectWrapper; @@ -17149,7 +17118,7 @@ declare module _ { * @see _.update */ update( - path: StringRepresentable|StringRepresentable[], + path: Many, updater: U ): LoDashExplicitObjectWrapper; } @@ -18485,7 +18454,7 @@ declare module _ { * @return Returns the new function. */ matchesProperty( - path: StringRepresentable|StringRepresentable[], + path: Many, srcValue: T ): (value: any) => boolean; @@ -18493,7 +18462,7 @@ declare module _ { * @see _.matchesProperty */ matchesProperty( - path: StringRepresentable|StringRepresentable[], + path: Many, srcValue: T ): (value: V) => boolean; } @@ -18615,7 +18584,7 @@ declare module _ { methodOf( object: TObject, ...args: any[] - ): (path: StringRepresentable|StringRepresentable[]) => TResult; + ): (path: Many) => TResult; /** * @see _.methodOf @@ -18623,7 +18592,7 @@ declare module _ { methodOf( object: {}, ...args: any[] - ): (path: StringRepresentable|StringRepresentable[]) => TResult; + ): (path: Many) => TResult; } interface LoDashImplicitObjectWrapper { @@ -18632,7 +18601,7 @@ declare module _ { */ methodOf( ...args: any[] - ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + ): LoDashImplicitObjectWrapper<(path: Many) => TResult>; } interface LoDashExplicitObjectWrapper { @@ -18641,7 +18610,7 @@ declare module _ { */ methodOf( ...args: any[] - ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>; + ): LoDashExplicitObjectWrapper<(path: Many) => TResult>; } //_.mixin @@ -18794,35 +18763,35 @@ declare module _ { * @param iteratees The iteratees to invoke. * @return Returns the new function. */ - over(...iteratees: (Function|Function[])[]): (...args: any[]) => TResult[]; + over(...iteratees: Array>): (...args: any[]) => TResult[]; } interface LoDashImplicitArrayWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; } interface LoDashImplicitObjectWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>; } interface LoDashExplicitArrayWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; } interface LoDashExplicitObjectWrapper { /** * @see _.over */ - over(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; + over(...iteratees: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>; } //_.overEvery @@ -18834,35 +18803,35 @@ declare module _ { * @param predicates The predicates to check. * @return Returns the new function. */ - overEvery(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; + overEvery(...predicates: Array>): (...args: any[]) => boolean; } interface LoDashImplicitArrayWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashImplicitObjectWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitArrayWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitObjectWrapper { /** * @see _.overEvery */ - overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overEvery(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } //_.overSome @@ -18874,35 +18843,35 @@ declare module _ { * @param predicates The predicates to check. * @return Returns the new function. */ - overSome(...predicates: (Function|Function[])[]): (...args: any[]) => boolean; + overSome(...predicates: Array>): (...args: any[]) => boolean; } interface LoDashImplicitArrayWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashImplicitObjectWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitArrayWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } interface LoDashExplicitObjectWrapper { /** * @see _.overSome */ - overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; + overSome(...predicates: Array>): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>; } //_.property @@ -18913,7 +18882,7 @@ declare module _ { * @param path The path of the property to get. * @return Returns the new function. */ - property(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult; + property(path: Many): (obj: TObj) => TResult; } interface LoDashImplicitWrapper { @@ -18953,21 +18922,21 @@ declare module _ { * @param object The object to query. * @return Returns the new function. */ - propertyOf(object: T): (path: string|string[]) => any; + propertyOf(object: T): (path: Many) => any; } interface LoDashImplicitObjectWrapper { /** * @see _.propertyOf */ - propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>; + propertyOf(): LoDashImplicitObjectWrapper<(path: Many) => any>; } interface LoDashExplicitObjectWrapper { /** * @see _.propertyOf */ - propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>; + propertyOf(): LoDashExplicitObjectWrapper<(path: Many) => any>; } //_.range @@ -19224,41 +19193,22 @@ declare module _ { uniqueId(): LoDashExplicitWrapper; } - interface ListIterator { - (value: T, index: number, collection: List): TResult; - } + type ListIterator = (value: T, index: number, collection: List) => TResult; - interface DictionaryIterator { - (value: T, key?: string, collection?: Dictionary): TResult; - } + type DictionaryIterator = (value: T, key?: string, collection?: Dictionary) => TResult; - interface NumericDictionaryIterator { - (value: T, key?: number, collection?: Dictionary): TResult; - } + type NumericDictionaryIterator = (value: T, key?: number, collection?: Dictionary) => TResult; - interface ObjectIterator { - (element: T, key?: string, collection?: any): TResult; - } + type ObjectIterator = (element: T, key?: string, collection?: any) => TResult; - interface StringIterator { - (char: string, index?: number, string?: string): TResult; - } + type StringIterator = (char: string, index?: number, string?: string) => TResult; - interface MemoVoidIterator { - (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void; - } - interface MemoIterator { - (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult; - } + type MemoVoidIterator = (prev: TResult, curr: T, indexOrKey?: any, list?: T[]) => void; - interface MemoVoidArrayIterator { - (acc: TResult, curr: T, index?: number, arr?: T[]): void; - } - interface MemoVoidDictionaryIterator { - (acc: TResult, curr: T, key?: string, dict?: Dictionary): void; - } + type MemoIterator = (prev: TResult, curr: T, indexOrKey?: any, list?: T[]) => TResult; - //interface Collection {} + type MemoVoidArrayIterator = (acc: TResult, curr: T, index?: number, arr?: T[]) => void; + type MemoVoidDictionaryIterator = (acc: TResult, curr: T, key?: string, dict?: Dictionary) => void; // Common interface between Arrays and jQuery objects interface List { diff --git a/lodash/meanBy/index.d.ts b/lodash/meanBy/index.d.ts index 0876057523..3004930ef6 100644 --- a/lodash/meanBy/index.d.ts +++ b/lodash/meanBy/index.d.ts @@ -1,8 +1,3 @@ -// Type definitions for Lo-Dash 4.14 -// Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -import * as _ from "../index" +import * as _ from "../index"; declare const meanBy: typeof _.meanBy; export = meanBy; diff --git a/lodash/tslint.json b/lodash/tslint.json new file mode 100644 index 0000000000..8bcd32b3b1 --- /dev/null +++ b/lodash/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "no-empty-interface": false, + "unified-signatures": false + } +} \ No newline at end of file From be8241af5b5f26f22bba48a6e62af51685e4b77b Mon Sep 17 00:00:00 2001 From: Richard Bateman Date: Tue, 27 Dec 2016 15:40:53 -0700 Subject: [PATCH 094/101] Fix incorrect method definition in pdfkit.d.ts (#13205) --- pdfkit/index.d.ts | 2 +- pdfkit/pdfkit-tests.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pdfkit/index.d.ts b/pdfkit/index.d.ts index 68e787c2fd..6d5272875b 100644 --- a/pdfkit/index.d.ts +++ b/pdfkit/index.d.ts @@ -160,7 +160,7 @@ declare namespace PDFKit.Mixins { bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): TDocument; quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): TDocument; rect(x: number, y: number, w: number, h: number): TDocument; - roundRect(x: number, y: number, w: number, h: number, r?: number): TDocument; + roundedRect(x: number, y: number, w: number, h: number, r?: number): TDocument; ellipse(x: number, y: number, r1: number, r2?: number): TDocument; circle(x: number, y: number, raduis: number): TDocument; polygon(...points: number[][]): TDocument; diff --git a/pdfkit/pdfkit-tests.ts b/pdfkit/pdfkit-tests.ts index a652e167a4..57aff702da 100644 --- a/pdfkit/pdfkit-tests.ts +++ b/pdfkit/pdfkit-tests.ts @@ -52,6 +52,8 @@ doc.path("M 0,20 L 100,160 Q 130,200 150,120 C 190,-40 200,200 300,150 L 400,90" //Rectangle shape helper sample doc.rect(100,200,100,100); +// Rounded rectangle +doc.roundedRect(150,250,150,150,10); //polygon doc.polygon([100,0],[50,100],[50,100]); From 82cf8e532decfe4e3bcb564d101bb2762b0b560a Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Wed, 28 Dec 2016 06:52:11 +0800 Subject: [PATCH 095/101] soap.d.ts: ClientSSLSecurty constructor parameters (#13216) --- soap/index.d.ts | 5 +++-- soap/soap-tests.ts | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/soap/index.d.ts b/soap/index.d.ts index 4262bdb64c..8cb9c43424 100644 --- a/soap/index.d.ts +++ b/soap/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for soap // Project: https://www.npmjs.com/package/soap -// Definitions by: Nicole Wang , Cage Fox +// Definitions by: Leo Liang , Cage Fox // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -15,7 +15,8 @@ export class WSSecurity implements Security { } export class ClientSSLSecurity implements Security { - constructor(key: string, cert: string, ca: string, defaults: any); + constructor(key: Buffer | string, cert: Buffer | string, ca: Buffer | string, defaults?: any); + constructor(key: Buffer | string, cert: Buffer | string, defaults?: any); } interface Client extends events.EventEmitter { diff --git a/soap/soap-tests.ts b/soap/soap-tests.ts index c0d902a642..48b2e2317e 100644 --- a/soap/soap-tests.ts +++ b/soap/soap-tests.ts @@ -11,7 +11,9 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { let securityOptions = { hasTimeStamp: false }; client.setSecurity(new soap.WSSecurity('user', 'password', securityOptions)); let defaults = {rejectUnauthorized: false}; - client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca',defaults)); + client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca', defaults)); + client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', defaults)); + client.setSecurity(new soap.ClientSSLSecurity('/path/to/key', '/path/to/cert', '/path/to/ca')); client.addSoapHeader({}); client.setEndpoint('http://localhost'); client['create']({ name: 'value' }, function(err, result) { From 1a87b929f05b797b41bb631369c2449b224a3176 Mon Sep 17 00:00:00 2001 From: Mizunashi Mana Date: Wed, 28 Dec 2016 08:05:52 +0900 Subject: [PATCH 096/101] Fix rx type definitions (#13268) --- rx/index.d.ts | 22 +++----- rx/rx-lite.d.ts | 84 +++++++++++++--------------- rx/{rx-lite-tests.ts => rx-tests.ts} | 44 +++++++++++++++ rx/rx.all.d.ts | 3 +- rx/rx.async-lite.d.ts | 8 +-- rx/rx.async-tests.ts | 2 - rx/rx.backpressure-lite.d.ts | 2 - rx/rx.backpressure-tests.ts | 2 +- rx/rx.binding-lite.d.ts | 2 - rx/rx.coincidence-lite.d.ts | 2 - rx/rx.time-lite.d.ts | 2 - rx/tsconfig.json | 4 +- rx/tslint.json | 12 ++++ 13 files changed, 111 insertions(+), 78 deletions(-) rename rx/{rx-lite-tests.ts => rx-tests.ts} (50%) create mode 100644 rx/tslint.json diff --git a/rx/index.d.ts b/rx/index.d.ts index c58295ca60..a3540fbd02 100644 --- a/rx/index.d.ts +++ b/rx/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for RxJS v2.5.3 +// Type definitions for RxJS 4.1 // Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov +// Definitions by: gsino , Igor Oleinikov , Mizunashi Mana // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -29,10 +29,8 @@ declare namespace Rx { observeOn(scheduler: IScheduler): Observable; subscribeOn(scheduler: IScheduler): Observable; - amb(rightSource: Observable): Observable; - amb(rightSource: IPromise): Observable; - onErrorResumeNext(second: Observable): Observable; - onErrorResumeNext(second: IPromise): Observable; + amb(rightSource: IPromise | Observable): Observable; + onErrorResumeNext(second: IPromise | Observable): Observable; bufferWithCount(count: number, skip?: number): Observable; windowWithCount(count: number, skip?: number): Observable>; defaultIfEmpty(defaultValue?: T): Observable; @@ -46,14 +44,12 @@ declare namespace Rx { interface ObservableStatic { using(resourceFactory: () => TResource, observableFactory: (resource: TResource) => Observable): Observable; - amb(...sources: Observable[]): Observable; amb(...sources: IPromise[]): Observable; - amb(sources: Observable[]): Observable; - amb(sources: IPromise[]): Observable; - onErrorResumeNext(...sources: Observable[]): Observable; + amb(...sources: Observable[]): Observable; + amb(sources: IPromise[] | Observable[]): Observable; onErrorResumeNext(...sources: IPromise[]): Observable; - onErrorResumeNext(sources: Observable[]): Observable; - onErrorResumeNext(sources: IPromise[]): Observable; + onErrorResumeNext(...sources: Observable[]): Observable; + onErrorResumeNext(sources: IPromise[] | Observable[]): Observable; } interface GroupedObservable extends Observable { @@ -63,5 +59,5 @@ declare namespace Rx { } declare module "rx" { - export = Rx + export = Rx; } diff --git a/rx/rx-lite.d.ts b/rx/rx-lite.d.ts index a9b481e392..7db2ed6bc8 100644 --- a/rx/rx-lite.d.ts +++ b/rx/rx-lite.d.ts @@ -1,10 +1,8 @@ -// DefinitelyTyped: partial - // This file contains common part of defintions for rx.d.ts and rx.lite.d.ts // Do not include the file separately. declare namespace Rx { - export module internals { + export namespace internals { function isEqual(left: any, right: any): boolean; function addRef(xs: Observable, r: { getDisposable(): IDisposable; }): Observable; @@ -43,11 +41,11 @@ declare namespace Rx { } } - export module config { + export namespace config { export var Promise: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }; } - export module helpers { + export namespace helpers { function noop(): void; function notDefined(value: any): boolean; function identity(value: T): T; @@ -116,21 +114,21 @@ declare namespace Rx { export interface IScheduler { now(): number; - isScheduler(value: any): boolean; + isScheduler(value: any): boolean; schedule(action: () => void): IDisposable; scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; - scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; + scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; scheduleWithRelative(dueTime: number, action: () => void): IDisposable; - scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; + scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleRecursive(action: (action: () =>void ) =>void ): IDisposable; - scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) =>void ) =>void ): IDisposable; + scheduleRecursive(action: (action: () => void) => void): IDisposable; + scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) => void) => void): IDisposable; scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): IDisposable; - scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) =>void ) =>void ): IDisposable; + scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; + scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; schedulePeriodic(period: number, action: () => void): IDisposable; schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; @@ -219,11 +217,9 @@ declare namespace Rx { forEach(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; // alias for subscribe toArray(): Observable; - catch(handler: (exception: any) => Observable): Observable; - catchException(handler: (exception: any) => Observable): Observable; // alias for catch - catch(handler: (exception: any) => IPromise): Observable; - catchException(handler: (exception: any) => IPromise): Observable; // alias for catch + catch(handler: (exception: Error) => IPromise | Observable): Observable; catch(second: Observable): Observable; + catchException(handler: (exception: Error) => IPromise | Observable): Observable; // alias for catch catchException(second: Observable): Observable; // alias for catch combineLatest(second: Observable|IPromise): Observable<[T, T2]>; combineLatest(second: Observable|IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; @@ -280,11 +276,11 @@ declare namespace Rx { distinctUntilChanged(skipParameter: boolean, comparer: (x: T, y: T) => boolean): Observable; distinctUntilChanged(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) => boolean): Observable; do(observer: Observer): Observable; + do(onNext?: (value: T) => void, onError?: (exception: Error) => void, onCompleted?: () => void): Observable; doAction(observer: Observer): Observable; // alias for do + doAction(onNext?: (value: T) => void, onError?: (exception: Error) => void, onCompleted?: () => void): Observable; // alias for do tap(observer: Observer): Observable; // alias for do - do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; - doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do - tap(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do + tap(onNext?: (value: T) => void, onError?: (exception: Error) => void, onCompleted?: () => void): Observable; // alias for do doOnNext(onNext: (value: T) => void, thisArg?: any): Observable; doOnError(onError: (exception: any) => void, thisArg?: any): Observable; @@ -442,6 +438,12 @@ declare namespace Rx { * @returns {An exclusive observable with only the results that happen when subscribed. */ exclusiveMap(selector: (value: I, index: number, source: Observable) => R, thisArg?: any): Observable; + + publish(): ConnectableObservable; + } + + interface ConnectableObservable extends Observable { + connect(): Disposable; } interface ObservableStatic { @@ -477,7 +479,7 @@ declare namespace Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(array: { length: number;[index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; + from(array: { length: number; [index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; /** * This method creates a new Observable sequence from an array-like object. * @param array An array-like or iterable object to convert to an Observable sequence. @@ -485,7 +487,7 @@ declare namespace Rx { * @param [thisArg] The context to use calling the mapFn if provided. * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. */ - from(array: { length: number;[index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; + from(array: { length: number; [index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; /** * This method creates a new Observable sequence from an array-like or iterable object. @@ -497,7 +499,7 @@ declare namespace Rx { from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; fromArray(array: T[], scheduler?: IScheduler): Observable; - fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; + fromArray(array: { length: number; [index: number]: T; }, scheduler?: IScheduler): Observable; generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable; never(): Observable; @@ -530,22 +532,16 @@ declare namespace Rx { just(value: T, scheduler?: IScheduler): Observable; // alias for return returnValue(value: T, scheduler?: IScheduler): Observable; // alias for return throw(exception: Error, scheduler?: IScheduler): Observable; - throw(exception: any, scheduler?: IScheduler): Observable; throwException(exception: Error, scheduler?: IScheduler): Observable; // alias for throw - throwException(exception: any, scheduler?: IScheduler): Observable; // alias for throw throwError(error: Error, scheduler?: IScheduler): Observable; // alias for throw - throwError(error: any, scheduler?: IScheduler): Observable; // alias for throw - catch(sources: Observable[]): Observable; - catch(sources: IPromise[]): Observable; - catchException(sources: Observable[]): Observable; // alias for catch - catchException(sources: IPromise[]): Observable; // alias for catch - catchError(sources: Observable[]): Observable; // alias for catch - catchError(sources: IPromise[]): Observable; // alias for catch + catch(sources: IPromise[] | Observable[]): Observable; catch(...sources: Observable[]): Observable; catch(...sources: IPromise[]): Observable; + catchException(sources: IPromise[] | Observable[]): Observable; // alias for catch catchException(...sources: Observable[]): Observable; // alias for catch catchException(...sources: IPromise[]): Observable; // alias for catch + catchError(sources: IPromise[] | Observable[]): Observable; // alias for catch catchError(...sources: Observable[]): Observable; // alias for catch catchError(...sources: IPromise[]): Observable; // alias for catch @@ -560,40 +556,36 @@ declare namespace Rx { combineLatest(sources: (Observable|IPromise)[]): Observable; combineLatest(sources: (Observable|IPromise)[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(first: Observable|IPromise, second: Observable|IPromise): Observable<[T, T2]>; + withLatestFrom(first: Observable|IPromise, second: Observable|IPromise): Observable<[T, T2]>; withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise): Observable<[T, T2, T3]>; + withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise): Observable<[T, T2, T3]>; withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, fourth: Observable|IPromise): Observable<[T, T2, T3, T4]>; + withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, fourth: Observable|IPromise): Observable<[T, T2, T3, T4]>; withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, fourth: Observable|IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, fourth: Observable|IPromise, fifth: Observable|IPromise): Observable<[T, T2, T3, T4, T5]>; + withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, fourth: Observable|IPromise, fifth: Observable|IPromise): Observable<[T, T2, T3, T4, T5]>; withLatestFrom(first: Observable|IPromise, second: Observable|IPromise, third: Observable|IPromise, fourth: Observable|IPromise, fifth: Observable|IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; withLatestFrom(souces: (Observable|IPromise)[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; concat(...sources: Observable[]): Observable; concat(...sources: IPromise[]): Observable; - concat(sources: Observable[]): Observable; - concat(sources: IPromise[]): Observable; + concat(sources: IPromise[] | Observable[]): Observable; merge(...sources: Observable[]): Observable; merge(...sources: IPromise[]): Observable; - merge(sources: Observable[]): Observable; - merge(sources: IPromise[]): Observable; + merge(sources: IPromise[] | Observable[]): Observable; merge(scheduler: IScheduler, ...sources: Observable[]): Observable; merge(scheduler: IScheduler, ...sources: IPromise[]): Observable; - merge(scheduler: IScheduler, sources: Observable[]): Observable; - merge(scheduler: IScheduler, sources: IPromise[]): Observable; + merge(scheduler: IScheduler, sources: IPromise[] | Observable[]): Observable; pairs(obj: { [key: string]: T }, scheduler?: IScheduler): Observable<[string, T]>; - zip(first: Observable|IPromise, sources: (Observable|IPromise)[]): Observable<[T1, T2]>; + zip(first: Observable | IPromise, sources: Observable | IPromise | (Observable | IPromise)[]): Observable<[T1, T2]>; zip(first: Observable|IPromise, sources: (Observable|IPromise)[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(source1: Observable|IPromise, source2: Observable|IPromise): Observable<[T1, T2]>; zip(source1: Observable|IPromise, source2: Observable|IPromise, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise): Observable<[T1, T2, T3]>; + zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise): Observable<[T1, T2, T3]>; zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, source4: Observable|IPromise): Observable<[T1, T2, T3, T4]>; + zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, source4: Observable|IPromise): Observable<[T1, T2, T3, T4]>; zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, source4: Observable|IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, source4: Observable|IPromise, source5: Observable|IPromise): Observable<[T1, T2, T3, T4, T5]>; + zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, source4: Observable|IPromise, source5: Observable|IPromise): Observable<[T1, T2, T3, T4, T5]>; zip(source1: Observable|IPromise, source2: Observable|IPromise, source3: Observable|IPromise, source4: Observable|IPromise, source5: Observable|IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable; zipArray(...sources: (Observable|IPromise)[]): Observable; zipArray(sources: (Observable|IPromise)[]): Observable; diff --git a/rx/rx-lite-tests.ts b/rx/rx-tests.ts similarity index 50% rename from rx/rx-lite-tests.ts rename to rx/rx-tests.ts index fcd1990321..26b616a254 100644 --- a/rx/rx-lite-tests.ts +++ b/rx/rx-tests.ts @@ -1,3 +1,4 @@ +import * as Rx from 'rx'; function test_scan() { @@ -9,7 +10,9 @@ function test_scan() { const source2: Rx.Observable = Rx.Observable.range(1, 3) .scan((acc, x, i, source) => acc + x, '...'); +} +function test_concatAll() { /* concatAll Example */ var source = Rx.Observable.range(0, 3) .map(function (x) { return Rx.Observable.range(x, 3); }) @@ -25,7 +28,9 @@ function test_scan() { function () { console.log('Completed'); }); +} +function test_mergeAll() { /* mergeAll example */ var source = Rx.Observable.range(0, 3) .map(function (x) { return Rx.Observable.range(x, 3); }) @@ -44,3 +49,42 @@ function test_scan() { } +// from https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/publish.md +function test_publish() { + var interval = Rx.Observable.interval(1000); + + var source = interval + .take(2) + .doAction(function (x) { + console.log('Side effect'); + }); + + var published = source.publish(); + + published.subscribe(createObserver('SourceA')); + published.subscribe(createObserver('SourceB')); + + var connection = published.connect(); + + function createObserver(tag: string) { + return Rx.Observer.create( + function (x) { + console.log('Next: ' + tag + x); + }, + function (err) { + console.log('Error: ' + err); + }, + function () { + console.log('Completed'); + }); + } + + // => Side effect + // => Next: SourceA0 + // => Next: SourceB0 + // => Side effect + // => Next: SourceA1 + // => Next: SourceB1 + // => Completed + // => Completed +} diff --git a/rx/rx.all.d.ts b/rx/rx.all.d.ts index 404b364fd0..b10d74053b 100644 --- a/rx/rx.all.d.ts +++ b/rx/rx.all.d.ts @@ -14,7 +14,6 @@ /// /// - declare module "rx.all" { export = Rx; -} \ No newline at end of file +} diff --git a/rx/rx.async-lite.d.ts b/rx/rx.async-lite.d.ts index 2dade9b82d..eb92134341 100644 --- a/rx/rx.async-lite.d.ts +++ b/rx/rx.async-lite.d.ts @@ -1,12 +1,12 @@ -// DefinitelyTyped: partial - // This file contains common part of defintions for rx.async.d.ts and rx.lite.d.ts // Do not include the file separately. +/* tslint:disable:forbidden-types */ + /// declare namespace Rx { - export module config { + export namespace config { /** * Configuration option to determine whether to use native events only */ @@ -68,6 +68,6 @@ declare namespace Rx { fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; fromEvent(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable; fromEvent(element: {on: (name: string, cb: (e: any) => any) => void; off: (name: string, cb: (e: any) => any) => void}, eventName: string, selector?: (arguments: any[]) => T): Observable; - fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable; + fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[]) => T): Observable; } } diff --git a/rx/rx.async-tests.ts b/rx/rx.async-tests.ts index df5270c062..0a3ee573fc 100644 --- a/rx/rx.async-tests.ts +++ b/rx/rx.async-tests.ts @@ -1,8 +1,6 @@ // Tests for RxJS-Async TypeScript definitions // Tests by Igor Oleinikov - - namespace Rx.Tests.Async { var obsNum: Rx.Observable; diff --git a/rx/rx.backpressure-lite.d.ts b/rx/rx.backpressure-lite.d.ts index a2aa813835..40563ba134 100644 --- a/rx/rx.backpressure-lite.d.ts +++ b/rx/rx.backpressure-lite.d.ts @@ -1,5 +1,3 @@ -// DefinitelyTyped: partial - // This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx/rx.backpressure-tests.ts b/rx/rx.backpressure-tests.ts index 5679428cd8..7db4aed25f 100644 --- a/rx/rx.backpressure-tests.ts +++ b/rx/rx.backpressure-tests.ts @@ -1,4 +1,4 @@ -// Tests for RxJS-BackPressure TypeScript definitions +// Tests for RxJS-BackPressure TypeScript definitions // Tests by Igor Oleinikov /// diff --git a/rx/rx.binding-lite.d.ts b/rx/rx.binding-lite.d.ts index 58575d796f..a877e56ad3 100644 --- a/rx/rx.binding-lite.d.ts +++ b/rx/rx.binding-lite.d.ts @@ -1,5 +1,3 @@ -// DefinitelyTyped: partial - // This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx/rx.coincidence-lite.d.ts b/rx/rx.coincidence-lite.d.ts index f754f1b38f..824b561829 100644 --- a/rx/rx.coincidence-lite.d.ts +++ b/rx/rx.coincidence-lite.d.ts @@ -1,5 +1,3 @@ -// DefinitelyTyped: partial - // This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx/rx.time-lite.d.ts b/rx/rx.time-lite.d.ts index ebc5f07484..07ff338942 100644 --- a/rx/rx.time-lite.d.ts +++ b/rx/rx.time-lite.d.ts @@ -1,5 +1,3 @@ -// DefinitelyTyped: partial - // This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts // Do not include the file separately. diff --git a/rx/tsconfig.json b/rx/tsconfig.json index 1740f39792..fec24d0bb9 100644 --- a/rx/tsconfig.json +++ b/rx/tsconfig.json @@ -14,7 +14,7 @@ }, "files": [ "index.d.ts", - "rx-lite-tests.ts", + "rx-tests.ts", "rx-lite.d.ts", "rx.aggregates.d.ts", "rx.all.d.ts", @@ -36,4 +36,4 @@ "rx.time.d.ts", "rx.virtualtime.d.ts" ] -} \ No newline at end of file +} diff --git a/rx/tslint.json b/rx/tslint.json new file mode 100644 index 0000000000..b4ab104e28 --- /dev/null +++ b/rx/tslint.json @@ -0,0 +1,12 @@ +{ + "extends": "../tslint.json", + "rules": { + "array-type": [ + false + ], + "dt-header": false, + "no-empty-interface": false, + "unified-signatures": false, + "no-single-declare-module": false + } +} From c3eef69e2efb3b51e94f2e84ca6938ec5b1a3d9d Mon Sep 17 00:00:00 2001 From: Carson Full Date: Tue, 27 Dec 2016 17:12:06 -0600 Subject: [PATCH 097/101] Redux Form v6 (#13214) * [Redux Form] Rename current definitions to 4.0 * Added start of redux-form v6 definition * Defined arrayMove parameter types * Unexported action creators that are not exported * Form props/methods don't need to be optional * Updated decorator to infer the component generic type * Fix reducer definition. State should always be the FormStateMap type not a generic. Returned is the state AND object with plugin method (not or). * Removed namespace. I think this will make it easier to extend functionality....just follow redux's lead really. * Split meta, input, and custom props from RC4 change. Renamed MyFieldProps to FieldCustomProps to match documented wording. * Fix onDragStart, onDrop, onFocus * Update SubmitHandler doc to give more info and reference SubmissionError * Added Selectors * Replace Form's fieldList with registeredFields * Split FieldArray's meta props out from rc4 change * Add submitSucceeded prop and setSubmitSucceeded action (#1428) * Added parse() and format() to Field * Removed value type from onBlur and onChange parameter (40c0d7e) * Revert handleSubmit change so TS sees both definitions as methods. * Nothing to see here... * Added props parameter to config's validate * Added array functions to FormProps * Removed unexported action creators * Overloaded reduxForm() to make generics optional. * Refactor Generic* interfaces from Field and FieldArray. These will have the generics, and the classes will have those generics set to any :( * Added some tests for definition. * Added pure option to config * Split definition into multiple files * [tsconfig] no implicit returns or this. enabled strict null checks and decorators. * Fix event handlers needing a element generic with any for now. * Added Fields * Updated definition for all changes up to v6.1.1. * Missed errors prop on SubmissionError * Updated definition for all changes up to v6.2.1. * Added header * Added validate and warn props https://github.com/erikras/redux-form/pull/2245 * Added clearAsyncError https://github.com/erikras/redux-form/pull/2213 * Added FieldArray get & getAll https://github.com/erikras/redux-form/pull/2247 * Updated version to 6.3.1 * Added react reference dependency * Fix initialize action. Thanks @csillag * Changed Normalizer, Formatter, Parser, Validator to types and exported them * Added original author of v4 definitions --- redux-form/index.d.ts | 486 ++---------------------- redux-form/lib/Field.d.ts | 313 ++++++++++++++++ redux-form/lib/FieldArray.d.ts | 214 +++++++++++ redux-form/lib/Fields.d.ts | 112 ++++++ redux-form/lib/FormSection.d.ts | 17 + redux-form/lib/actions.d.ts | 144 ++++++++ redux-form/lib/reducer.d.ts | 49 +++ redux-form/lib/reduxForm.d.ts | 551 ++++++++++++++++++++++++++++ redux-form/lib/selectors.d.ts | 74 ++++ redux-form/redux-form-4.0-tests.tsx | 331 +++++++++++++++++ redux-form/redux-form-4.0.d.ts | 476 ++++++++++++++++++++++++ redux-form/redux-form-tests.tsx | 345 ++--------------- redux-form/tsconfig.json | 7 +- 13 files changed, 2343 insertions(+), 776 deletions(-) create mode 100644 redux-form/lib/Field.d.ts create mode 100644 redux-form/lib/FieldArray.d.ts create mode 100644 redux-form/lib/Fields.d.ts create mode 100644 redux-form/lib/FormSection.d.ts create mode 100644 redux-form/lib/actions.d.ts create mode 100644 redux-form/lib/reducer.d.ts create mode 100644 redux-form/lib/reduxForm.d.ts create mode 100644 redux-form/lib/selectors.d.ts create mode 100644 redux-form/redux-form-4.0-tests.tsx create mode 100644 redux-form/redux-form-4.0.d.ts diff --git a/redux-form/index.d.ts b/redux-form/index.d.ts index 77a3004710..4c73f3e489 100644 --- a/redux-form/index.d.ts +++ b/redux-form/index.d.ts @@ -1,476 +1,38 @@ -// Type definitions for redux-form v4.0.3 +// Type definitions for redux-form v6.3.1 // Project: https://github.com/erikras/redux-form -// Definitions by: Daniel Lytkin +// Definitions by: Carson Full , Daniel Lytkin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as React from 'react'; -import { Component, SyntheticEvent, FormEventHandler } from 'react'; -import { Dispatch, ActionCreator, Reducer } from 'redux'; +/// -export const actionTypes: {[actionName:string]: string}; +import { + ComponentClass, + StatelessComponent, +} from 'react'; export type FieldValue = any; -export type FormData = { [fieldName: string]: FieldValue }; +export type FieldType = 'Field' | 'FieldArray'; -export interface FieldProp { - /** - * true if this field currently has focus. It will only work if you are - * passing onFocus to your input element. - */ - active: boolean; +export type DataShape = {[fieldName:string]: FieldValue}; - /** - * An alias for value only when value is a boolean. Provided for - * convenience of destructuring the whole field object into the props of a - * form element. - */ - checked?: boolean; +export type FormErrors = FormData & { _error?: string }; - /** - * true if the field value has changed from its initialized value. - * Opposite of pristine. - */ - dirty: boolean; - - /** - * The error for this field if its value is not passing validation. Both - * synchronous and asynchronous validation errors will be reported here. - */ - error?: any; - - /** - * The value for this field as supplied in initialValues to the form. - */ - initialValue: FieldValue; - - /** - * true if the field value fails validation (has a validation error). - * Opposite of valid. - */ - invalid: boolean; - - /** - * The name of the field. It will be the same as the key in the fields - * Object, but useful if bundling up a field to send down to a specialized - * input component. - */ - name: string; - - /** - * A function to call when the form field loses focus. It expects to - * either receive the React SyntheticEvent or the current value of the - * field. - */ - onBlur(eventOrValue: SyntheticEvent | FieldValue): void; - - /** - * A function to call when the form field is changed. It expects to either - * receive the React SyntheticEvent or the new value of the field. - * @param eventOrValue - */ - onChange(eventOrValue: SyntheticEvent | FieldValue): void; - - /** - * A function to call when the form field receives a 'dragStart' event. - * Saves the field value in the event for giving the field it is dropped - * into. - */ - onDragStart(): void; - - /** - * A function to call when the form field receives a drop event. - */ - onDrop(): void; - - /** - * A function to call when the form field receives focus. - */ - onFocus(): void; - - /** - * An alias for onChange. Provided for convenience of destructuring the - * whole field object into the props of a form element. Added to provide - * out-of-the-box support for Belle components' onUpdate API. - */ - onUpdate(): void; - - /** - * true if the field value is the same as its initialized value. Opposite - * of dirty. - */ - pristine: boolean; - - /** - * true if the field has been touched. By default this will be set when - * the field is blurred. - */ - touched: boolean; - - /** - * true if the field value passes validation (has no validation errors). - * Opposite of invalid. - */ - valid: boolean; - - /** - * The value of this form field. It will be a boolean for checkboxes, and - * a string for all other input types. - */ - value: FieldValue; - - /** - * true if this field has ever had focus. It will only work if you are - * passing onFocus to your input element. - */ - visited: boolean; -} - -export interface ReduxFormProps { - /** - * The name of the currently active (with focus) field. - */ - active?: string; - - /** - * A function that may be called to initiate asynchronous validation if - * asynchronous validation is enabled. - */ - asyncValidate?: Function; - - /** - * true if the asynchronous validation function has been called but has not - * yet returned. - */ - asyncValidating?: boolean; - - /** - * Destroys the form state in the Redux store. By default, this will be - * called for you in componentWillUnmount(). - */ - destroyForm?(): void; - - /** - * true if the form data has changed from its initialized values. Opposite - * of pristine. - */ - dirty?: boolean; - - /** - * A generic error for the entire form given by the _error key in the - * result from the synchronous validation function, the asynchronous - * validation, or the rejected promise from onSubmit. - */ - error?: any; - - /** - * The form data, in the form { field1: , field2: }. The - * field objects are meant to be destructured into your input component as - * props, e.g. . Each field Object has - * the following properties: - */ - fields?: { [field: string]: FieldProp }; - - /** - * A function meant to be passed to
or to - *