RE: [OpenMap Users] getting highlight() called from inside an OMRect

From: Rick Lane <lane_richard_b_at_bah.com>
Date: Wed, 30 Mar 2005 15:34:18 -0500

Well, I think OpenMap has built-in functionality to search for OMGraphics at
a given point; I don't use this because I don't use OMGraphics, however I
*do* scan through all of my custom items, and I don't really have any
performance issues because it operates on a separate thread. One efficiency
operation I do is keep track of all the objects that are drawn at any given
time; so if you zoom really far in and only 2 objects are currently visible,
I only search through these 2 objects.

 

  _____

From: Andrew Schulak [mailto:aschulak_at_gestalt-llc.com]
Sent: Wednesday, March 30, 2005 3:27 PM
To: Rick Lane; openmap-users_at_bbn.com
Subject: RE: [OpenMap Users] getting highlight() called from inside an
OMRect

 

Rick, thanks for the speedy response,

 

Is there a better way to find the OMRects at the spot clicked rather than
iterating over the complete set of all of my OMRects?

 

Thanks,

A

-----Original Message-----
From: Rick Lane [mailto:lane_richard_b_at_bah.com]
Sent: Wednesday, March 30, 2005 3:10 PM
To: Andrew Schulak; openmap-users_at_bbn.com
Subject: RE: [OpenMap Users] getting highlight() called from inside an
OMRect

Andrew,

 

My application uses boxes similarly to how you're describing. If you're
wondering how to get the transparency, simply create a Color object with a
less-than-255 value for the alpha component:

 

Color transColor = new Color(255, 0, 0, 100); // This will create a red
color that is transparent

 

Then you can call setFillPaint() with this color.

 

If you're wondering how to highlight when the mouse is inside the OMRect,
then modify the mouseMoved(MouseEvent) function in your layer to find which
OMRects are currently at the current mouse position, and call select()
accordingly.

 

Rick

 

 


  _____


From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com] On
Behalf Of Andrew Schulak
Sent: Wednesday, March 30, 2005 2:56 PM
To: openmap-users_at_bbn.com
Subject: [OpenMap Users] getting highlight() called from inside an OMRect

 

All,

 

I have a bunch of OMRects in an OMGraphicHandlerLayer. I would like the
highlight() and select() methods to be called when the mouse is inside the
OMRect as well as (or rather than) when it is only on the edge?

 

Is there a way to get this functionality?

 

I would not be opposed to using something other than an OMRect, my only
constraint is that it be a bordered box that is clear/transparent in the
middle.

 

Thanks,

Andrew

 



--
[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 Wed Mar 30 2005 - 15:35:16 EST

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