glimmer-dsl-swt 4.20.12.0 → 4.20.12.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 +5 -0
- data/README.md +5 -5
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_SAMPLES.md +11 -0
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/swt/custom/shape.rb +2 -0
- data/lib/glimmer/ui/custom_shape.rb +1 -1
- data/samples/hello/hello_canvas_drag_and_drop.rb +95 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8665a978cb56164d4d65f8c141e63e1ca080ef9b0c0bf1a91e9032016967cd41
|
4
|
+
data.tar.gz: 4d21198129e1c53e30e0aa712b1242d518b41e2170c57f03b9ada278df32823d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9767e3499bf28485234a4769c031d5a44b95b74e6ca134b8c89234db0fd152a8f6b8e993df30808e42dc877e1633a26c201beec7cfca510739b785033639f75f
|
7
|
+
data.tar.gz: 11dd762db3a0e6fbe2c2445bceb45ddc809b6cc99301aad405612f1a52b6b2553d5fb0f448b9bf0adb75729b76b52f227e2ae4db2baea497fbb537fc8dc15f12
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.20.12.1
|
4
|
+
|
5
|
+
- Hello, Canvas Drag & Drop! sample
|
6
|
+
|
3
7
|
### 4.20.12.0
|
4
8
|
|
5
9
|
- Canvas Shape Listeners: on_mouse_up, on_mouse_down, on_mouse_move, on_drag_detected
|
6
10
|
- Make scaffolding not generate an empty () after shell
|
11
|
+
- Hello, Canvas Shape Listeners! Sample
|
7
12
|
|
8
13
|
### 4.20.11.1
|
9
14
|
|
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.20.12.
|
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.20.12.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)
|
@@ -15,7 +15,7 @@
|
|
15
15
|
[<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
|
16
16
|
Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) and [Chalmers/Gothenburg University Software Engineering Master's Lecture Material](http://www.cse.chalmers.se/~bergert/slides/guest_lecture_DSLs.pdf)
|
17
17
|
|
18
|
-
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.12.
|
18
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.12.1 includes [SWT 4.20](https://download.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/), which was released on June 11, 2021. 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. Note that SWT now supports AARCH64 on Mac and Linux, but it is not fully tested in Glimmer DSL for SWT yet, so deem its support experimental for the time being without guarantees for functionality until declared otherwise (report any issues you may encounter).
|
19
19
|
|
20
20
|
**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 (keep in mind that it is still a beta, so default back to `bind` whenever needed).
|
21
21
|
|
@@ -326,7 +326,7 @@ jgem install glimmer-dsl-swt
|
|
326
326
|
|
327
327
|
Or this command if you want a specific version:
|
328
328
|
```
|
329
|
-
jgem install glimmer-dsl-swt -v 4.20.12.
|
329
|
+
jgem install glimmer-dsl-swt -v 4.20.12.1
|
330
330
|
```
|
331
331
|
|
332
332
|
`jgem` is JRuby's version of `gem` command.
|
@@ -354,7 +354,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
354
354
|
|
355
355
|
Add the following to `Gemfile`:
|
356
356
|
```
|
357
|
-
gem 'glimmer-dsl-swt', '~> 4.20.12.
|
357
|
+
gem 'glimmer-dsl-swt', '~> 4.20.12.1'
|
358
358
|
```
|
359
359
|
|
360
360
|
And, then run:
|
@@ -375,7 +375,7 @@ glimmer
|
|
375
375
|
```
|
376
376
|
|
377
377
|
```
|
378
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.12.
|
378
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.12.1
|
379
379
|
|
380
380
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
381
381
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.20.12.
|
1
|
+
4.20.12.1
|
@@ -45,6 +45,7 @@
|
|
45
45
|
- [Hello, Canvas Path!](#hello-canvas-path)
|
46
46
|
- [Hello, Canvas Data Binding!](#hello-canvas-data-binding)
|
47
47
|
- [Hello, Canvas Shape Listeners!](#hello-canvas-shape-listeners)
|
48
|
+
- [Hello, Canvas Drag and Drop!](#hello-canvas-drag-and-drop)
|
48
49
|
- [Hello, Cursor!](#hello-cursor)
|
49
50
|
- [Hello, Progress Bar!](#hello-progress-bar)
|
50
51
|
- [Hello, Tree!](#hello-tree)
|
@@ -833,6 +834,16 @@ Hello, Canvas Shape Listeners! - Dragged Circle
|
|
833
834
|
|
834
835
|
![Hello Canvas Shape Listeners Dragged](/images/glimmer-hello-canvas-shape-listeners-dragged.png)
|
835
836
|
|
837
|
+
#### Hello, Canvas Drag and Drop!
|
838
|
+
|
839
|
+
This sample demonstrates Canvas Shape DSL drag and drop (different from standard widget drag and drop).
|
840
|
+
|
841
|
+
Code:
|
842
|
+
|
843
|
+
[samples/hello/hello_canvas_drag_and_drop.rb](/samples/hello/hello_canvas_drag_and_drop.rb)
|
844
|
+
|
845
|
+
![Hello Canvas Drag and Drop](/images/glimmer-hello-canvas-drag-and-drop.gif)
|
846
|
+
|
836
847
|
#### Hello, Cursor!
|
837
848
|
|
838
849
|
This sample demonstrates the use of the `cursor` property keyword to change the mouse cursor.
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -180,7 +180,7 @@ module Glimmer
|
|
180
180
|
raise Glimmer::Error, 'Invalid custom shape for having no body! Please define body block!' if body_block.nil?
|
181
181
|
@body_root = instance_exec(&body_block)
|
182
182
|
raise Glimmer::Error, 'Invalid custom shape for having an empty body! Please fill body block!' if @body_root.nil?
|
183
|
-
auto_exec do
|
183
|
+
auto_exec do # TODO is this necessary given shape is a lightweight construct (not SWT widget) ?
|
184
184
|
@body_root.set_data('custom_shape', self)
|
185
185
|
end
|
186
186
|
execute_hook('after_body')
|
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'glimmer-dsl-swt'
|
2
|
+
|
3
|
+
class HelloCanvasDragAndDrop
|
4
|
+
include Glimmer::UI::CustomShell
|
5
|
+
|
6
|
+
body {
|
7
|
+
shell {
|
8
|
+
row_layout(:vertical) {
|
9
|
+
margin_width 0
|
10
|
+
margin_height 0
|
11
|
+
fill true
|
12
|
+
center true
|
13
|
+
}
|
14
|
+
text 'Hello, Canvas Drag & Drop!'
|
15
|
+
|
16
|
+
label(:center) {
|
17
|
+
text 'Drag orange balls and drop in the square.'
|
18
|
+
font height: 16
|
19
|
+
}
|
20
|
+
|
21
|
+
canvas {
|
22
|
+
layout_data {
|
23
|
+
width 350
|
24
|
+
height 350
|
25
|
+
}
|
26
|
+
|
27
|
+
background :white
|
28
|
+
|
29
|
+
@drop_square_border = rectangle(150, 260, 50, 50) {
|
30
|
+
foreground :black
|
31
|
+
line_width 3
|
32
|
+
line_style :dash
|
33
|
+
}
|
34
|
+
|
35
|
+
@drop_square = rectangle(153, 263, 44, 44) {
|
36
|
+
background :transparent
|
37
|
+
|
38
|
+
@number_shape = text {
|
39
|
+
x :default
|
40
|
+
y :default
|
41
|
+
string '0'
|
42
|
+
}
|
43
|
+
|
44
|
+
on_mouse_move do
|
45
|
+
if @dragging
|
46
|
+
@drop_square_border.foreground = :red
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
on_mouse_up do
|
51
|
+
if @dragging
|
52
|
+
ball_count = @number_shape.string.to_i
|
53
|
+
@number_shape.dispose
|
54
|
+
@drop_square.content {
|
55
|
+
@number_shape = text {
|
56
|
+
x :default
|
57
|
+
y :default
|
58
|
+
string (ball_count + 1).to_s
|
59
|
+
}
|
60
|
+
}
|
61
|
+
@dragging.dispose
|
62
|
+
end
|
63
|
+
end
|
64
|
+
}
|
65
|
+
|
66
|
+
10.times do |n|
|
67
|
+
an_oval = oval((rand*300).to_i, (rand*200).to_i, 50, 50) {
|
68
|
+
background rgb(255, 165, 0)
|
69
|
+
|
70
|
+
on_drag_detected do |event|
|
71
|
+
@dragging = an_oval
|
72
|
+
@last_x = event.x
|
73
|
+
@last_y = event.y
|
74
|
+
end
|
75
|
+
}
|
76
|
+
end
|
77
|
+
|
78
|
+
on_mouse_up do
|
79
|
+
@drop_square_border.foreground = :black
|
80
|
+
@dragging = nil
|
81
|
+
end
|
82
|
+
|
83
|
+
on_mouse_move do |event|
|
84
|
+
if @dragging
|
85
|
+
@dragging.move_by((event.x - @last_x), (event.y - @last_y))
|
86
|
+
@last_x = event.x
|
87
|
+
@last_y = event.y
|
88
|
+
end
|
89
|
+
end
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
HelloCanvasDragAndDrop.launch
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-swt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.20.12.
|
4
|
+
version: 4.20.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
@@ -576,6 +576,7 @@ files:
|
|
576
576
|
- samples/hello/hello_canvas_animation.rb
|
577
577
|
- samples/hello/hello_canvas_animation_multi.rb
|
578
578
|
- samples/hello/hello_canvas_data_binding.rb
|
579
|
+
- samples/hello/hello_canvas_drag_and_drop.rb
|
579
580
|
- samples/hello/hello_canvas_path.rb
|
580
581
|
- samples/hello/hello_canvas_shape_listeners.rb
|
581
582
|
- samples/hello/hello_canvas_transform.rb
|