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.
- 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
data/lib/limelight/commands.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 'optparse'
|
@@ -15,7 +15,7 @@ module Limelight
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def run(args)
|
18
|
-
|
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 =
|
31
|
+
packer = Limelight::Util::Packer.new
|
32
32
|
packer.pack(args.shift)
|
33
33
|
end
|
34
34
|
end
|
@@ -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
|
data/lib/limelight/java_util.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
|
@@ -6,7 +6,7 @@ module Limelight
|
|
6
6
|
|
7
7
|
class FileSceneLoader
|
8
8
|
|
9
|
-
include
|
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
|
data/lib/limelight/menu_bar.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 'limelight/pen'
|
@@ -7,7 +7,7 @@ module Limelight
|
|
7
7
|
|
8
8
|
class PaintAction
|
9
9
|
|
10
|
-
include
|
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 =
|
18
|
+
resolve_color = Util::Colors.resolve(value)
|
19
19
|
@context.setColor(resolve_color)
|
20
20
|
end
|
21
21
|
|
data/lib/limelight/producer.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 '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
|
-
|
88
|
+
styles = builtin_styles
|
89
|
+
return styles if path.nil?
|
88
90
|
filename = File.join(path, "styles.rb")
|
89
|
-
return
|
91
|
+
return styles if not @loader.exists?(filename)
|
90
92
|
content = @loader.load(filename)
|
91
|
-
return
|
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 =
|
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
|
data/lib/limelight/production.rb
CHANGED
data/lib/limelight/prop.rb
CHANGED
@@ -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|
|
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
|
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
|
-
@
|
38
|
-
@
|
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.
|
112
|
+
@panel.text = value
|
112
113
|
end
|
113
114
|
|
114
115
|
def text
|
115
|
-
return panel.
|
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.
|
156
|
+
return panel.get_box.clone
|
156
157
|
end
|
157
158
|
|
158
159
|
def bordered_area
|
159
|
-
return panel.
|
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
|
-
|
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
|
176
|
-
|
177
|
-
|
178
|
-
|
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, :
|
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
|
-
|
228
|
-
|
229
|
-
@
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
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
|
data/lib/limelight/scene.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 '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
|
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
|
|