limelight 0.3.0-java → 0.3.1-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.
Files changed (58) hide show
  1. data/lib/init.rb +1 -1
  2. data/lib/limelight.jar +0 -0
  3. data/lib/limelight/builtin/players.rb +2 -1
  4. data/lib/limelight/builtin/players/combo_box.rb +2 -0
  5. data/lib/limelight/builtin/players/curtains.rb +1 -0
  6. data/lib/limelight/builtin/players/password_box.rb +34 -0
  7. data/lib/limelight/casting_director.rb +2 -1
  8. data/lib/limelight/client/playbills.rb +83 -0
  9. data/lib/limelight/commands/command.rb +14 -2
  10. data/lib/limelight/commands/help_command.rb +50 -0
  11. data/lib/limelight/commands/unpack_command.rb +44 -0
  12. data/lib/limelight/commands/version_command.rb +31 -0
  13. data/lib/limelight/data.rb +47 -0
  14. data/lib/limelight/java_couplings.rb +1 -0
  15. data/lib/limelight/limelight_exception.rb +13 -0
  16. data/lib/limelight/main.rb +22 -24
  17. data/lib/limelight/producer.rb +3 -2
  18. data/lib/limelight/prop.rb +2 -1
  19. data/lib/limelight/scene.rb +8 -1
  20. data/lib/limelight/util/downloader.rb +113 -0
  21. data/lib/limelight/version.rb +1 -1
  22. data/productions/examples/8thlight.com/styles.rb +147 -149
  23. data/productions/examples/calculator/styles.rb +2 -4
  24. data/productions/examples/langstons_ant/styles.rb +1 -2
  25. data/productions/examples/sandbox/click_me/players/chromaton.rb +2 -3
  26. data/productions/examples/sandbox/click_me/styles.rb +6 -7
  27. data/productions/examples/sandbox/floaters/players/floater.rb +2 -2
  28. data/productions/examples/sandbox/floaters/styles.rb +1 -2
  29. data/productions/examples/sandbox/frameing/players/sandbox.rb +14 -0
  30. data/productions/examples/sandbox/frameing/props.rb +32 -0
  31. data/productions/examples/sandbox/frameing/styles.rb +42 -0
  32. data/productions/examples/sandbox/header.rb +1 -0
  33. data/productions/examples/sandbox/homer/styles.rb +1 -2
  34. data/productions/examples/sandbox/images_scene/styles.rb +3 -2
  35. data/productions/examples/sandbox/inputs/styles.rb +0 -1
  36. data/productions/examples/sandbox/rounded_corners/styles.rb +1 -2
  37. data/productions/examples/sandbox/scrolling/styles.rb +1 -2
  38. data/productions/examples/sandbox/styles.rb +7 -9
  39. data/productions/examples/sandbox/teaser/styles.rb +1 -2
  40. data/productions/examples/tutorials/tutorial_1/styles.rb +2 -4
  41. data/productions/startup/stages.rb +6 -0
  42. data/productions/startup/{players → welcome/players}/browse_button.rb +0 -0
  43. data/productions/startup/{players → welcome/players}/download_button.rb +3 -3
  44. data/productions/startup/{players → welcome/players}/sandbox_button.rb +0 -0
  45. data/productions/startup/{props.rb → welcome/props.rb} +0 -0
  46. data/productions/startup/{styles.rb → welcome/styles.rb} +0 -0
  47. data/spec/builtin/players/password_box_spec.rb +27 -0
  48. data/spec/client/playbills_spec.rb +76 -0
  49. data/spec/commands/help_command_spec.rb +39 -0
  50. data/spec/commands/unpack_command_spec.rb +44 -0
  51. data/spec/data_spec.rb +47 -0
  52. data/spec/main_spec.rb +20 -0
  53. data/spec/prop_spec.rb +18 -0
  54. data/spec/scene_spec.rb +43 -0
  55. data/spec/spec_helper.rb +2 -1
  56. data/spec/util/downloader_spec.rb +89 -0
  57. metadata +33 -11
  58. data/productions/examples/sandbox.llp +0 -0
@@ -4,8 +4,7 @@
4
4
  calculator {
5
5
  width 1000
6
6
  height 900
7
- horizontal_alignment :center
8
- vertical_alignment :top
7
+ alignment "top center"
9
8
  background_color :blue
10
9
  }
11
10
 
