On Sep 17, 2008, at 6:19 AM, Ken Orr wrote:
What's the best way to integrate resolution independent vector based
artwork into a Java Mac App? There isn't really support for creating
icons from PDF files (as far as I know). I know Kirill Grouchnikov
(and Mike Swingler?) talked about resolution independence as it
relates to Java at this years JavaOne (2008), but I don't know if
they touched on anything like this.
The platform-dependent way we brought resolution independent artwork
to Java was though Toolkit.getImage("NSImage://<your-image>"). If your
application is a bundled app, you can put PDF, ICNS, multi-res TIFF,
and a bunch of other formats in your bundle's Contents/Resources/
directory, and they will be picked up by the [NSImage imageNamed:]
machinery. You can also ask for standard system art which is available
from the AppKit/NSImage.h, with a slight change to the name of the
constants.
If you need a platform-independent way, Kirill discusses how to use an
SVG to Java2D transcoder that will create Java classes that paint in
Java2D based on an SVG file you give it: http://weblogs.java.net/blog/kirillcool/archive/2006/10/svg_and_java_ui_3.html
.
Hope this helps,
Mike Swingler
Java Runtime Engineer
Apple Inc.