limelight 0.1.0-java → 0.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/bin/limelight +0 -0
  2. data/bin/ll +2 -2
  3. data/bin/ll.bat +2 -2
  4. data/lib/init.rb +5 -3
  5. data/lib/limelight.jar +0 -0
  6. data/lib/limelight/animation.rb +20 -0
  7. data/lib/limelight/build_exception.rb +1 -1
  8. data/lib/limelight/builtin/players.rb +12 -0
  9. data/lib/limelight/builtin/players/button.rb +24 -0
  10. data/lib/limelight/builtin/players/check_box.rb +31 -0
  11. data/lib/limelight/builtin/players/combo_box.rb +55 -0
  12. data/lib/limelight/builtin/players/combo_box_popup_list.rb +19 -0
  13. data/lib/limelight/builtin/players/combo_box_popup_list_item.rb +21 -0
  14. data/lib/limelight/builtin/players/curtains.rb +22 -0
  15. data/lib/limelight/builtin/players/radio_button.rb +41 -0
  16. data/lib/limelight/builtin/players/text_area.rb +25 -0
  17. data/lib/limelight/builtin/players/text_box.rb +25 -0
  18. data/lib/limelight/builtin/styles.rb +35 -0
  19. data/lib/limelight/button_group_cache.rb +2 -2
  20. data/lib/limelight/casting_director.rb +9 -6
  21. data/lib/limelight/commands.rb +3 -3
  22. data/lib/limelight/file_chooser.rb +1 -1
  23. data/lib/limelight/file_filter.rb +1 -1
  24. data/lib/limelight/java_couplings.rb +57 -0
  25. data/lib/limelight/java_util.rb +1 -1
  26. data/lib/limelight/limelight_exception.rb +1 -1
  27. data/lib/limelight/loaders/file_scene_loader.rb +3 -2
  28. data/lib/limelight/menu_bar.rb +1 -1
  29. data/lib/limelight/paint_action.rb +2 -2
  30. data/lib/limelight/pen.rb +2 -2
  31. data/lib/limelight/producer.rb +21 -5
  32. data/lib/limelight/production.rb +1 -1
  33. data/lib/limelight/production_builder.rb +1 -1
  34. data/lib/limelight/prop.rb +49 -39
  35. data/lib/limelight/prop_builder.rb +1 -1
  36. data/lib/limelight/scene.rb +3 -3
  37. data/lib/limelight/stage.rb +5 -5
  38. data/lib/limelight/stage_builder.rb +1 -1
  39. data/lib/limelight/styles.rb +2 -2
  40. data/lib/limelight/styles_builder.rb +7 -7
  41. data/lib/limelight/theater.rb +2 -2
  42. data/lib/limelight/util.rb +1 -1
  43. data/lib/limelight/version.rb +2 -2
  44. data/productions/examples/8thlight.com/about/about.txt +3 -3
  45. data/productions/examples/8thlight.com/about/props.rb +1 -1
  46. data/productions/examples/8thlight.com/about/styles.rb +1 -1
  47. data/productions/examples/8thlight.com/footer.rb +1 -1
  48. data/productions/examples/8thlight.com/home/props.rb +1 -1
  49. data/productions/examples/8thlight.com/home/styles.rb +1 -1
  50. data/productions/examples/8thlight.com/images/bg.jpg +0 -0
  51. data/productions/examples/8thlight.com/images/button_bg.jpg +0 -0
  52. data/productions/examples/8thlight.com/images/canvas_bg.jpg +0 -0
  53. data/productions/examples/8thlight.com/images/thumbnail_book.jpg +0 -0
  54. data/productions/examples/8thlight.com/menu.rb +1 -1
  55. data/productions/examples/8thlight.com/services/props.rb +1 -1
  56. data/productions/examples/8thlight.com/services/services.txt +1 -1
  57. data/productions/examples/8thlight.com/services/styles.rb +1 -1
  58. data/productions/examples/8thlight.com/stages.rb +1 -1
  59. data/productions/examples/8thlight.com/styles.rb +8 -1
  60. data/productions/examples/calculator/players/button.rb +1 -1
  61. data/productions/examples/calculator/players/calculator.rb +1 -1
  62. data/productions/examples/calculator/players/calculator_model.rb +1 -1
  63. data/productions/examples/calculator/props.rb +1 -1
  64. data/productions/examples/calculator/styles.rb +1 -1
  65. data/productions/examples/langstons_ant/players/ant.rb +1 -1
  66. data/productions/examples/langstons_ant/players/log.rb +1 -1
  67. data/productions/examples/langstons_ant/players/start_stop_button.rb +1 -1
  68. data/productions/examples/langstons_ant/players/world.rb +1 -1
  69. data/productions/examples/langstons_ant/props.rb +1 -1
  70. data/productions/examples/langstons_ant/styles.rb +1 -1
  71. data/productions/examples/sandbox/click_me/players/chromaton.rb +1 -1
  72. data/productions/examples/sandbox/click_me/props.rb +1 -1
  73. data/productions/examples/sandbox/click_me/styles.rb +1 -1
  74. data/productions/examples/sandbox/floaters/players/floater.rb +21 -11
  75. data/productions/examples/sandbox/floaters/players/surface.rb +5 -1
  76. data/productions/examples/sandbox/floaters/props.rb +1 -1
  77. data/productions/examples/sandbox/floaters/styles.rb +1 -1
  78. data/productions/examples/sandbox/gradients/players/spinner.rb +5 -12
  79. data/productions/examples/sandbox/gradients/players/teaser.rb +7 -14
  80. data/productions/examples/sandbox/gradients/players/wave.rb +7 -14
  81. data/productions/examples/sandbox/gradients/players/waves.rb +7 -14
  82. data/productions/examples/sandbox/gradients/props.rb +1 -1
  83. data/productions/examples/sandbox/gradients/styles.rb +1 -1
  84. data/productions/examples/sandbox/header.rb +2 -1
  85. data/productions/examples/sandbox/homer/players/homer.rb +12 -8
  86. data/productions/examples/sandbox/homer/props.rb +1 -1
  87. data/productions/examples/sandbox/homer/styles.rb +1 -1
  88. data/productions/examples/sandbox/inputs/players/button_input.rb +1 -1
  89. data/productions/examples/sandbox/inputs/players/check_box_input.rb +1 -1
  90. data/productions/examples/sandbox/inputs/players/combo_box_input.rb +3 -3
  91. data/productions/examples/sandbox/inputs/players/radio_button_input.rb +1 -1
  92. data/productions/examples/sandbox/inputs/players/text_area_input.rb +1 -1
  93. data/productions/examples/sandbox/inputs/players/text_box_input.rb +1 -1
  94. data/productions/examples/sandbox/inputs/props.rb +3 -3
  95. data/productions/examples/sandbox/inputs/styles.rb +2 -1
  96. data/productions/examples/sandbox/players/sandbox.rb +1 -1
  97. data/productions/examples/sandbox/rounded_corners/players/box.rb +1 -1
  98. data/productions/examples/sandbox/rounded_corners/props.rb +1 -1
  99. data/productions/examples/sandbox/rounded_corners/styles.rb +1 -1
  100. data/productions/examples/sandbox/scrolling/players/add_button.rb +19 -0
  101. data/productions/examples/sandbox/scrolling/players/cell.rb +1 -2
  102. data/productions/examples/sandbox/scrolling/props.rb +9 -4
  103. data/productions/examples/sandbox/scrolling/styles.rb +10 -1
  104. data/productions/examples/sandbox/sketching/players/sketchpad.rb +1 -1
  105. data/productions/examples/sandbox/sketching/props.rb +1 -1
  106. data/productions/examples/sandbox/sketching/styles.rb +1 -2
  107. data/productions/examples/sandbox/sounds/bird.au +0 -0
  108. data/productions/examples/sandbox/sounds/cat.au +0 -0
  109. data/productions/examples/sandbox/sounds/cow.au +0 -0
  110. data/productions/examples/sandbox/sounds/dog.au +0 -0
  111. data/productions/examples/sandbox/sounds/donkey.au +0 -0
  112. data/productions/examples/sandbox/sounds/duck.au +0 -0
  113. data/productions/examples/sandbox/sounds/players/clip.rb +10 -0
  114. data/productions/examples/sandbox/sounds/props.rb +10 -0
  115. data/productions/examples/sandbox/sounds/styles.rb +17 -0
  116. data/productions/examples/sandbox/stages.rb +2 -1
  117. data/productions/examples/sandbox/styles.rb +6 -6
  118. data/productions/examples/sandbox/teaser/players/fader.rb +22 -16
  119. data/productions/examples/sandbox/teaser/props.rb +1 -1
  120. data/productions/examples/sandbox/teaser/styles.rb +1 -1
  121. data/productions/examples/tutorials/tutorial_1/players/sample.rb +1 -1
  122. data/productions/examples/tutorials/tutorial_1/props.rb +1 -1
  123. data/productions/examples/tutorials/tutorial_1/styles.rb +1 -1
  124. data/productions/stage_composer/init.rb +1 -1
  125. data/productions/stage_composer/inspector/players/inspector.rb +1 -1
  126. data/productions/stage_composer/inspector/players/prop_row.rb +1 -1
  127. data/productions/stage_composer/inspector/players/prop_tree.rb +1 -1
  128. data/productions/stage_composer/inspector/players/style_table.rb +1 -1
  129. data/productions/stage_composer/inspector/players/style_value.rb +1 -1
  130. data/productions/stage_composer/inspector/props.rb +2 -2
  131. data/productions/stage_composer/inspector/styles.rb +3 -3
  132. data/productions/stage_composer/lib/init.rb +1 -1
  133. data/productions/stage_composer/lib/limelight/composer/controller.rb +1 -1
  134. data/productions/stage_composer/lib/limelight/composer/lethargy.rb +1 -1
  135. data/productions/stage_composer/production.rb +1 -1
  136. data/productions/stage_composer/stages.rb +1 -1
  137. data/productions/startup/players/browse_button.rb +3 -0
  138. data/productions/startup/players/download_button.rb +4 -1
  139. data/productions/startup/players/sandbox_button.rb +4 -1
  140. data/productions/startup/props.rb +3 -5
  141. data/productions/startup/styles.rb +5 -5
  142. data/spec/builtin/players/button_spec.rb +21 -0
  143. data/spec/builtin/players/check_box_spec.rb +29 -0
  144. data/spec/builtin/players/combo_box_spec.rb +29 -0
  145. data/spec/{players → builtin/players}/radio_button_spec.rb +9 -20
  146. data/spec/builtin/players/text_area_spec.rb +27 -0
  147. data/spec/builtin/players/text_box_spec.rb +27 -0
  148. data/spec/casting_director_spec.rb +3 -3
  149. data/spec/commands_spec.rb +2 -2
  150. data/spec/file_chooser_spec.rb +1 -1
  151. data/spec/file_filter_spec.rb +1 -1
  152. data/spec/java_util_spec.rb +1 -1
  153. data/spec/loaders/file_loader_spec.rb +1 -1
  154. data/spec/paint_action_spec.rb +1 -1
  155. data/spec/pen_spec.rb +1 -1
  156. data/spec/producer_spec.rb +14 -4
  157. data/spec/production_builder_spec.rb +1 -1
  158. data/spec/production_spec.rb +1 -1
  159. data/spec/prop_builder_spec.rb +1 -1
  160. data/spec/prop_spec.rb +66 -5
  161. data/spec/scene_spec.rb +2 -2
  162. data/spec/spec_helper.rb +4 -1
  163. data/spec/stage_builder_spec.rb +1 -1
  164. data/spec/stage_spec.rb +1 -1
  165. data/spec/styles_builder_spec.rb +34 -2
  166. data/spec/theater_spec.rb +1 -1
  167. metadata +130 -106
  168. data/lib/limelight/players.rb +0 -9
  169. data/lib/limelight/players/button.rb +0 -29
  170. data/lib/limelight/players/check_box.rb +0 -38
  171. data/lib/limelight/players/combo_box.rb +0 -44
  172. data/lib/limelight/players/radio_button.rb +0 -47
  173. data/lib/limelight/players/text_area.rb +0 -25
  174. data/lib/limelight/players/text_box.rb +0 -25
  175. data/spec/players/button_spec.rb +0 -31
  176. data/spec/players/check_box_spec.rb +0 -40
  177. data/spec/players/combo_box_spec.rb +0 -39
  178. data/spec/players/text_area_spec.rb +0 -37
  179. data/spec/players/text_box_spec.rb +0 -37
