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


Python ArchiLib.outputXMLtoLog方法代码示例

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


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

示例1: DrawModels

# 需要导入模块: from al_lib.ArchiLib import ArchiLib [as 别名]
# 或者: from al_lib.ArchiLib.ArchiLib import outputXMLtoLog [as 别名]

#.........这里部分代码省略.........
        attrib[u"fillColor"] = u"#ffff00"
        attrib[u"archimateElement"] = AE_ID

        elm = etree.Element(tag, attrib, nsmap=NS_MAP)
        DMO.append(elm)
        DOE = self.al.findDiagramObject(attrib[ID])

        if len(DOE) == 1:
            DOE = DOE[0]
        else:
            logger.error(u"Diagram Object Not Found")
            raise LookupError(u"Ops")

        self.createBounds(DOE, Bounds)

        return DOE

    #
    # Create Bounds in DiagramObject
    # Example:
    #     <bounds
    #     x="162" y="175"
    #     width="120" height="55"
    # />
    def createBounds(self, DOE, attrib):

        tag = u"bounds"
        elm = etree.Element(tag, attrib, nsmap=NS_MAP)
        DOE.insert(0, elm)

    #
    # Create SourceConnections
    # Example:
    #     <sourceConnection
    #     xsi:type="archimate:Connection"
    #     id="592e8439"
    #     lineColor="#b1b1b1"
    #     source="4b59249d"
    #     target="c3fd7d30"
    #     relationship="27d1a38d"/>

    def createConnection(self, DOE1, DOE2, R_ID):

        tag = u"sourceConnection"
        attrib = dict()
        attrib[ARCHI_TYPE] = u"archimate:Connection"
        attrib[u"lineColor"] = u"#b1b1b1"
        attrib[ID] = self.al.getID()
        attrib[u"source"] = DOE1.get(ID)
        attrib[u"target"] = DOE2.get(ID)
        attrib[u"relationship"] = R_ID
        elm = etree.Element(tag, attrib, nsmap=NS_MAP)
        DOE1.insert(0, elm)
        SC_ID = attrib[ID]

        #
        # Aggregate target connectins
        # <child xsi:type="archimate:DiagramObject"
        #             id="52f55838"
        #             lineColor="#000000"
        #             textAlignment="2"
        #             targetConnections=""
        #             fillColor="#ffff00"
        #             archimateElement="c5369205">
        #        <bounds height="55"
        #  width="120" x="162" y="175"/>
        #      </child>

        attrib = DOE2.attrib

        if u"targetConnections" in attrib:
            attrib[u"targetConnections"] = attrib[u"targetConnections"] + " " + SC_ID
        else:
            attrib[u"targetConnections"] = " " + SC_ID

    #
    # Draw Model
    #
    def drawModel(self, elements):

        #
        # Diagram Model
        #
        DMO = self.createDiagramModel()

        for AE_ID, bnds in elements:
            #
            # DiagramObjects
            #
            self.createDiagramObject(DMO, AE_ID, bnds)

    def outputXMLtoFile(self, filename=u"DiagramModeling.archimate"):
        self.al.outputXMLtoFile(filename)

        ArchiLib.stopTimer(self.start_time)

    def outputXMLtoLog(self):
        self.al.outputXMLtoLog()

        ArchiLib.stopTimer(self.start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:104,代码来源:al_DrawModel.py


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