Re: [OpenMap Users] OMDrawingTool questioins

From: Don Dietrick <dietrick_at_bbn.com>
Date: Sun, 20 Mar 2005 00:52:17 -0500

Hi Piotr,

On Mar 17, 2005, at 4:58 AM, Piotr Kami¨˝ski wrote:

> Hi,
> I use OMDrawingTool in my application. There is a layer which contains
> some OMGraphic objects (our specialized ones) which user should not be
> allowed to delete. Unfortunately when I choose gestures mouse mode,
> select object and display popup menu there is "Delete" option.
> I've checked source code and it seems to me that this option (and
> "Change appearance") is always active.

I don't think it's always active, you can control whether that menu
appears by setting/unsetting the ALT_POPUP_BEHAVIOR_MASK.


> What can I do to prevent deletion of object:
> - make it unselectable? Maybe, but I want user to move grab points
> and initiate editing by simple selection.
> - disable OMDelete action? But it not prevents popup menu from
> displaying
> - subclass OMDrawingTool and override displayPopupMenu method? Maybe,
> but I'm looking for more general solution

If you want a different menu, this is what I would do, as it is the
general solution.

Also consider that the Layer is the object that actually does the
deletion. The OMDrawingTool just makes a request to the layer to
delete the OMGraphic, the layer doesn't have to do it. Although that
does make for a confusing GUI, to have the option to delete without the
reaction.

> I think that some kind of OMGraphic querying should occur in this
> method: isDeleteAllowed? isChangeAppearanceAllowed? or something.
> Maybe there is simpler solution, but DrawingTool and editable graphic
> are complex components and I don't know all the details of them. So,
> Don what is your proposition?

I suppose the OMDrawingTool could be modified to check the OMGraphic
for an attribute before putting the menu options up, that wouldn't be
that difficult.

> Some other questions concerning drawing tool and OMGraphics:
> - is there easy way to prevent moving OMPoly - I only want user to
> move grabpoints but don't want him to move whole graphic. It may
> happen by accident, and it changes location of all points - without
> easy undo :-( My application defines sea routes and each point of
> OMPoly becomes turning point of such route and its geographic position
> is important.

The behavior of the mouse gestures and how they affect the OMGraphic is
controlled by the States inside the com.bbn.openmap.omGraphic.editable
package. The poly edit state or selected state could be modified to
not do anything if a grab point wasn't selected. Now, it checks for a
touch to the OMPoly if a grab point isn't touched.

> - is it possible to use new 2525 symbology in OMDrawingTool? I'd like
> to choose symbol and put it on a map.

The EditableOMScalingRaster can move 2525 symbols being used in an
OMScalingIcon. The SymbolChooser that allows for the creation of the
symbols hasn't been tied to the OMDrawingToolLauncher yet. I haven't
had time to figure out a smooth, understandable way to have the
OMScalingRasterLoader launch it.

> - is it possible to use decorated splines in OMDrawingTool? I've
> tried OMDecoratedSplineLoader but while editing nothing is drawn - I
> can see only grabpoints.

The decorated splines can be modified, but I've noticed they can't be
created, I haven't had a chance to figure out why not.

> And one questions about storing OMGraphic to XML. I've seen new
> feature in OMDrawingTool - ScaledRasters. It's very nice. But what
> about storing such layer to a file? I've sent you some code which
> stores OMGraphics into XML. Have you tried to use it? I'm thinking
> about extending capabilities of that package to store also scalling
> rasters, but I'm a little afraid of the size of produced files. What
> are your thoughts about this?

I haven't had a chance to look at the XML creation code, but it's on my
list.

I agree with your reluctance to use XML to store rasters - maybe icons,
but nothing substantial. It might be OK to write out an XML file that
references the raster stored as a jpg or gif somewhere, or to store the
xml description and image in a zip archive.

Regards,

- Don



=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 Sun Mar 20 2005 - 00:56:40 EST

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