当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript DiagramNode.getName方法代码示例

本文整理汇总了TypeScript中core/editorCore/model/DiagramNode.DiagramNode.getName方法的典型用法代码示例。如果您正苦于以下问题:TypeScript DiagramNode.getName方法的具体用法?TypeScript DiagramNode.getName怎么用?TypeScript DiagramNode.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core/editorCore/model/DiagramNode.DiagramNode的用法示例。


在下文中一共展示了DiagramNode.getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: exportNodes

    protected exportNodes(graph: joint.dia.Graph, diagramParts: DiagramParts) {
        var nodes = [];

        for (var id in diagramParts.nodesMap) {
            var node: DiagramNode = diagramParts.nodesMap[id];
            var newNode = new TDefaultDiagramNode();
            newNode.logicalId = node.getLogicalId();
            newNode.graphicalId = node.getJointObject().id;
            newNode.type = node.getType();
            newNode.properties = this.exportProperties(node.getChangeableProperties());

            var nameProperty = new TProperty();
            nameProperty.name = "name";
            nameProperty.value = node.getName();
            nameProperty.type = "string";
            newNode.properties.push(nameProperty);

            var positionProperty = new TProperty();
            positionProperty.name = "position";
            positionProperty.value = "" + node.getX() + ", " + node.getY();
            positionProperty.type = "QPointF";
            newNode.properties.push(positionProperty);

            var sizeProperty = new TProperty();
            sizeProperty.name = "size";
            sizeProperty.value = node.getSize();
            sizeProperty.type = "string";
            newNode.properties.push(sizeProperty);

            nodes.push(newNode);
        }

        return nodes;
    }
开发者ID:qreal,项目名称:wmp,代码行数:34,代码来源:DiagramThriftExporter.ts

示例2: getEntities

    private getEntities(nodesMap: Map<String, DiagramNode>, linksMap: Map<String, Link>) {
        var nodes = [];
        for (var id in nodesMap) {
            var node: DiagramNode = nodesMap[id];
            if (node.getName() === "entity") {
                var newNode = new TNode();
                newNode.name = node.getChangeableProperties()['name'].value;
                newNode.image = GeneralConstants.APP_ROOT_PATH + "images/" + node.getChangeableProperties()['image'].value + ".svg";
                newNode.properties = this.getProperties(nodesMap, linksMap, node);

                nodes.push(newNode);
            }
        }
        return nodes;
    }
开发者ID:qreal,项目名称:wmp,代码行数:15,代码来源:PaletteExporter.ts

示例3: exportNodes

    protected exportNodes(nodesMap: Map<String, DiagramNode>, linksMap: Map<String, Link>) {
        var nodes = [];

        var initial: string;
        for (var i in nodesMap) {
            var target: boolean = false;
            var node: DiagramNode = nodesMap[i];
            for (var id in linksMap) {
                var link = linksMap[id];
                var jointObject = link.getJointObject();
                if (nodesMap[jointObject.get('target').id] === node) {
                    target = true;
                    break;
                }
            }
            if (target === false) {
                initial = i;
                break;
            }
        }

        var existNext: boolean = true;
        while (existNext) {
            existNext = false;
            var node: DiagramNode = nodesMap[initial];
            var newNode = new TNode();
            newNode.name = node.getName();
            newNode.properties = this.exportProperties(node.getChangeableProperties());
            for (var id in linksMap) {
                var link = linksMap[id];
                var jointObject = link.getJointObject();
                if (nodesMap[jointObject.get('source').id] === node) {
                    initial = jointObject.get('target').id;
                    existNext = true;
                }
            }
            nodes.push(newNode);
        }

        return nodes;
    }
开发者ID:qreal,项目名称:wmp,代码行数:41,代码来源:ModelExporter.ts

示例4: checkRangeNumberOfOutboundLinks

 public checkRangeNumberOfOutboundLinks(minNumber: number, maxNumber: number): void {
     if (this.outboundLinks.length < minNumber) {
         throw new Error("There must be at least " + minNumber + " links from " + this.node.getName());
     }
     if (this.outboundLinks.length > maxNumber) {
         throw new Error("There more than " + maxNumber + " links from " + this.node.getName());
     }
 }
开发者ID:qreal,项目名称:wmp,代码行数:8,代码来源:AbstractBlock.ts

示例5: checkExpectedNumberOfOutboundLinks

 public checkExpectedNumberOfOutboundLinks(expectedNumber: number): void {
     if (this.outboundLinks.length !== expectedNumber) {
         throw new Error("There must be exact " + expectedNumber + " links from " + this.node.getName());
     }
 }
开发者ID:qreal,项目名称:wmp,代码行数:5,代码来源:AbstractBlock.ts


注:本文中的core/editorCore/model/DiagramNode.DiagramNode.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。