⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 componentinstance.xsl

📁 Copyright&copy 2004 Sergiu Dumitriu, Marta G&icirc rdea, C&#259 t&#259 lin Hri&#355 cu Permission is
💻 XSL
字号:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Template: ComponentInstance.xsl

Displays ComponentInstance
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/2000/svg" xmlns:UML="org.omg.xmi.namespace.UML">
	<xsl:import href="../Common/Styling.xsl"/>
	<xsl:import href="../Common/NameCompartment.xsl"/>
	<xsl:import href="../CollaborationDiagrams/Object.xsl"/>
	<xsl:import href="../Common/Lines.xsl"/>
	<xsl:output media-type="image/svg+xml" method="xml" indent="yes"/>

	<!-- ComponentInstance -->
	<xsl:template name="ComponentInstance">
		<xsl:param name="DiagramID" select="@xmi.id"/>
		<xsl:param name="SemanticID" select="UML:GraphElement.semanticModel/UML:Uml1SemanticModelBridge/UML:Uml1SemanticModelBridge.element/*/@xmi.idref"/>

		<!-- Main ComponentInstance group -->
		<g transform="translate({UML:GraphElement.position/XMI.field[1]}, {UML:GraphElement.position/XMI.field[2]})" id="{$DiagramID}">
			<xsl:apply-templates select="." mode="FontStyle"/>
			<xsl:apply-templates select="." mode="StrokeStyle"/>
			<xsl:apply-templates select="." mode="isVisible"/>

			<title><xsl:value-of select="key('xmi.id', $SemanticID)/@name"/></title>
			<desc><xsl:text>ComponentInstance</xsl:text></desc>

			<xsl:variable name="height" select="UML:GraphNode.size/XMI.field[2]"/>

			<!-- The outline shape, a Rectangle with two small handles -->
			<rect width="{UML:GraphNode.size/XMI.field[1]}" height="{$height}">
				<xsl:apply-templates select="." mode="FillStyle"/>
			</rect>
			<rect width="25" height="10" x="-12.5" y="{$height div 2 - 20}">
				<xsl:apply-templates select="." mode="FillStyle"/>
			</rect>
			<rect width="25" height="10" x="-12.5" y="{$height div 2 + 10}">
				<xsl:apply-templates select="." mode="FillStyle"/>
			</rect>

			<!-- Contained nodes -->
			<xsl:for-each select="UML:GraphElement.contained/UML:GraphNode">
				<xsl:choose>
					<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'NameCompartment'">
						<!-- Name compartment -->
						<xsl:call-template name="NameCompartment">
							<xsl:with-param name="SemanticID" select="$SemanticID"/>
						</xsl:call-template>
					</xsl:when>

					<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'BodyCompartment'">
						<!-- Contained nodes -->
						<g transform="translate({UML:GraphElement.position/XMI.field[1]}, {UML:GraphElement.position/XMI.field[2]})" id="{$DiagramID}">
							<xsl:apply-templates select="." mode="FontStyle"/>
							<xsl:apply-templates select="." mode="StrokeStyle"/>
							<xsl:apply-templates select="." mode="isVisible"/>
							<xsl:for-each select="UML:GraphElement.contained/*">
								<xsl:choose>
									<xsl:when test="UML:GraphElement.semanticModel/UML:Uml1SemanticModelBridge/UML:Uml1SemanticModelBridge.element/UML:Object">
										<xsl:call-template name="Object" />
									</xsl:when>

									<xsl:when test="UML:GraphElement.semanticModel/UML:Uml1SemanticModelBridge/UML:Uml1SemanticModelBridge.element/UML:Link">
										<xsl:call-template name="Link_Line"/>
									</xsl:when>
								</xsl:choose>
							</xsl:for-each>
						</g>
					</xsl:when>
				</xsl:choose>
			</xsl:for-each>
		</g>
	</xsl:template>
</xsl:stylesheet>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -