Re: Webobjects-dev Digest, Vol 4, Issue 154
Re: Webobjects-dev Digest, Vol 4, Issue 154
- Subject: Re: Webobjects-dev Digest, Vol 4, Issue 154
- From: Thomas Pelaia II <email@hidden>
- Date: Wed, 14 Mar 2007 16:49:10 -0400
Hi,
Depending on what Quartz features you are using, you could simply use
the HTML Canvas tag along with JavaScript to draw using a subset of
Quartz like drawing directives.
See http://developer.apple.com/documentation/AppleApplications/
Reference/SafariJSRef/Classes/Canvas.html
The Canvas tag was introduced by Apple for Dashboard and is supported
by newer versions of both WebKit (e.g. Safari) and Firefox web
browsers. I don't know if it is supported by IE, yet or if it will
ever be supported in IE. Note that it is important to close canvas
tags explicitly for compatibility with Firefox (e.g. <canvas ...></
canvas>). It is not compatible across browsers to simply use (e.g.
<canvas .../>).
-tom
On Mar 14, 2007, at 3:11 PM, email@hidden
wrote:
Message: 8
Date: Wed, 14 Mar 2007 16:56:38 +0000
From: Ken Tabb <email@hidden>
Subject: Easiest way to integrate Quartz drawing into WO apps?
To: webobjects-dev <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Hi again folks,
I have some Objective-C code that draws pretty graphs using Quartz.
All looks lovely in Cocoa apps. I'd like to re-use this same code (or
at least the "pretty Quartz" technology within it) in a WebObjects
component, so that these same graphs appear in a web page (as a JPEG).
What's the best way to get to Cocoa/Obj-C code from WO/Java apps?
First one to say "Cocoa/Java bridge" gets a slap :)
I'm thinking the options are:
[1] Cocoa app turns into web service, and somehow get at that from
the WO app. I'm new to web services (although it's something I'll be
needing to get into at some point, albeit not specifically from a
Cocoa angle), both in terms of publishing and consuming them.
[2] Run Cocoa app as-is on the server (same Mac OS X Server as the WO
app) and get some sort of inter-process communication going -
suggestions for the best route welcome (it's been some years since I
did any Java IPC stuff so I'm sure it's all changed). Bearing in mind
it's all running on the same server though, I could at the worst send
data from WO -> Cocoa via XML file / stream, and get Cocoa app to
save the image (with session ID etc. preceding filename) in a known
subdirectory of the web server - the session could then remove all
images whose filename begins with the session's sessionID, at the
time the session is destroyed. I guess that would work (even though
it gets zero for elegance / scalability!)
[3] Re-write the Quartz code in a Python / Ruby script - I don't know
Python or Ruby yet, but wouldn't be against learning this if it was
necessary; I believe both have routes to Quartz. I still have the
issue of needing to call it from, and send data back to, the WO app -
all suggestions welcome!
And secondly, how long is a piece of string?
Thanks in advance for any tips you can give,
Ken
- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer
Science
University of Hertfordshire, UK
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden