glimmer-dsl-swt 4.23.1.4 → 4.24.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ee026868e1804b6f2869a86e9a5065e71da62719404a48b0dcd84543ff4456c
4
- data.tar.gz: 5a0873cbeeaf9b79d4c6f1e9f21457b27c7f84a36a7ea7494e7f7000f528f200
3
+ metadata.gz: c637efeb5ad59518aa1929c81cd53967df42d6a2085ae777cfb366ddf7022418
4
+ data.tar.gz: c6f2aa15e48d2f0cfae428894ef85fb8a251f8574a0df55b9a0ade3a4a8d3b43
5
5
  SHA512:
6
- metadata.gz: 1d160e6cca46cd9c9a64b9b6f218ad758862deedc101e2a6ff3f9a3700094cac5e2860b495d013138e741841331c88f29155658398afb48e50fc2fb3a83d9f3e
7
- data.tar.gz: 19d84761f50d5ec8b9a160def8fdfb2dcd67ec11f3625b2162224deedea84d528f409d4f42cf5c1092795108f2f4a07f1cab3fc8bb58f01edaff3ee445a2aae8
6
+ metadata.gz: dca42a5d1f7f78bdb866995c66aacc164b9b44881a16c5cca5949b88b2b4948700860fa27fdf168c21ef4ab6dd90b2d053282070bddb1693256656683e1d970e
7
+ data.tar.gz: b159b74c670e2363335043d538c188af59c3fd8da288340c6f47feecbad9cfb27cb01a54bd0e318e5cd83290290c9f8832c6171e0bd8b24ea14fffbc9dabdfdf
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.24.0.1
4
+
5
+ - Support declaratively setting shape data via `data` property
6
+ - Update Hello, Canvas Drag and Drop! sample to set data in draggable shapes for a more sophisticated drag and drop example
7
+ - Refactor Game of Life sample
8
+ - Hello, Drag and Drop!, Hello, Canvas Drag and Drop!, and Game of Life Video Tutorials added to Glimmer Meta-Sample
9
+
10
+ ## 4.24.0.0
11
+
12
+ - Upgrade to SWT 4.24
13
+
14
+ ## 4.23.1.5
15
+
16
+ - Refactor/Improve the Hello, Cursor! sample
17
+ - Add Hello, Cursor! video tutorial to Glimmer Meta-Sample
18
+
3
19
  ## 4.23.1.4
4
20
 
5
21
  - Improve convenience by making `sash_form` accept `orientation` with SWT style symbols directly (`:horizontal` directly instead of `swt(:horizontal)`)
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.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.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.1.4 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.
22
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.24.0.1 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
 
@@ -278,7 +278,7 @@ Audio is supported via the Java Sound library in a cross-platform approach and v
278
278
 
279
279
  ### Remaining Challenges
280
280
 
281
- Startup time is long. 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.
281
+ 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.
282
282
 
283
283
  Contributors who appreciate Glimmer's ultra-high productivity, maintainability, and extensibility might want to help report and resolve remaining challenges in its software architecture.
284
284
 
@@ -301,10 +301,10 @@ https://www.eclipse.org/swt/faq.php
301
301
 
302
302
  ## Pre-requisites
303
303
 
304
- - JDK 18 (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)
304
+ - JDK 18 is recommended / Minimum is JDK 16 on x64 platforms and Linux AARCH64, and JDK 17 on Mac ARM64 (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)
305
305
  - [RVM](http://rvm.io) on Mac & Linux (not needed on Windows)
306
306
  - JRuby 9.3.4.0 (supporting Ruby 2.6.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.3.4.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))
