Source: 3rdparty/dvt/doc/diagramLayoutAPI/DvtDiagramLayoutContext.js

Oracle® JavaScript Extension Toolkit (JET)
1.1.2

E65298-01

// Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
/**
 * <p>Pluggable layout code must conform to the pluggable layout contract. The following steps outline a simple pluggable layout.</p>
 * <ol>
 * <li> Diagram calls layout engine with layout context.</li>
 * <li> Layout engine loops over nodes using getNodeCount and getNodeByIndex()</li>
 * <ul>
 *  <li> layout engine gets dimensions of node by calling getBounds()</li>
 *  <li> layout engine sets position on node by calling setPosition()</li>
 * </ul>
 * <li> Layout engine loops over links using getLinkCount and getLinkByIndex()</li>
 * <ul>
 *  <li> layout engine gets start and end nodes by calling getStartId()/getEndId() on a link object</li>
 *  <li> layout engine analyzes nodes position and dimensions by calling getPosition() and getBounds() on each node and finds connection points for the link start/end</li>
 *  <li> layout engine creates a link path by calling setPoints() on a link object</li>
 * </ul>
 * <li> Diagram applies node positions from layout context</li>
 * </ol>
 *
 * <p>The DvtDiagramLayoutContext interface defines the context for a layout call.</p>
 * @export
 * @interface DvtDiagramLayoutContext
 * @memberof oj
 */

/**
 * Get a node context by id.
 * @method getNodeById
 * @instance
 * @param {string} id id of node context to get
 * @return {oj.DvtDiagramLayoutContextNode}
 * @memberof oj.DvtDiagramLayoutContext 
 * @export
 */

/**
 * Get a node context by index.
 * @method getNodeByIndex
 * @instance 
 * @param {number} index index of node context to get
 * @return {oj.DvtDiagramLayoutContextNode}
 * @memberof oj.DvtDiagramLayoutContext 
 * @export
 */

/**
 * Get the number of nodes to layout.
 * @method getNodeCount
 * @instance  
 * @return {number}
 * @memberof oj.DvtDiagramLayoutContext 
 * @export
 */

/**
 * Get a link context by id.
 * @method getLinkById
 * @instance   
 * @param {string} id id of link context to get
 * @return {oj.DvtDiagramLayoutContextLink}
 * @memberof oj.DvtDiagramLayoutContext 
 * @export
 */

/**
 * Get a link context by index.
 * @method getLinkByIndex
 * @instance 
 * @param {number} index index of link context to get
 * @return {oj.DvtDiagramLayoutContextLink}
 * @memberof oj.DvtDiagramLayoutContext
 * @export
 */

/**
 * Get the number of links to layout.
 * @method getLinkCount
 * @instance 
 * @return {number}
 * @memberof oj.DvtDiagramLayoutContext 
 * @export
 */

/**
 * Get whether the reading direction for the locale is right-to-left.
 * @method isLocaleR2L
 * @instance 
 * @return {boolean}
 * @memberof oj.DvtDiagramLayoutContext  
 * @export
 */

/**
 * Get the size of the Diagram.
 * @method getComponentSize
 * @instance 
 * @property {number} x x-coordinate
 * @property {number} y y-coordinate
 * @property {number} w width
 * @property {number} h height
 * @return {Object} An object containing properties of the diagram size
 * @memberof oj.DvtDiagramLayoutContext  
 * @export
 */

/**
 * Set the viewport the component should use after the layout, in the layout's coordinate system.
 * @method setViewport
 * @instance 
 * @param {Object} viewport An object containing properties of the viewport that the component should use after the layout
 * @property {number} x x-coordinate
 * @property {number} y y-coordinate
 * @property {number} w width
 * @property {number} h height
 * @memberof oj.DvtDiagramLayoutContext
 * @export
 */

/**
 * Get the viewport the component should use after the layout, in the layout's coordinate system.
 * @method getViewport
 * @instance 
 * @return {Object} An object containing properties of the viewport
 * @property {number} x x-coordinate
 * @property {number} y y-coordinate
 * @property {number} w width
 * @property {number} h height
 * @memberof oj.DvtDiagramLayoutContext  
 * @export
 */

/**
 * Get the current viewport used by the component in the layout's coordinate system for the diagram
 * @method getCurrentViewport
 * @instance  
 * @return {Object} An object containing properties of the current viewport
 * @property {number} x x-coordinate
 * @property {number} y y-coordinate
 * @property {number} w width
 * @property {number} h height 
 * @memberof oj.DvtDiagramLayoutContext  
 * @export
 */