Hi Jeff,
On Friday, August 24, 2001, at 07:37 PM, Jeff Mathis wrote:
> Donald,
>
> I actually have a Location, composed of OMText and an OMGraphic (an
> OMCircle to be exact), that needs to be dragged around the map. I looked
> and did not see an EditableOMLocation class, so I wrote one that
> extended EditableOMCircle. I also added an EditToolLoader specifically
> for my locations, and then used the OMDrawingTool.
>
> Getting both the circle and the text to move was a little challenging. I
> may be doing this wrong, but in my drawingComplete(omgraphic, omaction)
> method, I had to do the following in order for the moved circle and the
> associated text to show up in the new location:
>
>
> /**
> * Specified by the DrawingToolRequestor interface. This method is
> called after
> * the edit has been performed on a given location
> * @param omg the OMGraphic object, which should be a MapEntity
> * @param oma the OMAction
> */
> public void drawingComplete(OMGraphic omg, OMAction oma) {
> Debug.message("entitylocationlayer","EntityLocationLayer: called
> drawingComplete");
> // reset the text label based on the circles coordinates
> // i'm not sure i understand it, but all of these calls are
> necessary
> LatLonPoint l =
> ((OMCircle)((MapEntity)omg).getLocationMarker()).getLatLon();
>
>
> ((OMCircle)((MapEntity)omg).getLocationMarker()).setVisible(true);
> ((MapEntity)omg).setLocation(l.getLatitude(), l.getLongitude());
> ((MapEntity)omg).generate(map.getProjection());
> ((MapEntity)omg).render(map.getGraphics());
> repaint();
> }
>
> I'm not sure why I had to set the circle to be visible. I think I
> understand why I needed to call both generate and render, and then
> certainly repaint at the end.
>
> Could you comment on 5 method calls after defining the LatLonPoint? This
> may again be much more of a Swing issue than OpenMap
It's probably not a Swing issue, but more of the timing of actions that
EditableOMGraphics go through to try and manage the MouseEvents. I
think some if these actions usually get called in the EditableOMGraphic
before the drawingComplete() gets called, but there may not be something
happening as expected depending on the modifications you had to make to
EditableOMCircle.
Do you have to modify the circle, or just the placement of the
location? It might be easier to work with EditableOMPoint when editing
Location objects. That way, in the EditableOMGraphic.setGrabPoints()
and EditableOMGraphic.setGrabPoints(OMGraphic), you can just work with
the methods of the Location object. It's hard for me to say what's
going on since I don't know what your are doing in EditableOMCircle.
Let me know how confusing the Editable stuff is - what areas need more
documentation, does it make sense, etc?
Thanks,
Don
>
> thanks,
>
> jeff
>
> Donald Dietrick wrote:
>>
>> Hi Jeff,
>>
>> All of the EditableOMGraphics are really meant to be used with the
>> OMDrawingTool, although I suppose you could manage them through the
>> layer. I've never tried it, though.
>>
>> You can use the DrawingTool from a layer, though. See the DemoLayer on
>> how it uses it to create and edit graphics. By default, when the
>> drawing tool is activated, a palette appears that provides other
>> parameters for changing the attributes of the graphics. There is
>> also a
>> way to call it so that a GUI doesn't show up to allow the user to
>> change
>> all the other features of a graphic (other than position and size), if
>> you want those attributes preserved.
>>
>> - Don
>>
>> On Thursday, August 23, 2001, at 11:26 AM, Jeff Mathis wrote:
>>
>>> hello again,
>>>
>>> I have a layer which has a locationhandler. the locationhandler
>>> currently deals with a series of OMCircles to mark my locations of
>>> interest. I now need to be able to click on one of these locations and
>>> drag it to a new part of the map.
>>>
>>> I see there is an EditableOMCircle class, which I'm hoping has some of
>>> the functionality I need. Is this correct? If so, any hints on the
>>> best
>>> way to use it?
>>>
>>> If this is a class I want to use, I know I'll have to change my
>>> locationhandler to deal with an EditableOMGraphic instead of an
>>> OMGraphic.
>>>
>>> thanks
>>>
>>> jeff
>>> --
>>> Jeffrey Mathis, PhD FAX: 505-988-2229
>>> Senior Scientist email: jeff.mathis@biosgroup.com
>>> Bios Group, Inc. phone 505-992-6737
>>> 317 Paseo de Peralta http://www.biosgroup.com
>>> Santa Fe, NM 87501
>>>
>>> --
>>> [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"]
>>>
>>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Donald F. Dietrick, dietrick@bbn.com
BBN Technologies, 10 Moulton Street, Cambridge, MA 02138
617.873.3031 FAX 2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> --
> Jeffrey Mathis, PhD FAX: 505-988-2229
> Senior Scientist email: jeff.mathis@biosgroup.com
> Bios Group, Inc. phone 505-992-6737
> 317 Paseo de Peralta http://www.biosgroup.com
> Santa Fe, NM 87501
>
-- [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 29 07:58:13 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT