[OpenMap Users] MGRSPoint can not be resolved even though package imported

From: Steve Frierdich <sfrierdich_at_custom-mfg-eng.com>
Date: Wed, 08 Dec 2004 08:31:45 -0500

The MGRSPoint class can not be resolved . I am using the import statement
import com.bbn.openmap.proj.*
which will include the package the MGRSPoint class is in, which is
com.bbn.openmap.proj.coords,
but then I make an instance of the MGRSPoint class the class can not be
resolved. I am trying to create an instance of the MGRSPoint class
passing a LatLonPoint as a parameter in the constructor, but as stated
previously the MGRSPoint class can not be resolved. Does anyone know
how to resolved this orhas ever used the MGRSPoint class and can shed
some light on how to get this to work?
Below is the class code and highlighed is where the MGRSPoint class can
not be recolved occurs.
Thanks
Steve

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
package com.cme.mirss.saids.mapdisplayj;

import com.bbn.openmap.*;
import com.bbn.openmap.event.ProjectionEvent;
import com.bbn.openmap.event.ProjectionListener;
import com.bbn.openmap.proj.*;


public class SaidsProjectionChangeListener implements ProjectionListener
{
  //Flag to indicate that the projection change should be ignored. This
flag is
  //needed to prevent unnecessary broadcast of Map Bus Events when the
map bean
  //is set to a scale, lat, and long point.
  private transient boolean ignoreProjChangeEvent = false;
 
  private SaidsMission saidsMission;
 
  //Default constructor.
  public SaidsProjectionChangeListener(SaidsMission inSaidsMission)
  {
    saidsMission = inSaidsMission;
  }

  //projectionChanged() method is fired when any aspect of the map
displayed on
  //the map server changes such as move, resize, or scale in or out. When
  //projectionChange event is received, send SAIDS SW Map Bus Message on
current
  //center and scaled setting of map.
    public void projectionChanged(ProjectionEvent e)
    {
   
    //If ignoreProjChangeEvent is not set and a SAIDS Mission is open,
    //send projection events on the Map Bus.
    if(isIgnoreProjChangeEvent() == false && saidsMission.isMissionOpen())
    {
      Projection proj = e.getProjection();
      LatLonPoint centerPoint = proj.getCenter();
      float scaleFact = proj.getScale();
     //THIS IS WHERE ERROR - MGRSPOINT CAN NOT BE RESOVED
      MGRSPoint p = new MGRSPoint(centerPoint);
      //Send current map project settings.
      MapBusRx mapBusRx = saidsMission.getMapBusRx();
      mapBusRx.mapSaveSettings();
      Logger.logDebug("SaidsProjectionChangeListener lat=" +
        centerPoint.getLatitude() + " lon=" +
        centerPoint.getLongitude() +
        " scale=" +
        scaleFact);
    }
   
    }
   
  //Getter method for ignore projection change events.
    public synchronized boolean isIgnoreProjChangeEvent()
    {
        return ignoreProjChangeEvent;
    }

    //Setter method for ignore projection change event.
    public synchronized void setIgnoreProjChangeEvent(boolean b)
    {
        ignoreProjChangeEvent = b;
    }

}
Don Dietrick wrote:

>
> On Dec 7, 2004, at 2:30 PM, SteveC wrote:
>
>> * Don Dietrick (dietrick_at_bbn.com) wrote:
>>
>>> You need to call generate(Projection) on the OMGraphic, the other
>>> OMGraphics should be OK if the map isn't changing.
>>
>>
>> So this *should* work (see below). Its what I'm using, it lives in my
>> Layer class. When a line is added that layer disappears. resizing the
>> window makes it come back with the added line.
>>
>> TIA
>>
>> public void setLine(LatLonPoint a, LatLonPoint b)
>> {
>> System.out.println("adding line "+
>> +a.getLatitude()+","
>> +a.getLongitude() + " "
>> +b.getLatitude() + ","
>> +b.getLongitude());
>>
>>
>>
>> OMLine l = new OMLine(
>> a.getLatitude(),
>> a.getLongitude(),
>> b.getLatitude(),
>> b.getLongitude(),
>>
>> com.bbn.openmap.omGraphics.geom.BasicGeometry.LINETYPE_STRAIGHT
>> );
>>
>>
>> graphics.add( l);
>>
>> graphics.generate( getProjection(), true);
>
>
> instead do:
>
> l.generate(getProjection());
> graphics.add(l);
>
> but what you have should work, too. What are you doing in
> projectionChanged()?
>
> - Don
>
>> repaint();
>>
>> System.out.println(graphics.size());
>>
>> } // setLine
>>
>>
>>
>> have fun,
>>
>> SteveC steve_at_fractalus.com http://www.fractalus.com/steve/
>>
>>
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Don Dietrick, dietrick_at_bbn.com
> BBN Technologies, Cambridge, MA
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> --
> [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"]
>
>

--
[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 Dec 08 2004 - 08:32:28 EST

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