Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Invisible Paint?

Thread view: 
carl.manaster@gmail.com - 04 May 2006 19:45 GMT
Hi,

I have a collection of things, some of which I want to draw and others
which I want to not draw (not even in the background color because they
may cover up some of the visible things).  The drawing is being done by
JFreeChart, so it would be kind of clumsy to push my
choosing-whether-to-draw logic into it, and I want to use the indexes
into the original collection for interactions with the chart - rather
than create a collection of visibles and map indexes across
collections.

So I figured a good way to do this would be to assign an invisible
Paint to the things I don't want to draw.  I guessed that such a class
might already be part of AWT, but I don't see it, and a little googling
hasn't revealed one that someone else wrote.  I started rolling my own,
and I've gotten as far as the PaintContext and the ColorModel, just
returning null wherever I can get away with it, but so far the system
isn't letting me get away with a lot of nulls.

Am I going about this all wrong?  I realize it would be inefficient for
large items - wasting a lot of the system's time "drawing" things
invisibly - but it seemed like it ought to be a straightforward
approach that dodges some potential complexity for my specific case.
Does the Invisible class already exist somewhere?  Thanks in advance.

Peace,
--Carl
carl.manaster@gmail.com - 04 May 2006 20:07 GMT
Here we go:

final Color invisible = new Color(0, 0, 0, 0);

Peace,
--Carl


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.