@@ -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 'optparse'
@@ -15,7 +15,7 @@ module Limelight
15
15
  end
16
16
 
17
17
  def run(args)
18
- Java::limelight::Main.initialize_context
18
+ Main.initialize_context
19
19
  require 'limelight/producer'
20
20
  production = args.length > 0 ? args[0] : DEFAULT_PRODUCTION
21
21
  Limelight::Producer.open(production)
@@ -28,7 +28,7 @@ module Limelight
28
28
  end
29
29
 
30
30
  def run(args)
31
- packer = Java::limelight::io::Packer.new
31
+ packer = Limelight::Util::Packer.new
32
32
  packer.pack(args.shift)
33
33
  end
34
34
  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 'limelight/file_filter'
@@ -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
  module Limelight
@@ -0,0 +1,57 @@
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
+ module Limelight
5
+
6
+ Main = Java::limelight.Main
7
+ SceneLoader = Java::limelight.SceneLoader
8
+ Context = Java::limelight.Context
9
+ AnimationTask = Java::limelight.AnimationTask
10
+
11
+ module Styles
12
+ Style = Java::limelight.styles.Style
13
+ FlatStyle = Java::limelight.styles.FlatStyle
14
+ RichStyle = Java::limelight.styles.RichStyle
15
+ ScreenableStyle = Java::limelight.styles.ScreenableStyle
16
+ end
17
+
18
+ module Util
19
+ Colors = Java::limelight.util.Colors
20
+ end
21
+
22
+ module UI
23
+
24
+ ButtonGroupCache = Java::limelight.ui.ButtonGroupCache
25
+
26
+ module Model
27
+ Frame = Java::limelight.ui.model.Frame
28
+ Panel = Java::limelight.ui.model.PropPanel
29
+ module Inputs
30
+ ButtonPanel = Java::limelight.ui.model.inputs.ButtonPanel
31
+ CheckBoxPanel = Java::limelight.ui.model.inputs.CheckBoxPanel
32
+ ComboBoxPanel = Java::limelight.ui.model.inputs.ComboBoxPanel
33
+ RadioButtonPanel = Java::limelight.ui.model.inputs.RadioButtonPanel
34
+ TextAreaPanel = Java::limelight.ui.model.inputs.TextAreaPanel
35
+ TextBoxPanel = Java::limelight.ui.model.inputs.TextBoxPanel
36
+ end
37
+ end
38
+
39
+ module Api
40
+ Scene = Java::limelight.ui.api.Scene
41
+ Prop = Java::limelight.ui.api.Prop
42
+ Stage = Java::limelight.ui.api.Stage
43
+ Theater = Java::limelight.ui.api.Theater
44
+ end
45
+
46
+ module Painting
47
+ PaintAction = Java::limelight.ui.painting.PaintAction
48
+ end
49
+
50
+ end
51
+
52
+ module Util
53
+
54
+ Packer = Java::limelight.io.Packer
55
+
56
+ end
57
+ 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
  class Class
@@ -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
  module Limelight
@@ -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
  module Limelight
@@ -6,7 +6,7 @@ module Limelight
6
6
 
7
7
  class FileSceneLoader
8
8
 
9
- include Java::limelight.SceneLoader
9
+ include SceneLoader
10
10
 
11
11
  attr_reader :root
12
12
 
@@ -21,6 +21,7 @@ module Limelight
21
21
  end
22
22
 
23
23
  def path_to(path)
24
+ #TODO What about windoze?
24
25
  if(path[0] == "/"[0])
25
26
  return path
26
27
  else
@@ -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
  module Limelight
@@ -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 'limelight/pen'
@@ -7,7 +7,7 @@ module Limelight
7
7
 
8
8
  class PaintAction
9
9
 
10
- include Java::limelight.ui.painting.PaintAction
10
+ include UI::Painting::PaintAction
11
11
 
12
12
  attr_reader :block
13
13
 
data/lib/limelight/pen.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
  module Limelight
@@ -15,7 +15,7 @@ module Limelight
15
15
  end
16
16
 
17
17
  def color=(value)
18
- resolve_color = Java::limelight.ui.Colors.resolve(value)
18
+ resolve_color = Util::Colors.resolve(value)
19
19
  @context.setColor(resolve_color)
20
20
  end
21
21
 
@@ -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 'limelight/loaders/file_scene_loader'
@@ -22,6 +22,7 @@ module Limelight
22
22
  end
23
23
 
24
24
  attr_reader :loader, :theater, :production
25
+ attr_writer :builtin_styles
25
26
 
26
27
  def initialize(root_path, theater=nil, production=nil)
27
28
  if(root_path[-4..-1] == ".llp")
@@ -84,11 +85,12 @@ module Limelight
84
85
  end
85
86
 
86
87
  def load_styles(path)
87
- return {} if path.nil?
88
+ styles = builtin_styles
89
+ return styles if path.nil?
88
90
  filename = File.join(path, "styles.rb")
89
- return {} if not @loader.exists?(filename)
91
+ return styles if not @loader.exists?(filename)
90
92
  content = @loader.load(filename)
91
- return Limelight.build_styles do
93
+ return Limelight.build_styles(styles) do
92
94
  begin
93
95
  eval content
94
96
  rescue Exception => e
@@ -132,10 +134,24 @@ module Limelight
132
134
  end
133
135
 
134
136
  def unpack_production(production_name)
135
- packer = Java::limelight::io.Packer.new()
137
+ packer = Limelight::Util::Packer.new()
136
138
  return packer.unpack(production_name)
137
139
  end
