glimmer-dsl-swt 4.23.0.0 → 4.23.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +5 -5
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +2 -2
- data/glimmer-dsl-swt.gemspec +0 -0
- data/samples/elaborate/tetris/model/game.rb +26 -24
- data/samples/elaborate/tetris/view/score_lane.rb +5 -1
- data/samples/elaborate/tetris/view/tetris_menu_bar.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aabbb159eb1d27e98f8d8a51a9068c43e33a91e4bf249f44d0a965af81a4d8a
|
4
|
+
data.tar.gz: b4e45c49a1347c57ff6e7c8a5798dec9dba7d591e1f8aaf26f773b2708908c97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64fb826450b35b43049a31b8f36bbdceb9d24c28e3b193e0d73322ca81f4d0f429a0a678ebd6c61c1d23ad3bd4e04618dabd95b0d6462ee32ec202a24be66842
|
7
|
+
data.tar.gz: 9cc1a23579587dd4694a496052a83a4f886ec7762622526595831784c4531fa1c9345d2c6ccc67f8cb93b8fef1e69a510e5b0aa471641db7f4746fd0f83e0e04
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 4.23.0.1
|
4
|
+
|
5
|
+
- Add "Speed" menu to the Tetris sample
|
6
|
+
- Add "Show Next Block Preview" View menu item to the Tetris sample
|
7
|
+
- Document Glimmer::UI::Application alias for Glimmer::UI::CustomShell
|
8
|
+
|
3
9
|
## 4.23.0.0
|
4
10
|
|
5
11
|
- Upgrade to SWT 4.23
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.23.0.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for SWT 4.23.0.1
|
2
2
|
## JRuby Desktop Development GUI Framework
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
|
4
4
|
[![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
|
@@ -19,7 +19,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
19
19
|
|
20
20
|
![Eclipse SWT RCP NASA Mars Rover](/images/glimmer-eclipse-swt-rcp-nasa-mars-rover.png)
|
21
21
|
|
22
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.23.0.
|
22
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.23.0.1 includes [SWT 4.23](https://download.eclipse.org/eclipse/downloads/drops4/R-4.23-202203080310/), which was released on March 8, 2022. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT.
|
23
23
|
|
24
24
|
**Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword.
|
25
25
|
|
@@ -333,7 +333,7 @@ jgem install glimmer-dsl-swt
|
|
333
333
|
|
334
334
|
Or this command if you want a specific version:
|
335
335
|
```
|
336
|
-
jgem install glimmer-dsl-swt -v 4.23.0.
|
336
|
+
jgem install glimmer-dsl-swt -v 4.23.0.1
|
337
337
|
```
|
338
338
|
|
339
339
|
`jgem` is JRuby's version of `gem` command.
|
@@ -361,7 +361,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
361
361
|
|
362
362
|
Add the following to `Gemfile`:
|
363
363
|
```
|
364
|
-
gem 'glimmer-dsl-swt', '~> 4.23.0.
|
364
|
+
gem 'glimmer-dsl-swt', '~> 4.23.0.1'
|
365
365
|
```
|
366
366
|
|
367
367
|
And, then run:
|
@@ -384,7 +384,7 @@ glimmer
|
|
384
384
|
```
|
385
385
|
|
386
386
|
```
|
387
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.23.0.
|
387
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.23.0.1
|
388
388
|
|
389
389
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
390
390
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.23.0.
|
1
|
+
4.23.0.1
|
@@ -332,8 +332,8 @@ This is not an exaustive list, but should give you a good start in learning Glim
|
|
332
332
|
- `time`: featured in [Hello, Table!](/docs/reference/GLIMMER_SAMPLES.md#hello-table) / [Hello, Date Time!](/docs/reference/GLIMMER_SAMPLES.md#hello-date-time)
|
333
333
|
- `tool_bar`: featured in [Hello, Tool Bar!](/docs/reference/GLIMMER_SAMPLES.md#hello-tool-bar)
|
334
334
|
- `tool_item`: featured in [Hello, Tool Bar!](/docs/reference/GLIMMER_SAMPLES.md#hello-tool-bar)
|
335
|
-
- Glimmer::UI::CustomWidget
|
336
|
-
- Glimmer::UI::CustomShell: ability to define any keyword as a custom shell (aka custom window
|
335
|
+
- `Glimmer::UI::CustomWidget`: ability to define any keyword as a custom widget - featured in [Hello, Custom Widget!](/docs/reference/GLIMMER_SAMPLES.md#hello-custom-widget)
|
336
|
+
- `Glimmer::UI::CustomShell` (alias: `Glimmer::UI::Application`): ability to define any keyword as a custom shell (aka custom window or app) - featured in [Hello, Custom Shell!](/docs/reference/GLIMMER_SAMPLES.md#hello-custom-shell)
|
337
337
|
|
338
338
|
**Layouts:**
|
339
339
|
- `grid_layout`: featured in [Hello, Layout!](/docs/reference/GLIMMER_SAMPLES.md#hello-layout) / [Hello, Custom Shell!](/docs/reference/GLIMMER_SAMPLES.md#hello-custom-shell) / [Hello, Computed!](/docs/reference/GLIMMER_SAMPLES.md#hello-computed) / [Hello, Table!](/docs/reference/GLIMMER_SAMPLES.md#hello-table) / [Hello, Pop Up Context Menu!](/docs/reference/GLIMMER_SAMPLES.md#hello-pop-up-context-menu) / [Hello, Menu Bar!](/docs/reference/GLIMMER_SAMPLES.md#hello-menu-bar) / [Hello, List Single Selection!](/docs/reference/GLIMMER_SAMPLES.md#hello-list-single-selection) / [Hello, List Multi Selection!](/docs/reference/GLIMMER_SAMPLES.md#hello-list-multi-selection) / [Contact Manager](/docs/reference/GLIMMER_SAMPLES.md#contact-manager) / [Login](/docs/reference/GLIMMER_SAMPLES.md#login) / [Tic Tac Toe](/docs/reference/GLIMMER_SAMPLES.md#tic-tac-toe)
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -36,21 +36,27 @@ class Tetris
|
|
36
36
|
PREVIEW_PLAYFIELD_WIDTH = 4
|
37
37
|
PREVIEW_PLAYFIELD_HEIGHT = 2
|
38
38
|
SCORE_MULTIPLIER = {1 => 40, 2 => 100, 3 => 300, 4 => 1200}
|
39
|
+
UP_ARROW_ACTIONS = %i[instant_down rotate_right rotate_left]
|
40
|
+
SPEEDS = %i[snail sloth turtle rabbit gorilla bear horse gazelle cheetah falcon]
|
41
|
+
SPEED_INITIAL_DELAYS = SPEEDS.each_with_index.inject({}) {|hash, speed_index_pair| hash.merge(speed_index_pair.first => 1.1 - speed_index_pair.last*(0.1)) }
|
39
42
|
|
40
43
|
attr_reader :playfield_width, :playfield_height
|
41
|
-
attr_accessor :game_over, :paused, :preview_tetromino, :lines, :score, :level, :high_scores, :beeping, :added_high_score, :show_high_scores, :up_arrow_action
|
44
|
+
attr_accessor :game_over, :paused, :preview_tetromino, :lines, :score, :level, :high_scores, :beeping, :added_high_score, :show_high_scores, :up_arrow_action, :show_preview_tetromino, :initial_delay
|
42
45
|
alias game_over? game_over
|
43
46
|
alias paused? paused
|
44
47
|
alias beeping? beeping
|
45
48
|
alias added_high_score? added_high_score
|
49
|
+
alias show_preview_tetromino? show_preview_tetromino
|
46
50
|
|
47
51
|
def initialize(playfield_width = PLAYFIELD_WIDTH, playfield_height = PLAYFIELD_HEIGHT)
|
52
|
+
@initial_delay = SPEED_INITIAL_DELAYS[:snail]
|
48
53
|
@playfield_width = playfield_width
|
49
54
|
@playfield_height = playfield_height
|
50
55
|
@high_scores = []
|
51
56
|
@show_high_scores = false
|
52
57
|
@beeping = true
|
53
58
|
@up_arrow_action = :rotate_left
|
59
|
+
@show_preview_tetromino = true
|
54
60
|
load_high_scores!
|
55
61
|
end
|
56
62
|
|
@@ -198,35 +204,31 @@ class Tetris
|
|
198
204
|
end
|
199
205
|
|
200
206
|
def delay
|
201
|
-
[
|
207
|
+
[@initial_delay - (level.to_i * 0.1), 0.001].max
|
202
208
|
end
|
203
209
|
|
204
210
|
def beep
|
205
211
|
@beeper&.call if beeping
|
206
212
|
end
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
def rotate_right_on_up=(value)
|
217
|
-
self.up_arrow_action = :rotate_right if value
|
218
|
-
end
|
219
|
-
|
220
|
-
def rotate_right_on_up
|
221
|
-
self.up_arrow_action == :rotate_right
|
222
|
-
end
|
223
|
-
|
224
|
-
def rotate_left_on_up=(value)
|
225
|
-
self.up_arrow_action = :rotate_left if value
|
213
|
+
|
214
|
+
SPEED_INITIAL_DELAYS.each do |speed, speed_initial_day|
|
215
|
+
define_method("speed_#{speed}=") do |is_true|
|
216
|
+
self.initial_delay = speed_initial_day if is_true
|
217
|
+
end
|
218
|
+
|
219
|
+
define_method("speed_#{speed}") do
|
220
|
+
self.initial_delay == speed_initial_day
|
221
|
+
end
|
226
222
|
end
|
227
|
-
|
228
|
-
|
229
|
-
|
223
|
+
|
224
|
+
UP_ARROW_ACTIONS.each do |up_arrow_action_symbol|
|
225
|
+
define_method("#{up_arrow_action_symbol}_on_up=") do |is_true|
|
226
|
+
self.up_arrow_action = up_arrow_action_symbol if is_true
|
227
|
+
end
|
228
|
+
|
229
|
+
define_method("#{up_arrow_action_symbol}_on_up") do
|
230
|
+
self.up_arrow_action == up_arrow_action_symbol
|
231
|
+
end
|
230
232
|
end
|
231
233
|
|
232
234
|
def reset_tetrominoes
|
@@ -44,11 +44,15 @@ class Tetris
|
|
44
44
|
margin_right block_size
|
45
45
|
margin_height block_size
|
46
46
|
}
|
47
|
+
|
47
48
|
label(:center) {
|
48
49
|
text 'Next'
|
49
50
|
font name: @font_name, height: @font_height, style: FONT_TITLE_STYLE
|
51
|
+
visible <= [game, :show_preview_tetromino]
|
52
|
+
}
|
53
|
+
playfield(game_playfield: game.preview_playfield, playfield_width: Model::Game::PREVIEW_PLAYFIELD_WIDTH, playfield_height: Model::Game::PREVIEW_PLAYFIELD_HEIGHT, block_size: block_size) {
|
54
|
+
visible <= [game, :show_preview_tetromino]
|
50
55
|
}
|
51
|
-
playfield(game_playfield: game.preview_playfield, playfield_width: Model::Game::PREVIEW_PLAYFIELD_WIDTH, playfield_height: Model::Game::PREVIEW_PLAYFIELD_HEIGHT, block_size: block_size)
|
52
56
|
|
53
57
|
label(:center) {
|
54
58
|
text 'Score'
|
@@ -71,6 +71,14 @@ class Tetris
|
|
71
71
|
menu {
|
72
72
|
text '&View'
|
73
73
|
|
74
|
+
menu_item(:check) {
|
75
|
+
text 'Show Next Block Preview'
|
76
|
+
accelerator COMMAND_KEY, :shift, :p
|
77
|
+
selection <=> [game, :show_preview_tetromino]
|
78
|
+
}
|
79
|
+
|
80
|
+
menu_item(:separator)
|
81
|
+
|
74
82
|
menu {
|
75
83
|
text '&High Scores'
|
76
84
|
menu_item(:check) {
|
@@ -89,6 +97,17 @@ class Tetris
|
|
89
97
|
}
|
90
98
|
} # end of menu
|
91
99
|
|
100
|
+
menu {
|
101
|
+
text '&Speed'
|
102
|
+
|
103
|
+
Model::Game::SPEEDS.each do |speed|
|
104
|
+
menu_item(:radio) {
|
105
|
+
text speed.to_s.capitalize
|
106
|
+
selection <=> [game, "speed_#{speed}", computed_by: :initial_delay]
|
107
|
+
}
|
108
|
+
end
|
109
|
+
}
|
110
|
+
|
92
111
|
menu {
|
93
112
|
text '&Options'
|
94
113
|
menu_item(:check) {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-swt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.23.0.
|
4
|
+
version: 4.23.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|