glimmer-dsl-swt 4.24.1.0 → 4.24.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +8 -8
- data/VERSION +1 -1
- data/bin/girb +0 -0
- data/bin/glimmer +0 -0
- data/docs/reference/GLIMMER_SAMPLES.md +1 -1
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/rake_task/scaffold.rb +5 -0
- data/lib/glimmer/swt/tab_item_proxy.rb +17 -0
- data/samples/elaborate/meta_sample/tutorials.yml +3 -0
- data/samples/elaborate/parking.rb +42 -30
- data/samples/hello/hello_canvas_path.rb +1 -0
- data/samples/hello/hello_canvas_transform.rb +3 -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: 3e57512ecadc776545bfb55c46f485fca1e00d759274ae9e23f657e5715e2e3b
|
4
|
+
data.tar.gz: e532e61f73196e3fc6bb6c843603423f8988fae82b0a5b57b803640d79bdc5de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a35b9ff6d5ed82a46dabd6ce20def1a0c685b910734159897be8486adae3fdf535f46f8212fbe0a3974f92b6fa5dc801bf92cb712cc73e41f502a6c7fe7a320
|
7
|
+
data.tar.gz: a217d6e154f2f0b59d85d0421363bd5bf27a3707cfbd72b05b2a9f3e223d10b2ed3ec34fda2376966576efaa8862eca34d7ddcd556357c64bbb8ec1d3594e811
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 4.24.1.3
|
4
|
+
|
5
|
+
- Fix Windows freezing issue with warbler during packaging with the `glimmer package` command (caused by bundler included in JRuby on JDK18, fixed by installing latest bundler)
|
6
|
+
|
7
|
+
## 4.24.1.2
|
8
|
+
|
9
|
+
- Fix issue where you cannot call `tab_item_proxy.text` or `tab_item_proxy.text = 'new text'` because its `swt_widget` is the contained `composite`
|
10
|
+
- Refactor Parking sample to clarify rotation details
|
11
|
+
|
12
|
+
## 4.24.1.1
|
13
|
+
|
14
|
+
- Fix `jar-dependencies` gem version to v0.4.1 in scaffolded applications to avoid issue encountered in newly released v0.4.2
|
15
|
+
|
3
16
|
## 4.24.1.0
|
4
17
|
|
5
18
|
- Upgrade to JRuby 9.3.6.0
|
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.24.1.
|
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.24.1.3
|
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.24.1.
|
22
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.24.1.3 includes [SWT 4.24](https://download.eclipse.org/eclipse/downloads/drops4/R-4.24-202206070700/), which was released on June 7, 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. That was [originally conceived back in 2007](https://andymaleh.blogspot.com/2007/12/data-shining-in-glimmer.html).
|
25
25
|
|
@@ -281,7 +281,7 @@ Audio is supported via the Java Sound library in a cross-platform approach and v
|
|
281
281
|
|
282
282
|
### Remaining Challenges
|
283
283
|
|
284
|
-
JRuby startup time is longer than that of CRuby, but has gotten a lot faster with newer CPUs, especially the latest Mac ARM64 processors. Thankfully, [there are work-arounds](https://andymaleh.blogspot.com/2021/03/glimmer-dsl-for-swt-41900-halved.html) that could make apps start as fast as instantly when needed.
|
284
|
+
JRuby startup time is longer than that of CRuby, but has gotten a lot faster with newer CPUs, especially the latest Mac ARM64 processors (it is now about 2.5 seconds on Mac ARM64 processors like the M1 chip). Thankfully, [there are work-arounds](https://andymaleh.blogspot.com/2021/03/glimmer-dsl-for-swt-41900-halved.html) that could make apps start as fast as instantly when needed.
|
285
285
|
|
286
286
|
Contributors who appreciate Glimmer's ultra-high productivity, maintainability, and extensibility might want to help report and resolve remaining challenges in its software architecture.
|
287
287
|
|
@@ -304,9 +304,9 @@ https://www.eclipse.org/swt/faq.php
|
|
304
304
|
|
305
305
|
## Pre-requisites
|
306
306
|
|
307
|
-
- JDK 18 is
|
307
|
+
- JDK 18 is required / JDK 16 is the minimum except on Mac ARM64 where JDK 17 is the minimum (find at https://www.oracle.com/java/technologies/downloads / Ensure `PATH` env var includes Java bin directory for `jpackage` command to work when packaging Glimmer applications / Preferably setup `JAVA_HOME` env var too to point to JDK home directory before installing JRuby)
|
308
308
|
- [RVM](http://rvm.io) on Mac & Linux (not needed on Windows)
|
309
|
-
- JRuby 9.3.6.0 (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.6.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))
|
309
|
+
- JRuby 9.3.6.0 is required (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.6.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))
|
310
310
|
- SWT 4.24 (already included in the [glimmer-dsl-swt](https://rubygems.org/gems/glimmer-dsl-swt) gem). Note that SWT supports ARM64/AARCH64 on Mac and Linux since version 4.20
|
311
311
|
- Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
|
312
312
|
|
@@ -336,7 +336,7 @@ jgem install glimmer-dsl-swt
|
|
336
336
|
|
337
337
|
Or this command if you want a specific version:
|
338
338
|
```
|
339
|
-
jgem install glimmer-dsl-swt -v 4.24.1.
|
339
|
+
jgem install glimmer-dsl-swt -v 4.24.1.3
|
340
340
|
```
|
341
341
|
|
342
342
|
`jgem` is JRuby's version of `gem` command.
|
@@ -364,7 +364,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
364
364
|
|
365
365
|
Add the following to `Gemfile`:
|
366
366
|
```
|
367
|
-
gem 'glimmer-dsl-swt', '~> 4.24.1.
|
367
|
+
gem 'glimmer-dsl-swt', '~> 4.24.1.3'
|
368
368
|
```
|
369
369
|
|
370
370
|
And, then run:
|
@@ -387,7 +387,7 @@ glimmer
|
|
387
387
|
```
|
388
388
|
|
389
389
|
```
|
390
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.24.1.
|
390
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.24.1.3
|
391
391
|
|
392
392
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
393
393
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.24.1.
|
1
|
+
4.24.1.3
|
data/bin/girb
CHANGED
File without changes
|
data/bin/glimmer
CHANGED
File without changes
|
@@ -100,7 +100,7 @@ This brings up the [Glimmer Meta-Sample (The Sample of Samples)](/samples/elabor
|
|
100
100
|
|
101
101
|
![Glimmer Meta-Sample](/images/glimmer-meta-sample.png)
|
102
102
|
|
103
|
-
You may edit the code of any sample before launching it by clicking on the "Launch" button. This helps you learn by experimenting with Glimmer GUI DSL syntax. To go back to original code, simply hit the "Reset" button.
|
103
|
+
You may edit the code of any sample before launching it by clicking on the "Launch" button. This helps you learn by experimenting with Glimmer GUI DSL syntax. To go back to original code, simply hit the "Reset" button. Also, for some samples, you can click the "Tutorial" button, and a YouTube video is played to guide you through learning the sample. The YouTube videos are played from the [Glimmer YouTube Channel](https://www.youtube.com/channel/UC5hzDE23HZXsZLAxYk2UJEw).
|
104
104
|
|
105
105
|
Note that if you fail to run any sample through the Glimmer Meta-Sample for whatever reason, you could always run directly by cloning the project, running `bundle`, and then this command (drop the "bin" if you install the glimmer-dsl-swt gem instead):
|
106
106
|
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -125,6 +125,7 @@ module Glimmer
|
|
125
125
|
GEMFILE_SUFFIX = <<~MULTI_LINE_STRING
|
126
126
|
|
127
127
|
group :development do
|
128
|
+
gem 'jar-dependencies', '0.4.1'
|
128
129
|
gem 'rspec', '~> 3.5.0'
|
129
130
|
gem 'juwelier', '2.4.9'
|
130
131
|
gem 'warbler', '2.0.5'
|
@@ -146,6 +147,7 @@ module Glimmer
|
|
146
147
|
gem_name = file_name(app_name)
|
147
148
|
gem_summary = human_name(app_name)
|
148
149
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
150
|
+
system "jruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
149
151
|
system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
|
150
152
|
system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
151
153
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
@@ -249,6 +251,7 @@ module Glimmer
|
|
249
251
|
namespace = 'glimmer'
|
250
252
|
end
|
251
253
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
254
|
+
system "jruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
252
255
|
system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
|
253
256
|
system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
254
257
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
@@ -316,6 +319,7 @@ module Glimmer
|
|
316
319
|
end
|
317
320
|
|
318
321
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
322
|
+
system "jruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
319
323
|
system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
|
320
324
|
system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
321
325
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
@@ -354,6 +358,7 @@ module Glimmer
|
|
354
358
|
end
|
355
359
|
|
356
360
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
361
|
+
system "jruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
357
362
|
system "jruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exists?
|
358
363
|
system "jruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
359
364
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
@@ -78,6 +78,23 @@ module Glimmer
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
ATTRIBUTES.each do |attribute|
|
82
|
+
define_method(attribute) do
|
83
|
+
auto_exec do
|
84
|
+
widget_proxy.send(attribute)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
define_method("#{attribute}=") do |value|
|
89
|
+
value.tap do
|
90
|
+
auto_exec do
|
91
|
+
widget_proxy.send("#{attribute}=", value)
|
92
|
+
shell_proxy.pack_same_size
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
81
98
|
def dispose
|
82
99
|
auto_exec do
|
83
100
|
swt_tab_item.setControl(nil)
|
@@ -26,10 +26,10 @@ require_relative 'parking/model/parking_presenter'
|
|
26
26
|
class Parking
|
27
27
|
include Glimmer::UI::CustomShell
|
28
28
|
|
29
|
+
CANVAS_LENGTH = 600
|
29
30
|
FLOOR_COUNT = 4
|
30
31
|
|
31
32
|
before_body do
|
32
|
-
@parking_spots = Model::ParkingSpot::LETTERS.clone
|
33
33
|
@parking_presenter = Model::ParkingPresenter.new(FLOOR_COUNT)
|
34
34
|
end
|
35
35
|
|
@@ -56,7 +56,6 @@ class Parking
|
|
56
56
|
selection <=> [@parking_presenter, :selected_floor]
|
57
57
|
|
58
58
|
on_widget_selected do
|
59
|
-
@parking_spots = Model::ParkingSpot::LETTERS.clone
|
60
59
|
@canvas.dispose_shapes
|
61
60
|
@canvas.content {
|
62
61
|
parking_floor
|
@@ -65,8 +64,8 @@ class Parking
|
|
65
64
|
}
|
66
65
|
@canvas = canvas {
|
67
66
|
layout_data {
|
68
|
-
width
|
69
|
-
height
|
67
|
+
width CANVAS_LENGTH
|
68
|
+
height CANVAS_LENGTH
|
70
69
|
}
|
71
70
|
|
72
71
|
background :dark_gray
|
@@ -77,42 +76,33 @@ class Parking
|
|
77
76
|
}
|
78
77
|
|
79
78
|
def parking_floor
|
80
|
-
parking_quad(67.5, 0, 125)
|
81
|
-
parking_quad(67.5, 0, 125)
|
82
|
-
|
83
|
-
|
84
|
-
parking_quad(67.5, 0, 125) { |shp|
|
85
|
-
shp.rotate(180)
|
86
|
-
}
|
87
|
-
parking_quad(67.5, 0, 125) { |shp|
|
88
|
-
shp.rotate(270)
|
89
|
-
}
|
79
|
+
parking_quad(67.5, 0, 125, 0)
|
80
|
+
parking_quad(67.5, 0, 125, 90)
|
81
|
+
parking_quad(67.5, 0, 125, 180)
|
82
|
+
parking_quad(67.5, 0, 125, 270)
|
90
83
|
end
|
91
84
|
|
92
|
-
def parking_quad(location_x, location_y, length,
|
85
|
+
def parking_quad(location_x, location_y, length, angle)
|
93
86
|
distance = (1.0/3)*length
|
94
|
-
parking_spot(location_x, location_y, length,
|
95
|
-
parking_spot(location_x + distance, location_y, length,
|
96
|
-
parking_spot(location_x + 2*distance, location_y, length,
|
97
|
-
parking_spot(location_x + 3*distance, location_y, length,
|
87
|
+
parking_spot(location_x, location_y, length, angle)
|
88
|
+
parking_spot(location_x + distance, location_y, length, angle)
|
89
|
+
parking_spot(location_x + 2*distance, location_y, length, angle)
|
90
|
+
parking_spot(location_x + 3*distance, location_y, length, angle)
|
98
91
|
end
|
99
92
|
|
100
|
-
def parking_spot(location_x, location_y, length,
|
101
|
-
parking_spot_letter =
|
93
|
+
def parking_spot(location_x, location_y, length, angle)
|
94
|
+
parking_spot_letter = next_parking_spot_letter
|
102
95
|
height = length
|
103
96
|
width = (2.0/3)*length
|
104
|
-
|
97
|
+
|
98
|
+
shape(location_x, location_y) {
|
105
99
|
line_width (1.0/15)*length
|
106
100
|
foreground :white
|
107
101
|
|
108
|
-
block&.call(the_shape)
|
109
|
-
|
110
102
|
rectangle(location_x, location_y, width, height) {
|
111
|
-
background <= [
|
112
|
-
|
113
|
-
|
114
|
-
on_read: ->(b) {b ? :red : :dark_gray}
|
115
|
-
]
|
103
|
+
background <= [parking_spot_for(parking_spot_letter), :booked,
|
104
|
+
on_read: ->(value) {value ? :red : :dark_gray}
|
105
|
+
]
|
116
106
|
|
117
107
|
text {
|
118
108
|
x :default
|
@@ -123,7 +113,8 @@ class Parking
|
|
123
113
|
|
124
114
|
on_mouse_up do
|
125
115
|
begin
|
126
|
-
|
116
|
+
selected_parking_floor.book!(parking_spot_letter)
|
117
|
+
|
127
118
|
message_box {
|
128
119
|
text 'Parking Booked!'
|
129
120
|
message "Floor #{@parking_presenter.selected_floor} Parking Spot #{parking_spot_letter} Is Booked!"
|
@@ -138,8 +129,29 @@ class Parking
|
|
138
129
|
line(location_x, location_y, location_x + width, location_y)
|
139
130
|
line(location_x + width, location_y, location_x + width, location_y + height)
|
140
131
|
|
132
|
+
# Rotate around the canvas center point
|
133
|
+
transform {
|
134
|
+
translation CANVAS_LENGTH/2.0, CANVAS_LENGTH/2.0
|
135
|
+
rotation angle
|
136
|
+
translation -CANVAS_LENGTH/2.0, -CANVAS_LENGTH/2.0
|
137
|
+
}
|
141
138
|
}
|
142
139
|
end
|
140
|
+
|
141
|
+
def parking_spot_for(parking_spot_letter)
|
142
|
+
selected_parking_floor.parking_spots[parking_spot_letter]
|
143
|
+
end
|
144
|
+
|
145
|
+
def selected_parking_floor
|
146
|
+
@parking_presenter.floors[@parking_presenter.selected_floor - 1]
|
147
|
+
end
|
148
|
+
|
149
|
+
private
|
150
|
+
|
151
|
+
def next_parking_spot_letter
|
152
|
+
@parking_spot_letters = Model::ParkingSpot::LETTERS.clone if @parking_spot_letters.nil? || @parking_spot_letters.empty?
|
153
|
+
@parking_spot_letters.shift
|
154
|
+
end
|
143
155
|
end
|
144
156
|
|
145
157
|
Parking.launch
|
@@ -19,12 +19,14 @@ shell {
|
|
19
19
|
# also supports inversion, identity, shear, and multiplication {transform properties}
|
20
20
|
}
|
21
21
|
}
|
22
|
+
|
22
23
|
image(glimmer_logo, 0, 0) {
|
23
24
|
transform {
|
24
25
|
translation 110, 220
|
25
26
|
scale 0.21, 0.21
|
26
27
|
}
|
27
28
|
}
|
29
|
+
|
28
30
|
image(glimmer_logo, 0, 0) {
|
29
31
|
transform {
|
30
32
|
translation 220, 220
|
@@ -32,6 +34,7 @@ shell {
|
|
32
34
|
scale 0.21, 0.21
|
33
35
|
}
|
34
36
|
}
|
37
|
+
|
35
38
|
image(glimmer_logo, 0, 0) {
|
36
39
|
transform {
|
37
40
|
translation 220, 110
|
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.24.1.
|
4
|
+
version: 4.24.1.3
|
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-
|
11
|
+
date: 2022-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|