307
- - SWT 4.23 (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
307
+ - 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
308
308
  - Git (comes with Mac and Linux. Install on Windows: https://git-scm.com/download/win )
309
309
 
310
310
  Glimmer might still work on other versions of Java, JRuby and SWT, but there are no guarantees, so it is best to stick to the pre-requisites outlined above.
@@ -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.1.4
336
+ jgem install glimmer-dsl-swt -v 4.24.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.1.4'
364
+ gem 'glimmer-dsl-swt', '~> 4.24.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.1.4
387
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.24.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.1.4
1
+ 4.24.0.1
@@ -940,7 +940,7 @@ The system tray allows showing icons for various apps that need to stay on for e
940
940
 
941
941
  In Glimmer DSL for SWT, generating tray items is automated via the `tray_item` keyword, which can be nested under `shell` and then have a child `menu` underneath that pops up when the user clicks on its icon in the system tray. It is recommended that the related shell is declared with the `:on_top` style (in addition to the default style `:shell_trim`) to ensure it opens above all apps when shown.
942
942
 
943
- Note that if you would like to display notifications, you can use the [Nebula Notifier custom widget](https://github.com/AndyObtiva/glimmer-cw-nebula#notifier). Alternatively, you can look into the [Two Slices](https://github.com/sshtools/two-slices) Java library.
943
+ Note that if you would like to display notifications, you can use the [JFace Notification API](https://help.eclipse.org/latest/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/notifications/NotificationPopup.html) and new [JFace Notification builder](https://www.eclipse.org/eclipse/news/4.23/platform_isv.php#notification-api), the [Nebula Notifier custom widget](https://github.com/AndyObtiva/glimmer-cw-nebula#notifier), or the [Two Slices](https://github.com/sshtools/two-slices) Java library.
944
944
 
945
945
  Example code:
946
946
 
@@ -84,6 +84,7 @@
84
84
  - [Glimmer Calculator](#glimmer-calculator)
85
85
  - [Gladiator](#gladiator)
86
86
  - [Timer](#timer)
87
+ - [Contact Manager App](#contact-manager-app)
87
88
  - [License](#license)
88
89
 
89
90
  ## Samples
@@ -1429,11 +1430,11 @@ Gladiator is a good demonstration of:
1429
1430
 
1430
1431
  [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-timer/master/glimmer-timer-screenshot.png" />](https://github.com/AndyObtiva/glimmer-cs-timer)
1431
1432
 
1432
- #### Contact Manager
1433
+ #### Contact Manager App
1433
1434
 
1434
- [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager](https://github.com/AndyObtiva/contact_manager) is an enhanced version of the included Contact Manager elaborate sample, which demonstrates how to connect to a [SQLite database](https://www.sqlite.org/index.html) with [ActiveRecord](https://rubygems.org/gems/activerecord).
1435
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/icons/linux/Contact%20Manager.png" height=40 /> Contact Manager](https://github.com/AndyObtiva/contact_manager) is an enhanced version of the included Contact Manager elaborate sample, which demonstrates how to connect to a [SQLite database](https://www.sqlite.org/index.html) with [ActiveRecord](https://rubygems.org/gems/activerecord) and how to implement a [Master-Detail Interface](https://en.wikipedia.org/wiki/Master%E2%80%93detail_interface) following the [Model-View-Presenter Pattern](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter). This version can also be packaged as a native executable (DMG/MSI/DEB/RPM).
1435
1436
 
1436
- [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/screenshots/contact-manager.png" /> ](https://github.com/AndyObtiva/contact_manager)
1437
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/contact_manager/master/screenshots/contact-manager.gif" /> ](https://github.com/AndyObtiva/contact_manager)
1437
1438
 
1438
1439
  ## License
1439
1440
 
Binary file
@@ -562,7 +562,8 @@ module Glimmer
562
562
  end
563
563
 
564
564
  def has_attribute?(attribute_name, *args)
565
- self.class.gc_instance_methods.include?(attribute_setter(attribute_name)) or
565
+ attribute_name == 'data' or
566
+ self.class.gc_instance_methods.include?(attribute_setter(attribute_name)) or
566
567
  parameter_name?(attribute_name) or
567
568
  (respond_to?(attribute_name, super: true) and respond_to?(ruby_attribute_setter(attribute_name), super: true))
568
569
  end
@@ -577,7 +578,9 @@ module Glimmer
577
578
  property_change = nil
578
579
  ruby_attribute_getter_name = ruby_attribute_getter(attribute_name)
579
580
  ruby_attribute_setter_name = ruby_attribute_setter(attribute_name)
580
- if parameter_name?(attribute_name)
581
+ if attribute_name == 'data'
582
+ set_data(*args)
583
+ elsif parameter_name?(attribute_name)
581
584
  return if ruby_attribute_getter_name == (args.size == 1 ? args.first : args)
582
585
  set_parameter_attribute(ruby_attribute_getter_name, *args)
583
586
  elsif (respond_to?(attribute_name, super: true) and respond_to?(ruby_attribute_setter_name, super: true))
@@ -74,9 +74,6 @@ module Glimmer
74
74
  DisplayProxy.instance.auto_exec { parent.swt_widget.setMenuBar(swt_widget) }
75
75
  elsif styles.include?(:pop_up)
76
76
  if parent.swt_widget.is_a?(TrayItem)
77
- parent.on_widget_selected {
78
- self.visible = true
79
- }
80
77
  parent.on_menu_detected {
81
78
  self.visible = true
82
79
  }
@@ -35,7 +35,7 @@ class GameOfLife
35
35
  def initialize(row_count=DEFAULT_ROW_COUNT, column_count=DEFAULT_COLUMN_COUNT)
36
36
  @row_count = row_count
37
37
  @column_count = column_count
38
- @speed = 1.0
38
+ @speed = 10.0
39
39
  build_cells
40
40
  end
41
41
 
@@ -48,11 +48,23 @@ class GameOfLife
48
48
  (0...HEIGHT).each do |row_index|
49
49
  (0...WIDTH).each do |column_index|
50
50
  rectangle(column_index*CELL_WIDTH, row_index*CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT) {
51
- background <= [@grid.cell_rows[row_index][column_index], "alive", on_read: ->(a) {a ? :black : :white}]
51
+ background <= [@grid.cell_rows[row_index][column_index], :alive, on_read: ->(a) {a ? :black : :white}]
52
52
 
53
53
  on_mouse_down do
54
54
  @grid.cell_rows[row_index][column_index].toggle_aliveness!
55
55
  end
56
+
57
+ on_drag_detected do
58
+ @drag_detected = true
59
+ end
60
+
61
+ on_mouse_move do
62
+ @grid.cell_rows[row_index][column_index].live! if @drag_detected
63
+ end
64
+
65
+ on_mouse_up do
66
+ @drag_detected = false
67
+ end
56
68
  }
57
69
  end
58
70
  end
@@ -17,3 +17,8 @@ Hello, Menu Bar!: 3RRVFIfA_UM
17
17
  Weather: rC6x6aj1MdA
18
18
  Hello, Date Time!: MpXbPEMUrns
19
19
  Hello, Sash Form!: F7j2TTpbX6s
20
+ Hello, Cursor!: 4AYlo8n3WFc
21
+ Hello, Tray Item!: VYXgIr5zxMM
22
+ Hello, Drag And Drop!: zJSG5ysow0M
23
+ Hello, Canvas Drag And Drop!: e7taTbRrDAM
24
+ Game Of Life: pDE79YRjOjs
@@ -48,7 +48,7 @@ class Sample
48
48
  end
49
49
 
50
50
  def tutorials
51
- if remote_tutorials && !remote_tutorials.empty? && remote_tutorials != local_tutorials
51
+ if remote_tutorials && !remote_tutorials.empty? && remote_tutorials.size >= local_tutorials.size
52
52
  remote_tutorials
53
53
  else
54
54
  local_tutorials
@@ -1,3 +1,24 @@
1
+ # Copyright (c) 2007-2022 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
1
22
  require 'glimmer-dsl-swt'
2
23
 
3
24
  class HelloCanvasDragAndDrop
@@ -27,7 +48,9 @@ class HelloCanvasDragAndDrop
27
48
  background :white
28
49
 
29
50
  10.times do |n|
30
- an_oval = oval((rand*300).to_i, (rand*200).to_i, 50, 50) {
51
+ value = rand(10)
52
+ oval((rand*300).to_i, (rand*200).to_i, 50, 50) {
53
+ data 'value', value
31
54
  background rgb(255, 165, 0)
32
55
 
33
56
  # declare shape as a drag source, which unlike `drag_and_move true`, it means the shape now
@@ -38,6 +61,12 @@ class HelloCanvasDragAndDrop
38
61
  oval(0, 0) {
39
62
  foreground :black
40
63
  }
64
+
65
+ text {
66
+ x :default
67
+ y :default
68
+ string value.to_s
69
+ }
41
70
  }
42
71
  end
43
72
 
@@ -70,7 +99,7 @@ class HelloCanvasDragAndDrop
70
99
  @number_shape = text {
71
100
  x :default
72
101
  y :default
73
- string (ball_count + 1).to_s
102
+ string (ball_count + drop_event.dragged_shape.get_data('value')).to_s
74
103
  }
75
104
  }
76
105
  drop_event.dragged_shape.dispose
@@ -23,27 +23,25 @@ require 'glimmer-dsl-swt'
23
23
 
24
24
  class HelloCursor
25
25
  include Glimmer::UI::CustomShell
26
-
26
+
27
27
  attr_accessor :selected_cursor
28
-
28
+
29
29
  # This method matches the name of the :selected_cursor property by convention
30
30
  def selected_cursor_options
31
31
  Glimmer::SWT::SWTProxy.cursor_options
32
32
  end
33
-
34
- after_body do
35
- observe(self, :selected_cursor) {
36
- body_root.cursor = selected_cursor
37
- }
33
+
34
+ before_body do
35
+ self.selected_cursor = :arrow
38
36
  end
39
-
37
+
40
38
  body {
41
39
  shell {
42
40
  grid_layout
43
-
41
+
44
42
  text 'Hello, Cursor!'
45
- cursor :wait
46
-
43
+ cursor <= [self, :selected_cursor]
44
+
47
45
  label {
48
46
  text 'Please select a cursor style and see it change the mouse cursor (varies per platform):'
49
47
  font style: :bold
@@ -105,12 +105,6 @@ class HelloTrayItem
105
105
  }
106
106
 
107
107
  # supported tray item listeners (you can try to add actions to them when needed)
108
- # on_swt_Show do
109
- # end
110
- #
111
- # on_swt_Hide do
112
- # end
113
- #
114
108
  # on_widget_selected do
115
109
  # end
116
110
  #
Binary file
Binary file
Binary file
Binary file
Binary file
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.1.4
4
+ version: 4.24.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-06-03 00:00:00.000000000 Z
11
+ date: 2022-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -328,6 +328,20 @@ dependencies:
328
328
  - - "~>"
329
329
  - !ruby/object:Gem::Version
330
330
  version: 0.7.0
331
+ - !ruby/object:Gem::Dependency
332
+ requirement: !ruby/object:Gem::Requirement
333
+ requirements:
334
+ - - ">="
335
+ - !ruby/object:Gem::Version
336
+ version: 0.14.1.cr2
337
+ name: jruby-openssl
338
+ prerelease: false
339
+ type: :development
340
+ version_requirements: !ruby/object:Gem::Requirement
341
+ requirements:
342
+ - - ">="
343
+ - !ruby/object:Gem::Version
344
+ version: 0.14.1.cr2
331
345
  description: Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) is a native-GUI
332
346
  cross-platform desktop development library written in JRuby, an OS-threaded faster
333
347
  JVM version of Ruby. It includes SWT 4.22 (released November 24, 2021). Glimmer's