[OpenMap Users] MapBean repaint all layers *but* mine

From: Rick Lane <lane_richard_b_at_bah.com>
Date: Mon, 28 Mar 2005 10:01:47 -0500


For several reasons, I do not use the Drawing Tool (or the XOR paint mode)
to perform my dragging functions, instead I actually re-draw the elements in
their entirety as they're dragged. To do this, I create a BufferedImage
with all the elements *except* those that are being dragged so that on
subsequent repaints, I can simply draw the BI and then draw that which I'm

The first way I implemented this was to create a transparent BI, so that I
didn't really care what was going on underneath (in other layers), I could
simply draw my transparent BI on top of them. However, the speed increase I
get from *not* using transparency is too good to turn down, and so I'm left
with a problem. I want to call mapBean.paintAll(Graphics) and pass in my
BI's graphics context, however I don't want my layer to be included in this
(because as it works now, my paintComponents() function draws the BI, and so
I get erratic behavior when I try to paint the BI as I'm trying to build the
BI). Is there some way I can temporarily tell the MapBean not to paint this
layer? If paintAll was blocking, I could simply set a Boolean flag so that
my layer wouldn't paint, but because a separate thread takes care of this, I
can't control the behavior. I was thinking of somehow removing this layer
from the MapBean and then adding it, but I haven't been successful with this
approach either.

Any help is greatly appreciated.


[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Mar 28 2005 - 10:02:21 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT