[e-lang] E's Tamed Java API - Drawing in a UI
Toby Murray
toby.murray at dsto.defence.gov.au
Sun Mar 26 22:34:46 EST 2006
[ my apologies if this goes out twice -- my email software seems to be
lacking some determinism ;) ]
I'm wondering if anyone out there can help with a query about E's tamed
Java APIs. I've been experimenting recently with E and have found it
surprisingly easy to get a (albeit fairly simple) distributed
application up and running.
I've come to writing the UI and want the ability to draw arbitrarily
within a fixed region of a window. Being fairly new to Java UI
programming in general, I had a bit of a look around and thought of
creating a JPanel of the appropriate size, then calling it's
getGraphics() method to get a graphics context that would allow me to
draw in it.
But the getGraphics() method of all JComponents is suppressed (according
to the javadocs on erights.org), from which JPanel inherits.
Is there another way to accomplish the above?
Or can I remove this restriction (unsupress the getGraphics() method) or
work around it in some other way (perhaps by writing my own swing
component or something)?
I can perhaps understand why this method is suppressed if you want to be
able to hand untrusted objects refrences to your gui components and
don't want them to be able to draw all over them. However, it does seem
to restrict the ability in general to draw.
I must admit here that I'm not at all familiar with E programming in
general and this experimentation is really my first foray into E etc. So
any comments / ideas or explanations would be really helpful, as I'm a
little stumped at this point.
Thanks heaps,
Toby
--
Toby Murray
Advanced Computer Capabilities Group
Information Networks Division
DSTO, Australia
IMPORTANT: This e-mail remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
Crimes Act 1914. If you have received this e-mail in error, you are
requested to contact the sender and delete the e-mail.
--
Toby Murray
Advanced Computer Capabilities Group
Information Networks Division
DSTO, Australia
IMPORTANT: This e-mail remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
Crimes Act 1914. If you have received this e-mail in error, you are
requested to contact the sender and delete the e-mail.
More information about the e-lang
mailing list