Invisible Paint?

C

carl.manaster

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top