📄 action.xsl
字号:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Template: Action.xsl
Displays Actions
-->
<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/StringTSpan.xsl"/>
<xsl:output media-type="image/svg+xml" method="xml" indent="yes"/>
<!-- Action -->
<xsl:template name="Action">
<xsl:param name="DiagramID" select="@xmi.id"/>
<xsl:param name="SemanticID" select="UML:GraphElement.semanticModel/UML:Uml1SemanticModelBridge/UML:Uml1SemanticModelBridge.element/*/@xmi.idref"/>
<!-- Main Action 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"/>
<desc><xsl:text>Action</xsl:text></desc>
<!-- Action text -->
<text stroke="none" baseline-shift="-100%">
<xsl:for-each select="UML:GraphElement.contained/UML:GraphNode">
<xsl:choose>
<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'Label'">
<!-- Action label -->
<tspan x="{UML:GraphElement.position/XMI.field[1]}" y="{UML:GraphElement.position/XMI.field[2]}">
<xsl:choose>
<xsl:when test="key('xmi.id', $SemanticID)/parent::UML:State.entry"><xsl:text>entry</xsl:text></xsl:when>
<xsl:when test="key('xmi.id', $SemanticID)/parent::UML:State.exit"><xsl:text>exit</xsl:text></xsl:when>
<xsl:when test="key('xmi.id', $SemanticID)/parent::UML:State.doActivity"><xsl:text>do</xsl:text></xsl:when>
</xsl:choose>
</tspan>
</xsl:when>
<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'EffectStart'">
<!-- Label / expression delimiter, '/' -->
<tspan x="{UML:GraphElement.position/XMI.field[1]}" y="{UML:GraphElement.position/XMI.field[2]}"><xsl:text>/</xsl:text></tspan>
</xsl:when>
<xsl:when test="UML:GraphElement.semanticModel/UML:SimpleSemanticModelElement/@typeInfo = 'Expression'">
<!-- Action expression -->
<xsl:call-template name="StringTSpan">
<xsl:with-param name="SemanticID" select="SemanticID"/>
<xsl:with-param name="String" select="key('xmi.id', $SemanticID)/UML:Action.script/UML:ActionExpression/@body"/>
<xsl:with-param name="x" select="UML:GraphElement.position/XMI.field[1]"/>
<xsl:with-param name="y" select="UML:GraphElement.position/XMI.field[2]"/>
</xsl:call-template>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</text>
</g>
</xsl:template>
</xsl:stylesheet>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -