limelight 0.1.0-java → 0.2.0-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/bin/limelight +0 -0
- data/bin/ll +2 -2
- data/bin/ll.bat +2 -2
- data/lib/init.rb +5 -3
- data/lib/limelight.jar +0 -0
- data/lib/limelight/animation.rb +20 -0
- data/lib/limelight/build_exception.rb +1 -1
- data/lib/limelight/builtin/players.rb +12 -0
- data/lib/limelight/builtin/players/button.rb +24 -0
- data/lib/limelight/builtin/players/check_box.rb +31 -0
- data/lib/limelight/builtin/players/combo_box.rb +55 -0
- data/lib/limelight/builtin/players/combo_box_popup_list.rb +19 -0
- data/lib/limelight/builtin/players/combo_box_popup_list_item.rb +21 -0
- data/lib/limelight/builtin/players/curtains.rb +22 -0
- data/lib/limelight/builtin/players/radio_button.rb +41 -0
- data/lib/limelight/builtin/players/text_area.rb +25 -0
- data/lib/limelight/builtin/players/text_box.rb +25 -0
- data/lib/limelight/builtin/styles.rb +35 -0
- data/lib/limelight/button_group_cache.rb +2 -2
- data/lib/limelight/casting_director.rb +9 -6
- data/lib/limelight/commands.rb +3 -3
- data/lib/limelight/file_chooser.rb +1 -1
- data/lib/limelight/file_filter.rb +1 -1
- data/lib/limelight/java_couplings.rb +57 -0
- data/lib/limelight/java_util.rb +1 -1
- data/lib/limelight/limelight_exception.rb +1 -1
- data/lib/limelight/loaders/file_scene_loader.rb +3 -2
- data/lib/limelight/menu_bar.rb +1 -1
- data/lib/limelight/paint_action.rb +2 -2
- data/lib/limelight/pen.rb +2 -2
- data/lib/limelight/producer.rb +21 -5
- data/lib/limelight/production.rb +1 -1
- data/lib/limelight/production_builder.rb +1 -1
- data/lib/limelight/prop.rb +49 -39
- data/lib/limelight/prop_builder.rb +1 -1
- data/lib/limelight/scene.rb +3 -3
- data/lib/limelight/stage.rb +5 -5
- data/lib/limelight/stage_builder.rb +1 -1
- data/lib/limelight/styles.rb +2 -2
- data/lib/limelight/styles_builder.rb +7 -7
- data/lib/limelight/theater.rb +2 -2
- data/lib/limelight/util.rb +1 -1
- data/lib/limelight/version.rb +2 -2
- data/productions/examples/8thlight.com/about/about.txt +3 -3
- data/productions/examples/8thlight.com/about/props.rb +1 -1
- data/productions/examples/8thlight.com/about/styles.rb +1 -1
- data/productions/examples/8thlight.com/footer.rb +1 -1
- data/productions/examples/8thlight.com/home/props.rb +1 -1
- data/productions/examples/8thlight.com/home/styles.rb +1 -1
- data/productions/examples/8thlight.com/images/bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/button_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/canvas_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/thumbnail_book.jpg +0 -0
- data/productions/examples/8thlight.com/menu.rb +1 -1
- data/productions/examples/8thlight.com/services/props.rb +1 -1
- data/productions/examples/8thlight.com/services/services.txt +1 -1
- data/productions/examples/8thlight.com/services/styles.rb +1 -1
- data/productions/examples/8thlight.com/stages.rb +1 -1
- data/productions/examples/8thlight.com/styles.rb +8 -1
- data/productions/examples/calculator/players/button.rb +1 -1
- data/productions/examples/calculator/players/calculator.rb +1 -1
- data/productions/examples/calculator/players/calculator_model.rb +1 -1
- data/productions/examples/calculator/props.rb +1 -1
- data/productions/examples/calculator/styles.rb +1 -1
- data/productions/examples/langstons_ant/players/ant.rb +1 -1
- data/productions/examples/langstons_ant/players/log.rb +1 -1
- data/productions/examples/langstons_ant/players/start_stop_button.rb +1 -1
- data/productions/examples/langstons_ant/players/world.rb +1 -1
- data/productions/examples/langstons_ant/props.rb +1 -1
- data/productions/examples/langstons_ant/styles.rb +1 -1
- data/productions/examples/sandbox/click_me/players/chromaton.rb +1 -1
- data/productions/examples/sandbox/click_me/props.rb +1 -1
- data/productions/examples/sandbox/click_me/styles.rb +1 -1
- data/productions/examples/sandbox/floaters/players/floater.rb +21 -11
- data/productions/examples/sandbox/floaters/players/surface.rb +5 -1
- data/productions/examples/sandbox/floaters/props.rb +1 -1
- data/productions/examples/sandbox/floaters/styles.rb +1 -1
- data/productions/examples/sandbox/gradients/players/spinner.rb +5 -12
- data/productions/examples/sandbox/gradients/players/teaser.rb +7 -14
- data/productions/examples/sandbox/gradients/players/wave.rb +7 -14
- data/productions/examples/sandbox/gradients/players/waves.rb +7 -14
- data/productions/examples/sandbox/gradients/props.rb +1 -1
- data/productions/examples/sandbox/gradients/styles.rb +1 -1
- data/productions/examples/sandbox/header.rb +2 -1
- data/productions/examples/sandbox/homer/players/homer.rb +12 -8
- data/productions/examples/sandbox/homer/props.rb +1 -1
- data/productions/examples/sandbox/homer/styles.rb +1 -1
- data/productions/examples/sandbox/inputs/players/button_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/check_box_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/combo_box_input.rb +3 -3
- data/productions/examples/sandbox/inputs/players/radio_button_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/text_area_input.rb +1 -1
- data/productions/examples/sandbox/inputs/players/text_box_input.rb +1 -1
- data/productions/examples/sandbox/inputs/props.rb +3 -3
- data/productions/examples/sandbox/inputs/styles.rb +2 -1
- data/productions/examples/sandbox/players/sandbox.rb +1 -1
- data/productions/examples/sandbox/rounded_corners/players/box.rb +1 -1
- data/productions/examples/sandbox/rounded_corners/props.rb +1 -1
- data/productions/examples/sandbox/rounded_corners/styles.rb +1 -1
- data/productions/examples/sandbox/scrolling/players/add_button.rb +19 -0
- data/productions/examples/sandbox/scrolling/players/cell.rb +1 -2
- data/productions/examples/sandbox/scrolling/props.rb +9 -4
- data/productions/examples/sandbox/scrolling/styles.rb +10 -1
- data/productions/examples/sandbox/sketching/players/sketchpad.rb +1 -1
- data/productions/examples/sandbox/sketching/props.rb +1 -1
- data/productions/examples/sandbox/sketching/styles.rb +1 -2
- data/productions/examples/sandbox/sounds/bird.au +0 -0
- data/productions/examples/sandbox/sounds/cat.au +0 -0
- data/productions/examples/sandbox/sounds/cow.au +0 -0
- data/productions/examples/sandbox/sounds/dog.au +0 -0
- data/productions/examples/sandbox/sounds/donkey.au +0 -0
- data/productions/examples/sandbox/sounds/duck.au +0 -0
- data/productions/examples/sandbox/sounds/players/clip.rb +10 -0
- data/productions/examples/sandbox/sounds/props.rb +10 -0
- data/productions/examples/sandbox/sounds/styles.rb +17 -0
- data/productions/examples/sandbox/stages.rb +2 -1
- data/productions/examples/sandbox/styles.rb +6 -6
- data/productions/examples/sandbox/teaser/players/fader.rb +22 -16
- data/productions/examples/sandbox/teaser/props.rb +1 -1
- data/productions/examples/sandbox/teaser/styles.rb +1 -1
- data/productions/examples/tutorials/tutorial_1/players/sample.rb +1 -1
- data/productions/examples/tutorials/tutorial_1/props.rb +1 -1
- data/productions/examples/tutorials/tutorial_1/styles.rb +1 -1
- data/productions/stage_composer/init.rb +1 -1
- data/productions/stage_composer/inspector/players/inspector.rb +1 -1
- data/productions/stage_composer/inspector/players/prop_row.rb +1 -1
- data/productions/stage_composer/inspector/players/prop_tree.rb +1 -1
- data/productions/stage_composer/inspector/players/style_table.rb +1 -1
- data/productions/stage_composer/inspector/players/style_value.rb +1 -1
- data/productions/stage_composer/inspector/props.rb +2 -2
- data/productions/stage_composer/inspector/styles.rb +3 -3
- data/productions/stage_composer/lib/init.rb +1 -1
- data/productions/stage_composer/lib/limelight/composer/controller.rb +1 -1
- data/productions/stage_composer/lib/limelight/composer/lethargy.rb +1 -1
- data/productions/stage_composer/production.rb +1 -1
- data/productions/stage_composer/stages.rb +1 -1
- data/productions/startup/players/browse_button.rb +3 -0
- data/productions/startup/players/download_button.rb +4 -1
- data/productions/startup/players/sandbox_button.rb +4 -1
- data/productions/startup/props.rb +3 -5
- data/productions/startup/styles.rb +5 -5
- data/spec/builtin/players/button_spec.rb +21 -0
- data/spec/builtin/players/check_box_spec.rb +29 -0
- data/spec/builtin/players/combo_box_spec.rb +29 -0
- data/spec/{players → builtin/players}/radio_button_spec.rb +9 -20
- data/spec/builtin/players/text_area_spec.rb +27 -0
- data/spec/builtin/players/text_box_spec.rb +27 -0
- data/spec/casting_director_spec.rb +3 -3
- data/spec/commands_spec.rb +2 -2
- data/spec/file_chooser_spec.rb +1 -1
- data/spec/file_filter_spec.rb +1 -1
- data/spec/java_util_spec.rb +1 -1
- data/spec/loaders/file_loader_spec.rb +1 -1
- data/spec/paint_action_spec.rb +1 -1
- data/spec/pen_spec.rb +1 -1
- data/spec/producer_spec.rb +14 -4
- data/spec/production_builder_spec.rb +1 -1
- data/spec/production_spec.rb +1 -1
- data/spec/prop_builder_spec.rb +1 -1
- data/spec/prop_spec.rb +66 -5
- data/spec/scene_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -1
- data/spec/stage_builder_spec.rb +1 -1
- data/spec/stage_spec.rb +1 -1
- data/spec/styles_builder_spec.rb +34 -2
- data/spec/theater_spec.rb +1 -1
- metadata +130 -106
- data/lib/limelight/players.rb +0 -9
- data/lib/limelight/players/button.rb +0 -29
- data/lib/limelight/players/check_box.rb +0 -38
- data/lib/limelight/players/combo_box.rb +0 -44
- data/lib/limelight/players/radio_button.rb +0 -47
- data/lib/limelight/players/text_area.rb +0 -25
- data/lib/limelight/players/text_box.rb +0 -25
- data/spec/players/button_spec.rb +0 -31
- data/spec/players/check_box_spec.rb +0 -40
- data/spec/players/combo_box_spec.rb +0 -39
- data/spec/players/text_area_spec.rb +0 -37
- data/spec/players/text_box_spec.rb +0 -37
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
|
5
|
+
require 'limelight/scene'
|
|
6
|
+
require 'limelight/prop'
|
|
7
|
+
require 'limelight/builtin/players/combo_box'
|
|
8
|
+
|
|
9
|
+
describe Limelight::Builtin::Players::ComboBox do
|
|
10
|
+
|
|
11
|
+
before(:each) do
|
|
12
|
+
@scene = Limelight::Scene.new(:casting_director => make_mock("caster", :fill_cast => nil))
|
|
13
|
+
@prop = Limelight::Prop.new(:scene => @scene)
|
|
14
|
+
@prop.include_player(Limelight::Builtin::Players::ComboBox)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
it "should have a ComboBox" do
|
|
18
|
+
@prop.panel.children[0].class.should == Limelight::UI::Model::Inputs::ComboBoxPanel
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "should have settable value" do
|
|
22
|
+
@prop.choices = ["1", "2", "3"]
|
|
23
|
+
@prop.value.should == "1"
|
|
24
|
+
|
|
25
|
+
@prop.value = "3"
|
|
26
|
+
@prop.value.should == "3"
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + "
|
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
|
5
5
|
require 'limelight/scene'
|
|
6
6
|
require 'limelight/prop'
|
|
7
|
-
require 'limelight/players/radio_button'
|
|
7
|
+
require 'limelight/builtin/players/radio_button'
|
|
8
8
|
|
|
9
|
-
describe Limelight::Players::RadioButton do
|
|
9
|
+
describe Limelight::Builtin::Players::RadioButton do
|
|
10
10
|
|
|
11
11
|
before(:each) do
|
|
12
12
|
@scene = Limelight::Scene.new(:casting_director => make_mock("caster", :fill_cast => nil))
|
|
13
13
|
@prop = Limelight::Prop.new
|
|
14
14
|
@scene << @prop
|
|
15
|
-
@prop.include_player(Limelight::Players::RadioButton)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it "should get rid of the all painters and add a RadioButtonPainter" do
|
|
19
|
-
@prop.panel.painters.size.should == 1
|
|
20
|
-
@prop.panel.painters.last.class.should == Java::limelight.ui.painting.RadioButtonPainter
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "should clear event listeners on the panel" do
|
|
24
|
-
@prop.panel.mouse_listeners.length.should == 0
|
|
25
|
-
@prop.panel.key_listeners.length.should == 0
|
|
15
|
+
@prop.include_player(Limelight::Builtin::Players::RadioButton)
|
|
26
16
|
end
|
|
27
17
|
|
|
28
18
|
it "should have a RadioButton" do
|
|
29
|
-
@prop.panel.
|
|
19
|
+
@prop.panel.children[0].class.should == Limelight::UI::Model::Inputs::RadioButtonPanel
|
|
30
20
|
end
|
|
31
|
-
|
|
21
|
+
|
|
32
22
|
it "should handled checked state" do
|
|
33
23
|
@prop.checked?.should == false
|
|
34
24
|
@prop.checked.should == false
|
|
@@ -41,7 +31,6 @@ describe Limelight::Players::RadioButton do
|
|
|
41
31
|
@prop.checked.should == true
|
|
42
32
|
@prop.selected?.should == true
|
|
43
33
|
@prop.selected.should == true
|
|
44
|
-
@prop.panel.components[0].is_selected.should == true
|
|
45
34
|
end
|
|
46
35
|
|
|
47
36
|
it "should belong to a button group" do
|
|
@@ -49,12 +38,12 @@ describe Limelight::Players::RadioButton do
|
|
|
49
38
|
|
|
50
39
|
prop2 = Limelight::Prop.new
|
|
51
40
|
@scene << prop2
|
|
52
|
-
prop2.add_controller(Limelight::Players::RadioButton)
|
|
41
|
+
prop2.add_controller(Limelight::Builtin::Players::RadioButton)
|
|
53
42
|
prop2.group = "group 1"
|
|
54
43
|
|
|
55
44
|
prop3 = Limelight::Prop.new
|
|
56
45
|
@scene << prop3
|
|
57
|
-
prop3.add_controller(Limelight::Players::RadioButton)
|
|
46
|
+
prop3.add_controller(Limelight::Builtin::Players::RadioButton)
|
|
58
47
|
prop3.group = "group 2"
|
|
59
48
|
|
|
60
49
|
group1 = @scene.button_groups["group 1"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
|
5
|
+
require 'limelight/prop'
|
|
6
|
+
require 'limelight/builtin/players/text_area'
|
|
7
|
+
|
|
8
|
+
describe Limelight::Builtin::Players::TextArea do
|
|
9
|
+
|
|
10
|
+
before(:each) do
|
|
11
|
+
@prop = Limelight::Prop.new
|
|
12
|
+
@prop.add_controller(Limelight::Builtin::Players::TextArea)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should have a JTextArea" do
|
|
16
|
+
@prop.panel.children[0].class.should == Limelight::UI::Model::Inputs::TextAreaPanel
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should use the TextArea for the text accessor" do
|
|
20
|
+
@prop.text = "blah"
|
|
21
|
+
@prop.panel.children[0].text.should == "blah"
|
|
22
|
+
|
|
23
|
+
@prop.panel.children[0].text = "harumph"
|
|
24
|
+
@prop.text.should == "harumph"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
|
|
5
|
+
require 'limelight/prop'
|
|
6
|
+
require 'limelight/builtin/players/text_box'
|
|
7
|
+
|
|
8
|
+
describe Limelight::Builtin::Players::TextBox do
|
|
9
|
+
|
|
10
|
+
before(:each) do
|
|
11
|
+
@prop = Limelight::Prop.new
|
|
12
|
+
@prop.add_controller(Limelight::Builtin::Players::TextBox)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should have a TextField" do
|
|
16
|
+
@prop.panel.children[0].class.should == Limelight::UI::Model::Inputs::TextBoxPanel
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should use the TextField for the text accessor" do
|
|
20
|
+
@prop.text = "blah"
|
|
21
|
+
@prop.panel.children[0].text.should == "blah"
|
|
22
|
+
|
|
23
|
+
@prop.panel.children[0].text = "harumph"
|
|
24
|
+
@prop.text.should == "harumph"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
|
@@ -64,7 +64,7 @@ describe Limelight::CastingDirector do
|
|
|
64
64
|
|
|
65
65
|
@casting_director.fill_cast(@root)
|
|
66
66
|
|
|
67
|
-
@root.is_a?(Limelight::Players::Button).should == true
|
|
67
|
+
@root.is_a?(Limelight::Builtin::Players::Button).should == true
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
it "should load custom players" do
|
|
@@ -86,7 +86,7 @@ describe Limelight::CastingDirector do
|
|
|
86
86
|
|
|
87
87
|
@root.should_receive(:include_player).with("root module")
|
|
88
88
|
@root.should_receive(:include_player).with("custom_player module")
|
|
89
|
-
@root.should_receive(:include_player).with(Limelight::Players::Button)
|
|
89
|
+
@root.should_receive(:include_player).with(Limelight::Builtin::Players::Button)
|
|
90
90
|
|
|
91
91
|
@casting_director.fill_cast(@root)
|
|
92
92
|
end
|
data/spec/commands_spec.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
|
@@ -24,7 +24,7 @@ describe Limelight::Commands do
|
|
|
24
24
|
|
|
25
25
|
it "should pack a production" do
|
|
26
26
|
mock_packer = make_mock("packer")
|
|
27
|
-
|
|
27
|
+
Limelight::Util::Packer.should_receive(:new).and_return(mock_packer)
|
|
28
28
|
mock_packer.should_receive(:pack).with("production_to_pack")
|
|
29
29
|
|
|
30
30
|
Limelight::Commands.run(["pack", "production_to_pack"])
|
data/spec/file_chooser_spec.rb
CHANGED
data/spec/file_filter_spec.rb
CHANGED
data/spec/java_util_spec.rb
CHANGED
data/spec/paint_action_spec.rb
CHANGED
data/spec/pen_spec.rb
CHANGED
data/spec/producer_spec.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
|
@@ -44,8 +44,17 @@ describe Limelight::Producer do
|
|
|
44
44
|
scene = @producer.load_props(".", :casting_director => make_mock("casting_director", :fill_cast => nil))
|
|
45
45
|
scene.children.size.should == 0
|
|
46
46
|
end
|
|
47
|
+
|
|
48
|
+
it "should load builtin styles" do
|
|
49
|
+
@loader.should_receive(:exists?).with("./styles.rb").and_return(false)
|
|
50
|
+
|
|
51
|
+
styles = @producer.load_styles(".")
|
|
52
|
+
|
|
53
|
+
styles["limelight_builtin_players_combo_box_popup_list"].should_not == nil
|
|
54
|
+
end
|
|
47
55
|
|
|
48
56
|
it "should load styles" do
|
|
57
|
+
@producer.builtin_styles = {}
|
|
49
58
|
@loader.should_receive(:exists?).with("./styles.rb").and_return(true)
|
|
50
59
|
@loader.should_receive(:load).with("./styles.rb").and_return("alpha { width 100 }")
|
|
51
60
|
|
|
@@ -60,7 +69,7 @@ describe Limelight::Producer do
|
|
|
60
69
|
|
|
61
70
|
begin
|
|
62
71
|
result = @producer.load_props(".", :casting_director => make_mock("casting_director", :fill_cast => nil))
|
|
63
|
-
result.should == nil # should never
|
|
72
|
+
result.should == nil # should never perform
|
|
64
73
|
rescue Limelight::BuildException => e
|
|
65
74
|
e.line_number.should == 3
|
|
66
75
|
e.filename.should == "./props.rb"
|
|
@@ -74,11 +83,11 @@ describe Limelight::Producer do
|
|
|
74
83
|
|
|
75
84
|
begin
|
|
76
85
|
result = @producer.load_styles(".")
|
|
77
|
-
result.should == nil # should never
|
|
86
|
+
result.should == nil # should never perform
|
|
78
87
|
rescue Limelight::BuildException => e
|
|
79
88
|
e.line_number.should == 4
|
|
80
89
|
e.filename.should == "./styles.rb"
|
|
81
|
-
e.message.should include("./styles.rb:4: undefined method `-@' for #<Java::
|
|
90
|
+
e.message.should include("./styles.rb:4: undefined method `-@' for #<Java::LimelightStyles::RichStyle:0x")
|
|
82
91
|
end
|
|
83
92
|
end
|
|
84
93
|
|
|
@@ -126,6 +135,7 @@ describe Limelight::Producer do
|
|
|
126
135
|
end
|
|
127
136
|
|
|
128
137
|
it "should load empty styles if styles.rb doesn't exist" do
|
|
138
|
+
@producer.builtin_styles = {}
|
|
129
139
|
@loader.should_receive(:exists?).with("./styles.rb").and_return(false)
|
|
130
140
|
|
|
131
141
|
@producer.load_styles(".").should == {}
|
data/spec/production_spec.rb
CHANGED
data/spec/prop_builder_spec.rb
CHANGED
data/spec/prop_spec.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
|
@@ -14,6 +14,18 @@ describe Limelight::Prop do
|
|
|
14
14
|
@prop = Limelight::Prop.new(:id => "root", :name => "root_class")
|
|
15
15
|
@scene << @prop
|
|
16
16
|
end
|
|
17
|
+
|
|
18
|
+
it "should set the childs parent before adding the child to the parent" do
|
|
19
|
+
# This is important because a child must be illuminated before a parent knows about it
|
|
20
|
+
child = Limelight::Prop.new(:id => "child", :name => "child_class")
|
|
21
|
+
|
|
22
|
+
child.should_receive(:set_parent) do
|
|
23
|
+
@prop.children.size.should == 0
|
|
24
|
+
end
|
|
25
|
+
@prop.add(child)
|
|
26
|
+
|
|
27
|
+
@prop.children.size.should == 1
|
|
28
|
+
end
|
|
17
29
|
|
|
18
30
|
it "should extend added controllers and invoke the extended hook" do
|
|
19
31
|
module TestController
|
|
@@ -146,6 +158,46 @@ describe Limelight::Prop do
|
|
|
146
158
|
|
|
147
159
|
prop.foo.should == "bar"
|
|
148
160
|
end
|
|
161
|
+
|
|
162
|
+
it "should set styles upon illuminating, and convert them to strings" do
|
|
163
|
+
prop = Limelight::Prop.new(:width => "100", :height => 200, :horizontal_alignment => :center)
|
|
164
|
+
|
|
165
|
+
@scene << prop
|
|
166
|
+
|
|
167
|
+
prop.style.width.should == "100"
|
|
168
|
+
prop.style.height.should == "200"
|
|
169
|
+
prop.style.horizontal_alignment.should == "center"
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
it "should add additional styles listed in options" do
|
|
173
|
+
style1 = Limelight::Styles::RichStyle.new()
|
|
174
|
+
style2 = Limelight::Styles::RichStyle.new()
|
|
175
|
+
style3 = Limelight::Styles::RichStyle.new()
|
|
176
|
+
@scene.styles.merge!("one" => style1, "two" => style2, "three" => style3)
|
|
177
|
+
|
|
178
|
+
prop = Limelight::Prop.new(:name => "one", :styles => "two three")
|
|
179
|
+
@scene << prop
|
|
180
|
+
|
|
181
|
+
prop.style.should have_extension(style1)
|
|
182
|
+
prop.style.should have_extension(style2)
|
|
183
|
+
prop.style.should have_extension(style3)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
it "should add additional styles and their hover part" do
|
|
187
|
+
style1 = Limelight::Styles::RichStyle.new()
|
|
188
|
+
style2 = Limelight::Styles::RichStyle.new()
|
|
189
|
+
style3 = Limelight::Styles::RichStyle.new()
|
|
190
|
+
style4 = Limelight::Styles::RichStyle.new()
|
|
191
|
+
@scene.styles.merge!("one" => style1, "one.hover" => style2, "two" => style3, "two.hover" => style4)
|
|
192
|
+
|
|
193
|
+
prop = Limelight::Prop.new(:name => "one", :styles => "two three")
|
|
194
|
+
@scene << prop
|
|
195
|
+
|
|
196
|
+
prop.style.should have_extension(style1)
|
|
197
|
+
prop.style.should have_extension(style3)
|
|
198
|
+
prop.hover_style.should == style2
|
|
199
|
+
prop.hover_style.should have_extension(style4)
|
|
200
|
+
end
|
|
149
201
|
|
|
150
202
|
it "should be able to remove children" do
|
|
151
203
|
child1 = Limelight::Prop.new()
|
|
@@ -157,13 +209,13 @@ describe Limelight::Prop do
|
|
|
157
209
|
|
|
158
210
|
@prop.children.length.should == 2
|
|
159
211
|
@prop.children.should_not include(child2)
|
|
160
|
-
@prop.panel.
|
|
161
|
-
@prop.panel.
|
|
212
|
+
@prop.panel.children.length.should == 2
|
|
213
|
+
@prop.panel.children.should_not include(child2.panel)
|
|
162
214
|
end
|
|
163
215
|
|
|
164
216
|
it "should make dimensions accessible" do
|
|
165
|
-
@prop.panel.should_receive(:
|
|
166
|
-
@prop.panel.should_receive(:
|
|
217
|
+
@prop.panel.should_receive(:get_box).and_return("whole area")
|
|
218
|
+
@prop.panel.should_receive(:get_box_inside_borders).and_return("area inside borders")
|
|
167
219
|
|
|
168
220
|
@prop.area.should == "whole area"
|
|
169
221
|
@prop.bordered_area.should == "area inside borders"
|
|
@@ -211,6 +263,15 @@ describe Limelight::Prop do
|
|
|
211
263
|
@prop.children[1].children.length.should == 1
|
|
212
264
|
@prop.children[1].children[0].name.should == "three"
|
|
213
265
|
end
|
|
266
|
+
|
|
267
|
+
it "should play sound" do
|
|
268
|
+
loader = make_mock("loader")
|
|
269
|
+
@scene.loader = loader
|
|
270
|
+
loader.should_receive(:path_to).with("some.au").and_return("/full/path/to/some.au");
|
|
271
|
+
@prop.panel.should_receive(:play_sound).with("/full/path/to/some.au");
|
|
272
|
+
|
|
273
|
+
@prop.play_sound("some.au")
|
|
274
|
+
end
|
|
214
275
|
|
|
215
276
|
end
|
|
216
277
|
|
data/spec/scene_spec.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
|
|
@@ -18,7 +18,7 @@ describe Limelight::Scene do
|
|
|
18
18
|
|
|
19
19
|
it "should have a button group cache" do
|
|
20
20
|
@scene.button_groups.should_not == nil
|
|
21
|
-
@scene.button_groups.class.should ==
|
|
21
|
+
@scene.button_groups.class.should == Limelight::UI::ButtonGroupCache
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "should pullout sytles and casting_director from options" do
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
#- Copyright 2008 8th Light, Inc.
|
|
1
|
+
#- Copyright 2008 8th Light, Inc. All Rights Reserved.
|
|
2
2
|
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
3
|
|
|
4
4
|
require File.expand_path(File.dirname(__FILE__) + "/../lib/init")
|
|
5
5
|
|
|
6
6
|
require 'spec'
|
|
7
7
|
|
|
8
|
+
context = Limelight::Context.instance
|
|
9
|
+
context.frameManager = Java::limelight.ui.model.FrameManager.new
|
|
10
|
+
|
|
8
11
|
def make_mock(name, stubs = {})
|
|
9
12
|
the_mock = mock(name)
|
|
10
13
|
the_mock.stubs!(stubs)
|