📄 class.xsl
字号:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Template: Class.xsl
Displays classes
-->
<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="../ClassDiagrams/AttributeCompartment.xsl"/>
<xsl:import href="../ClassDiagrams/OperationCompartment.xsl"/>
<xsl:import href="../Common/CompartmentSeparator.xsl"/>
<xsl:output media-type="image/svg+xml" method="xml" indent="yes"/>
<!-- Class -->
<xsl:template name="Class">
<xsl:param name="DiagramID" select="@xmi.id"/>
<xsl:param name="SemanticID" select="UML:GraphElement.semanticModel/UML:Uml1SemanticModelBridge/UML:Uml1SemanticModelBridge.element/*/@xmi.idref"/>
<!-- Main Class 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:choose>
<xsl:when test="UML:GraphElement.semanticModel//UML:Interface"><xsl:text>Interface</xsl:text></xsl:when>
<xsl:when test="UML:GraphElement.semanticModel//UML:AssociationClassNode"><xsl:text>AssociationClass</xsl:text></xsl:when>
<xsl:when test="UML:GraphElement.semanticModel//UML:Actor"><xsl:text>Actor</xsl:text></xsl:when>
<xsl:when test="UML:GraphElement.semanticModel//UML:Class"><xsl:text>Class</xsl:text></xsl:when>
</xsl:choose>
</desc>
<!-- The outline shape, a Rectangle -->
<rect width="{UML:GraphNode.size/XMI.field[1]}" height="{UML:GraphNode.size/XMI.field[2]}">
<xsl:apply-templates select="." mode="FillStyle"/>
</rect>
<!-- Contained nodes -->
<xsl:for-each select="UML:GraphElement.contained/*">
<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 = 'CompartmentSeparator'">
<!-- Compartment separator -->
<xsl:call-template name="CompartmentSeparator"/>
</xsl:when>
<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'AttributeCompartment'">
<!-- Attribute compartment -->
<xsl:call-template name="AttributeCompartment">
<xsl:with-param name="SemanticID" select="$SemanticID"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'OperationCompartment'">
<!-- Operation compartment -->
<xsl:call-template name="OperationCompartment">
<xsl:with-param name="SemanticID" select="$SemanticID"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</g>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -