swing 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY CHANGED
@@ -5,3 +5,7 @@
5
5
  == 0.0.1 / 2011-05-21
6
6
 
7
7
  * Initial draft
8
+
9
+ == 0.0.2 / 2011-05-21
10
+
11
+ * Splitting source files
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -2,7 +2,7 @@ include Java
2
2
 
3
3
  module Clients
4
4
 
5
- module SwingGui
5
+ module Swing
6
6
  # Class that implements ActionListener interface around a given block
7
7
  class ActionListener
8
8
  java_implements java.awt.event.ActionListener
@@ -0,0 +1,22 @@
1
+ require 'swing/action_listener'
2
+ require 'swing/attr_setter'
3
+
4
+ module Clients
5
+ module Swing
6
+
7
+ class Button < javax.swing.JButton
8
+ include AttrSetter
9
+
10
+ attr_setter :enabled
11
+
12
+ def initialize text, opts = {}, &block
13
+ set_attributes(opts) { super(text) }
14
+
15
+ self.addActionListener ActionListener.new &block
16
+
17
+ opts[:parent].add self if opts[:parent]
18
+ end
19
+ end # class Button
20
+
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ require 'swing/action_listener'
2
+ require 'swing/attr_setter'
3
+
4
+ module Clients
5
+ module Swing
6
+
7
+ class CheckBox < javax.swing.JCheckBox
8
+ include AttrSetter
9
+
10
+ attr_setter :selected
11
+
12
+ def initialize text, opts = {}, &block
13
+ set_attributes(opts) { super(text) }
14
+
15
+ # TODO: Probably need to implement ItemListener as well?
16
+ self.addActionListener ActionListener.new &block
17
+
18
+ opts[:parent].add self if opts[:parent]
19
+ end
20
+ end # class CheckBox
21
+
22
+ end
23
+ end
@@ -1,47 +1,4 @@
1
- require 'swing/action_listener'
2
- require 'swing/attr_setter'
3
-
4
- module Clients
5
-
6
- # Swing-based GUI controls
7
- module SwingGui
8
-
9
- class Button < javax.swing.JButton
10
- include AttrSetter
11
-
12
- attr_setter :enabled
13
-
14
- def initialize text, opts = {}, &block
15
- set_attributes(opts) { super(text) }
16
-
17
- self.addActionListener ActionListener.new &block
18
-
19
- opts[:parent].add self if opts[:parent]
20
- end
21
- end # class Button
22
-
23
- class CheckBox < javax.swing.JCheckBox
24
- include AttrSetter
25
-
26
- attr_setter :selected
27
-
28
- def initialize text, opts = {}, &block
29
- set_attributes(opts) { super(text) }
30
-
31
- # TODO: Probably need to implement ItemListener as well?
32
- self.addActionListener ActionListener.new &block
33
-
34
- opts[:parent].add self if opts[:parent]
35
- end
36
- end # class CheckBox
37
-
38
- class Label < javax.swing.JLabel
39
- include AttrSetter
40
-
41
- def initialize text, opts = {}, &block
42
- set_attributes(opts) { super(text) }
43
- opts[:parent].add self if opts[:parent]
44
- end
45
- end # class Label
46
- end
47
- end
1
+ # Swing-based GUI controls
2
+ require 'swing/label'
3
+ require 'swing/button'
4
+ require 'swing/check_box'
data/lib/swing/frame.rb CHANGED
@@ -5,7 +5,7 @@ import javax.swing.JFrame
5
5
  module Clients
6
6
 
7
7
  # Swing-based GUI controls
8
- module SwingGui
8
+ module Swing
9
9
 
10
10
  class Frame < JFrame
11
11
  include AttrSetter
@@ -0,0 +1,16 @@
1
+ require 'swing/action_listener'
2
+ require 'swing/attr_setter'
3
+
4
+ module Clients
5
+ module Swing
6
+
7
+ class Label < javax.swing.JLabel
8
+ include AttrSetter
9
+
10
+ def initialize text, opts = {}, &block
11
+ set_attributes(opts) { super(text) }
12
+ opts[:parent].add self if opts[:parent]
13
+ end
14
+ end # class Label
15
+ end
16
+ end
data/lib/swing/list.rb CHANGED
@@ -3,7 +3,7 @@ require 'swing/attr_setter'
3
3
  module Clients
4
4
 
5
5
  # Swing-based GUI controls
6
- module SwingGui
6
+ module Swing
7
7
 
8
8
  class List < javax.swing.JList
