glimmer-dsl-swt 4.18.6.2 → 4.18.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +4 -4
  4. data/VERSION +1 -1
  5. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +64 -6
  6. data/docs/reference/GLIMMER_SAMPLES.md +71 -0
  7. data/glimmer-dsl-swt.gemspec +16 -6
  8. data/lib/glimmer/dsl/swt/animation_expression.rb +1 -1
  9. data/lib/glimmer/dsl/swt/custom_shape_expression.rb +61 -0
  10. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -1
  11. data/lib/glimmer/dsl/swt/dsl.rb +1 -0
  12. data/lib/glimmer/dsl/swt/expand_item_expression.rb +4 -4
  13. data/lib/glimmer/dsl/swt/image_expression.rb +1 -1
  14. data/lib/glimmer/dsl/swt/multiply_expression.rb +1 -1
  15. data/lib/glimmer/dsl/swt/shape_expression.rb +1 -1
  16. data/lib/glimmer/dsl/swt/transform_expression.rb +1 -1
  17. data/lib/glimmer/dsl/swt/widget_expression.rb +2 -1
  18. data/lib/glimmer/swt/custom/shape.rb +473 -180
  19. data/lib/glimmer/swt/custom/shape/image.rb +7 -9
  20. data/lib/glimmer/swt/custom/shape/path.rb +38 -29
  21. data/lib/glimmer/swt/custom/shape/path_segment.rb +21 -19
  22. data/lib/glimmer/swt/custom/shape/polygon.rb +24 -8
  23. data/lib/glimmer/swt/custom/shape/polyline.rb +5 -0
  24. data/lib/glimmer/swt/custom/shape/rectangle.rb +10 -19
  25. data/lib/glimmer/swt/display_proxy.rb +1 -1
  26. data/lib/glimmer/swt/message_box_proxy.rb +1 -1
  27. data/lib/glimmer/swt/shell_proxy.rb +1 -1
  28. data/lib/glimmer/swt/tab_folder_proxy.rb +52 -0
  29. data/lib/glimmer/swt/transform_proxy.rb +1 -1
  30. data/lib/glimmer/swt/widget_proxy.rb +1 -1
  31. data/lib/glimmer/ui/custom_shape.rb +281 -0
  32. data/samples/elaborate/meta_sample.rb +5 -5
  33. data/samples/elaborate/metronome.rb +177 -0
  34. data/samples/elaborate/stock_ticker.rb +0 -6
  35. data/samples/elaborate/tetris.rb +1 -12
  36. data/samples/elaborate/tetris/model/game.rb +3 -0
  37. data/samples/elaborate/tetris/view/bevel.rb +78 -0
  38. data/samples/elaborate/tetris/view/block.rb +6 -29
  39. data/samples/hello/hello_canvas.rb +3 -0
  40. data/samples/hello/hello_canvas_animation_data_binding.rb +66 -0
  41. data/samples/hello/hello_canvas_data_binding.rb +24 -3
  42. data/samples/hello/hello_canvas_path.rb +1 -1
  43. data/samples/hello/hello_custom_shape.rb +78 -0
  44. data/samples/hello/hello_shape.rb +71 -0
  45. data/samples/hello/hello_spinner.rb +7 -2
  46. data/sounds/metronome-down.wav +0 -0
  47. data/sounds/metronome-up.wav +0 -0
  48. metadata +14 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d4f89641fcc2573b43cd52e23cf4dda45aa209e55cd49cbe751f6a4b7bc85b1
4
- data.tar.gz: 9cf53e2b5aef11f838314b50188f63b3a69936ea31f54930da77bddfd561b08e
3
+ metadata.gz: 98ad3496a7f7eec9bebe867be21b6fefd3764baf67b8336a2177086826fc6e0c
4
+ data.tar.gz: 6093daa8c240d0e02f43078590f84eb77c9cdba070c2c8ba5c7e665fb4455338
5
5
  SHA512:
