Hi Laura,
On Nov 20, 2003, at 7:06 AM, Laura Paterson wrote:
> Hi,
>
> I would like to be able to draw rectangles onto my map from the centre
> point
> (like the current zoom tool), rather than from the top left corner.
> After
> looking through the source code, it seems like I need to create a new
> EditableRect class, and also a new RectLoader to be able to choose
> between
> the two methods of drawing.
>
> What I wasn't quite so clear on is what methods of the current
> EditableOMRect need to be changed to make it draw in a different way,
> and if
> it would be easier to extend EditableOMRect instead of
> EditableOMGraphic.
You might be able to get away with just modifying the
com.bbn.openmap.omGraphics.editable.RectUndefinedState.mousePressed()
method, to set the
graphic.getGrabPoint(EditableOMRect.NW_POINT_INDEX).set(e.getX(),
e.getY());
to
graphic.getGrabPoint(EditableOMRect.CENTER_POINT_INDEX).set(e.getX(),
e.getY());
You'd then have to modify the RectStateMachine to use your extended
RectUndefinedState object.
And then you'd only have to make EditableOMRect use your new
StateMachine.
I'd like to incorporate this ability into OpenMap, because I prefer
creating geospatial rectangles from the middle, too. I'm not sure
whether new EditableOMRect/OMRectLoades are necessary, or if an object
flag should be set. Maybe both.
- Don
>
> Has anyone done this before, or have any suggestions on how to make
> these
> changes?
>
> Thanks,
> Laura
>
>
> General Dynamics United Kingdom Limited
> Registered in England and Wales No. 1911653
> Registered Office: 100 New Bridge Street, London, EC4V 6JA
> --
> [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 Mon Nov 24 08:21:54 2003
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:36 EDT