9
9
  include AttrSetter
data/lib/swing/menu.rb ADDED
@@ -0,0 +1,19 @@
1
+ require 'swing/attr_setter'
2
+
3
+ module Clients
4
+
5
+ # Swing-based Menu elements
6
+ module Swing
7
+
8
+ class Menu < javax.swing.JMenu
9
+ include AttrSetter
10
+
11
+ def initialize text, opts = {}
12
+ set_attributes(opts) { super text }
13
+ opts[:parent].add self if opts[:parent]
14
+ end
15
+ end
16
+
17
+ end
18
+ end
19
+
@@ -1,10 +1,9 @@
1
- require 'swing/action_listener'
1
+ require 'swing/menu'
2
+ require 'swing/menu_item'
2
3
  require 'swing/attr_setter'
3
4
 
4
5
  module Clients
5
-
6
- # Swing-based Menu elements
7
- module SwingGui
6
+ module Swing
8
7
 
9
8
  class MenuBar < javax.swing.JMenuBar
10
9
  include AttrSetter
@@ -31,25 +30,6 @@ module Clients
31
30
  end
32
31
  end
33
32
 
34
- class Menu < javax.swing.JMenu
35
- include AttrSetter
36
-
37
- def initialize text, opts = {}
38
- set_attributes(opts) { super text }
39
- opts[:parent].add self if opts[:parent]
40
- end
41
- end
42
-
43
- class MenuItem < javax.swing.JMenuItem
44
- include AttrSetter
45
-
46
- def initialize text, opts = {}, &block
47
- set_attributes(opts) { super text }
48
- self.addActionListener ActionListener.new &block
49
- opts[:parent].add self if opts[:parent]
50
- end
51
- end
52
-
53
33
  end
54
34
  end
55
35
 
@@ -0,0 +1,19 @@
1
+ require 'swing/action_listener'
2
+ require 'swing/attr_setter'
3
+
4
+ module Clients
5
+ module Swing
6
+
7
+ class MenuItem < javax.swing.JMenuItem
8
+ include AttrSetter
9
+
10
+ def initialize text, opts = {}, &block
11
+ set_attributes(opts) { super text }
12
+ self.addActionListener ActionListener.new &block
13
+ opts[:parent].add self if opts[:parent]
14
+ end
15
+ end
16
+
17
+ end
18
+ end
19
+
data/lib/swing/panel.rb CHANGED
@@ -3,7 +3,7 @@ require 'swing/attr_setter'
3
3
  module Clients
4
4
 
5
5
  # Swing-based GUI controls
6
- module SwingGui
6
+ module Swing
7
7
 
8
8
  class Panel < javax.swing.JPanel
9
9
  include AttrSetter
@@ -3,7 +3,7 @@ require 'swing/attr_setter'
3
3
  module Clients
4
4
 
5
5
  # Swing-based GUI controls
6
- module SwingGui
6
+ module Swing
7
7
 
8
8
  # Scroll Pane around given scrollable component
9
9
  class ScrollPane < javax.swing.JScrollPane
@@ -4,7 +4,7 @@ import javax.swing.JSplitPane
4
4
  module Clients
5
5
 
6
6
  # Swing-based GUI controls
7
- module SwingGui
7
+ module Swing
8
8
 
9
9
  class SplitPane < JSplitPane
10
10
  include AttrSetter
data/lib/swing/table.rb CHANGED
@@ -3,7 +3,7 @@ require 'swing/attr_setter'
3
3
  module Clients
4
4
 
5
5
  # Swing-based GUI controls
6
- module SwingGui
6
+ module Swing
7
7
 
8
8
  class Table < javax.swing.JTable
9
9
  include AttrSetter
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: swing
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - arvicco
@@ -53,10 +53,15 @@ files:
53
53
  - lib/version.rb
54
54
  - lib/swing/action_listener.rb
55
55
  - lib/swing/attr_setter.rb
56
+ - lib/swing/button.rb
57
+ - lib/swing/check_box.rb
56
58
  - lib/swing/controls.rb
57
59
  - lib/swing/frame.rb
60
+ - lib/swing/label.rb
58
61
  - lib/swing/list.rb
59
- - lib/swing/menus.rb
62
+ - lib/swing/menu.rb
63
+ - lib/swing/menu_bar.rb
64
+ - lib/swing/menu_item.rb
60
65
  - lib/swing/panel.rb
61
66
  - lib/swing/scroll_pane.rb
62
67
  - lib/swing/split_pane.rb