Re: [OpenMap Users] Connecting Graphics

From: Don Dietrick <dietrick_at_bbn.com>
Date: Tue, 29 Mar 2005 13:08:04 -0500

On Mar 29, 2005, at 12:38 PM, Lepkowski, Thomas M., CTR, OSD-PA&E wrote:

> Classification: UNCLASSIFIED
>
> Don't mean to be nit picky, but it's "putAttribute".  The plot
> thickens...


Oh, yes. Well, thank God for JavaDocs...

> you must first say
>
> setAttributes( New HashMap() );


You shouldn't have to do that, the hash table should be created
automatically if it's needed. I'll check again, but not *having* to
set the attribute hash is the intended behavior.

- Don


>
> as in
>
> <code>
>
> OMGraphic omg = new OMGraphic();
> omg.setAttributes( New HashMap() );
>
> // now this will work
> omg.putAttribute("key_1", "Hello World");
>
> // and later, this will not print null
> System.out.println ( omg.getAttribute( "key_1" ) );
>
> </code>
>
>
>
> Thanks for the tip, Don.  You sent me down a good path.
> (put|get)Attribute
> gives us more flexibility than setAppObject.
>
> -Tom
>
> -----Original Message-----
> From: owner-openmap-users_at_bbn.com
> [mailto:owner-openmap-users_at_bbn.com]On
> Behalf Of Don Dietrick
> Sent: Thursday, March 24, 2005 4:58 PM
> To: Andrew Hnatiw
> Cc: OpenMap Users; <chris.allport_at_red-inc.us>
> Subject: Re: [OpenMap Users] Connecting Graphics
>
>
>
> Actually, OMGraphics were modified (in 4.6.1 I think) to have
> setAttribute(key, object) and getAttribute(key), so you can associate
> as many objects as you want with an OMGraphic.
>
> The setAppObject(...) is still there and still works, the
> setAttribute(...) calls work with it, which is why it may have gone
> unnoticed.
>
> In OpenMap 4.6.2, labeling has been added to OMGraphics, too, if you
> use set an OMLabeler object on an OMGraphic using the OMGraphic.LABEL
> key.
>
> - Don
>
> On Mar 24, 2005, at 4:33 PM, Andrew Hnatiw wrote:
>
> >
> > Each OMGraphic has a "setAppObject()" method that allows you to
> > associate an object with that graphic.  I think that at some point
> Don
> > recommended using this to associate labels to an object.  I do this
> by
> > setting the application object for a graphic to be a label and for
> the
> > label to be the graphic it is associated with.  Then, I overrode the
> > generate() method of the label (your alert) to draw the label based
> on
> > where the application object associated to it is.  I think this could
> > solve your problem.  Only catch is that you can only have one
> > application object associated with each OMGraphic... of course you
> > could make that object an OMGraphicList to associate more than one
> > graphic.
> >
> > hth,
> > Andy
> >
> > Andrew Hnatiw, Software Engineer
> >  RAYTHEON
> >  7700 Arlington Blvd
> >  Falls Church, VA 22042
> >
> >
> >
> >
> >
> > "Chris Allport" <chris.allport_at_red-inc.us>
> > Sent by: owner-openmap-users_at_bbn.com
> >
> > 03/24/2005 11:22 AM
> >
> > Please respond to
> >  <chris.allport_at_red-inc.us>
> >
> >
> >
> > To
> > "OpenMap Users" <openmap-users_at_bbn.com>
> >
> > cc
> >
> > Subject
> > [OpenMap Users] Connecting Graphics
> >
> >
> >
> >
> >
> >
> >
> > My application has objects moving around on a map.  Once in a while,
> > alerts
> >  will come in for an object and this alert should be displayed at
> some
> >  position offset from the object.  When the object moves, the alert's
> >  position should be updated (relative to the object).
> >
> >  Does OpenMap currently have any support for this type of
> > functionality?  If
> >  not, I shall attempt to contribute this capability if you think it
> > might be
> >  welcome.
> >
> >  Thanks in advance-
> >
> >  Chris
> >
> >  --
> >  Chris Allport
> >  Unmanned Systems Research & Development Lab
> >  Patuxent River Naval Air Station
> >  Phone: (301) 904-5943
> >
> >
> >  --
> >  [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"]
> >
> >
>
>
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 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"]
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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"]
Received on Tue Mar 29 2005 - 13:08:26 EST

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