Re: [OpenMap Users] CoordMouseMode

From: Juan Proyecto <juanproyecto@terra.es>
Date: Tue Apr 29 2003 - 20:28:36 EDT

Hi,

    I solved the problem. The only thing I had to do was setting
InfoDelegator to the Navigation and Distance Modes:

NavMouseMode2 nmm2=new NavMouseMode2();

nmm2.setInfoDelegator(infodele);

DistanceMouseMode dmm=new DistanceMouseMode();

dmm.setInfoDelegator(infodele);

    Thanks.

----- Original Message -----
From: "Don Dietrick" <dietrick@bbn.com>
To: "Juan Proyecto" <juanproyecto@terra.es>
Cc: <openmap-users@bbn.com>
Sent: Saturday, April 26, 2003 2:53 PM
Subject: Re: [OpenMap Users] CoordMouseMode

Hi Juan,

On Friday, April 25, 2003, at 01:46 PM, Juan Proyecto wrote:

> Hi,
>
> I have a problem using the CoordMouseMode. I´m programming an
> application but I´m not using the properties files. I am adding all
> the components on design time.
>
> I am trying to see the coordinates on my windows just as OpenMap´s
> Viewer does, when I move my mouse along the map.
> I add my layers, which dysplay correctly, the four Modes (Navigation,
> Gestures, Distance, None), ...
> I´m adding too a CoordMouseMode as a static public var when I´m
> "creating" the application :

First, you don't want them to be static, there's no need.

>
> /...../
>
> public static LayerHandler manejaCapas;
> public static Container Contenedor;
> public static int IndiceElementos=0;
> public static MapHandler mapHandler = new MapHandler();
> public static BufferedMapBean map = new BufferedMapBean();
> public static JPanel panelInicio=new JPanel();
> public static MouseDelegator raton=new MouseDelegator();
> public static NavMouseMode2 nmm2= new NavMouseMode2();
> public static SelectMouseMode smm= new SelectMouseMode();
> public static DistanceMouseMode dmm= new DistanceMouseMode();
> public static NullMouseMode nullmm= new NullMouseMode();
> public static Projection proyeccion;
> public static InformationDelegator infodele;
> public static LayersPanel pancapas=new LayersPanel();
> public static JLabel inde;
> public static CoordMouseMode cmm;
> /....../
> I have tried to add in the CoordMouseMode the InformationDelegator,
> but the application hangs up.

Secondly, you don't have to hook components up to each other. Set
their behavior through properties, and then add them to the MapHandler.
  They will hook up to each other.

> /......./
> infodele=new InformationDelegator();
>

I don't think you need to do this.
> inde=new JLabel();
> infodele.setInfoLineHolder(inde);

> infodele.setShowInfoLine(true);
> infodele.setLightTriggers(true);
> infodele.setShowLights(true);

So you don't do this...
> infodele.setMap(map);

> infodele.setFloatable(false);
>
> // cmm.setActive(true);
> // cmm.setInfoDelegator(infodele);
> // System.out.println(cmm.getInfoDelegator());
> // mapHandler.add(cmm);
>
>
> mapHandler.add(infodele);
> /....../
>
> getContentPane().add(infodele, BorderLayout.SOUTH);
> /......./
>
>
> The point is that everything works well but nothing is shown in the
> infolabel but the lights at the lower-right corner indicating
> the status of each layer.
>
> Could anyone tell me what am I missing?

The mouse mode needs a MouseDelegator and a MapBean, and they need to
hook up. The MapHandler mechanism will take care of the connections.

- Don

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Wed Apr 30 05:58:51 2003

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