6
- metadata.gz: 355fe3aab4e45648832678ce3a2c00411129be61bbff91575f4c19b73254a82ab9fa58ce6acbac78d6dca4daf383340cd074e6ec5ea6128bcdb37df94befe125
7
- data.tar.gz: d30171ae846dc373fb4d58426bcdc64a179579c4f86ee749d16cb0a5f3440bc542305a91a1e0d5774b796e14750a1918ae4e8d3bb33b2eaff70da4fd3a7afff1
6
+ metadata.gz: 43d3ffa17ae9ad9fae4f867d483439116d0e08055614f83c2ef59f87a38268472ace3821ee6b2521588d02fda8da6a6f009ff9ea93085dc60170835cb6aa4aff
7
+ data.tar.gz: 0f4bb8712916ddb9ee5cd25ded0bdce6b5fc008f2ab23a53ccac07f19eac556daf4eb3594944e91c3a47efd3df3794012abd572fb6ea17ed74357622a67a5253
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.18.7.3
4
+
5
+ - Support the ability for nested shapes to override their parent `shape` common shared properties
6
+ - Refactor Tetris to use a custom shape (`bevel`) for its blocks given they are used in both the game and the icon, thus achieving code reuse
7
+ - Fix issue with moving filled polygon (moving drawn polygon works)
8
+
9
+ ### 4.18.7.2
10
+
11
+ - Enable defining custom shapes with direct args just like basic shapes (alternative to using keyword arg options)
12
+ - Fix interpretation of `:max`/`:default` `width`/`height` values in Canvas Shape DSL
13
+
14
+ ### 4.18.7.1
15
+
16
+ - Hello, Canvas Animation Data Binding! Sample
17
+ - Metronome Elaborate Sample
18
+ - Update Hello, Spinner! Sample to data bind a Thank you message to selected value
19
+
20
+ ### 4.18.7.0
21
+
22
+ - Support direct use of the `shape` keyword as a shape composite that could contain other shapes and shares common attributes (e.g. background color) with all of them
23
+ - Hello, Shape! Sample (implements a method-based custom shape containing other nested shapes)
24
+ - Support custom shapes via including the Glimmer::UI::CustomShape module to add new shape keywords to the Glimmer GUI DSL / Canvas Shape DSL, representing shapes composed of a group of nested shapes (e.g. `car` shape representing a group of nested `polygon` shapes)
25
+ - Hello, Custom Shape! Sample (redoes Hello, Shape! with the use of a class-based custom shape)
26
+ - Support :max value for Canvas Shape DSL width and height, meaning fill up parent (useful for using rectangles as borders)
27
+ - Upgrade to glimmer v1.2.0
28
+
29
+ ### 4.18.6.3
30
+
31
+ - Support `Glimmer::SWT::Custom::Shape::PathSegment#dispose` method
32
+ - Amend Hello, Canvas Path! sample with ability to regenerate paths
33
+ - Make `tab_folder` preinit all its tabs by default while supporting the SWT style of `:initialize_tabs_on_select` to init tabs on first select instead.
34
+ - Support trimming line style symbols (no need to say line_ before each style. e.g. `:line_solid` becomes `:solid`) in Canvas Shape DSL line_style property
35
+ - Support `antialias true` as an alternative to `antialias :on`, `antialias false` as an alternative to `antialias :off`, and `antialias nil` as an alternative to `antialias :default`
36
+
3
37
  ### 4.18.6.2
4
38
 
5
39
  - Hello, Canvas Data Binding! Sample
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.18.6.2
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.18.7.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)
@@ -13,7 +13,7 @@
13
13
  [<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
14
14
  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)
15
15
 
