Here is the changelist in case you are interested in reviewing the
changes (although remember most of the work was done in the previous
check-in):
http://code.google.com/p/visage/source/detail?r=0164367eb49f5f2c1efcfd85a2728a25b2ae705e
And here is a little bit about Angle literals:
Angle instances can be specified as degrees, radians, or turns. For
precise calculations, they are stored in the given unit type as a double
value.
Angles can be easily created using angle literals; for example, a 90
degree Angle instance can be defined in several ways:
Angle a = 90deg;
Angle a = .25turn;
Angle a = Angle.valueOf(Math.PI / 2, AngleUnit.RADIAN);</pre></code>
Angle instances are immutable, and are therefore replaced rather than
modified. To create a new Angle instance, either use a time literal, or
use the Angle.valueOf(value, unit) factory method.
Angles support operator overloading of all the usual suspects (+, -, *,
/, etc.) They also have a custom formatter to let you specify precision.
Happy New Year!
Cheers,
--
--Steve
blog: http://steveonjava.com/
- Josh
Blasting forth in three part harmony!
I also kept the license as New BSD to promote code sharing, so you are
free to take those classes and reuse/convert them for Leonardo. In fact
I encourage you to do so, because that makes the job of wrapping
Leonardo with Visage that much easier! :)
What you are a not getting is the literal syntax support. You would
need to use the Java constructors to create objects instead. For example:
Color.rgb(16, 16, 16)
instead of #0F0F0F
or
Length.valueOf(16, LengthUnit.CENTIMETERS)
rather than 16cm
Although this is the unique value proposition of Visage... we can add
to the language to make things simpler and more elegant than you can do
purely with Java APIs.
Here is a link to the right folder in the source tree to get you started:
http://code.google.com/p/visage/source/browse/#hg%2Fsrc%2Fshare%2Fclasses%2Fjavafx%2Flang
Cheers,
--Steve