MINT-scxml 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +2 -2
- data/Gemfile.lock +12 -4
- data/History.txt +14 -0
- data/MINT-scxml.gemspec +26 -20
- data/Manifest.txt +2 -15
- data/README.rdoc +1 -1
- data/Rakefile +1 -7
- data/lib/MINT-scxml.rb +1 -1
- data/lib/MINT-scxml/scxml-parser.rb +213 -75
- data/spec/if_spec.rb +209 -0
- data/spec/parser_spec.rb +465 -208
- data/spec/spec_helper.rb +1 -1
- data/spec/test_handgestures_spec.rb +2 -1
- data/spec/testmachines/button.scxml +52 -0
- metadata +64 -78
- data/statemachines/aui-scxml/AIC.scxml +0 -26
- data/statemachines/aui-scxml/AICommand.scxml +0 -34
- data/statemachines/aui-scxml/AICommand2.scxml +0 -32
- data/statemachines/aui-scxml/AIO.scxml +0 -25
- data/statemachines/aui/AIC.rb +0 -29
- data/statemachines/aui/AIChoiceElement.rb +0 -32
- data/statemachines/aui/AICommand.rb +0 -34
- data/statemachines/aui/AIIN.rb +0 -7
- data/statemachines/aui/AIINContinous.rb +0 -41
- data/statemachines/aui/AIMultiChoice.rb +0 -46
- data/statemachines/aui/AIMultiChoiceElement.rb +0 -46
- data/statemachines/aui/AIOUTContinous.rb +0 -41
- data/statemachines/aui/AISingleChoice.rb +0 -42
- data/statemachines/aui/AISingleChoiceElement.rb +0 -45
- data/statemachines/aui/aio.rb +0 -28
data/spec/spec_helper.rb
CHANGED
@@ -27,7 +27,8 @@ describe 'state' do
|
|
27
27
|
before (:each) do
|
28
28
|
context = TestContext.new
|
29
29
|
parser = StatemachineParser.new(context)
|
30
|
-
@sm = parser.build_from_scxml "
|
30
|
+
@sm = parser.build_from_scxml File.dirname(__FILE__)+"/testmachines/handgestures-scxmlgui.scxml"
|
31
|
+
@sm.reset
|
31
32
|
end
|
32
33
|
|
33
34
|
it "should start with the correct initial state >no_hands<" do
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<scxml initial="initialized" name="Button" version="0.9" xmlns="http://www.w3.org/2005/07/scxml"><!-- node-size-and-position x=0.0 y=0.0 w=730.0 h=440.0 -->
|
2
|
+
<state id="initialized"><!-- node-size-and-position x=70.0 y=60.0 w=100.0 h=30.0 -->
|
3
|
+
<transition event="position" target="positioning"></transition>
|
4
|
+
</state>
|
5
|
+
<state id="positioning"><!-- node-size-and-position x=60.0 y=130.0 w=100.0 h=30.0 -->
|
6
|
+
<transition event="calculated" target="positioned"></transition>
|
7
|
+
</state>
|
8
|
+
<state id="positioned"><!-- node-size-and-position x=50.0 y=220.0 w=100.0 h=30.0 -->
|
9
|
+
<transition event="display" target="p"></transition>
|
10
|
+
</state>
|
11
|
+
<state id="hidden"><!-- node-size-and-position x=270.0 y=60.0 w=130.0 h=40.0 -->
|
12
|
+
<transition event="position" target="positioning"></transition>
|
13
|
+
</state>
|
14
|
+
<state id="disabled"><!-- node-size-and-position x=490.0 y=60.0 w=130.0 h=40.0 -->
|
15
|
+
<transition event="hide" target="hidden"></transition>
|
16
|
+
</state>
|
17
|
+
<parallel id="p"><!-- node-size-and-position x=170.0 y=150.0 w=510.0 h=270.0 -->
|
18
|
+
<transition event="disable" target="disabled"></transition>
|
19
|
+
<transition event="hide" target="hidden"></transition>
|
20
|
+
<state id="displaying" initial="init_js"><!-- node-size-and-position x=20.0 y=30.0 w=280.0 h=240.0 -->
|
21
|
+
<state id="displayed"><!-- node-size-and-position x=100.0 y=110.0 w=100.0 h=30.0 -->
|
22
|
+
<transition event="highlight" target="highlighted"><!-- edge-path [highlighted] x=90.0 y=170.0 pointx=0.0 pointy=18.0 offsetx=19.0 offsety=-14.0 --></transition>
|
23
|
+
</state>
|
24
|
+
<state id="highlighted"><!-- node-size-and-position x=100.0 y=200.0 w=100.0 h=30.0 -->
|
25
|
+
<transition event="unhighlight" target="displayed"><!-- edge-path [displayed] x=190.0 y=170.0 --></transition>
|
26
|
+
<transition event="up" target="displayed">
|
27
|
+
<invoke src="highlight_up" type="x-mint"></invoke>
|
28
|
+
<!-- edge-path [displayed] x=230.0 y=210.0 x=230.0 y=130.0 pointx=0.0 pointy=-10.0 offsetx=0.0 offsety=5.0 --></transition>
|
29
|
+
<transition event="down" target="displayed">
|
30
|
+
<invoke src="highlight_down" type="x-mint"></invoke>
|
31
|
+
<!-- edge-path [displayed] x=60.0 y=210.0 x=60.0 y=130.0 --></transition>
|
32
|
+
<transition event="left" target="displayed">
|
33
|
+
<invoke src="highlight_left" type="x-mint"></invoke>
|
34
|
+
<!-- edge-path [displayed] x=30.0 y=220.0 x=30.0 y=120.0 --></transition>
|
35
|
+
<transition event="right" target="displayed">
|
36
|
+
<invoke src="highlight_right" type="x-mint"></invoke>
|
37
|
+
<!-- edge-path [displayed] x=270.0 y=220.0 x=270.0 y=120.0 --></transition>
|
38
|
+
</state>
|
39
|
+
<state id="init_js"><!-- node-size-and-position x=90.0 y=50.0 w=100.0 h=30.0 -->
|
40
|
+
<transition target="displayed"></transition>
|
41
|
+
</state>
|
42
|
+
</state>
|
43
|
+
<state id="b" initial="released"><!-- node-size-and-position x=330.0 y=23.0 w=170.0 h=210.0 -->
|
44
|
+
<state id="pressed"><!-- node-size-and-position x=30.0 y=140.0 w=100.0 h=30.0 -->
|
45
|
+
<transition event="release" target="released"><!-- edge-path [released] x=120.0 y=100.0 pointx=0.0 pointy=-40.0 offsetx=0.0 offsety=5.0 --></transition>
|
46
|
+
</state>
|
47
|
+
<state id="released"><!-- node-size-and-position x=30.0 y=40.0 w=100.0 h=30.0 -->
|
48
|
+
<transition event="press" target="pressed"><!-- edge-path [pressed] x=40.0 y=100.0 --></transition>
|
49
|
+
</state>
|
50
|
+
</state>
|
51
|
+
</parallel>
|
52
|
+
</scxml>
|
metadata
CHANGED
@@ -1,63 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: MINT-scxml
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jessica H. Colnago, Sebastian Feuerstack
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-11-20 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: MINT-statemachine
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &73711550 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 2
|
32
|
-
- 3
|
33
|
-
version: 1.2.3
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.3.0
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: hoe
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: *73711550
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rdoc
|
27
|
+
requirement: &73710560 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.10'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *73710560
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: newgem
|
38
|
+
requirement: &73710050 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
|
-
requirements:
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.5.3
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *73710050
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: hoe
|
49
|
+
requirement: &73709310 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
42
52
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 9
|
48
|
-
version: "2.9"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.1'
|
49
55
|
type: :development
|
50
|
-
|
51
|
-
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *73709310
|
58
|
+
description: This gem implements a state chart XML (SCXML) parser that generates a
|
59
|
+
ruby statemachine.
|
52
60
|
email: Sebastian@Feuerstack.org
|
53
61
|
executables: []
|
54
|
-
|
55
62
|
extensions: []
|
56
|
-
|
57
|
-
extra_rdoc_files:
|
63
|
+
extra_rdoc_files:
|
58
64
|
- History.txt
|
59
65
|
- Manifest.txt
|
60
|
-
|
66
|
+
- README.rdoc
|
67
|
+
files:
|
61
68
|
- Gemfile
|
62
69
|
- Gemfile.lock
|
63
70
|
- History.txt
|
@@ -68,11 +75,13 @@ files:
|
|
68
75
|
- lib/MINT-scxml.rb
|
69
76
|
- lib/MINT-scxml/scxml-parser.rb
|
70
77
|
- spec/atm_spec.rb
|
78
|
+
- spec/if_spec.rb
|
71
79
|
- spec/parser_spec.rb
|
72
80
|
- spec/spec.opts
|
73
81
|
- spec/spec_helper.rb
|
74
82
|
- spec/test_handgestures_spec.rb
|
75
83
|
- spec/testmachines/atm_enhanced.rb
|
84
|
+
- spec/testmachines/button.scxml
|
76
85
|
- spec/testmachines/handgestures-scxmlgui.png
|
77
86
|
- spec/testmachines/handgestures-scxmlgui.scxml
|
78
87
|
- spec/testmachines/multiplestates.rb
|
@@ -84,21 +93,6 @@ files:
|
|
84
93
|
- spec_helper.rb
|
85
94
|
- statemachines/AICommand_scxml_spec.rb
|
86
95
|
- statemachines/AIO_scxml_spec.rb
|
87
|
-
- statemachines/aui-scxml/AIC.scxml
|
88
|
-
- statemachines/aui-scxml/AICommand.scxml
|
89
|
-
- statemachines/aui-scxml/AICommand2.scxml
|
90
|
-
- statemachines/aui-scxml/AIO.scxml
|
91
|
-
- statemachines/aui/AIC.rb
|
92
|
-
- statemachines/aui/AIChoiceElement.rb
|
93
|
-
- statemachines/aui/AICommand.rb
|
94
|
-
- statemachines/aui/AIIN.rb
|
95
|
-
- statemachines/aui/AIINContinous.rb
|
96
|
-
- statemachines/aui/AIMultiChoice.rb
|
97
|
-
- statemachines/aui/AIMultiChoiceElement.rb
|
98
|
-
- statemachines/aui/AIOUTContinous.rb
|
99
|
-
- statemachines/aui/AISingleChoice.rb
|
100
|
-
- statemachines/aui/AISingleChoiceElement.rb
|
101
|
-
- statemachines/aui/aio.rb
|
102
96
|
- statemachines/specs/AICommand_spec.rb
|
103
97
|
- statemachines/specs/AIINContinous_spec.rb
|
104
98
|
- statemachines/specs/AIMultiChoiceElement_spec.rb
|
@@ -110,37 +104,29 @@ files:
|
|
110
104
|
- .gemtest
|
111
105
|
homepage: http://www.multi-access.de
|
112
106
|
licenses: []
|
113
|
-
|
114
107
|
post_install_message:
|
115
|
-
rdoc_options:
|
108
|
+
rdoc_options:
|
116
109
|
- --main
|
117
110
|
- README.rdoc
|
118
|
-
require_paths:
|
111
|
+
require_paths:
|
119
112
|
- lib
|
120
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
114
|
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
|
127
|
-
- 0
|
128
|
-
version: "0"
|
129
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
120
|
none: false
|
131
|
-
requirements:
|
132
|
-
- -
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
|
135
|
-
segments:
|
136
|
-
- 0
|
137
|
-
version: "0"
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
138
125
|
requirements: []
|
139
|
-
|
140
126
|
rubyforge_project: MINT-scxml
|
141
|
-
rubygems_version: 1.8.
|
127
|
+
rubygems_version: 1.8.15
|
142
128
|
signing_key:
|
143
129
|
specification_version: 3
|
144
|
-
summary: This gem implements a state chart XML (SCXML) parser that generates a ruby
|
130
|
+
summary: This gem implements a state chart XML (SCXML) parser that generates a ruby
|
131
|
+
statemachine.
|
145
132
|
test_files: []
|
146
|
-
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<scxml id="SCXML" xmlns="http://www.w3.org/2005/07/scxml">
|
2
|
-
<state id="AIC">
|
3
|
-
<state id="initialized">
|
4
|
-
<transition event="organize" target="organized"/>
|
5
|
-
</state>
|
6
|
-
<state id="organized">
|
7
|
-
<transition event="present" target="presenting"/>
|
8
|
-
</state>
|
9
|
-
<state id="suspended">
|
10
|
-
<transition event="organize" target="organized"/>
|
11
|
-
</state>
|
12
|
-
<state id="presenting">
|
13
|
-
<transition event="suspend" target="suspended"/>
|
14
|
-
<state id="defocused">
|
15
|
-
<transition event="focus" target="focused"/>
|
16
|
-
<transition event="next" target="focused"/>
|
17
|
-
<transition event="prev" target="focused"/>
|
18
|
-
<transition event="parent" target="focused"/>
|
19
|
-
<transition event="child" target="focused"/>
|
20
|
-
</state>
|
21
|
-
<state id="focused">
|
22
|
-
<transition event="defocus" target="defocused"/>
|
23
|
-
</state>
|
24
|
-
</state>
|
25
|
-
</state>
|
26
|
-
</scxml>
|
@@ -1,34 +0,0 @@
|
|
1
|
-
<scxml id="SCXML" xmlns="http://www.w3.org/2005/07/scxml">
|
2
|
-
<state id="AICommand">
|
3
|
-
<state id="initialized">
|
4
|
-
<transition event="organize" target="organized"/>
|
5
|
-
</state>
|
6
|
-
<state id="organized">
|
7
|
-
<transition event="present" target="presenting"/>
|
8
|
-
</state>
|
9
|
-
<state id="suspended">
|
10
|
-
<transition event="organize" target="organized"/>
|
11
|
-
</state>
|
12
|
-
<state id="presenting">
|
13
|
-
<transition event="suspend" target="suspended"/>
|
14
|
-
<state id="defocused">
|
15
|
-
<transition event="focus" target="focused"/>
|
16
|
-
<transition event="next" target="focused"/>
|
17
|
-
<transition event="prev" target="focused"/>
|
18
|
-
<transition event="parent" target="focused"/>
|
19
|
-
</state>
|
20
|
-
<state id="focused">
|
21
|
-
<transition event="defocus" target="defocused"/>
|
22
|
-
<state id="deactivated">
|
23
|
-
<transition event="activate" target="activated"/>
|
24
|
-
</state>
|
25
|
-
<state id="activated">
|
26
|
-
<transition event="deactivate" target="deactivated"/>
|
27
|
-
</state>
|
28
|
-
<history id="history" type="deep">
|
29
|
-
<transition target="deactivated"/>
|
30
|
-
</history>
|
31
|
-
</state>
|
32
|
-
</state>
|
33
|
-
</state>
|
34
|
-
</scxml>
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<scxml id="SCXML" xmlns="http://www.w3.org/2005/07/scxml"><!-- node-size-and-position x=0.0 y=0.0 w=299.19717193536917 h=692.0 -->
|
2
|
-
<state id="initialized"><!-- node-size-and-position x=118.75 y=43.0 w=70.0 h=20.0 -->
|
3
|
-
<transition event="organize" target="organized"></transition>
|
4
|
-
</state>
|
5
|
-
<state id="organized"><!-- node-size-and-position x=123.75 y=113.0 w=60.0 h=20.0 -->
|
6
|
-
<transition event="present" target="presenting"></transition>
|
7
|
-
</state>
|
8
|
-
<state id="presenting" initial="defocused"><!-- node-size-and-position x=20.0 y=183.0 w=161.5 h=356.0 -->
|
9
|
-
<transition event="suspend" target="suspended"></transition>
|
10
|
-
<state id="focused" initial="deactivated"><!-- node-size-and-position x=20.0 y=113.0 w=121.5 h=223.0 -->
|
11
|
-
<transition event="defocus" target="defocused"><!-- edge-path [defocused] x=78.78709972846912 y=98.06535407059803 --></transition>
|
12
|
-
<state id="deactivated"><!-- node-size-and-position x=29.0 y=113.0 w=70.0 h=20.0 -->
|
13
|
-
<transition event="activate" target="activated"><!-- edge-path [activated] x=70.0 y=158.0 pointx=0.0 pointy=19.0 offsetx=1.0 offsety=6.0 --></transition>
|
14
|
-
</state>
|
15
|
-
<state id="activated"><!-- node-size-and-position x=34.0 y=183.0 w=60.0 h=20.0 -->
|
16
|
-
<transition event="deactivate" target="deactivated"><!-- edge-path [deactivated] x=50.0 y=158.0 pointx=0.0 pointy=10.0 offsetx=-1.0 offsety=-1.0 --></transition>
|
17
|
-
</state>
|
18
|
-
<history id="history" type="deep"><!-- node-size-and-position x=39.0 y=43.0 w=50.0 h=20.0 -->
|
19
|
-
<transition target="deactivated"></transition>
|
20
|
-
</history>
|
21
|
-
</state>
|
22
|
-
<state id="defocused"><!-- node-size-and-position x=50.75 y=43.0 w=60.0 h=20.0 -->
|
23
|
-
<transition event="focus" target="focused"><!-- edge-path [focused] x=117.5 y=88.0 --></transition>
|
24
|
-
<transition event="next" target="focused"><!-- edge-path [focused] x=98.14354986423456 y=93.03267703529902 --></transition>
|
25
|
-
<transition event="prev" target="focused"><!-- edge-path [focused] x=136.85645013576544 y=82.96732296470098 --></transition>
|
26
|
-
<transition event="parent" target="focused"><!-- edge-path [focused] x=156.21290027153088 y=77.93464592940197 --></transition>
|
27
|
-
</state>
|
28
|
-
</state>
|
29
|
-
<state id="suspended"><!-- node-size-and-position x=125.75 y=589.0 w=60.0 h=20.0 -->
|
30
|
-
<transition event="organize" target="organized"><!-- edge-path [organized] x=211.75 y=361.0 --></transition>
|
31
|
-
</state>
|
32
|
-
</scxml>
|
@@ -1,25 +0,0 @@
|
|
1
|
-
<scxml id="SCXML" xmlns="http://www.w3.org/2005/07/scxml">
|
2
|
-
<state id="AIO">
|
3
|
-
<state id="initialized">
|
4
|
-
<transition event="organize" target="organized"/>
|
5
|
-
</state>
|
6
|
-
<state id="organized">
|
7
|
-
<transition event="present" target="presenting"/>
|
8
|
-
</state>
|
9
|
-
<state id="suspended">
|
10
|
-
<transition event="organize" target="organized"/>
|
11
|
-
</state>
|
12
|
-
<state id="presenting">
|
13
|
-
<transition event="suspend" target="suspended"/>
|
14
|
-
<state id="defocused">
|
15
|
-
<transition event="focus" target="focused"/>
|
16
|
-
<transition event="next" target="focused"/>
|
17
|
-
<transition event="prev" target="focused"/>
|
18
|
-
<transition event="parent" target="focused"/>
|
19
|
-
</state>
|
20
|
-
<state id="focused">
|
21
|
-
<transition event="defocus" target="defocused"/>
|
22
|
-
</state>
|
23
|
-
</state>
|
24
|
-
</state>
|
25
|
-
</scxml>
|
data/statemachines/aui/AIC.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'statemachine'
|
3
|
-
|
4
|
-
module MINT
|
5
|
-
class AIC < AIO
|
6
|
-
def initialize_statemachine
|
7
|
-
if @statemachine.blank?
|
8
|
-
@statemachine = Statemachine.build do
|
9
|
-
superstate :AIC do
|
10
|
-
trans :initialized, :organize, :organized
|
11
|
-
trans :organized, :present, :presenting
|
12
|
-
trans :suspended, :organize, :organized
|
13
|
-
|
14
|
-
superstate :presenting do
|
15
|
-
event :suspend, :suspended
|
16
|
-
|
17
|
-
trans :defocused, :focus, :focused
|
18
|
-
trans :defocused, :next, :focused, :focus_next
|
19
|
-
trans :defocused, :prev, :focused, :focus_prev
|
20
|
-
trans :defocused, :parent, :focused, :focus_parent
|
21
|
-
trans :defocused, :child, :focused, :focus_child
|
22
|
-
trans :focused, :defocus, :defocused
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'statemachine'
|
3
|
-
|
4
|
-
# This code is only used in parallel with others
|
5
|
-
module MINT
|
6
|
-
class AIChoiceElement
|
7
|
-
def initialize_statemachine
|
8
|
-
if @statemachine.blank?
|
9
|
-
@statemachine = Statemachine.build do
|
10
|
-
superstate :AIChoiceElement do
|
11
|
-
trans :initialized, :organize, :organized
|
12
|
-
trans :organized, :present, :presenting
|
13
|
-
trans :suspended, :organize, :organized
|
14
|
-
|
15
|
-
superstate :presenting do
|
16
|
-
event :suspend, :suspended
|
17
|
-
|
18
|
-
trans :defocused, :focus, :focused
|
19
|
-
trans :defocused, :next, :focused, :focus_next
|
20
|
-
trans :defocused, :prev, :focused, :focus_prev
|
21
|
-
trans :defocused, :parent, :focused, :focus_parent
|
22
|
-
trans :focused, :defocus, :defocused
|
23
|
-
trans :focused, :drag, :dragging, :self_choose, In(:unchosen)
|
24
|
-
trans :focused, :drag, :dragging, nil, In(:chosen)
|
25
|
-
trans :dragging, :drop, :defocused
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|