{"id":16382440,"url":"https://github.com/andyobtiva/glimmer-dsl-swing","last_synced_at":"2025-04-04T13:27:57.659Z","repository":{"id":56874611,"uuid":"437964342","full_name":"AndyObtiva/glimmer-dsl-swing","owner":"AndyObtiva","description":"Glimmer DSL for Swing (JRuby Swing Desktop Development GUI Library) - Enables development of desktop applications using Java Swing and Java 2D, including vector graphics and AWT geometry.","archived":false,"fork":false,"pushed_at":"2023-06-29T17:37:16.000Z","size":151,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T03:49:12.908Z","etag":null,"topics":["desktop","dsl-syntax","framework","glimmer","glimmer-dsl","gui","ruby","ruby-gem","ruby-library","rubygem","swing","swing-gui","swing-gui-toolkit"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndyObtiva.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-13T17:29:46.000Z","updated_at":"2024-05-31T12:45:33.000Z","dependencies_parsed_at":"2024-12-17T16:45:04.362Z","dependency_job_id":"5d77b387-c36b-49c6-8952-e76179339c3b","html_url":"https://github.com/AndyObtiva/glimmer-dsl-swing","commit_stats":{"total_commits":23,"total_committers":2,"mean_commits":11.5,"dds":"0.13043478260869568","last_synced_commit":"fb5fffd8b338df5b0f61761092d909d426f8d2a3"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyObtiva%2Fglimmer-dsl-swing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyObtiva%2Fglimmer-dsl-swing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyObtiva%2Fglimmer-dsl-swing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndyObtiva%2Fglimmer-dsl-swing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndyObtiva","download_url":"https://codeload.github.com/AndyObtiva/glimmer-dsl-swing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247184223,"owners_count":20897740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["desktop","dsl-syntax","framework","glimmer","glimmer-dsl","gui","ruby","ruby-gem","ruby-library","rubygem","swing","swing-gui","swing-gui-toolkit"],"created_at":"2024-10-11T04:05:24.299Z","updated_at":"2025-04-04T13:27:57.643Z","avatar_url":"https://github.com/AndyObtiva.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [\u003cimg src=\"https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png\" height=85 /\u003e](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Swing 0.0.5\n## JRuby Swing Desktop Development GUI Library\n[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swing.svg)](http://badge.fury.io/rb/glimmer-dsl-swing)\n[![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) enables building desktop applications with [Java Swing](https://docs.oracle.com/javase/tutorial/uiswing/), [Java AWT](https://docs.oracle.com/javase/8/docs/technotes/guides/awt/index.html), [Java Foundation Classes](https://docs.oracle.com/javase/tutorial/uiswing/start/about.html) and [Java 2D](https://docs.oracle.com/javase/tutorial/2d/index.html) via [JRuby](https://www.jruby.org/).\n\nThere has been a great divide between two big GUI toolkits in Java:\n- [Eclipse SWT](https://www.eclipse.org/swt/)\n- [Java Swing/AWT/JFC/2D](https://docs.oracle.com/javase/tutorial/uiswing/)\n\n[Glimmer](https://github.com/AndyObtiva/glimmer) intentionally avoided [Swing](https://docs.oracle.com/javase/tutorial/uiswing/)-like GUI toolkits in the past because they produced non-native looking graphical user interfaces that not only looked out of place in various operating systems, but also degraded usability, user experience, and the professional look of applications significantly, especially given that unlike [SWT](https://www.eclipse.org/swt/), [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) performance is affected by [Java Garbage Collection](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/performissues003.html) pauses. As such, [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) was initially born as the premiere [Glimmer](https://github.com/AndyObtiva/glimmer) DSL.\n\nThat said, from a balanced software engineering point of view, there are sometimes non-functional requirements that might target [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) as an appropriate GUI toolkit solution. Like in the case of extending legacy [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) applications or developing rare applications that require fully custom looking graphical user interfaces (typically not recommended), such as traffic control planning or diagramming applications. In the latter case, it would not matter whether to use [SWT](https://www.eclipse.org/swt/) or [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) as they both provide support for building non-native components (in addition to native widgets in the case of [SWT](https://www.eclipse.org/swt/)).\n\n[Glimmer DSL for Swing](https://rubygems.org/gems/glimmer-dsl-swing) aims to supercharge productivity and maintainability in developing [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) applications by providing a DSL similar to [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) having:\n- [Declarative DSL syntax](#glimmer-gui-dsl) that visually maps to the GUI component hierarchy\n- Convention over configuration via [smart defaults and automation of low-level details](#smart-defaults-and-conventions)\n- Requiring the least amount of syntax possible to build GUI\n- Custom Keyword support\n- Bidirectional Data-Binding to declaratively wire and automatically synchronize GUI with Business Models\n- Scaffolding for new custom components, apps, and gems\n- Native-Executable packaging on Mac, Windows, and Linux.\n\nHello, World!\n\n![screenshots/glimmer-dsl-swing-mac-hello-world.png](screenshots/glimmer-dsl-swing-mac-hello-world.png)\n\n```ruby\njframe('Hello, World!') {\n  jlabel('Hello, World!')\n}.show\n```\n\nNOTE: Glimmer DSL for Swing is currently in early alpha mode (incomplete proof-of-concept). If you want it developed faster, then [open an issue report](https://github.com/AndyObtiva/glimmer-dsl-swing/issues/new). I have completed some GitHub project features much faster before due to [issue reports](https://github.com/AndyObtiva/glimmer-dsl-swing/issues) and [pull requests](https://github.com/AndyObtiva/glimmer-dsl-swing/pulls). Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.\n\nLearn more about the differences between various [Glimmer](https://github.com/AndyObtiva/glimmer) DSLs by looking at the **[Glimmer DSL Comparison Table](https://github.com/AndyObtiva/glimmer#glimmer-dsl-comparison-table)**.\n\n## Prerequisites\n\n- JDK 8 (find at https://www.oracle.com/java/technologies/downloads/#java8)\n- [RVM](http://rvm.io) on Mac \u0026 Linux (not available on Windows)\n- JRuby 9.2.19.0 (supporting Ruby 2.5.x syntax) (get via [RVM](http://rvm.io) on Mac and Linux by running `rvm install jruby-9.2.19.0`; On Windows, find at [https://www.jruby.org/download](https://www.jruby.org/download))\n\nNote: On the Mac, if you have [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) installed, and it added `export JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\"` to your `.zprofile`, `.zshrc`, `.bash_profile`, or `.bashrc`, make sure to disable it before using Glimmer DSL for Swing. Unfortunately, it is not compatible with it and will hang its apps until disabled.\n\n## Setup\n\n### Option 1: Install\n\nRun this command to install directly:\n```\ngem install glimmer-dsl-swing -v0.0.5\n```\n\n### Option 2: Bundler\n\nAdd the following to `Gemfile`:\n```\ngem 'glimmer-dsl-swing', '0.0.5'\n```\n\nAnd, then run:\n```\nbundle\n```\n\n## Usage\n\nRequire the library and mixin the `Glimmer` module to utilize the Glimmer GUI DSL for Swing:\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\ninclude Glimmer\n\njframe('Hello, World!') {\n  jlabel('Hello, World!')\n}.show\n```\n\nFor actual application development outside of simple demos, mixin the `Glimmer` module into a custom application class instead:\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\nclass SomeApplication\n  include Glimmer\n\n  def launch\n    jframe('Hello, World!') {\n      jlabel('Hello, World!')\n    }.show\n  end\nend\n\nSomeApplication.new.launch\n```\n\n## Glimmer GUI DSL\n\nThe Glimmer GUI DSL enables development of desktop graphical user interfaces in a manner similar to HTML, but in one language, Ruby, thus avoiding the multi-language separation dissonance encountered on the web, especially given that Ruby looping/conditional constructs do not need scriptlets to be added around View code. This makes desktop development extremely productive.\n\n1 - Keywords\n\nYou may declare any [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) component with its keyword, which is the underscored version of the class name. For example, `jframe` is the keyword for `javax.swing.JFrame` (`j_frame` is acceptable too)\n\nExamples:\n\n```ruby\njframe\njbutton\njlabel\n```\n\n2 - Arguments\n\nYou may pass any arguments that a [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) component constructor accepts to its Glimmer keyword.\n\nExample (`JFrame`, `JButton`, and `JLabel` have a constructor signature that accepts a string representing title or text):\n\n```ruby\njframe('Hello, World!')\njbutton('Push Me')\njlabel('Name')\n```\n\nThe recommended style is to always wrap arguments with parentheses for component keywords.\n\n3 - Content Block\n\nYou may pass a content block to any [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) component keyword, which contains properties and/or nested components.\n\nExample:\n\n```ruby\njframe('Hello, World!') {\n  minimum_size 320, 240\n\n  jlabel('Hello, World!')\n}\n```\n\nThe recommended style for the content block is always curly braces `{}` to denote as View nesting code different from looping/conditional logic, which utilizes `do;end` instead.\n\nProperty arguments never have parentheses.\n\n4 - Listeners\n\nYou may declare listeners with their `on_`-prefixed event method name on the [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) listener class (these are the classes in the signatures of `AddXYZListener` methods on [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) component classes).\n\nFor example, `JButton` has an `AddXYZListener` method called `AddActionListener`, which accepts an `ActionListener` class. That class has one event method: `actionPerformed`. In Glimmer, you simply underscore that and prefix with `on_`:\n\n```ruby\njframe('Hello, Button!') {\n  jbutton('Click') {\n    on_action_performed do\n      puts 'Clicked!'\n    end\n  }\n}\n```\n\nThe recommended style for listeners is always a `do; end` block.\n\n5 - Component Proxy \u0026 Methods\n\nWhen utilizing the Glimmer GUI DSL, you get back proxy objects that wrap [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) components. To access the original component wrapped by the proxy object, you may call the `#original` method.\n\nFurthermore, you may invoke any method available on the component on the proxy object, like the `#show` method on `JFrame`.\n\n```ruby\nframe1 = jframe('Hello, World!') {\n  # ...\n}\nframe1.show\n```\n\nDespite `#show` being deprecated in the Java API, it is recommended to use `#show` instead of `visible=` in the Glimmer GUI DSL because it has less awkward syntax (it calls `visible=` behind the scenes to avoid the deprecated API). `#show` also invokes `pack` automatically on first run, utilizing `SwingUtilities.invokeLater`.\n\n6 - Observe Model Attributes\n\nIn Smalltalk-MVC ([Model View Controller](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) Architectural Pattern), the View is an active View that observes the Model for changes and updates itself.\n\n![MVC](http://3.bp.blogspot.com/-4eW59Ao0ess/ToiBzAiYdZI/AAAAAAAAAOg/SiYa6XHwBFE/s320/Screen+shot+2011-10-02+at+10.22.11+AM.png)\n\nThis can be achieved with the Glimmer GUI DSL using the `observe` keyword, which takes a model (any object, including `self`) and attribute Symbol or String expression (e.g. `:count` or `'address.street'`).\n\nThe model is automatically enhanced as an `Glimmer::DataBinding::ObservableModel` / `Glimmer::DataBinding::ObservableHash` / `Glimmer::DataBinding::ObservableArray` depending on its type to support notifying observers of attribute changes (when performed using the attribute writer, which automatically calls added method `notify_observers(attribute)`)\n\nNote that it is usually recommended to observe external model objects (not `self`), but `self` is OK in very simple cases or presentation-related attributes only.\n\nExample:\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\nclass Counter\n  attr_accessor :count\n\n  def initialize\n    self.count = 0\n  end\nend\n\nclass HelloButton\n  include Glimmer\n  \n  def initialize\n    @counter = Counter.new\n\n    observe(@counter, :count) do |new_count|\n      @button.text = \"Click To Increment: #{new_count}\"\n    end\n  end\n  \n  def launch\n    jframe('Hello, Button!') {\n      @button = jbutton('Click To Increment: 0') {\n        on_action_performed do\n          @counter.count += 1\n        end\n      }\n    }.show\n  end\nend\n\nHelloButton.new.launch\n```\n\n![screenshots/glimmer-dsl-swing-mac-hello-button.png](screenshots/glimmer-dsl-swing-mac-hello-button.png)\n\n### Shape DSL\n\n[Glimmer DSL for Swing](https://rubygems.org/gems/glimmer-dsl-swing) might be the only Ruby Swing DSL out there that supports an additional Shape DSL.\n\nThis enables declarative painting of arbitrary shapes using Java 2D, which is similar to how SVG works on the web.\n\nSimply utilize underscored shape names from the `java.awt.geom` [package classes](https://docs.oracle.com/javase/8/docs/api/java/awt/geom/package-summary.html) minus the `2D` suffix, following the same general rules of the [Glimmer GUI DSL](#glimmer-gui-dsl).\n\nFor example, `Arc2D` becomes simply `arc`.\n\nGlimmer utilizes the `Double` variation of shape classes.\n\nAdditionally, you can set these shape properties:\n- `draw_paint` (alias: `draw_color`): takes [`java.awt.Color`](https://docs.oracle.com/javase/8/docs/api/java/awt/Color.html) rgba arguments to use color for drawing\n- `fill_paint` (alias: `fill_color`): takes [`java.awt.Color`](https://docs.oracle.com/javase/8/docs/api/java/awt/Color.html) rgba arguments to use color for filling\n- `stroke`: takes [`java.awt.BasicStroke`](https://docs.oracle.com/javase/8/docs/api/java/awt/BasicStroke.html) line width and other arguments to use for drawing\n\n`path` can have the following operations nested:\n- `move_to x, y`: move to point\n- `line_to x2, y2`: connect line to end point\n- `curve_to ctrl_x1, ctrl_y1, ctrl_x2, ctrl_y2, x2, y2`: connect curve to control point 1, control point 2, and end point\n- `close_path`: close path, reconnecting last shape/point back to first point\n\nExample:\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\ninclude Glimmer\n\njframe('Hello, Shapes!') {\n  minimum_size 400, 400\n  \n  arc(40, 40, 90, 90, 30, 230, 0) {\n    fill_paint 255, 0, 0\n    draw_paint 0, 128, 255\n    stroke 3\n  }\n  \n  arc(40, 140, 90, 90, 30, 230, 1) {\n    fill_paint 255, 0, 0\n    draw_paint 0, 128, 255\n    stroke 3\n  }\n  \n  arc(40, 240, 90, 90, 30, 230, 2) {\n    fill_paint 255, 0, 0\n    draw_paint 0, 128, 255\n    stroke 3\n  }\n  \n  rectangle(140, 40, 180, 90) {\n    fill_paint 255, 255, 0\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n  \n  round_rectangle(140, 140, 180, 90, 60, 40) {\n    fill_paint 255, 255, 0\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n\n  ellipse(140, 240, 180, 90) {\n    fill_paint 255, 255, 0\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n  \n  line(180, 60, 280, 110) {\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n  \n  quad_curve(170, 60, 180, 90, 220, 100) {\n    draw_paint 0, 255, 0\n    stroke 3\n  }\n  \n  cubic_curve(190, 60, 240, 40, 220, 80, 260, 70) {\n    draw_paint 0, 0, 255\n    stroke 3\n  }\n  \n  path {\n    move_to 200, 150\n    line_to 270, 170\n    line_to 250, 220\n    line_to 220, 190\n    line_to 200, 200\n    line_to 180, 170\n    \n    close_path\n    \n    fill_paint 0, 255, 0\n    draw_paint 0, 0, 255\n    stroke 3\n  }\n  \n  path {\n    move_to 160, 300\n    curve_to 190, 260, 200, 280, 210, 270\n    curve_to 240, 280, 250, 300, 260, 290\n    curve_to 290, 290, 300, 310, 310, 300\n    \n    fill_paint 0, 255, 0\n    draw_paint 0, 0, 255\n    stroke 3\n  }\n}.show\n```\n\n![screenshots/glimmer-dsl-swing-mac-hello-shapes.png](screenshots/glimmer-dsl-swing-mac-hello-shapes.png)\n\n## Smart Defaults and Conventions\n\n- `jframe` automatically invokes `pack` on first run of `show`, and ensures utilizing `SwingUtilities.invokeLater` behind the scenes.\n- When nesting a shape under a [swing](https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html)/[awt](https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html) component, it is automatically added to shapes to paint on top of component (after painting component itself).\n\n## Girb (Glimmer IRB)\n\nYou can run the `girb` command (`bin/girb` if you cloned the project locally):\n\n```\ngirb\n```\n\nThis gives you `irb` with the `glimmer-dsl-swing` gem loaded and the `Glimmer` module mixed into the main object for easy experimentation with GUI.\n\n## Samples\n\n### Hello Samples\n\n#### Hello, World!\n\nRun with gem installed:\n\n```\njruby -r glimmer-dsl-swing -e \"require 'samples/hello/hello_world'\"\n```\n\nOr run from locally cloned project directory:\n\n```\njruby -r ./lib/glimmer-dsl-swing samples/hello/hello_world.rb\n```\n\n![screenshots/glimmer-dsl-swing-mac-hello-world.png](screenshots/glimmer-dsl-swing-mac-hello-world.png)\n\n[samples/hello/hello_world.rb](samples/hello/hello_world.rb):\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\ninclude Glimmer\n\njframe('Hello, World!') {\n  jlabel('Hello, World!')\n}.show\n```\n\n#### Hello, Button!\n\nRun with gem installed:\n\n```\njruby -r glimmer-dsl-swing -e \"require 'samples/hello/hello_button'\"\n```\n\nOr run from locally cloned project directory:\n\n```\njruby -r ./lib/glimmer-dsl-swing samples/hello/hello_button.rb\n```\n\n![screenshots/glimmer-dsl-swing-mac-hello-button.png](screenshots/glimmer-dsl-swing-mac-hello-button.png)\n\nVersion 1 (without model) - [samples/hello/hello_button.rb](samples/hello/hello_button.rb):\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\ninclude Glimmer\n\njframe('Hello, Button!') {\n  @button = jbutton('Click To Increment: 0') {\n    on_action_performed do\n      button_text_match = @button.text.match(/(.*)(\\d+)$/)\n      count = button_text_match[2].to_i + 1\n      @button.text = \"#{button_text_match[1]}#{count}\"\n    end\n  }\n}.show\n```\n\nVersion 2 (with model) - [samples/hello/hello_button2.rb](samples/hello/hello_button2.rb):\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\nclass Counter\n  attr_accessor :count\n\n  def initialize\n    self.count = 0\n  end\nend\n\nclass HelloButton\n  include Glimmer\n  \n  def initialize\n    @counter = Counter.new\n\n    observe(@counter, :count) do |new_count|\n      @button.text = \"Click To Increment: #{new_count}\"\n    end\n  end\n  \n  def launch\n    jframe('Hello, Button!') {\n      @button = jbutton('Click To Increment: 0') {\n        on_action_performed do\n          @counter.count += 1\n        end\n      }\n    }.show\n  end\nend\n\nHelloButton.new.launch\n```\n\n#### Hello, Shapes!\n\nRun with gem installed:\n\n```\njruby -r glimmer-dsl-swing -e \"require 'samples/hello/hello_shapes'\"\n```\n\nOr run from locally cloned project directory:\n\n```\njruby -r ./lib/glimmer-dsl-swing samples/hello/hello_shapes.rb\n```\n\n![screenshots/glimmer-dsl-swing-mac-hello-shapes.png](screenshots/glimmer-dsl-swing-mac-hello-shapes.png)\n\n[samples/hello/hello_shapes.rb](samples/hello/hello_shapes.rb):\n\n```ruby\nrequire 'glimmer-dsl-swing'\n\ninclude Glimmer\n\njframe('Hello, Shapes!') {\n  minimum_size 400, 400\n  \n  arc(40, 40, 90, 90, 30, 230, 0) {\n    fill_paint 255, 0, 0\n    draw_paint 0, 128, 255\n    stroke 3\n  }\n  \n  arc(40, 140, 90, 90, 30, 230, 1) {\n    fill_paint 255, 0, 0\n    draw_paint 0, 128, 255\n    stroke 3\n  }\n  \n  arc(40, 240, 90, 90, 30, 230, 2) {\n    fill_paint 255, 0, 0\n    draw_paint 0, 128, 255\n    stroke 3\n  }\n  \n  rectangle(140, 40, 180, 90) {\n    fill_paint 255, 255, 0\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n  \n  round_rectangle(140, 140, 180, 90, 60, 40) {\n    fill_paint 255, 255, 0\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n\n  ellipse(140, 240, 180, 90) {\n    fill_paint 255, 255, 0\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n  \n  line(180, 60, 280, 110) {\n    draw_paint 255, 0, 0\n    stroke 3\n  }\n  \n  quad_curve(170, 60, 180, 90, 220, 100) {\n    draw_paint 0, 255, 0\n    stroke 3\n  }\n  \n  cubic_curve(190, 60, 240, 40, 220, 80, 260, 70) {\n    draw_paint 0, 0, 255\n    stroke 3\n  }\n  \n  path {\n    move_to 200, 150\n    line_to 270, 170\n    line_to 250, 220\n    line_to 220, 190\n    line_to 200, 200\n    line_to 180, 170\n    \n    close_path\n    \n    fill_paint 0, 255, 0\n    draw_paint 0, 0, 255\n    stroke 3\n  }\n  \n  path {\n    move_to 160, 300\n    curve_to 190, 260, 200, 280, 210, 270\n    curve_to 240, 280, 250, 300, 260, 290\n    curve_to 290, 290, 300, 310, 310, 300\n    \n    fill_paint 0, 255, 0\n    draw_paint 0, 0, 255\n    stroke 3\n  }\n}.show\n```\n\n## Resources\n\n- Oracle Swing Tutorial: https://docs.oracle.com/javase/tutorial/uiswing/\n- Oracle Java 2D Tutorial: https://docs.oracle.com/javase/tutorial/2d/index.html\n- Oracle Swing JavaDoc: https://docs.oracle.com/javase/8/docs/api/javax/swing/package-summary.html\n- Oracle AWT JavaDoc: https://docs.oracle.com/javase/8/docs/api/java/awt/package-summary.html\n- Oracle AWT Geom JavaDoc: https://docs.oracle.com/javase/8/docs/api/java/awt/geom/package-summary.html\n\n## Process\n\n[Glimmer Process](https://github.com/AndyObtiva/glimmer/blob/master/PROCESS.md)\n\n## Help\n\n### Issues\n\nIf you encounter [issues](https://github.com/AndyObtiva/glimmer-dsl-swing/issues) that are not reported, discover missing features that are not mentioned in [TODO.md](TODO.md), or think up better ways to use [Swing](https://docs.oracle.com/javase/tutorial/uiswing/) than what is possible with [Glimmer DSL for Swing](https://rubygems.org/gems/glimmer-dsl-swing), you may submit an [issue](https://github.com/AndyObtiva/glimmer-dsl-swing/issues/new) or [pull request](https://github.com/AndyObtiva/glimmer-dsl-swing/compare) on [GitHub](https://github.com). In the meantime while waiting for a fix, you may try older gem versions of [Glimmer DSL for Swing](https://rubygems.org/gems/glimmer-dsl-swing) in case you find one that does not have the issue and actually works.\n\n### Chat\n\nIf you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n## Planned Features and Feature Suggestions\n\nThese features have been planned or suggested. You might see them in a future version of [Glimmer DSL for Swing](https://rubygems.org/gems/glimmer-dsl-swing). You are welcome to contribute more feature suggestions.\n\n[TODO.md](TODO.md)\n\n## Change Log\n\n[CHANGELOG.md](CHANGELOG.md)\n\n## Contributing\n\n-   Check out the latest master to make sure the feature hasn't been\n    implemented or the bug hasn't been fixed yet.\n-   Check out the issue tracker to make sure someone already hasn't\n    requested it and/or contributed it.\n-   Fork the project.\n-   Start a feature/bugfix branch.\n-   Commit and push until you are happy with your contribution.\n-   Make sure to add tests for it. This is important so I don't break it\n    in a future version unintentionally.\n-   Please try not to mess with the Rakefile, version, or history. If\n    you want to have your own version, or is otherwise necessary, that\n    is fine, but please isolate to its own commit so I can cherry-pick\n    around it.\n\n## Contributors\n\n* [Andy Maleh](https://github.com/AndyObtiva) (Founder)\n\n[Click here to view contributor commits.](https://github.com/AndyObtiva/glimmer-dsl-swing/graphs/contributors)\n\n## Copyright\n\n[MIT](LICENSE.txt)\n\nCopyright (c) 2021 Andy Maleh.\n\n--\n\n[\u003cimg src=\"https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png\" height=40 /\u003e](https://github.com/AndyObtiva/glimmer) Built for [Glimmer](https://github.com/AndyObtiva/glimmer) (DSL Framework).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyobtiva%2Fglimmer-dsl-swing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyobtiva%2Fglimmer-dsl-swing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyobtiva%2Fglimmer-dsl-swing/lists"}