16
- [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.18.6.2 includes [SWT 4.18](https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/), which was released on December 2, 2020. 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.
16
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.18.7.3 includes [SWT 4.18](https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/), which was released on December 2, 2020. 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.
17
17
 
18
18
  [Glimmer DSL for SWT receives two updates per month](https://rubygems.org/gems/glimmer-dsl-swt/versions). You can trust [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) with your Ruby desktop GUI development needs! [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) brings great ideas to the table, such as declarative programming via domain specific languages, currently under-utilized in the GUI domain. That said, it may not be feature complete enough for everybody's needs, so please help make [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) even better by providing feedback and [contributing](#contributing) when possible. The project is very active, so any feature suggestions that are accepted could be implemented within weeks if not days. Also, you are welcome to [hire me](#hire-me) full-time if you want long-term development of [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) for your project needs.
19
19
 
@@ -340,7 +340,7 @@ jgem install glimmer-dsl-swt
340
340
 
341
341
  Or this command if you want a specific version:
342
342
  ```
343
- jgem install glimmer-dsl-swt -v 4.18.6.2
343
+ jgem install glimmer-dsl-swt -v 4.18.7.3
344
344
  ```
345
345
 
346
346
  `jgem` is JRuby's version of `gem` command.
@@ -358,7 +358,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
358
358
 
359
359
  Add the following to `Gemfile`:
360
360
  ```
361
- gem 'glimmer-dsl-swt', '~> 4.18.6.2'
361
+ gem 'glimmer-dsl-swt', '~> 4.18.7.3'
362
362
  ```
363
363
 
364
364
  And, then run:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.18.6.2
1
+ 4.18.7.3
@@ -39,6 +39,7 @@ This guide should help you get started with Glimmer DSL for SWT. For more advanc
39
39
  - [Shapes inside a Shape](#shapes-inside-a-shape)
40
40
  - [Shapes inside a Widget](#shapes-inside-a-widget)
41
41
  - [Shapes inside an Image](#shapes-inside-an-image)
42
+ - [Custom Shapes](#custom-shapes)
42
43
  - [Canvas Shape API](#canvas-shape-api)
43
44
  - [Pixel Graphics](#pixel-graphics)
44
45
  - [Canvas Path DSL](#canvas-path-dsl)
@@ -410,6 +411,14 @@ Example (you may copy/paste in [`girb`](GLIMMER_GIRB.md)):
410
411
  @shell.open
411
412
  ```
412
413
 
414
+ ##### Tab Folder API
415
+
416
+ Unlike basic SWT usage, `tab_folder` has the smart default of pre-initializing all tabs so that they are properly sized/filled so no delays occur when a user browses through them for the first time by selecting unselected tabs.
417
+
418
+ The [Stock Ticker](/docs/reference/GLIMMER_SAMPLES.md#stock-ticker) sample takes advantage of this to ensure all tabs are pre-initialized and filled with rendered data even before the user selects any of them.
419
+
420
+ That said, `tab_folder` can optionally receive a custom Glimmer SWT style named `:initialize_tabs_on_select`, which disables that behavior by going back to SWT's default of initializing tabs upon first selection (e.g. upon clicking with the mouse).
421
+
413
422
  ##### Shell Icon
414
423
 
415
424
  To set the shell icon, simply set the `image` property under the `shell` widget. This shows up in the operating system toolbar and app-switcher (e.g. CMD+TAB) (and application window top-left corner in Windows)
@@ -1415,7 +1424,7 @@ Optionally, a shape keyword takes a block that can set any attributes from [org.
1415
1424
  Here is a list of supported attributes nestable within a block under shapes:
1416
1425
  - `advanced` enables advanced graphics subsystem (boolean value). Typically gets enabled automatically when setting alpha, antialias, patterns, interpolation, clipping. Rendering sometimes differs between advanced and non-advanced mode for basic graphics too, so you could enable manually if you prefer its look even for basic graphics.
1417
1426
  - `alpha` sets transparency (integer between `0` and `255`)
1418
- - `antialias` enables antialiasing (SWT style value of `:default`, `:off`, `:on` whereby `:default` applies OS default, which varies per OS)
1427
+ - `antialias` enables antialiasing (SWT style value of `:default` (or nil), `:off` (or false), `:on` (or true) whereby `:default` applies OS default, which varies per OS)
1419
1428
  - `background` sets fill color for fillable shapes (standard color symbol (e.g. `:red`), `rgb(red_integer, green_integer, blue_integer)` color, or Color/ColorProxy object directly)
1420
1429
  - `background_pattern` sets fill gradient/image pattern for fillable shape background (takes the same arguments as the SWT [Pattern](https://help.eclipse.org/2020-12/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/graphics/Pattern.html) class [e.g. `background_pattern 2.3, 4.2, 5.4, 7.2, :red, :blue`] / note: this feature isn't extensively tested yet)
1421
1430
  - `clipping` clips area of painting (numeric values for `(x, y, width, height)`)
@@ -1427,7 +1436,7 @@ Here is a list of supported attributes nestable within a block under shapes:
1427
1436
  - `line_cap` sets line cap (SWT style value of `:cap_flat`, `:cap_round`, or `:cap_square`)
1428
1437
  - `line_dash` line dash float values (automatically sets `line_style` to SWT style value of `:line_custom`)
1429
1438
  - `line_join` line join style (SWT style value of `:join_miter`, `:join_round`, or `:join_bevel`)
1430
- - `line_style` line join style (SWT style value of `:line_solid`, `:line_dash`, `:line_dot`, `:line_dashdot`, or `:line_dashdotdot`)
1439
+ - `line_style` line join style (SWT style value of `:solid`, `:dash`, `:dot`, `:dashdot`, `:dashdotdot`, or `:custom` while requiring `line_dash` attribute (or alternatively with `line_` prefix as per official SWT docs like `:line_solid` for `:solid`)
1431
1440
  - `line_width` line width in integer (used in draw operations)
1432
1441
  - `text_anti_alias` enables text antialiasing (SWT style value of `:default`, `:off`, `:on` whereby `:default` applies OS default, which varies per OS)
1433
1442
  - `transform` sets transform object using [Canvas Transform DSL](#canvas-transform-dsl) syntax
@@ -1476,7 +1485,9 @@ Screenshot:
1476
1485
 
1477
1486
  If you specify the x and y coordinates as `:default`, `nil`, or leave them out, they get calculated automatically by centering the shape within its parent `canvas`.
1478
1487
 
1479
- Note that you could shift a shape off its centered position within its parent `canvas` by using `x_delta` and `y_delta` instead of `x` and `y`
1488
+ If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally.
1489
+
1490
+ Note that you could shift a shape off its centered position within its parent `canvas` by setting `x` to `[:default, x_delta]` and `y` to `[:default, y_delta]`
1480
1491
 
1481
1492
  The round and gradient options could be dropped since Glimmer DSL for SWT supports auto-inference of them based on shape parameters.
1482
1493
 
@@ -1633,9 +1644,13 @@ Shapes can be nested within each other. If you nest a shape within another, its
1633
1644
 
1634
1645
  As such, if you move the parent, it moves all its children with it.
1635
1646
 
1636
- If you specify the x and y coordinates as `:default`, `nil`, or leave them out, they get calculated automatically by centering the shape within its parent shape relatively.
1647
+ If you specify the `x` and `y` coordinates as `:default`, `nil`, or leave them out, they get calculated automatically by centering the shape within its parent shape relatively.
1648
+
1649
+ If you specify the `width` and `height` parameters as `:default`, `nil`, or leave them out, they get calculated automatically from the shape's nested children shapes if any (e.g calculating the dimensions of a text from its extent according to its font size) or from the parent's size otherwise.
1637
1650
 
1638
- Note that you could shift a shape off its centered position within its parent shape by using `x_delta` and `y_delta` instead of `x` and `y`
1651
+ If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally.
1652
+
1653
+ Note that you could shift a shape off its centered position within its parent shape by setting `x` to `[:default, x_delta]` and `y` to `[:default, y_delta]`
1639
1654
 
1640
1655
  Check [Hello, Canvas!](GLIMMER_SAMPLES.md#hello-canvas) for an example that nests lines, points, a polyline, and an image within a drawn rectangle parent:
1641
1656
 
@@ -1757,6 +1772,21 @@ shell {
1757
1772
 
1758
1773
  ![Image Shape DSL](/images/glimmer-example-image-shape-dsl-app-switcher-icon.png)
1759
1774
 
1775
+ #### Custom Shapes
1776
+
1777
+ Glimmer enables defining custom shape keywords, which represent shapes made up of other nested shapes.
1778
+
1779
+ Custom shapes expand a software engineer's Glimmer GUI DSL vocabulary in their app development to be able to represent
1780
+ higher visual concepts like vehicles, scenes, and characters with a single keyword (e.g. `car`, `beach`, `player`),
1781
+ which embody and abstract all the details relating to the visual concept. This enables orders of magnitudes in increased
1782
+ productivity and readability/maintainability as a result.
1783
+
1784
+ Just like [custom widgets](#custom-widgets), custom shapes can be defined in one of two ways:
1785
+ - method-based custom shapes: Use the `shape` keyword as a parent to represent a shape composite (similar to widget composite) and include other shapes like rectangles, polygons, and lines within.
1786
+ - class-based custom shapes: Include the `Glimmer::UI::CustomShape` supermodule and define the `options`, `body {}` block, and `before_body/after_body` hooks (similar to how it is down with [custom widgets](#custom-widgets))
1787
+
1788
+ Check out [Hello, Shape!](/docs/reference/GLIMMER_SAMPLES.md#hello-shape) and [Hello, Custom Shape!](/docs/reference/GLIMMER_SAMPLES.md#hello-custom-shape) for examples of both approaches.
1789
+
1760
1790
  #### Canvas Shape API
1761
1791
 
1762
1792
  These Canvas Shape API methods help with manipulating shapes upon user interaction, such as mouse clicking a specific shape.
@@ -1767,11 +1797,30 @@ They are implemented with the help of the highly robust Java built-in shape geom
1767
1797
  - `Shape#contain?(x, y)` : indicates if shape contains x, y point
1768
1798
  - `Shape#include?(x, y)` : indicates if shape includes x, y point on the edge if drawn or inside if filled (include uses contain for filled shapes)
1769
1799
  - `Shape#move_by(x_delta, y_delta)` : moves shape object at x, y location
1800
+ - `Shape#dispose` : disposes of shape, removing it form its parent canvas, widget, or shape
1801
+ - `Shape#content {}` : reopens a shape to add more content inside it using the Glimmer GUI DSL (e.g. Canvas Shape DSL) just like `WidgetProxy#content {}`.
1770
1802
  - `Shape#size` : calculated size for shape bounding box (e.g. a polygon with an irregular shape will have its bounding box width and height calculated)
1771
1803
  - `Shape#bounds` : calculated bounds (x, y, width, height) for shape bounding box (e.g. a polygon with an irregular shape will have its bounding box top-left x, y, width and height calculated)
1804
+ - `Shape#width` : static (including `:default`) or derived width for shape (including irregular geometric shapes like Polygon)
1805
+ - `Shape#height` : static (including `:default`) or derived height for shape (including irregular geometric shapes like Polygon)
1806
+ - `Shape#default_width?` : whether `:default` or `[:default, delta]` is set for static width
1807
+ - `Shape#default_height?` : whether `:default` or `[:default, delta]` is set for static height
1808
+ - `Shape#max_width?` : whether `:max` or `[:max, delta]` is set for static width
1809
+ - `Shape#max_height?` : whether `:max` or `[:max, delta]` is set for static height
1810
+ - `Shape#calculated_width` : calculated width for shape when set to :default to indicate it is sized by its children (e.g. in the case of containing text with a specific font size not knowing its width/height dimensions in advance)
1811
+ - `Shape#calculated_height` : calculated height for shape when set to :default to indicate it is sized by its children (e.g. in the case of containing text with a specific font size not knowing its width/height dimensions in advance)
1812
+ - `Shape#x` : top-left corner x position, static or `:default` (could be relative if shape is nested within another shape)
1813
+ - `Shape#y` : top-left corner y position, static or `:default` (could be relative if shape is nested within another shape)
1814
+ - `Shape#absolute_x` : absolute top-left corner x position
1815
+ - `Shape#absolute_y` : absolute top-left corner y position
1816
+ - `Shape#default_x?` : whether x is specified via `:default` style to indicate centering within parent (or `[:default, offset]`)
1817
+ - `Shape#default_y?` : calculated top-left corner y position
1818
+ - `Shape#calculated_x` : calculated top-left corner x position when default/delta is set (i.e. centered within parent)
1819
+ - `Shape#calculated_y` : calculated top-left corner y position when default/delta is set (i.e. centered within parent)
1772
1820
 
1773
1821
  Check [Hello, Canvas!](GLIMMER_SAMPLES.md#hello-canvas) for an example.
1774
1822
 
1823
+
1775
1824
  #### Pixel Graphics
1776
1825
 
1777
1826
  **(Early Alpha Feature)**
@@ -1991,6 +2040,15 @@ Learn more at the [Hello, Canvas Path!](GLIMMER_SAMPLES.md#hello-canvas-path) an
1991
2040
 
1992
2041
  ![Stock Ticker](/images/glimmer-stock-ticker.gif)
1993
2042
 
2043
+ #### Canvas Path API
2044
+
2045
+ Every path segment object (mixing in [`Glimmer::SWT::Custom::PathSegment`](/lib/glimmer/swt/custom/shape/path_segment.rb) like `path`, `point`, `line`, `quad`, and `cubic`) has the following API methods:
2046
+ - `#path`: indicates which path the segment is part of.
2047
+ - `#path_root`: indicates the root path the segment is part of.
2048
+ - `#dispose`: disposes a path segment from its path
2049
+ - `#content {}` : reopens a path to add more segments inside it using the Glimmer GUI DSL (e.g. Canvas Path DSL) just like `WidgetProxy#content {}`.
2050
+ - `#first_path_segment?`: indicates if the path segment is the first in the path
2051
+
1994
2052
  ### Canvas Transform DSL
1995
2053
 
1996
2054
  **(ALPHA FEATURE)**
@@ -2139,7 +2197,7 @@ API of Animation Object (returned from `animation` keyword):
2139
2197
  - `#cycle_limited?` returns true if `cycle_count` is specified
2140
2198
  - `#duration_limited?` returns true if `duration_limit` is specified
2141
2199
 
2142
- Learn more at the [Hello, Canvas Animation! Sample](GLIMMER_SAMPLES.md#hello-canvas-animation).
2200
+ Learn more at the [Hello, Canvas Animation!](GLIMMER_SAMPLES.md#hello-canvas-animation) and [Hello, Canvas Animation Data Binding!](GLIMMER_SAMPLES.md#hello-canvas-animation-data-binding) samples.
2143
2201
 
2144
2202
  If there is anything missing you would like added to the Glimmer Animation DSL that you saw available in the SWT APIs, you may [report an issue](https://github.com/AndyObtiva/glimmer-dsl-swt/issues) or implement yourself and [contribute](#contributing) via a Pull Request.
2145
2203
 
@@ -32,13 +32,17 @@
32
32
  - [Hello, Code Text!](#hello-code-text)
33
33
  - [Hello, Canvas!](#hello-canvas)
34
34
  - [Hello, Canvas Animation!](#hello-canvas-animation)
35
+ - [Hello, Canvas Animation Data Binding!](#hello-canvas-animation-data-binding)
35
36
  - [Hello, Canvas Transform!](#hello-canvas-transform)
36
37
  - [Hello, Canvas Path!](#hello-canvas-path)
38
+ - [Hello, Canvas Data Binding!](#hello-canvas-data-binding)
37
39
  - [Hello, Cursor!](#hello-cursor)
38
40
  - [Hello, Progress Bar!](#hello-progress-bar)
39
41
  - [Hello, Tree!](#hello-tree)
40
42
  - [Hello, Color Dialog!](#hello-color-dialog)
41
43
  - [Hello, Font Dialog!](#hello-font-dialog)
44
+ - [Hello, Shape!](#hello-shape)
45
+ - [Hello, Custom Shape!](#hello-custom-shape)
42
46
  - [Elaborate Samples](#elaborate-samples)
43
47
  - [User Profile](#user-profile)
44
48
  - [Login](#login)
@@ -47,6 +51,7 @@
47
51
  - [Glimmer Tetris](#glimmer-tetris)
48
52
  - [Mandelbrot Fractal](#mandelbrot-fractal)
49
53
  - [Stock Ticker](#stock-ticker)
54
+ - [Metronome](#metronome)
50
55
  - [External Samples](#external-samples)
51
56
  - [Glimmer Calculator](#glimmer-calculator)
52
57
  - [Gladiator](#gladiator)
@@ -606,6 +611,18 @@ Hello, Canvas Animation Another Frame!
606
611
 
607
612
  ![Hello Canvas Animation Frame 2](/images/glimmer-hello-canvas-animation-frame2.png)
608
613
 
614
+ #### Hello, Canvas Animation Data Binding!
615
+
616
+ This sample demonstrates the use of the [Canvas Animation DSL](#canvas-animation-dsl) with data-binding.
617
+
618
+ Code:
619
+
620
+ [samples/hello/hello_canvas_animation_data_binding.rb](/samples/hello/hello_canvas_animation_data_binding.rb)
621
+
622
+ Hello, Canvas Animation Data Binding!
623
+
624
+ ![Hello Canvas Animation Data Binding](/images/glimmer-hello-canvas-animation-data-binding.gif)
625
+
609
626
  #### Hello, Canvas Transform!
610
627
 
611
628
  This sample demonstrates the use of the `transform` keyword as part of the [Transform DSL](#canvas-transform-dsl) within the [Shape DSL](#canvas-shape-dsl).
@@ -630,6 +647,20 @@ Hello, Canvas Path!
630
647
 
631
648
  ![Hello Canvas Path](/images/glimmer-hello-canvas-path.png)
632
649
 
650
+ #### Hello, Canvas Data Binding!
651
+
652
+ This sample demonstrates Canvas Shape DSL data-binding.
653
+
654
+ Code:
655
+
656
+ [samples/hello/hello_canvas_data_binding.rb](/samples/hello/hello_canvas_data_binding.rb)
657
+
658
+ Hello, Canvas Data Binding!
659
+
660
+ ![Hello Canvas Data Binding](/images/glimmer-hello-canvas-data-binding.png)
661
+
662
+ ![Hello Canvas Data Binding Line Changed](/images/glimmer-hello-canvas-data-binding-line-changed.png)
663
+
633
664
  #### Hello, Cursor!
634
665
 
635
666
  This sample demonstrates the use of the `cursor` property keyword to change the mouse cursor.
@@ -702,6 +733,32 @@ Hello, Font Dialog!
702
733
 
703
734
  ![Hello Font Dialog Font Changed](/images/glimmer-hello-font-dialog-font-changed.png)
704
735
 
736
+ #### Hello, Shape!
737
+
738
+ This sample demonstrates the use of the `shape` keyword, which represents shape composites that contain other nested shapes.
739
+
740
+ Code:
741
+
742
+ [samples/hello/hello_shape.rb](/samples/hello/hello_shape.rb)
743
+
744
+ Hello, Shape!
745
+
746
+ ![Hello Shape](/images/glimmer-hello-shape.png)
747
+
748
+ #### Hello, Custom Shape!
749
+
750
+ This sample demonstrates the use of the `Glimmer::UI::CustomShape` module, which is used to author new custom shape keywords.
751
+ It reimplements Hello, Shape! with a class-based custom shape instead of a method-based custom shape.
752
+ Just provides another option that is useful when defining more elaborate shapes to separate them from the main app code.
753
+
754
+ Code:
755
+
756
+ [samples/hello/hello_custom_shape.rb](/samples/hello/hello_custom_shape.rb)
757
+
758
+ Hello, Custom Shape!
759
+
760
+ ![Hello Custom Shape](/images/glimmer-hello-custom-shape.png)
761
+
705
762
  ### Elaborate Samples
706
763
 
707
764
  For more elaborate samples, check the following:
@@ -836,6 +893,20 @@ Code:
836
893
 
837
894
  ![Stock Ticker](/images/glimmer-stock-ticker.gif)
838
895
 
896
+ #### Metronome
897
+
898
+ This sample demonstrates a Metronome that accepts a beat count and bpm rate, ticking at every beat, with an uptick at the beginning of the rhythm interval.
899
+
900
+ It takes advantage of the Canvas Shape DSL, data-binding, and the Java Sound library. It employs a hybrid approach of relying on standard widget layouts (grid layout) and canvas shape x,y placement.
901
+
902
+ Code:
903
+
904
+ [samples/elaborate/metronome.rb](/samples/elaborate/metronome.rb)
905
+
906
+ ![Metronome](/images/glimmer-metronome.gif)
907
+
908
+ [Download video with sound](/videos/glimmer-metronome.mp4?raw=true).
909
+
839
910
  ### External Samples
840
911
 
841
912
  #### Glimmer Calculator
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: glimmer-dsl-swt 4.18.6.2 ruby lib
5
+ # stub: glimmer-dsl-swt 4.18.7.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-swt".freeze
9
- s.version = "4.18.6.2"
9
+ s.version = "4.18.7.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2021-03-02"
14
+ s.date = "2021-03-09"
15
15
  s.description = "Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) is a native-GUI cross-platform desktop development library written in JRuby, an OS-threaded faster JVM version of Ruby. Glimmer's main innovation is a declarative Ruby DSL that enables productive and efficient authoring of desktop application user-interfaces by relying on the robust Eclipse SWT library. Glimmer additionally innovates by having built-in data-binding support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns, or alternatively drive development GUI-first, and then write clean business models (test-first) afterwards. Not only does Glimmer provide a large set of GUI widgets, but it also supports drawing Canvas Graphics like Shapes and Animations. To get started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets. Glimmer also includes native-executable packaging support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in Ruby as truly native DMG/PKG/APP files on the Mac + App Store, MSI/EXE files on Windows, and Gem Packaged Shell Scripts on Linux.".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["glimmer".freeze, "girb".freeze]
@@ -66,6 +66,7 @@ Gem::Specification.new do |s|
66
66
  "lib/glimmer/dsl/swt/column_properties_expression.rb",
67
67
  "lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb",
68
68
  "lib/glimmer/dsl/swt/cursor_expression.rb",
69
+ "lib/glimmer/dsl/swt/custom_shape_expression.rb",
69
70
  "lib/glimmer/dsl/swt/custom_widget_expression.rb",
70
71
  "lib/glimmer/dsl/swt/data_binding_expression.rb",
71
72
  "lib/glimmer/dsl/swt/dialog_expression.rb",
@@ -148,6 +149,7 @@ Gem::Specification.new do |s|
148
149
  "lib/glimmer/swt/style_constantizable.rb",
149
150
  "lib/glimmer/swt/styled_text_proxy.rb",
150
151
  "lib/glimmer/swt/swt_proxy.rb",
152
+ "lib/glimmer/swt/tab_folder_proxy.rb",
151
153
  "lib/glimmer/swt/tab_item_proxy.rb",
152
154
  "lib/glimmer/swt/table_column_proxy.rb",
153
155
  "lib/glimmer/swt/table_proxy.rb",
@@ -156,6 +158,7 @@ Gem::Specification.new do |s|
156
158
  "lib/glimmer/swt/widget_listener_proxy.rb",
157
159
  "lib/glimmer/swt/widget_proxy.rb",
158
160
  "lib/glimmer/ui.rb",
161
+ "lib/glimmer/ui/custom_shape.rb",
159
162
  "lib/glimmer/ui/custom_shell.rb",
160
163
  "lib/glimmer/ui/custom_widget.rb",
161
164
  "lib/glimmer/util/proc_tracker.rb",
@@ -166,12 +169,14 @@ Gem::Specification.new do |s|
166
169
  "samples/elaborate/login.rb",
167
170
  "samples/elaborate/mandelbrot_fractal.rb",
168
171
  "samples/elaborate/meta_sample.rb",
172
+ "samples/elaborate/metronome.rb",
169
173
  "samples/elaborate/stock_ticker.rb",
170
174
  "samples/elaborate/tetris.rb",
171
175
  "samples/elaborate/tetris/model/block.rb",
172
176
  "samples/elaborate/tetris/model/game.rb",
173
177
  "samples/elaborate/tetris/model/past_game.rb",
174
178
  "samples/elaborate/tetris/model/tetromino.rb",
179
+ "samples/elaborate/tetris/view/bevel.rb",
175
180
  "samples/elaborate/tetris/view/block.rb",
176
181
  "samples/elaborate/tetris/view/high_score_dialog.rb",
177
182
  "samples/elaborate/tetris/view/playfield.rb",
@@ -185,6 +190,7 @@ Gem::Specification.new do |s|
185
190
  "samples/hello/hello_button.rb",
186
191
  "samples/hello/hello_canvas.rb",
187
192
  "samples/hello/hello_canvas_animation.rb",
193
+ "samples/hello/hello_canvas_animation_data_binding.rb",
188
194
  "samples/hello/hello_canvas_data_binding.rb",
189
195
  "samples/hello/hello_canvas_path.rb",
190
196
  "samples/hello/hello_canvas_transform.rb",
@@ -196,6 +202,7 @@ Gem::Specification.new do |s|
196
202
  "samples/hello/hello_computed.rb",
197
203
  "samples/hello/hello_computed/contact.rb",
198
204
  "samples/hello/hello_cursor.rb",
205
+ "samples/hello/hello_custom_shape.rb",
199
206
  "samples/hello/hello_custom_shell.rb",
200
207
  "samples/hello/hello_custom_widget.rb",
201
208
  "samples/hello/hello_date_time.rb",
@@ -216,6 +223,7 @@ Gem::Specification.new do |s|
216
223
  "samples/hello/hello_radio.rb",
217
224
  "samples/hello/hello_radio_group.rb",
218
225
  "samples/hello/hello_sash_form.rb",
226
+ "samples/hello/hello_shape.rb",
219
227
  "samples/hello/hello_spinner.rb",
220
228
  "samples/hello/hello_styled_text.rb",
221
229
  "samples/hello/hello_tab.rb",
@@ -223,6 +231,8 @@ Gem::Specification.new do |s|
223
231
  "samples/hello/hello_table/baseball_park.png",
224
232
  "samples/hello/hello_tree.rb",
225
233
  "samples/hello/hello_world.rb",
234
+ "sounds/metronome-down.wav",
235
+ "sounds/metronome-up.wav",
226
236
  "vendor/swt/linux/swt.jar",
227
237
  "vendor/swt/mac/swt.jar",
228
238
  "vendor/swt/windows/swt.jar"
@@ -237,7 +247,7 @@ Gem::Specification.new do |s|
237
247
  s.specification_version = 4
238
248
 
239
249
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
240
- s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.1.2"])
250
+ s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 1.2.0"])
241
251
  s.add_runtime_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
242
252
  s.add_runtime_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
243
253
  s.add_runtime_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
@@ -255,7 +265,7 @@ Gem::Specification.new do |s|
255
265
  s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
256
266
  s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
257
267
  else
258
- s.add_dependency(%q<glimmer>.freeze, ["~> 1.1.2"])
268
+ s.add_dependency(%q<glimmer>.freeze, ["~> 1.2.0"])
259
269
  s.add_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
260
270
  s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
261
271
  s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])
@@ -274,7 +284,7 @@ Gem::Specification.new do |s|
274
284
  s.add_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
275
285
  end
276
286
  else
277
- s.add_dependency(%q<glimmer>.freeze, ["~> 1.1.2"])
287
+ s.add_dependency(%q<glimmer>.freeze, ["~> 1.2.0"])
278
288
  s.add_dependency(%q<super_module>.freeze, [">= 1.4.1", "< 2.0.0"])
279
289
  s.add_dependency(%q<nested_inherited_jruby_include_package>.freeze, [">= 0.3.0", "< 2.0.0"])
280
290
  s.add_dependency(%q<puts_debuggerer>.freeze, [">= 0.11.0", "< 2.0.0"])