Re: [OpenMap Users] Re: Single Distance Line with the Distance Layer

From: Adams Tan <nikida78_at_gmail.com>
Date: Wed, 10 Sep 2008 11:09:30 +0800

Well, i try to make changes to the DistanceLayer by using a custom
DrawingEditorTool...

However, I've encountered a brick wall when I try to remove the old line...
please advise..

Perhaps there's another way, but the following is what I've experimented...
Code Snippets...
//imports....
public class DistanceDrawingEditorTool extends DrawingEditorTool {
    private List<EditableOMGraphic> drawnLines = new
ArrayList<EditableOMGraphic>();

    public DistanceDrawingEditorTool(EditorLayer layer) {
        super(layer);
    }

    _at_Override
    public boolean mouseClicked(MouseEvent e) {
        System.out.println("Total Count: " + drawnLines.size());
        //remove old line if present
        if (drawnLines.size() > 1) {
            EditableOMGraphic oldLine = drawnLines.get(0);
            //remove old line here....
            //BRICK WALL -> How to remove line?
        }

        return super.mouseClicked(e);
    }

    _at_Override
    protected OMDrawingToolMouseMode activateDrawingTool(String ttc) {
        OMDrawingToolMouseMode mouseMode = super.activateDrawingTool(ttc);
        drawnLines.add(getDrawingTool().getCurrentEditable());
        return mouseMode;
    }
}

On Wed, Sep 10, 2008 at 3:58 AM, Don Dietrick <dietrick_at_bbn.com> wrote:

> You might prefer the behavior of the DistanceMouseMode, instead of using
> the distance layer, it only does one measurement at a time.
>
> Of course, you can always adjust the code of the DistanceLayer to clear out
> the OMGraphicList when another distance line is started.
>
> -Don
>
>
>
> On Sep 9, 2008, at 6:26 AM, Adams Tan wrote:
>
> Any hint on this?
>>
>> Adams
>>
>> On Tue, Aug 26, 2008 at 9:56 AM, Adams Tan <nikida78_at_gmail.com> wrote:
>> Hi,
>>
>> Using the default Distance Layer, a new distance line is created
>> everytime.
>>
>> How can remove the previous line whenever a new line is created?
>>
>> Adams
>>
>>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 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 Sep 09 2008 - 23:10:17 EDT

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