@@ -31,8 +30,7 @@ button {
31
30
  background_color :white
32
31
  text_color :black
33
32
  font_size 20
34
- horizontal_alignment :center
35
- vertical_alignment :center
33
+ alignment :center
36
34
  border_width 10
37
35
  border_color :black
38
36
  }
@@ -18,8 +18,7 @@ title {
18
18
  border_width 2
19
19
  border_color "orange"
20
20
  margin 10
21
- vertical_alignment "center"
22
- horizontal_alignment "center"
21
+ alignment "center"
23
22
  text_color "orange"
24
23
  font_size 30
25
24
  font_face "Arial"
@@ -38,9 +38,8 @@ module Chromaton
38
38
 
39
39
  def new_random_size
40
40
  @size = rand(500) + 50
41
- puts "@size: #{@size}"
42
- style.width = @size.to_s
43
- style.height = @size.to_s
41
+ style.width = @size
42
+ style.height = @size
44
43
  end
45
44
 
46
45
  def update_text
@@ -2,11 +2,10 @@
2
2
  #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
3
 
4
4
  chromaton {
5
- width 100
6
- height 100
7
- background_color :red
8
- text_color :white
9
- font_size 12
10
- horizontal_alignment :center
11
- vertical_alignment :center
5
+ width 100
6
+ height 100
7
+ background_color :red
8
+ text_color :white
9
+ font_size 12
10
+ alignment :center
12
11
  }
@@ -24,7 +24,7 @@ module Floater
24
24
 
25
25
  def new_x=(value)
26
26
  @x = value
27
- style.x = (value.to_i - width/2).to_s
27
+ style.x = (value.to_i - width/2)
28
28
  end
29
29
 
30
30
  def y
@@ -34,7 +34,7 @@ module Floater
34
34
 
35
35
  def new_y=(value)
36
36
  @y = value
37
- style.y = (value.to_i - width/2).to_s
37
+ style.y = (value.to_i - width/2)
38
38
  end
39
39
 
40
40
  def center
@@ -10,8 +10,7 @@ floater {
10
10
  background_color "#6fb963bb"
11
11
  text_color :white
12
12
  font_size 12
13
- horizontal_alignment :center
14
- vertical_alignment :center
13
+ alignment :center
15
14
  }
16
15
 
17
16
  surface {
@@ -0,0 +1,14 @@
1
+ module Sandbox
2
+
3
+ prop_reader :subject
4
+
5
+ def apply(style, value)
6
+ begin
7
+ subject.style.send("#{style}=".to_sym, value)
8
+ rescue Exception => e
9
+ puts e
10
+ # puts e.backtrace
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,32 @@
1
+ hamlet = <<END
2
+ To be, or not to be. That is the question. Whether tis nobler in the mind to suffer the slings and arrows of time,
3
+ or to take arms against a sea of troubles and by opposing, end them.
4
+ END
5
+
6
+ __ :name => "sandbox"
7
+ __install "header.rb"
8
+ arena :vertical_alignment => :center do
9
+ control_panel do
10
+ setting do
11
+ label :text => "Margin:"
12
+ input :players => "text_box", :text => "10%", :on_focus_lost => "scene.apply(:margin, text)"
13
+ end
14
+ setting do
15
+ label :text => "Border Width:"
16
+ input :players => "text_box", :text => "10%", :on_focus_lost => "scene.apply(:border_width, text)"
17
+ end
18
+ setting do
19
+ label :text => "Padding:"
20
+ input :players => "text_box", :text => "10%", :on_focus_lost => "scene.apply(:padding, text)"
21
+ end
22
+ setting do
23
+ label :text => "Rounded Corner Radius:"
24
+ input :players => "text_box", :text => "10%", :on_focus_lost => "scene.apply(:rounded_corner_radius, text)"
25
+ end
26
+ end
27
+ image_area do
28
+ box do
29
+ subject :id => "subject", :text => hamlet
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,42 @@
1
+ control_panel {
2
+ width "100%"
3
+ background_color :gray
4
+ secondary_background_color :dark_green
5
+ gradient_angle 270
6
+ gradient :on
7
+ horizontal_alignment :center
8
+ padding 10
9
+ }
10
+
11
+ setting {
12
+ width 120
13
+ }
14
+
15
+ label {
16
+ text_color :white
17
+ font_style "bold"
18
+ }
19
+
20
+ image_area {
21
+ width "100%"
22
+ height "90%"
23
+ alignment :center
24
+ background_color :light_gray
25
+ }
26
+
27
+ box {
28
+ background_color :tan
29
+ width :auto
30
+ height :auto
31
+ }
32
+
33
+ subject {
34
+ width "300"
35
+ height "300"
36
+ margin "10%"
37
+ border_width "10%"
38
+ padding "10%"
39
+ rounded_corner_radius "10%"
40
+ border_color :black
41
+ background_color :yellow
42
+ }
@@ -13,5 +13,6 @@ header do
13
13
  example_link :text => "Sketching", :on_mouse_clicked => "scene.load('sketching')"
14
14
  example_link :text => "Sound", :on_mouse_clicked => "scene.load('sounds')"
15
15
  example_link :text => "Images", :on_mouse_clicked => "scene.load('images_scene')"
16
+ example_link :text => "Frameing", :on_mouse_clicked => "scene.load('frameing')"
16
17
  end
17
18
 
@@ -4,8 +4,7 @@
4
4
  beach {
5
5
  width 640
6
6
  height 480
7
- horizontal_alignment :center
8
- vertical_alignment :center
7
+ alignment :center
9
8
  background_image "images/beach.jpg"
10
9
  }
11
10
 
@@ -20,11 +20,12 @@ label {
20
20
  image_area {
21
21
  width "100%"
22
22
  height "90%"
23
- horizontal_alignment :center
24
- vertical_alignment :center
23
+ alignment :center
25
24
  background_color :light_gray
26
25
  }
27
26
 
28
27
  logo {
29
28
  border_width 1
30
29
  }
30
+
31
+
@@ -11,7 +11,6 @@ table {
11
11
  cell {
12
12
  width 250
13
13
  height 100
14
- vertical_alignment :center
15
14
  horizontal_alignment :center
16
15
  border_width 1
17
16
  border_color :blue
@@ -13,6 +13,5 @@ box {
13
13
  row {
14
14
  width 500
15
15
  height 100
16
- horizontal_alignment :center
17
- vertical_alignment :center
16
+ alignment :center
18
17
  }
@@ -20,8 +20,7 @@ cell {
20
20
  width 50
21
21
  height 50
22
22
  text_color :black
23
- vertical_alignment :center
24
- horizontal_alignment :center
23
+ alignment :center
25
24
  }
26
25
 
27
26
  buttons_panel {
@@ -2,16 +2,15 @@
2
2
  #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
3
 
4
4
  sandbox {
5
- width "100%"
6
- height "100%"
7
- vertical_alignment :top
5
+ width "100%"
6
+ height "100%"
7
+ vertical_alignment :top
8
8
  }
9
9
 
10
10
  arena {
11
11
  width "100%"
12
- height 800
13
- horizontal_alignment :center
14
- vertical_alignment :center
12
+ height 800
13
+ alignment :center
15
14
  }
16
15
 
17
16
  header {
@@ -20,15 +19,14 @@ header {
20
19
  background_color "#888"
21
20
  border_color :blue
22
21
  border_width 1
23
- horizontal_alignment :center
22
+ alignment :center
24
23
  }
25
24
 
26
25
  example_link {
27
26
  width 100
28
27
  height 48
29
28
  font_size 12
30
- horizontal_alignment :center
31
- vertical_alignment :center
29
+ alignment :center
32
30
  text_color :blue
33
31
  hover {
34
32
  text_color :white
@@ -4,8 +4,7 @@
4
4
  pattern {
5
5
  width 521
6
6
  height 640
7
- horizontal_alignment :center
8
- vertical_alignment :center
7
+ alignment :center
9
8
  background_image "images/marilyn.jpg"
10
9
  background_image_fill_strategy :static
11
10
  }
@@ -5,16 +5,14 @@ backdrop {
5
5
  background_color "black"
6
6
  width "100%"
7
7
  height "100%"
8
- horizontal_alignment "center"
9
- vertical_alignment "center"
8
+ alignment "center"
10
9
  }
11
10
 
12
11
  sample {
13
12
  width 100
14
13
  height 100
15
14
  margin 5
16
- horizontal_alignment "center"
17
- vertical_alignment "center"
15
+ alignment "center"
18
16
  font_size "18"
19
17
  font_style "bold"
20
18
  text_color "white"
@@ -0,0 +1,6 @@
1
+ stage "default" do
2
+ default_scene "welcome"
3
+ title "Limelight"
4
+ location [200, 25]
5
+ size [800, 800]
6
+ end
@@ -5,10 +5,10 @@ module DownloadButton
5
5
 
6
6
  def mouse_clicked(e)
7
7
  url = scene.find("url_field").text
8
- downloader = Limelight::Context.instance.downloader
9
8
  begin
10
- file = downloader.download(url)
11
- scene.open_production(file.absolute_path)
9
+ puts "url: #{url}"
10
+ file = Limelight::Util::Downloader.download(url.strip)
11
+ scene.open_production(file)
12
12
  rescue Exception => e
13
13
  scene.stage.alert(e.to_s)
14
14
  end
File without changes
@@ -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/password_box'
7
+
8
+ describe Limelight::Builtin::Players::PasswordBox do
9
+
10
+ before(:each) do
11
+ @prop = Limelight::Prop.new
12
+ @prop.include_player(Limelight::Builtin::Players::PasswordBox)
13
+ end
14
+
15
+ it "should have a PasswordBox" do
16
+ @prop.panel.children[0].class.should == Limelight::UI::Model::Inputs::PasswordBoxPanel
17
+ end
18
+
19
+ it "should use the PasswordBox 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,76 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
2
+ require 'limelight/client/playbills'
3
+
4
+ describe Limelight::Client::Playbills do
5
+
6
+ before(:each) do
7
+ @xml = <<END
8
+ <?xml version="1.0" encoding="UTF-8"?>
9
+ <playbills type="array">
10
+ <playbill>
11
+ <author>Jim Weirich and Micah Martin</author>
12
+ <created-at type="datetime">2009-01-02T17:07:26Z</created-at>
13
+ <description>The classic game of memory.</description>
14
+ <id type="integer">1</id>
15
+ <name>simon</name>
16
+ <size>270418</size>
17
+ <title>Limelight Simon</title>
18
+ <updated-at type="datetime">2009-01-02T17:07:26Z</updated-at>
19
+ <version>1.0</version>
20
+ <llp-path>/playbills/1.llp</llp-path>
21
+ <thumbnail-path>/playbills/1.thumbnail</thumbnail-path>
22
+ </playbill>
23
+ </playbills>
24
+ END
25
+
26
+ @response = mock("response")
27
+ end
28
+
29
+ it "should translate xml with 1 playbill" do
30
+ playbills = Limelight::Client::Playbills.from_xml(@xml)
31
+ playbills.length.should == 1
32
+
33
+ simon = playbills[0]
34
+ simon.name.should == "simon"
35
+ simon.title.should == "Limelight Simon"
36
+ simon.size.should == "270418"
37
+ simon.updated_at.year.should == 2009
38
+ simon.created_at.year.should == 2009
39
+ simon.thumbnail_path.should == "/playbills/1.thumbnail"
40
+ simon.llp_path.should == "/playbills/1.llp"
41
+ simon.author.should == "Jim Weirich and Micah Martin"
42
+ simon.description.should == "The classic game of memory."
43
+ end
44
+
45
+ it "should get all the playbills from a URL" do
46
+ Net::HTTP.should_receive(:get_response).with(URI.parse("http://localhost:3000/playbills.xml")).and_return(@response)
47
+ @response.should_receive(:body).and_return(@xml)
48
+
49
+ playbills = Limelight::Client::Playbills.from_url("http://localhost:3000/playbills.xml")
50
+
51
+ playbills.length.should == 1
52
+ playbills[0].uri.host.should == "localhost"
53
+ playbills[0].uri.port.should == 3000
54
+ end
55
+
56
+ it "should get the thumbnail for a playbill" do
57
+ playbill = Limelight::Client::Playbill.new(URI.parse("http://localhost:3000/playbills.xml"))
58
+ playbill.thumbnail_path = "/playbills/1.thumbnail"
59
+
60
+ Net::HTTP.should_receive(:get_response).with(URI.parse("http://localhost:3000/playbills/1.thumbnail")).and_return(@response)
61
+ @response.should_receive(:body).and_return("blah")
62
+
63
+ playbill.thumbnail.should == "blah"
64
+ end
65
+
66
+ it "should get the thumbnail for a playbill" do
67
+ playbill = Limelight::Client::Playbill.new(URI.parse("http://localhost:3000/playbills.xml"))
68
+ playbill.llp_path = "/playbills/1.llp"
69
+
70
+ Net::HTTP.should_receive(:get_response).with(URI.parse("http://localhost:3000/playbills/1.llp")).and_return(@response)
71
+ @response.should_receive(:body).and_return("blah")
72
+
73
+ playbill.llp.should == "blah"
74
+ end
75
+
76
+ end