image()
but draw it using primitives as star()
and text()
.Let's take a look at the finished product first, shall we?

It looks good but surely you will notice that the font is not exactly the same, alas I have not found the exact font yet but downloaded one from http://1001freefonts.com because it's name is "Swingtime"

Let's see it step by step
- Antialias is turn on, we don't want ugly "jaggies" on our logo.
- We create the star as a shape so it won't be drawn right away, because we will be applying two transformations that should not be concatenated right away.
- The first transformations moves the center over which the star will be rotated, as Star2D (from swingx) draws a five pointed star in a leaned way, meaning the top point is not aligned with the Y axis.
- Notice that
rotate()
treats its angle property as radians instead of degrees (I'll add degree support later) and that its [x,y] properties are optional. - Next we draw the star using a generic drawing operation
draw()
, which is able to draw any outline/shape operation and java.awt.Shape as well. This operation defines the second transformation applied to the star. - Notice that the saved star shape retains the first transformation
- The Swingtime font is loaded from a file, derived to a 50 point size and applied.
- Finally the 'Groovy' text is drawn, applying a translate/scale transformation.
- Notice that on scale operations you may specify only one of the axis, the other one will be 1 (no change)
draw()
didn't support nesting of transformations and shapes didn't retain any transformations applied to them.Keep on Groovying!