group
and transformations
. The following code shows how they can be usedSo what do we have here...
- set the current color to green.
- declare a group, all operations that change the graphics context will not have an effect outside the group.
- draw a rounded not-filled rectangle, which will serve as a bound delimiter.
- draw another rounded rectangle, filled with cyan.
- apply a transformation to the last rectangle, it will translate the rectangle by 10 units across the x axis.
- draw a third rectangle, filled with red. Note that the 3 rectangles start at the same x position.
- set the current color to yellow.
- draw a line, it should be stroked with yellow (current color).
- draw a second line (oustide the group), it should be stroked with green(current color).

Transformations may be applied to any contextual or grouping operation (a contextual operation allows nesting of other operations), and as in JavaFX, there are four of them:
translate
, scale
, rotate
and skew
. As the builder evolves I see that it's becoming a little bit difficult to keep track of all the samples, so I decided to create a demo app (like the JavaFX tutorial) that will server as a showcase. By the way Danno has been busy adding binding support to SwingBuilder, and its very likely that that binding solution will be used in GraphicsBuilder.Keep on Groovying!