<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
.KEYW {color: yellow;}
.COMM {color: #bbb; font-style: italic;}
.NUMB {color: #393;}
.STRN {color: #393;}
.REGX {color: #339;}
.NAME {color: white;}
.PUNC {color: #5ca29c;}
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
</style></head><body><pre><span class='line'> 1</span> <span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">global</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// BEGIN CLOSURE</span><span class="WHIT">
<span class='line'> 2</span>
<span class='line'> 3</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Joint</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">global.Joint</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="NAME">Element</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.dia.Element</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.point</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 6</span>
<span class='line'> 7</span> </span><span class="COMM">/**
<span class='line'> 8</span> * @name Joint.dia.uml
<span class='line'> 9</span> * @namespace Holds functionality related to UML diagrams.
<span class='line'> 10</span> */</span><span class="WHIT">
<span class='line'> 11</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">uml</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.dia.uml</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 12</span>
<span class='line'> 13</span> </span><span class="NAME">Joint.arrows.aggregation</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">size</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">path</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"M"</span><span class="PUNC">,</span><span class="STRN">"7"</span><span class="PUNC">,</span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="STRN">"L"</span><span class="PUNC">,</span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="STRN">"5"</span><span class="PUNC">,</span><span class="STRN">"L"</span><span class="PUNC">,</span><span class="STRN">"-7"</span><span class="PUNC">,</span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"L"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"0"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"-5"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"z"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">dx</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">dy</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">stroke</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"black"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="STRN">"stroke-width"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2.0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"black"</span><span class="WHIT">
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 25</span>
<span class='line'> 26</span> </span><span class="COMM">/**
<span class='line'> 27</span> * Predefined aggregation arrow for Class diagram.
<span class='line'> 28</span> * @name aggregationArrow
<span class='line'> 29</span> * @memberOf Joint.dia.uml
<span class='line'> 30</span> * @example c1.joint(c2, Joint.dia.uml.aggregationArrow);
<span class='line'> 31</span> */</span><span class="WHIT">
<span class='line'> 32</span> </span><span class="NAME">uml.aggregationArrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">endArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"aggregation"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="NAME">startArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">"stroke-dasharray"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="COMM">/**
<span class='line'> 38</span> * Predefined dependency arrow for Class diagram.
<span class='line'> 39</span> * @name dependencyArrow
<span class='line'> 40</span> * @memberOf Joint.dia.uml
<span class='line'> 41</span> * @example c1.joint(c2, Joint.dia.uml.dependencyArrow);
<span class='line'> 42</span> */</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="NAME">uml.dependencyArrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">endArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"basic"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">startArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">"stroke-dasharray"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="COMM">/**
<span class='line'> 49</span> * Predefined generalization arrow for Class diagram.
<span class='line'> 50</span> * @name generalizationArrow
<span class='line'> 51</span> * @memberOf Joint.dia.uml
<span class='line'> 52</span> * @example c1.joint(c2, Joint.dia.uml.generalizationArrow);
<span class='line'> 53</span> */</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="NAME">uml.generalizationArrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">endArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"basic"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"white"</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">startArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">"stroke-dasharray"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="COMM">/**
<span class='line'> 60</span> * Predefined arrow for StateChart.
<span class='line'> 61</span> * @name Joint.dia.uml.arrow
<span class='line'> 62</span> * @memberOf Joint.dia.uml
<span class='line'> 63</span> * @example s1.joint(s2, Joint.dia.uml.arrow);
<span class='line'> 64</span> */</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="NAME">uml.arrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">startArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">endArrow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">type</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"basic"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="STRN">"stroke-dasharray"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 70</span>
<span class='line'> 71</span> </span><span class="COMM">/**
<span class='line'> 72</span> * UML StateChart state.
<span class='line'> 73</span> * @name State.create
<span class='line'> 74</span> * @methodOf Joint.dia.uml
<span class='line'> 75</span> * @param {Object} properties
<span class='line'> 76</span> * @param {Object} properties.rect Bounding box of the State (e.g. {x: 50, y: 100, width: 100, height: 80}).
<span class='line'> 77</span> * @param {Number} [properties.radius] Radius of the corners of the state rectangle.
<span class='line'> 78</span> * @param {String} [properties.label] The name of the state.
<span class='line'> 79</span> * @param {Number} [properties.labelOffsetX] Offset in x-axis of the label from the state rectangle origin.
<span class='line'> 80</span> * @param {Number} [properties.labelOffsetY] Offset in y-axis of the label from the state rectangle origin.
<span class='line'> 81</span> * @param {Number} [properties.swimlaneOffsetY] Offset in y-axis of the swimlane shown after the state label.
<span class='line'> 82</span> * @param {Object} [properties.attrs] SVG attributes of the appearance of the state.
<span class='line'> 83</span> * @param {Object} [properties.actions] Actions of the state.
<span class='line'> 84</span> * @param {String} [properties.actions.entry] Entry action of the state.
<span class='line'> 85</span> * @param {String} [properties.actions.exit] Exit action of the state.
<span class='line'> 86</span> * @param {array} [properties.actions.inner] Actions of the state (e.g. ["Evt1", "Action1()", "Evt2", "Action2()"])
<span class='line'> 87</span> * @param {Number} [properties.actionsOffsetX] Offset in x-axis of the actions.
<span class='line'> 88</span> * @param {Number} [properties.actionsOffsetY] Offset in y-axis of the actions.
<span class='line'> 89</span> * @example
<span class='line'> 90</span> var s1 = Joint.dia.uml.State.create({
<span class='line'> 91</span> rect: {x: 120, y: 70, width: 100, height: 60},
<span class='line'> 92</span> label: "state 1",
<span class='line'> 93</span> attrs: {
<span class='line'> 94</span> fill: "90-#000-green:1-#fff"
<span class='line'> 95</span> },
<span class='line'> 96</span> actions: {
<span class='line'> 97</span> entry: "init()",
<span class='line'> 98</span> exit: "destroy()",
<span class='line'> 99</span> inner: ["Evt1", "foo()", "Evt2", "bar()"]
<span class='line'>100</span> }
<span class='line'>101</span> });
<span class='line'>102</span> */</span><span class="WHIT">
<span class='line'>103</span> </span><span class="NAME">uml.State</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Element.extend</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">object</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"State"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">module</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"uml"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">init</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">properties</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="COMM">// options</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.DeepSupplement</span><span class="PUNC">(</span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">radius</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">15</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'white'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">label</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">labelOffsetX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">20</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">labelOffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">swimlaneOffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">actions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">exit</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">inner</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">actionsOffsetX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">actionsOffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="COMM">// wrapper</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">this.setWrapper</span><span class="PUNC">(</span><span class="NAME">this.paper.rect</span><span class="PUNC">(</span><span class="NAME">p.rect.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.rect.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.rect.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.rect.height</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.radius</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.attrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="COMM">// inner</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getLabelElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getSwimlaneElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getActionsElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="NAME">getLabelElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.paper.text</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.label</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.labelAttrs</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">tbb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">t.translate</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">tbb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetX</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">tbb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">getSwimlaneElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.paper.path</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"M"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlaneOffsetY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"L"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bb.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlaneOffsetY</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">getActionsElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="COMM">// collect all actions</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p.actions.entry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"entry/ "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.actions.entry</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p.actions.exit</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">"exit/ "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.actions.exit</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.actions.inner.length</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.actions.inner</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/ "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.actions.inner</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">+</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="COMM">// trim</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.replace</span><span class="PUNC">(</span><span class="REGX">/^\s\s*/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/\s\s*$/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span>
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="COMM">// draw text with actions</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.paper.text</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.actionsOffsetX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlaneOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.actionsOffsetY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="NAME">tbb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="NAME">t.attr</span><span class="PUNC">(</span><span class="STRN">"text-anchor"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"start"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="NAME">t.translate</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tbb.height</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// tune the y position</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="NAME">zoom</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="NAME">this.wrapper.attr</span><span class="PUNC">(</span><span class="STRN">"r"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.properties.radius</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// set wrapper's radius back to its initial value (it deformates after scaling)</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="NAME">this.shadow</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.shadow.attr</span><span class="PUNC">(</span><span class="STRN">"r"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.properties.radius</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// update shadow as well if there is one </span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// label</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// swimlane</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// actions</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getLabelElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getSwimlaneElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getActionsElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>175</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>176</span>
<span class='line'>177</span>
<span class='line'>178</span> </span><span class="COMM">/**
<span class='line'>179</span> * UML StateChart start state.
<span class='line'>180</span> * @name StartState.create
<span class='line'>181</span> * @methodOf Joint.dia.uml
<span class='line'>182</span> * @param {Object} properties
<span class='line'>183</span> * @param {Object} properties.position Position of the start state (e.g. {x: 50, y: 100}).
<span class='line'>184</span> * @param {Number} [properties.radius] Radius of the circle of the start state.
<span class='line'>185</span> * @param {Object} [properties.attrs] SVG attributes of the appearance of the start state.
<span class='line'>186</span> * @example
<span class='line'>187</span> var s0 = Joint.dia.uml.StartState.create({
<span class='line'>188</span> position: {x: 120, y: 70},
<span class='line'>189</span> radius: 15,
<span class='line'>190</span> attrs: {
<span class='line'>191</span> stroke: "blue",
<span class='line'>192</span> fill: "yellow"
<span class='line'>193</span> }
<span class='line'>194</span> });
<span class='line'>195</span> */</span><span class="WHIT">
<span class='line'>196</span> </span><span class="NAME">uml.StartState</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Element.extend</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="NAME">object</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"StartState"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">module</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"uml"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">init</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">properties</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="COMM">// options</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.DeepSupplement</span><span class="PUNC">(</span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="NAME">position</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">point</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="NAME">radius</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'black'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="COMM">// wrapper</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">this.setWrapper</span><span class="PUNC">(</span><span class="NAME">this.paper.circle</span><span class="PUNC">(</span><span class="NAME">p.position.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.position.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.radius</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.attrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>209</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>210</span>
<span class='line'>211</span>
<span class='line'>212</span> </span><span class="COMM">/**
<span class='line'>213</span> * UML StateChart end state.
<span class='line'>214</span> * @name EndState.create
<span class='line'>215</span> * @methodOf Joint.dia.uml
<span class='line'>216</span> * @param {Object} properties
<span class='line'>217</span> * @param {Object} properties.position Position of the end state (e.g. {x: 50, y: 100}).
<span class='line'>218</span> * @param {Number} [properties.radius] Radius of the circle of the end state.
<span class='line'>219</span> * @param {Number} [properties.innerRadius] Radius of the inner circle of the end state.
<span class='line'>220</span> * @param {Object} [properties.attrs] SVG attributes of the appearance of the end state.
<span class='line'>221</span> * @param {Object} [properties.innerAttrs] SVG attributes of the appearance of the inner circle of the end state.
<span class='line'>222</span> * @example
<span class='line'>223</span> var s0 = Joint.dia.uml.EndState.create({
<span class='line'>224</span> position: {x: 120, y: 70},
<span class='line'>225</span> radius: 15,
<span class='line'>226</span> innerRadius: 8,
<span class='line'>227</span> attrs: {
<span class='line'>228</span> stroke: "blue",
<span class='line'>229</span> fill: "yellow"
<span class='line'>230</span> },
<span class='line'>231</span> innerAttrs: {
<span class='line'>232</span> fill: "red"
<span class='line'>233</span> }
<span class='line'>234</span> });
<span class='line'>235</span> */</span><span class="WHIT">
<span class='line'>236</span> </span><span class="NAME">uml.EndState</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Element.extend</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="NAME">object</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"EndState"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="NAME">module</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"uml"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="NAME">init</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">properties</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="COMM">// options</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.DeepSupplement</span><span class="PUNC">(</span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="NAME">position</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">point</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="NAME">radius</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT"> </span><span class="NAME">innerRadius</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">properties.radius</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">properties.radius</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'white'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="NAME">innerAttrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'black'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="COMM">// wrapper</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="NAME">this.setWrapper</span><span class="PUNC">(</span><span class="NAME">this.paper.circle</span><span class="PUNC">(</span><span class="NAME">p.position.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.position.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.radius</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.attrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="COMM">// inner</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.paper.circle</span><span class="PUNC">(</span><span class="NAME">p.position.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.position.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.innerRadius</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.innerAttrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT"> </span><span class="NAME">zoom</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">scale.apply</span><span class="PUNC">(</span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>256</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span>
<span class='line'>258</span>
<span class='line'>259</span> </span><span class="COMM">/**
<span class='line'>260</span> * UML StateChart class.
<span class='line'>261</span> * @name Class.create
<span class='line'>262</span> * @methodOf Joint.dia.uml
<span class='line'>263</span> * @param {Object} properties
<span class='line'>264</span> * @param {Object} properties.rect Bounding box of the Class (e.g. {x: 50, y: 100, width: 100, height: 80}).
<span class='line'>265</span> * @param {String} [properties.label] The name of the class.
<span class='line'>266</span> * @param {Number} [properties.labelOffsetX] Offset in x-axis of the label from the class rectangle origin.
<span class='line'>267</span> * @param {Number} [properties.labelOffsetY] Offset in y-axis of the label from the class rectangle origin.
<span class='line'>268</span> * @param {Number} [properties.swimlane1OffsetY] Offset in y-axis of the swimlane shown after the class label.
<span class='line'>269</span> * @param {Number} [properties.swimlane2OffsetY] Offset in y-axis of the swimlane shown after the class attributes.
<span class='line'>270</span> * @param {Object} [properties.attrs] SVG attributes of the appearance of the state.
<span class='line'>271</span> * @param {array} [properties.attributes] Attributes of the class.
<span class='line'>272</span> * @param {array} [properties.methods] Methods of the class.
<span class='line'>273</span> * @param {Number} [properties.attributesOffsetX] Offset in x-axis of the attributes.
<span class='line'>274</span> * @param {Number} [properties.attributesOffsetY] Offset in y-axis of the attributes.
<span class='line'>275</span> * @param {Number} [properties.methodsOffsetX] Offset in x-axis of the methods.
<span class='line'>276</span> * @param {Number} [properties.methodsOffsetY] Offset in y-axis of the methods.
<span class='line'>277</span> * @example
<span class='line'>278</span> var c1 = Joint.dia.uml.Class.create({
<span class='line'>279</span> rect: {x: 120, y: 70, width: 120, height: 80},
<span class='line'>280</span> label: "MyClass",
<span class='line'>281</span> attrs: {
<span class='line'>282</span> fill: "90-#000-yellow:1-#fff"
<span class='line'>283</span> },
<span class='line'>284</span> attributes: ["-position"],
<span class='line'>285</span> methods: ["+createIterator()"]
<span class='line'>286</span> });
<span class='line'>287</span> */</span><span class="WHIT">
<span class='line'>288</span> </span><span class="NAME">uml.Class</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Element.extend</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="NAME">object</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Class"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="NAME">module</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"uml"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT"> </span><span class="NAME">init</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">properties</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Joint.DeepSupplement</span><span class="PUNC">(</span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">properties</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">fill</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'white'</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">label</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="NAME">labelOffsetX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">20</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="NAME">labelOffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="NAME">swimlane1OffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="NAME">swimlane2OffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="NAME">attributes</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT"> </span><span class="NAME">attributesOffsetX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT"> </span><span class="NAME">attributesOffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT"> </span><span class="NAME">methods</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="NAME">methodsOffsetX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">methodsOffsetY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>306</span> </span><span class="WHIT"> </span><span class="COMM">// wrapper</span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT"> </span><span class="NAME">this.setWrapper</span><span class="PUNC">(</span><span class="NAME">this.paper.rect</span><span class="PUNC">(</span><span class="NAME">p.rect.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.rect.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.rect.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.rect.height</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.attrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT"> </span><span class="COMM">// inner</span><span class="WHIT">
<span class='line'>309</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getLabelElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getSwimlane1Element</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getAttributesElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getSwimlane2Element</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>313</span> </span><span class="WHIT"> </span><span class="NAME">this.addInner</span><span class="PUNC">(</span><span class="NAME">this.getMethodsElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">getLabelElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.paper.text</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p.label</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="NAME">p.labelAttrs</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">tbb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="NAME">t.translate</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">tbb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">tbb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="NAME">getSwimlane1Element</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.paper.path</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"M"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane1OffsetY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"L"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bb.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane1OffsetY</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="NAME">getSwimlane2Element</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>329</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT"> </span><span class="NAME">bbAtrrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// attributes</span><span class="WHIT">
<span class='line'>333</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.paper.path</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"M"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane1OffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bbAtrrs.height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane2OffsetY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"L"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bb.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane1OffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bbAtrrs.height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane2OffsetY</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">join</span><span class="PUNC">(</span><span class="STRN">" "</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT"> </span><span class="NAME">getAttributesElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.attributes.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>338</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.attributes</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>339</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT"> </span><span class="COMM">// trim</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.replace</span><span class="PUNC">(</span><span class="REGX">/^\s\s*/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/\s\s*$/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>342</span>
<span class='line'>343</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.paper.text</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.attributesOffsetX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane1OffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.attributesOffsetY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>346</span> </span><span class="WHIT"> </span><span class="NAME">tbb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT"> </span><span class="NAME">t.attr</span><span class="PUNC">(</span><span class="STRN">"text-anchor"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"start"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="NAME">t.translate</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tbb.height</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// tune the y-position</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="NAME">getMethodsElement</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.properties</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">len</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.methods.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">len</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.methods</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>356</span> </span><span class="WHIT"> </span><span class="COMM">// trim</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">str.replace</span><span class="PUNC">(</span><span class="REGX">/^\s\s*/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/\s\s*$/</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>358</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT"> </span><span class="NAME">bb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.wrapper.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT"> </span><span class="NAME">bbAtrrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// attributes</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.paper.text</span><span class="PUNC">(</span><span class="NAME">bb.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.methodsOffsetX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bb.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.labelOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane1OffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.attributesOffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bbAtrrs.height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.swimlane2OffsetY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">p.methodsOffsetY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">tbb</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t.getBBox</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT"> </span><span class="NAME">t.attr</span><span class="PUNC">(</span><span class="STRN">"text-anchor"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"start"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT"> </span><span class="NAME">t.translate</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tbb.height</span><span class="PUNC">/</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// tune the y-position</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="NAME">zoom</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// label</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// swimlane1</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// attributes</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// swimlane2</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">4</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// methods</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getLabelElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getSwimlane1Element</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getAttributesElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getSwimlane2Element</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT"> </span><span class="NAME">this.inner</span><span class="PUNC">[</span><span class="NUMB">4</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getMethodsElement</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>379</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>380</span>
<span class='line'>381</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// END CLOSURE</span></pre></body></html>