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

From: Rick Lane <>
Date: Mon, 28 Mar 2005 10:16:55 -0500

Right, which is the approach I tried with the boolean flag, however there's
no way for me to determine a good point to set this flag (so that my layer
doesn't paint). In other words, assume the following bit of code:


Setting the "do not paint" flag to true causes the layer to not paint,
however because the call to paintAll is not blocking, I am immediately
setting the "do not paint" flag to false again, before the layer's paint()
method is actually called, so the effect is lost.

-----Original Message-----
From: Don Dietrick []
Sent: Monday, March 28, 2005 10:12 AM
To: Rick Lane
Cc: 'OpenMap Users'
Subject: Re: [OpenMap Users] MapBean repaint all layers *but* mine

I'd modify your layer so it has the capability to know to not do
anything when it's paint() method is called.
- Don

On Mar 28, 2005, at 10:01 AM, Rick Lane wrote:

> Greetings,
> 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
> dragging.
> 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.
> Rick
> --
> [To unsubscribe to this list send an email to ""
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

Don Dietrick,
BBN Technologies, Cambridge, MA

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

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