limelight 0.5.1-java → 0.5.2-java
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/lib/limelight.jar +0 -0
- data/lib/limelight/builtin/utilities_production/alert/players/alert.rb +4 -1
- data/lib/limelight/builtin/utilities_production/production.rb +2 -2
- data/lib/limelight/dsl/styles_builder.rb +5 -0
- data/lib/limelight/java_couplings.rb +2 -2
- data/lib/limelight/main.rb +43 -46
- data/lib/limelight/producer.rb +21 -0
- data/lib/limelight/production.rb +18 -11
- data/lib/limelight/specs/test_scene_opener.rb +3 -0
- data/lib/limelight/stage.rb +62 -9
- data/lib/limelight/studio.rb +12 -143
- data/lib/limelight/styles/style.rb +288 -0
- data/lib/limelight/theater.rb +17 -2
- data/lib/limelight/version.rb +1 -1
- data/productions/examples/sandbox/stage_handles/players/sizer.rb +3 -0
- data/spec/limelight/builtin/players/combo_box_spec.rb +1 -1
- data/spec/limelight/builtin/players/radio_button_spec.rb +1 -1
- data/spec/limelight/casting_director_spec.rb +1 -1
- data/spec/limelight/commands/create_command_spec.rb +3 -3
- data/spec/limelight/commands/pack_command_spec.rb +1 -1
- data/spec/limelight/commands/unpack_command_spec.rb +1 -1
- data/spec/limelight/dsl/prop_builder_spec.rb +6 -6
- data/spec/limelight/file_chooser_spec.rb +1 -1
- data/spec/limelight/file_filter_spec.rb +2 -2
- data/spec/limelight/main_spec.rb +2 -2
- data/spec/limelight/paint_action_spec.rb +1 -1
- data/spec/limelight/pen_spec.rb +1 -1
- data/spec/limelight/producer_spec.rb +21 -8
- data/spec/limelight/production_spec.rb +4 -7
- data/spec/limelight/prop_spec.rb +2 -2
- data/spec/limelight/scene_spec.rb +1 -1
- data/spec/limelight/stage_spec.rb +32 -3
- data/spec/limelight/templates/templater_spec.rb +1 -1
- data/spec/limelight/theater_spec.rb +27 -0
- data/spec/spec_helper.rb +0 -6
- metadata +5 -4
- data/lib/limelight/styles.rb +0 -347
@@ -0,0 +1,288 @@
|
|
1
|
+
raise "studio.rb is present for solely to document it's Java counterpart limelight.Studio. This file should NOT be loaded in the Ruby runtime."
|
2
|
+
|
3
|
+
module Limelight
|
4
|
+
module Styles
|
5
|
+
class Style
|
6
|
+
# Specifies the Width attribute of a prop.
|
7
|
+
# type: dimension
|
8
|
+
# default_value: auto
|
9
|
+
attr_accessor :width
|
10
|
+
|
11
|
+
# Specifies the Height attribute of a prop.
|
12
|
+
# type: dimension
|
13
|
+
# default_value: auto
|
14
|
+
attr_accessor :height
|
15
|
+
|
16
|
+
# Specifies the Min Width attribute of a prop.
|
17
|
+
# type: noneable simple dimension
|
18
|
+
# default_value: none
|
19
|
+
attr_accessor :min_width
|
20
|
+
|
21
|
+
# Specifies the Min Height attribute of a prop.
|
22
|
+
# type: noneable simple dimension
|
23
|
+
# default_value: none
|
24
|
+
attr_accessor :min_height
|
25
|
+
|
26
|
+
# Specifies the Max Width attribute of a prop.
|
27
|
+
# type: noneable simple dimension
|
28
|
+
# default_value: none
|
29
|
+
attr_accessor :max_width
|
30
|
+
|
31
|
+
# Specifies the Max Height attribute of a prop.
|
32
|
+
# type: noneable simple dimension
|
33
|
+
# default_value: none
|
34
|
+
attr_accessor :max_height
|
35
|
+
|
36
|
+
# Specifies the Vertical Scrollbar attribute of a prop.
|
37
|
+
# type: on/off
|
38
|
+
# default_value: off
|
39
|
+
attr_accessor :vertical_scrollbar
|
40
|
+
|
41
|
+
# Specifies the Horizontal Scrollbar attribute of a prop.
|
42
|
+
# type: on/off
|
43
|
+
# default_value: off
|
44
|
+
attr_accessor :horizontal_scrollbar
|
45
|
+
|
46
|
+
# Specifies the Top Border Color attribute of a prop.
|
47
|
+
# type: color
|
48
|
+
# default_value: #000000ff
|
49
|
+
attr_accessor :top_border_color
|
50
|
+
|
51
|
+
# Specifies the Right Border Color attribute of a prop.
|
52
|
+
# type: color
|
53
|
+
# default_value: #000000ff
|
54
|
+
attr_accessor :right_border_color
|
55
|
+
|
56
|
+
# Specifies the Bottom Border Color attribute of a prop.
|
57
|
+
# type: color
|
58
|
+
# default_value: #000000ff
|
59
|
+
attr_accessor :bottom_border_color
|
60
|
+
|
61
|
+
# Specifies the Left Border Color attribute of a prop.
|
62
|
+
# type: color
|
63
|
+
# default_value: #000000ff
|
64
|
+
attr_accessor :left_border_color
|
65
|
+
|
66
|
+
# Specifies the Top Border Width attribute of a prop.
|
67
|
+
# type: pixels
|
68
|
+
# default_value: 0
|
69
|
+
attr_accessor :top_border_width
|
70
|
+
|
71
|
+
# Specifies the Right Border Width attribute of a prop.
|
72
|
+
# type: pixels
|
73
|
+
# default_value: 0
|
74
|
+
attr_accessor :right_border_width
|
75
|
+
|
76
|
+
# Specifies the Bottom Border Width attribute of a prop.
|
77
|
+
# type: pixels
|
78
|
+
# default_value: 0
|
79
|
+
attr_accessor :bottom_border_width
|
80
|
+
|
81
|
+
# Specifies the Left Border Width attribute of a prop.
|
82
|
+
# type: pixels
|
83
|
+
# default_value: 0
|
84
|
+
attr_accessor :left_border_width
|
85
|
+
|
86
|
+
# Specifies the Top Margin attribute of a prop.
|
87
|
+
# type: pixels
|
88
|
+
# default_value: 0
|
89
|
+
attr_accessor :top_margin
|
90
|
+
|
91
|
+
# Specifies the Right Margin attribute of a prop.
|
92
|
+
# type: pixels
|
93
|
+
# default_value: 0
|
94
|
+
attr_accessor :right_margin
|
95
|
+
|
96
|
+
# Specifies the Bottom Margin attribute of a prop.
|
97
|
+
# type: pixels
|
98
|
+
# default_value: 0
|
99
|
+
attr_accessor :bottom_margin
|
100
|
+
|
101
|
+
# Specifies the Left Margin attribute of a prop.
|
102
|
+
# type: pixels
|
103
|
+
# default_value: 0
|
104
|
+
attr_accessor :left_margin
|
105
|
+
|
106
|
+
# Specifies the Top Padding attribute of a prop.
|
107
|
+
# type: pixels
|
108
|
+
# default_value: 0
|
109
|
+
attr_accessor :top_padding
|
110
|
+
|
111
|
+
# Specifies the Right Padding attribute of a prop.
|
112
|
+
# type: pixels
|
113
|
+
# default_value: 0
|
114
|
+
attr_accessor :right_padding
|
115
|
+
|
116
|
+
# Specifies the Bottom Padding attribute of a prop.
|
117
|
+
# type: pixels
|
118
|
+
# default_value: 0
|
119
|
+
attr_accessor :bottom_padding
|
120
|
+
|
121
|
+
# Specifies the Left Padding attribute of a prop.
|
122
|
+
# type: pixels
|
123
|
+
# default_value: 0
|
124
|
+
attr_accessor :left_padding
|
125
|
+
|
126
|
+
# Specifies the Background Color attribute of a prop.
|
127
|
+
# type: color
|
128
|
+
# default_value: #00000000
|
129
|
+
attr_accessor :background_color
|
130
|
+
|
131
|
+
# Specifies the Secondary Background Color attribute of a prop.
|
132
|
+
# type: color
|
133
|
+
# default_value: #00000000
|
134
|
+
attr_accessor :secondary_background_color
|
135
|
+
|
136
|
+
# Specifies the Background Image attribute of a prop.
|
137
|
+
# type: noneable string
|
138
|
+
# default_value: none
|
139
|
+
attr_accessor :background_image
|
140
|
+
|
141
|
+
# Specifies the Background Image Fill Strategy attribute of a prop.
|
142
|
+
# type: fill strategy
|
143
|
+
# default_value: repeat
|
144
|
+
attr_accessor :background_image_fill_strategy
|
145
|
+
|
146
|
+
# Specifies the Gradient attribute of a prop.
|
147
|
+
# type: on/off
|
148
|
+
# default_value: off
|
149
|
+
attr_accessor :gradient
|
150
|
+
|
151
|
+
# Specifies the Gradient Angle attribute of a prop.
|
152
|
+
# type: degrees
|
153
|
+
# default_value: 90
|
154
|
+
attr_accessor :gradient_angle
|
155
|
+
|
156
|
+
# Specifies the Gradient Penetration attribute of a prop.
|
157
|
+
# type: percentage
|
158
|
+
# default_value: 100%
|
159
|
+
attr_accessor :gradient_penetration
|
160
|
+
|
161
|
+
# Specifies the Cyclic Gradient attribute of a prop.
|
162
|
+
# type: on/off
|
163
|
+
# default_value: off
|
164
|
+
attr_accessor :cyclic_gradient
|
165
|
+
|
166
|
+
# Specifies the Horizontal Alignment attribute of a prop.
|
167
|
+
# type: horizontal alignment
|
168
|
+
# default_value: left
|
169
|
+
attr_accessor :horizontal_alignment
|
170
|
+
|
171
|
+
# Specifies the Vertical Alignment attribute of a prop.
|
172
|
+
# type: vertical alignment
|
173
|
+
# default_value: top
|
174
|
+
attr_accessor :vertical_alignment
|
175
|
+
|
176
|
+
# Specifies the Text Color attribute of a prop.
|
177
|
+
# type: color
|
178
|
+
# default_value: #000000ff
|
179
|
+
attr_accessor :text_color
|
180
|
+
|
181
|
+
# Specifies the Font Face attribute of a prop.
|
182
|
+
# type: string
|
183
|
+
# default_value: Arial
|
184
|
+
attr_accessor :font_face
|
185
|
+
|
186
|
+
# Specifies the Font Size attribute of a prop.
|
187
|
+
# type: integer
|
188
|
+
# default_value: 12
|
189
|
+
attr_accessor :font_size
|
190
|
+
|
191
|
+
# Specifies the Font Style attribute of a prop.
|
192
|
+
# type: font style
|
193
|
+
# default_value: plain
|
194
|
+
attr_accessor :font_style
|
195
|
+
|
196
|
+
# Specifies the Transparency attribute of a prop.
|
197
|
+
# type: percentage
|
198
|
+
# default_value: 0%
|
199
|
+
attr_accessor :transparency
|
200
|
+
|
201
|
+
# Specifies the Top Right Rounded Corner Radius attribute of a prop.
|
202
|
+
# type: pixels
|
203
|
+
# default_value: 0
|
204
|
+
attr_accessor :top_right_rounded_corner_radius
|
205
|
+
|
206
|
+
# Specifies the Bottom Right Rounded Corner Radius attribute of a prop.
|
207
|
+
# type: pixels
|
208
|
+
# default_value: 0
|
209
|
+
attr_accessor :bottom_right_rounded_corner_radius
|
210
|
+
|
211
|
+
# Specifies the Bottom Left Rounded Corner Radius attribute of a prop.
|
212
|
+
# type: pixels
|
213
|
+
# default_value: 0
|
214
|
+
attr_accessor :bottom_left_rounded_corner_radius
|
215
|
+
|
216
|
+
# Specifies the Top Left Rounded Corner Radius attribute of a prop.
|
217
|
+
# type: pixels
|
218
|
+
# default_value: 0
|
219
|
+
attr_accessor :top_left_rounded_corner_radius
|
220
|
+
|
221
|
+
# Specifies the Top Right Border Width attribute of a prop.
|
222
|
+
# type: pixels
|
223
|
+
# default_value: 0
|
224
|
+
attr_accessor :top_right_border_width
|
225
|
+
|
226
|
+
# Specifies the Bottom Right Border Width attribute of a prop.
|
227
|
+
# type: pixels
|
228
|
+
# default_value: 0
|
229
|
+
attr_accessor :bottom_right_border_width
|
230
|
+
|
231
|
+
# Specifies the Bottom Left Border Width attribute of a prop.
|
232
|
+
# type: pixels
|
233
|
+
# default_value: 0
|
234
|
+
attr_accessor :bottom_left_border_width
|
235
|
+
|
236
|
+
# Specifies the Top Left Border Width attribute of a prop.
|
237
|
+
# type: pixels
|
238
|
+
# default_value: 0
|
239
|
+
attr_accessor :top_left_border_width
|
240
|
+
|
241
|
+
# Specifies the Top Right Border Color attribute of a prop.
|
242
|
+
# type: color
|
243
|
+
# default_value: #000000ff
|
244
|
+
attr_accessor :top_right_border_color
|
245
|
+
|
246
|
+
# Specifies the Bottom Right Border Color attribute of a prop.
|
247
|
+
# type: color
|
248
|
+
# default_value: #000000ff
|
249
|
+
attr_accessor :bottom_right_border_color
|
250
|
+
|
251
|
+
# Specifies the Bottom Left Border Color attribute of a prop.
|
252
|
+
# type: color
|
253
|
+
# default_value: #000000ff
|
254
|
+
attr_accessor :bottom_left_border_color
|
255
|
+
|
256
|
+
# Specifies the Top Left Border Color attribute of a prop.
|
257
|
+
# type: color
|
258
|
+
# default_value: #000000ff
|
259
|
+
attr_accessor :top_left_border_color
|
260
|
+
|
261
|
+
# Specifies the Float attribute of a prop.
|
262
|
+
# type: on/off
|
263
|
+
# default_value: off
|
264
|
+
attr_accessor :float
|
265
|
+
|
266
|
+
# Specifies the X attribute of a prop.
|
267
|
+
# type: x-coordinate
|
268
|
+
# default_value: 0
|
269
|
+
attr_accessor :x
|
270
|
+
|
271
|
+
# Specifies the Y attribute of a prop.
|
272
|
+
# type: y-coordinate
|
273
|
+
# default_value: 0
|
274
|
+
attr_accessor :y
|
275
|
+
|
276
|
+
# Specifies the Background Image X attribute of a prop.
|
277
|
+
# type: x-coordinate
|
278
|
+
# default_value: 0
|
279
|
+
attr_accessor :background_image_x
|
280
|
+
|
281
|
+
# Specifies the Background Image Y attribute of a prop.
|
282
|
+
# type: y-coordinate
|
283
|
+
# default_value: 0
|
284
|
+
attr_accessor :background_image_y
|
285
|
+
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
data/lib/limelight/theater.rb
CHANGED
@@ -47,18 +47,27 @@ module Limelight
|
|
47
47
|
return stage
|
48
48
|
end
|
49
49
|
|
50
|
-
# Lets the Theater know which stage
|
50
|
+
# Invoked when a stage, blonging to this theater becomes active. Lets the Theater know which stage
|
51
|
+
# has the limelight (currently active). Only 1 stage may be active at a time.
|
51
52
|
#
|
52
53
|
def stage_activated(stage)
|
53
54
|
@active_stage = stage
|
54
55
|
end
|
55
56
|
|
57
|
+
# Invoked when a stage, belonging to this theater, loose it's status as the active stage. The active_stage is
|
58
|
+
# cleared. Only 1 stage may be active at a time.
|
59
|
+
#
|
60
|
+
def stage_deactivated(stage)
|
61
|
+
@active_stage = nil
|
62
|
+
@production.theater_empty! if !any_visible_stages?
|
63
|
+
end
|
64
|
+
|
56
65
|
# Removes the stage from this theater.
|
57
66
|
#
|
58
67
|
def stage_closed(stage)
|
59
68
|
@stages.delete(stage.name)
|
60
69
|
@active_stage = nil if @active_stage == stage
|
61
|
-
@production.theater_empty! if @stages.empty?
|
70
|
+
@production.theater_empty! if @stages.empty? || !any_visible_stages?
|
62
71
|
end
|
63
72
|
|
64
73
|
# If no Stages are added, the Theater will provide a default Stage named "Limelight".
|
@@ -81,6 +90,12 @@ module Limelight
|
|
81
90
|
def build_stage(name, options)
|
82
91
|
return Limelight::Stage.new(self, name, options)
|
83
92
|
end
|
93
|
+
|
94
|
+
private ###############################################
|
95
|
+
|
96
|
+
def any_visible_stages?
|
97
|
+
return @stages.values.any? { |s| s.visible? }
|
98
|
+
end
|
84
99
|
|
85
100
|
end
|
86
101
|
|
data/lib/limelight/version.rb
CHANGED
@@ -9,7 +9,7 @@ require 'limelight/builtin/players/combo_box'
|
|
9
9
|
describe Limelight::Builtin::Players::ComboBox do
|
10
10
|
|
11
11
|
before(:each) do
|
12
|
-
@scene = Limelight::Scene.new(:casting_director =>
|
12
|
+
@scene = Limelight::Scene.new(:casting_director => mock("caster", :fill_cast => nil))
|
13
13
|
@prop = Limelight::Prop.new(:scene => @scene)
|
14
14
|
@prop.include_player(Limelight::Builtin::Players::ComboBox)
|
15
15
|
end
|
@@ -9,7 +9,7 @@ require 'limelight/builtin/players/radio_button'
|
|
9
9
|
describe Limelight::Builtin::Players::RadioButton do
|
10
10
|
|
11
11
|
before(:each) do
|
12
|
-
@scene = Limelight::Scene.new(:casting_director =>
|
12
|
+
@scene = Limelight::Scene.new(:casting_director => mock("caster", :fill_cast => nil))
|
13
13
|
@prop = Limelight::Prop.new
|
14
14
|
@scene << @prop
|
15
15
|
@prop.include_player(Limelight::Builtin::Players::RadioButton)
|
@@ -13,7 +13,7 @@ describe Limelight::CastingDirector do
|
|
13
13
|
TestDir.clean
|
14
14
|
$casted_props = []
|
15
15
|
$casted_players = []
|
16
|
-
@scene = Limelight::Scene.new(:casting_director =>
|
16
|
+
@scene = Limelight::Scene.new(:casting_director => mock("casting_director", :fill_cast => nil), :path => TestDir.path("scene_path"))
|
17
17
|
@scene.illuminate
|
18
18
|
@loader = Limelight::FileLoader.for_root(TestDir.root)
|
19
19
|
@casting_director = Limelight::CastingDirector.new(@loader)
|
@@ -23,9 +23,9 @@ describe Limelight::Commands::CreateCommand do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should create a production" do
|
26
|
-
production_templater =
|
26
|
+
production_templater = mock("production_templater")
|
27
27
|
Limelight::Templates::ProductionTemplater.should_receive(:new).and_return(production_templater)
|
28
|
-
scene_templater =
|
28
|
+
scene_templater = mock("scene_templater")
|
29
29
|
Limelight::Templates::SceneTemplater.should_receive(:new).and_return(scene_templater)
|
30
30
|
production_templater.should_receive(:generate)
|
31
31
|
scene_templater.should_receive(:generate)
|
@@ -35,7 +35,7 @@ describe Limelight::Commands::CreateCommand do
|
|
35
35
|
|
36
36
|
it "should create a scene" do
|
37
37
|
Limelight::Templates::ProductionTemplater.should_not_receive(:new)
|
38
|
-
scene_templater =
|
38
|
+
scene_templater = mock("scene_templater")
|
39
39
|
Limelight::Templates::SceneTemplater.should_receive(:new).and_return(scene_templater)
|
40
40
|
scene_templater.should_receive(:generate)
|
41
41
|
|
@@ -16,7 +16,7 @@ describe Limelight::Commands::PackCommand do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should pack a production" do
|
19
|
-
mock_packer =
|
19
|
+
mock_packer = mock("packer")
|
20
20
|
Limelight::Util::Packer.should_receive(:new).and_return(mock_packer)
|
21
21
|
mock_packer.should_receive(:pack).with("production_to_pack")
|
22
22
|
|
@@ -15,7 +15,7 @@ describe Limelight::Commands::UnpackCommand do
|
|
15
15
|
@mock_output = StringIO.new
|
16
16
|
Limelight::Commands.output = @mock_output
|
17
17
|
|
18
|
-
@mock_unpacker =
|
18
|
+
@mock_unpacker = mock("unpacker")
|
19
19
|
Limelight::Util::Packer.stub!(:new).and_return(@mock_unpacker)
|
20
20
|
@mock_unpacker.stub!(:unpack).and_return "unpacked location"
|
21
21
|
|
@@ -7,7 +7,7 @@ require 'limelight/dsl/prop_builder'
|
|
7
7
|
describe Limelight::DSL::PropBuilder do
|
8
8
|
|
9
9
|
before(:each) do
|
10
|
-
@caster =
|
10
|
+
@caster = mock("caster", :fill_cast => nil)
|
11
11
|
@scene = Limelight::Scene.new(:name => "root", :casting_director => @caster)
|
12
12
|
end
|
13
13
|
|
@@ -118,7 +118,7 @@ describe Limelight::DSL::PropBuilder do
|
|
118
118
|
end
|
119
119
|
|
120
120
|
it "should install external props" do
|
121
|
-
loader =
|
121
|
+
loader = mock("loader", :exists? => true)
|
122
122
|
loader.should_receive(:load).with("external.rb").and_return("child :id => 123")
|
123
123
|
|
124
124
|
root = Limelight::build_props(@scene, :id => 321, :build_loader => loader, :casting_director => @caster) do
|
@@ -145,7 +145,7 @@ describe Limelight::DSL::PropBuilder do
|
|
145
145
|
end
|
146
146
|
|
147
147
|
it "should fail when the external file doesn't exist" do
|
148
|
-
loader =
|
148
|
+
loader = mock("loader")
|
149
149
|
loader.should_receive(:exists?).with("external.rb").and_return(false)
|
150
150
|
|
151
151
|
begin
|
@@ -158,7 +158,7 @@ describe Limelight::DSL::PropBuilder do
|
|
158
158
|
end
|
159
159
|
|
160
160
|
it "should fail with PropException when there's problem in the external file" do
|
161
|
-
loader =
|
161
|
+
loader = mock("loader", :exists? => true)
|
162
162
|
loader.should_receive(:load).with("external.rb").and_return("+")
|
163
163
|
|
164
164
|
begin
|
@@ -172,7 +172,7 @@ describe Limelight::DSL::PropBuilder do
|
|
172
172
|
|
173
173
|
it "should build onto an existing block" do
|
174
174
|
prop = Limelight::Prop.new
|
175
|
-
scene = Limelight::Scene.new(:casting_director =>
|
175
|
+
scene = Limelight::Scene.new(:casting_director => mock(:casting_director, :fill_cast => nil))
|
176
176
|
scene << prop
|
177
177
|
builder = Limelight::DSL::PropBuilder.new(prop)
|
178
178
|
block = Proc.new { one; two { three } }
|
@@ -229,7 +229,7 @@ describe Limelight::DSL::PropBuilder do
|
|
229
229
|
end
|
230
230
|
|
231
231
|
it "should allow instance_variable when installing an external props file" do
|
232
|
-
loader =
|
232
|
+
loader = mock("loader", :exists? => true)
|
233
233
|
loader.should_receive(:load).with("external.rb").and_return("child :id => @desired_id")
|
234
234
|
|
235
235
|
root = Limelight::build_props(@scene, :id => 321, :build_loader => loader, :casting_director => @caster) do
|