RE: [OpenMap Users] Extending CoordDialog and cretaing to CoordPa nel for AOI input

From: Catania, Luke A ERDC-TEC-VA <Luke.A.Catania@erdc.usace.army.mil>
Date: Wed Aug 20 2003 - 17:47:05 EDT

Don,

I want to figure out the new scale of the map based upon the to corner point
representing the AOI. I know I can use

newScale = com.bbn.openmap.proj.ProjMath.getScale(point1, point2,
projection);

but how to I get the projection when I am using a listener in the CoorDialog
I noticed the class CenterSupport and its setCenter method which somehow
communicates with the map to center it on the point entered. I notice that
there is a ProjectionSupport & ZoomSupport method. I was going to use
ZoomSupport to zoom my map and get the zoom factor from newScale above, if
that is the correct way. But I still need to get the projection to pass to
getScale. I though maybe there would be a some method I could call from
ProjectionSupport, but do not see one that would work. How else can I get
the map projection.

Luke

-----Original Message-----
From: Don Dietrick [mailto:dietrick@bbn.com]
Sent: Wednesday, August 20, 2003 3:45 PM
To: Catania, Luke A ERDC-TEC-VA
Cc: openmap-users@bbn.com
Subject: Re: [OpenMap Users] Extending CoordDialog and cretaing to
CoordPanel for AOI input

Hi Luke,

On Wednesday, August 20, 2003, at 12:15 PM, Catania, Luke A
ERDC-TEC-VA wrote:

> I want to add an AOI panel to the CoordDialog. It has the Dec Deg and
> DMS panel, but I want a user to be able to put in the UR and LL
> corners of an AOI and to zoom on that area.
>
>
>
> I have extended CoordDialog and copied actionPerformed to it and added:
>
>
>
> else if (tabPane.getSelectedComponent() == aoiCoordPanel)
>
> aoiCoordPanel.setCenter();
>
>
>
> I copied setup() and added the my new panel (AOICordPanel) as a new
> tab.
>
>
>
> I extended NavigateMenu class and changed coordDialog2 to instantiate
> my dialog.
>
>
>
> if (Environment.getBoolean(Environment.UseInternalFrames)) {
>
> coordDialog = new CoordInternalFrame();
>
> } else {
>
> coordDialog2 = newACSCoordDialog();
>
> }
>
> return coordMenuItem;
>
>
>
> Not sure what CoordInternalFrame, so I did not change that.

CoordInternalFrame is a CoordDialog if OpenMap is being run as an
applet.

> I basically copied CoordPanel and made changes to it to create
> AOICordPanel class by adding additional textfields and labels to allow
> the user to input two corner coordinates.
>
> I changed setCenter to average the UR and LL coordinates to get the
> center point. I still have to work on the zoom part.
>
>
>
> But when I enter my 4 coords and call apply it does nothing. I
> modified actionPerformed and it does call the setCenter method of my
> AOICordPanel class and does call centerDelegate.fireCenter(lat,
> lon); At least I have print statements on either sided of itand it
> gets to those and no error messages are printed.
>
>
>
> Am I missing something else?

I'd go through CoordDialog and where ever there is a call to coordPanel
and dmsPanel, incorporate your panel into that logic.

In 4.6, this whole setup completely changed, none of the panels are
hard-coded into CoordDialog, it works with the MapHandler to find the
panels and wire them together.

- 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"]
--
[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 Aug 20 17:48:21 2003

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