glimmer-dsl-swt 4.18.7.1 → 4.18.7.2
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 +4 -4
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +7 -1
- data/glimmer-dsl-swt.gemspec +3 -3
- data/lib/glimmer/swt/custom/shape.rb +42 -19
- data/lib/glimmer/ui/custom_shape.rb +1 -1
- data/samples/elaborate/meta_sample.rb +5 -5
- data/samples/elaborate/metronome.rb +27 -4
- data/samples/hello/hello_canvas_animation_data_binding.rb +21 -0
- data/samples/hello/hello_custom_shape.rb +3 -3
- data/samples/hello/hello_shape.rb +3 -3
- 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: 91d53b49c974e0ce9b4f3d0a715ab59785d2b23fde0abe4bda5ad20de58e68a7
|
4
|
+
data.tar.gz: db8c3d1030700bda5faed413c1719336e12e110fd65c154b5650d2b69e3d7eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9630530911bcd671a335cef7a1911db6150382532d03b85cd8e6629d02c6d10c44e7901fe40ee48f114c73465c56efff53d13b984cf53393999a449e83c394ca
|
7
|
+
data.tar.gz: 0d07793e4f0a79b75a1eaf073a39dad0af872c19e6c325bd9d4632ce3b9cf53f0735d1bf7e9a2a1e7a46a7d95ebe202e38626400c128cff78d88a5c15d0154a3
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.18.7.2
|
4
|
+
|
5
|
+
- Enable defining custom shapes with direct args just like basic shapes (alternative to using keyword arg options)
|
6
|
+
- Fix interpretation of `:max`/`:default` `width`/`height` values in Canvas Shape DSL
|
7
|
+
|
3
8
|
### 4.18.7.1
|
4
9
|
|
5
10
|
- Hello, Canvas Animation 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.7.
|
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.2
|
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.7.
|
16
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.18.7.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.
|
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.7.
|
343
|
+
jgem install glimmer-dsl-swt -v 4.18.7.2
|
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.7.
|
361
|
+
gem 'glimmer-dsl-swt', '~> 4.18.7.2'
|
362
362
|
```
|
363
363
|
|
364
364
|
And, then run:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.18.7.
|
1
|
+
4.18.7.2
|
@@ -1485,6 +1485,8 @@ Screenshot:
|
|
1485
1485
|
|
1486
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`.
|
1487
1487
|
|
1488
|
+
If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally.
|
1489
|
+
|
1488
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]`
|
1489
1491
|
|
1490
1492
|
The round and gradient options could be dropped since Glimmer DSL for SWT supports auto-inference of them based on shape parameters.
|
@@ -1644,7 +1646,9 @@ As such, if you move the parent, it moves all its children with it.
|
|
1644
1646
|
|
1645
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.
|
1646
1648
|
|
1647
|
-
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 (e.g calculating the dimensions of a text from its extent according to its font size).
|
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.
|
1650
|
+
|
1651
|
+
If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally.
|
1648
1652
|
|
1649
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]`
|
1650
1654
|
|
@@ -1801,6 +1805,8 @@ They are implemented with the help of the highly robust Java built-in shape geom
|
|
1801
1805
|
- `Shape#height` : static (including `:default`) or derived height for shape (including irregular geometric shapes like Polygon)
|
1802
1806
|
- `Shape#default_width?` : whether `:default` or `[:default, delta]` is set for static width
|
1803
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
|
1804
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)
|
1805
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)
|
1806
1812
|
- `Shape#x` : top-left corner x position, static or `:default` (could be relative if shape is nested within another shape)
|
data/glimmer-dsl-swt.gemspec
CHANGED
@@ -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.7.
|
5
|
+
# stub: glimmer-dsl-swt 4.18.7.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer-dsl-swt".freeze
|
9
|
-
s.version = "4.18.7.
|
9
|
+
s.version = "4.18.7.2"
|
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-
|
14
|
+
s.date = "2021-03-06"
|
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]
|
@@ -214,12 +214,12 @@ module Glimmer
|
|
214
214
|
def move_by(x_delta, y_delta)
|
215
215
|
if respond_to?(:x) && respond_to?(:y) && respond_to?(:x=) && respond_to?(:y=)
|
216
216
|
if default_x?
|
217
|
-
self.
|
217
|
+
self.x_delta += x_delta
|
218
218
|
else
|
219
219
|
self.x += x_delta
|
220
220
|
end
|
221
221
|
if default_y?
|
222
|
-
self.
|
222
|
+
self.y_delta += y_delta
|
223
223
|
else
|
224
224
|
self.y += y_delta
|
225
225
|
end
|
@@ -483,6 +483,21 @@ module Glimmer
|
|
483
483
|
end
|
484
484
|
end
|
485
485
|
|
486
|
+
# Sets data just like SWT widgets
|
487
|
+
def set_data(key=nil, value)
|
488
|
+
@data ||= {}
|
489
|
+
@data[key] = value
|
490
|
+
end
|
491
|
+
alias setData set_data # for compatibility with SWT APIs
|
492
|
+
|
493
|
+
# Gets data just like SWT widgets
|
494
|
+
def get_data(key=nil)
|
495
|
+
@data ||= {}
|
496
|
+
@data[key]
|
497
|
+
end
|
498
|
+
alias getData get_data # for compatibility with SWT APIs
|
499
|
+
alias data get_data # for compatibility with SWT APIs
|
500
|
+
|
486
501
|
def method_missing(method_name, *args, &block)
|
487
502
|
if method_name.to_s.end_with?('=')
|
488
503
|
set_attribute(method_name, *args)
|
@@ -676,7 +691,7 @@ module Glimmer
|
|
676
691
|
|
677
692
|
# args translated to absolute coordinates
|
678
693
|
def calculated_args
|
679
|
-
return @args if !default_x? && !default_y? && !default_width? && !default_height? && parent.is_a?(Drawable)
|
694
|
+
return @args if !default_x? && !default_y? && !default_width? && !default_height? && !max_width? && !max_height? && parent.is_a?(Drawable)
|
680
695
|
# Note: Must set x and move_by because not all shapes have a real x and some must translate all their points with move_by
|
681
696
|
# TODO change that by setting a bounding box for all shapes with a calculated top-left x, y and
|
682
697
|
# a setter that does the moving inside them instead so that I could rely on absolute_x and absolute_y
|
@@ -708,11 +723,11 @@ module Glimmer
|
|
708
723
|
end
|
709
724
|
if default_x?
|
710
725
|
original_x = x
|
711
|
-
self.x = default_x +
|
726
|
+
self.x = default_x + self.x_delta
|
712
727
|
end
|
713
728
|
if default_y?
|
714
729
|
original_y = y
|
715
|
-
self.y = default_y +
|
730
|
+
self.y = default_y + self.y_delta
|
716
731
|
end
|
717
732
|
if parent.is_a?(Shape)
|
718
733
|
move_by(@parent_absolute_x, @parent_absolute_y)
|
@@ -792,7 +807,9 @@ module Glimmer
|
|
792
807
|
shape_x + shape_width
|
793
808
|
end
|
794
809
|
end
|
795
|
-
if shapes.
|
810
|
+
if shapes.empty?
|
811
|
+
max_width
|
812
|
+
elsif shapes.size == 1 && shapes.first.max_width?
|
796
813
|
self.parent.size.x
|
797
814
|
else
|
798
815
|
x_ends.max.to_f
|
@@ -810,7 +827,9 @@ module Glimmer
|
|
810
827
|
shape_y + shape_height
|
811
828
|
end
|
812
829
|
end
|
813
|
-
if shapes.
|
830
|
+
if shapes.empty?
|
831
|
+
max_height
|
832
|
+
elsif shapes.size == 1 && shapes.first.max_height?
|
814
833
|
self.parent.size.y
|
815
834
|
else
|
816
835
|
y_ends.max.to_f
|
@@ -841,55 +860,59 @@ module Glimmer
|
|
841
860
|
result_height
|
842
861
|
end
|
843
862
|
|
844
|
-
def
|
863
|
+
def x_delta
|
845
864
|
return 0 unless default_x? && x.is_a?(Array)
|
846
865
|
x[1].to_f
|
847
866
|
end
|
848
867
|
|
849
|
-
def
|
868
|
+
def y_delta
|
850
869
|
return 0 unless default_y? && y.is_a?(Array)
|
851
870
|
y[1].to_f
|
852
871
|
end
|
853
872
|
|
854
873
|
def width_delta
|
855
|
-
return 0 unless default_width? && width.is_a?(Array)
|
874
|
+
return 0 unless (default_width? || max_width?) && width.is_a?(Array)
|
856
875
|
width[1].to_f
|
857
876
|
end
|
858
877
|
|
859
878
|
def height_delta
|
860
|
-
return 0 unless default_height? && height.is_a?(Array)
|
879
|
+
return 0 unless (default_height? || max_height?) && height.is_a?(Array)
|
861
880
|
height[1].to_f
|
862
881
|
end
|
863
882
|
|
864
|
-
def
|
883
|
+
def x_delta=(delta)
|
865
884
|
return unless default_x?
|
866
|
-
|
885
|
+
symbol = x.is_a?(Array) ? x.first : x
|
886
|
+
self.x = [symbol, delta]
|
867
887
|
end
|
868
888
|
|
869
|
-
def
|
889
|
+
def y_delta=(delta)
|
870
890
|
return unless default_y?
|
871
|
-
|
891
|
+
symbol = y.is_a?(Array) ? y.first : y
|
892
|
+
self.y = [symbol, delta]
|
872
893
|
end
|
873
894
|
|
874
895
|
def width_delta=(delta)
|
875
896
|
return unless default_width?
|
876
|
-
|
897
|
+
symbol = width.is_a?(Array) ? width.first : width
|
898
|
+
self.width = [symbol, delta]
|
877
899
|
end
|
878
900
|
|
879
901
|
def height_delta=(delta)
|
880
902
|
return unless default_height?
|
881
|
-
|
903
|
+
symbol = height.is_a?(Array) ? height.first : height
|
904
|
+
self.height = [symbol, delta]
|
882
905
|
end
|
883
906
|
|
884
907
|
def calculated_x
|
885
908
|
result = default_x? ? default_x : self.x
|
886
|
-
result +=
|
909
|
+
result += self.x_delta
|
887
910
|
result
|
888
911
|
end
|
889
912
|
|
890
913
|
def calculated_y
|
891
914
|
result = default_y? ? default_y : self.y
|
892
|
-
result +=
|
915
|
+
result += self.y_delta
|
893
916
|
result
|
894
917
|
end
|
895
918
|
|
@@ -253,7 +253,7 @@ module Glimmer
|
|
253
253
|
@content
|
254
254
|
end
|
255
255
|
end
|
256
|
-
|
256
|
+
|
257
257
|
def method_missing(method, *args, &block)
|
258
258
|
# TODO Consider supporting a glimmer error silencing option for methods defined here
|
259
259
|
# but fail the glimmer DSL for the right reason to avoid seeing noise in the log output
|
@@ -215,7 +215,7 @@ class MetaSampleApplication
|
|
215
215
|
|
216
216
|
expand_bar {
|
217
217
|
layout_data(:fill, :fill, true, true)
|
218
|
-
font height:
|
218
|
+
font height: 25
|
219
219
|
|
220
220
|
SampleDirectory.sample_directories.each { |sample_directory|
|
221
221
|
expand_item {
|
@@ -227,7 +227,7 @@ class MetaSampleApplication
|
|
227
227
|
fill true
|
228
228
|
}
|
229
229
|
selection bind(sample_directory, :selected_sample_name)
|
230
|
-
font height:
|
230
|
+
font height: 20
|
231
231
|
}
|
232
232
|
}
|
233
233
|
}
|
@@ -236,12 +236,12 @@ class MetaSampleApplication
|
|
236
236
|
composite {
|
237
237
|
fill_layout
|
238
238
|
layout_data(:fill, :center, true, false) {
|
239
|
-
height_hint
|
239
|
+
height_hint 96
|
240
240
|
}
|
241
241
|
|
242
242
|
button {
|
243
243
|
text 'Launch'
|
244
|
-
font height:
|
244
|
+
font height: 25
|
245
245
|
enabled bind(SampleDirectory, 'selected_sample.launchable')
|
246
246
|
|
247
247
|
on_widget_selected {
|
@@ -254,7 +254,7 @@ class MetaSampleApplication
|
|
254
254
|
}
|
255
255
|
button {
|
256
256
|
text 'Reset'
|
257
|
-
font height:
|
257
|
+
font height: 25
|
258
258
|
enabled bind(SampleDirectory, 'selected_sample.editable')
|
259
259
|
|
260
260
|
on_widget_selected {
|
@@ -1,3 +1,24 @@
|
|
1
|
+
# Copyright (c) 2007-2021 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 Metronome
|
@@ -92,13 +113,15 @@ class Metronome
|
|
92
113
|
|
93
114
|
def beat_container
|
94
115
|
composite {
|
95
|
-
grid_layout(@rhythm.beat_count, true)
|
96
|
-
margin_left 10
|
97
|
-
}
|
116
|
+
grid_layout(@rhythm.beat_count, true)
|
98
117
|
|
99
118
|
@rhythm.beat_count.times { |n|
|
100
119
|
canvas {
|
101
|
-
|
120
|
+
layout_data {
|
121
|
+
width_hint 50
|
122
|
+
height_hint 50
|
123
|
+
}
|
124
|
+
rectangle(0, 0, :default, :default, 36, 36) {
|
102
125
|
background bind(self, "rhythm.beats[#{n}].on") {|on| on ? :red : :yellow}
|
103
126
|
}
|
104
127
|
}
|
@@ -1,3 +1,24 @@
|
|
1
|
+
# Copyright (c) 2007-2021 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
|
require 'bigdecimal'
|
3
24
|
|
@@ -61,11 +61,11 @@ class HelloCustomShape
|
|
61
61
|
background :white
|
62
62
|
|
63
63
|
15.times { |n|
|
64
|
-
x_location = (rand*WIDTH/2).to_i%WIDTH + (rand*
|
65
|
-
y_location = (rand*HEIGHT/2).to_i%HEIGHT + (rand*
|
64
|
+
x_location = (rand*WIDTH/2).to_i%WIDTH + (rand*15).to_i
|
65
|
+
y_location = (rand*HEIGHT/2).to_i%HEIGHT + (rand*15).to_i
|
66
66
|
foreground_color = rgb(rand*255, rand*255, rand*255)
|
67
67
|
|
68
|
-
stick_figure(x: x_location, y: y_location, width:
|
68
|
+
stick_figure(x: x_location, y: y_location, width: 35+n*2, height: 35+n*2) {
|
69
69
|
foreground foreground_color
|
70
70
|
}
|
71
71
|
}
|
@@ -33,11 +33,11 @@ class HelloShape
|
|
33
33
|
background :white
|
34
34
|
|
35
35
|
15.times { |n|
|
36
|
-
x_location = (rand*125).to_i%200 + (rand*
|
37
|
-
y_location = (rand*125).to_i%200 + (rand*
|
36
|
+
x_location = (rand*125).to_i%200 + (rand*15).to_i
|
37
|
+
y_location = (rand*125).to_i%200 + (rand*15).to_i
|
38
38
|
foreground_color = rgb(rand*255, rand*255, rand*255)
|
39
39
|
|
40
|
-
stick_figure(x_location, y_location,
|
40
|
+
stick_figure(x_location, y_location, 35+n*2, 35+n*2) {
|
41
41
|
foreground foreground_color
|
42
42
|
}
|
43
43
|
}
|
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.18.7.
|
4
|
+
version: 4.18.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|