swing 0.0.1 → 0.0.2
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/HISTORY +4 -0
- data/VERSION +1 -1
- data/lib/swing/action_listener.rb +1 -1
- data/lib/swing/button.rb +22 -0
- data/lib/swing/check_box.rb +23 -0
- data/lib/swing/controls.rb +4 -47
- data/lib/swing/frame.rb +1 -1
- data/lib/swing/label.rb +16 -0
- data/lib/swing/list.rb +1 -1
- data/lib/swing/menu.rb +19 -0
- data/lib/swing/{menus.rb → menu_bar.rb} +3 -23
- data/lib/swing/menu_item.rb +19 -0
- data/lib/swing/panel.rb +1 -1
- data/lib/swing/scroll_pane.rb +1 -1
- data/lib/swing/split_pane.rb +1 -1
- data/lib/swing/table.rb +1 -1
- metadata +7 -2
data/HISTORY
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/swing/button.rb
ADDED
@@ -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
|
data/lib/swing/controls.rb
CHANGED
@@ -1,47 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'swing/
|
3
|
-
|
4
|
-
|
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
data/lib/swing/label.rb
ADDED
@@ -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
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/
|
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
data/lib/swing/scroll_pane.rb
CHANGED
data/lib/swing/split_pane.rb
CHANGED
data/lib/swing/table.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: swing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
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/
|
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
|