Re: [OpenMap Users] Swing component on a layer

From: Don Dietrick <dietrick@bbn.com>
Date: Tue Feb 11 2003 - 11:40:55 EST

Hi Chris,

Using the MapHandler, you can easily have your layer provide Swing
widgets to the application to get picked up by other containers, and
the layer can control the visibility of the widgets so they only appear
when the layer is also visible. One easy way to do this is to have the
Layer also be a com.bbn.openmap.gui.Tool, and you return your widget
in the getFace() method. In fact, in the next release of OpenMap,
we'll be including an EditorLayer that does exactly this very thing.
You can add menus, whatever. Remember to set the
Layer.addToBeanContext() flag to true.

If you want the widget to appear over the map, that's a slightly harder
problem. Swing widgets tend to hijack all the mouse events if they are
added to any component also added to the MapBean. One way to get
around this is to use a JLayeredPane and add your MapBean to it, and
then add your swing widget to a different layer of the JLayeredPane.

Hope this helps,

Don

On Monday, February 10, 2003, at 12:44 PM, Chris Hopkins wrote:

>
> Hi all -
>
> We're trying to create an OpenMap layer (or some kind of view) which
> allows
> a user to "slide" through time and see what would be happening on a map
> during a planned mission. Has anyone tried to "tie" a Swing component
> to a
> layer?
>
> Here's what I'm trying to do:
>
> - When the layer is active, something like a JSlider shows up in, say,
> the
> lower right corner of the map
> - The user can then manipulate the slider to set the "current" time
> - The layer would react to changes in the slider position and display
> various things on the map like points of interest for that time
> period, etc.
> - When the layer is inactive, the JSlider would go away
> - If the window is resized, the JSlider would automagically move with
> the
> resize amount
>
> Thanks,
> Chris
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Feb 11 11:41:14 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:34 EDT