138
140
 
141
+ def builtin_styles
142
+ return @builtin_styles if @builtin_styles
143
+ builtin_styles_file = File.join($LIMELIGHT_LIB, "limelight", "builtin", "styles.rb")
144
+ content = IO.read(builtin_styles_file)
145
+ @builtin_styles = Limelight.build_styles do
146
+ begin
147
+ eval content
148
+ rescue Exception => e
149
+ raise BuildException.new(filename, content, e)
150
+ end
151
+ end
152
+ return @builtin_styles
153
+ end
154
+
139
155
  end
140
156
 
141
157
  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 'limelight/limelight_exception'
@@ -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 'limelight/production'
@@ -1,9 +1,10 @@
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 'limelight/java_util'
5
5
  require 'limelight/pen'
6
6
  require 'limelight/paint_action'
7
+ require 'limelight/animation'
7
8
 
8
9
  module Limelight
9
10
  class Prop
@@ -14,7 +15,7 @@ module Limelight
14
15
  @events ||= []
15
16
  syms.each do |sym|
16
17
  @events << sym unless @events.include?(sym)
17
- define_method(sym) { |event| } # do nothing by default
18
+ define_method(sym) { |event| } # do nothing by default
18
19
  end
19
20
  end
20
21
 
@@ -24,24 +25,24 @@ module Limelight
24
25
 
25
26
  end
26
27
 
27
- include Java::limelight.ui.Prop
28
+ include UI::Api::Prop
28
29
 
29
- attr_reader :panel, :style, :children, :scene, :parent
30
+ attr_reader :panel, :style, :hover_style, :children, :scene, :parent
30
31
  attr_reader :name, :id, :players
31
- getters :panel, :style, :scene, :name, :text
32
+ getters :panel, :style, :hover_style, :scene, :name, :text
32
33
  setters :text
33
34
 
34
35
  def initialize(hash = {})
35
36
  @options = hash
36
37
  @children = []
37
- @panel = Java::limelight.ui.Panel.new(self)
38
- @style = Java::limelight.ui.ScreenableStyle.new
38
+ @style = Styles::ScreenableStyle.new
39
+ @panel = UI::Model::Panel.new(self)
39
40
  end
40
41
 
41
42
  def add(child)
43
+ child.set_parent(self)
42
44
  @children << child
43
45
  @panel.add(child.panel)
44
- child.set_parent(self)
45
46
  end
46
47
 
47
48
  def <<(child)
@@ -99,7 +100,7 @@ module Limelight
99
100
  return result if result
100
101
  end
101
102
  return nil
102
- end
103
+ end
103
104
 
104
105
  def find_by_name(name, results = [])
105
106
  results << self if @name == name
@@ -108,11 +109,11 @@ module Limelight
108
109
  end
109
110
 
110
111
  def text=(value)
111
- @panel.text_accessor.text = value
112
+ @panel.text = value
112
113
  end
113
114
 
114
115
  def text
115
- return panel.text_accessor.text
116
+ return panel.text
116
117
  end
117
118
 
118
119
  #TODO - MDM - DELETE ME
@@ -152,35 +153,31 @@ module Limelight
152
153
  end
153
154
 
154
155
  def area
155
- return panel.get_rectangle.clone
156
+ return panel.get_box.clone
156
157
  end
157
158
 
158
159
  def bordered_area
159
- return panel.get_rectangle_inside_borders.clone
160
+ return panel.get_box_inside_borders.clone
160
161
  end
161
162
 
162
163
  def pen
163
164
  return Pen.new(panel.getGraphics)
164
165
  end
165
166
 
166
- # GUI Events ##########################################
167
-
168
- def hover_on
169
- return nil if @hover_style.nil?
170
- @panel.setCursor(java.awt.Cursor.new(java.awt.Cursor::HAND_CURSOR))
171
- style.applyScreen(@hover_style)
172
- update
167
+ def play_sound(filename)
168
+ @panel.play_sound(@scene.loader.path_to(filename))
173
169
  end
174
-
175
- def hover_off
176
- return nil if @hover_style.nil?
177
- @panel.setCursor(java.awt.Cursor.new(java.awt.Cursor::DEFAULT_CURSOR))
178
- @style.removeScreen()
179
- update
170
+
171
+ def animate(options={}, &block)
172
+ animation = Animation.new(self, block, options)
173
+ animation.start
174
+ return animation
180
175
  end
181
176
 
177
+ # GUI Events ##########################################
178
+
182
179
  EVENTS = [:mouse_clicked, :mouse_entered, :mouse_exited, :mouse_pressed, :mouse_released, :mouse_dragged, :mouse_moved,
183
- :key_typed, :key_pressed, :key_released, :focus_gained, :focus_lost, :state_changed, :button_pressed, :item_state_changed]
180
+ :key_typed, :key_pressed, :key_released, :focus_gained, :focus_lost, :button_pressed, :value_changed]
184
181
 
185
182
  event *EVENTS
186
183
 
@@ -192,6 +189,7 @@ module Limelight
192
189
  @id = @options.delete(:id)
193
190
  @name = @options.delete(:name)
194
191
  @players = @options.delete(:players)
192
+ @additional_styles = @options.delete(:styles)
195
193
 
196
194
  inherit_styles
197
195
  @scene.casting_director.fill_cast(self)
@@ -206,7 +204,7 @@ module Limelight
206
204
  if self.respond_to?(setter_sym)
207
205
  self.send(setter_sym, value)
208
206
  elsif self.style.respond_to?(setter_sym)
209
- self.style.send(setter_sym, value)
207
+ self.style.send(setter_sym, value.to_s)
210
208
  elsif is_event_setter(key)
211
209
  define_event(key, value)
212
210
  end
@@ -224,18 +222,30 @@ module Limelight
224
222
  end
225
223
 
226
224
  def inherit_styles
227
- return if @name.nil?
228
- new_style = @scene.styles[@name]
229
- @style.add_extension(new_style) if new_style
230
- @hover_style = scene.styles["#{@name}.hover"]
231
- end
232
-
233
- def disinherit_styles
234
- return if @name.nil?
235
- old_style = @scene.styles[@name]
236
- @style.remove_extension(old_style) if old_style
237
- @hover_style = nil
225
+ style_names = []
226
+ style_names << @name unless @name.nil?
227
+ style_names += @additional_styles.gsub(',', ' ').split(' ') unless @additional_styles.nil?
228
+ style_names.each do |style_name|
229
+ new_style = @scene.styles[style_name]
230
+ @style.add_extension(new_style) if new_style
231
+ new_hover_style = scene.styles["#{style_name}.hover"]
232
+ if new_hover_style
233
+ if @hover_style.nil?
234
+ @hover_style = new_hover_style
235
+ else
236
+ @hover_style.add_extension(new_hover_style)
237
+ end
238
+ end
239
+ end
238
240
  end
241
+
242
+ # Why is this method here? No one appears to use it.
243
+ # def disinherit_styles
244
+ # return if @name.nil?
245
+ # old_style = @scene.styles[@name]
246
+ # @style.remove_extension(old_style) if old_style
247
+ # @hover_style = nil
248
+ # end
239
249
 
240
250
  end
241
251
  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 'limelight/prop'
@@ -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 'limelight/java_util'
@@ -8,11 +8,11 @@ require 'limelight/button_group_cache'
8
8
  module Limelight
9
9
  class Scene < Prop
10
10
 
11
- include Java::limelight.ui.Scene
11
+ include UI::Api::Scene
12
12
 
13
13
  attr_reader :button_groups, :styles, :casting_director
14
14
  attr_accessor :stage, :loader, :visible, :path, :production
15
- getters :stage, :loader
15
+ getters :stage, :loader, :styles
16
16
  setters :stage
17
17
  event :scene_opened
18
18