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

From: Adams Tan <nikida78_at_email.domain.hidden>
Date: Tue Sep 09 2008 - 23:09:30 EDT

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);
    }

    @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);
    }

    @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@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@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@bbn.com
> BBN Technologies, Cambridge MA
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>
>

--
[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 Tue Sep 9 23:14:10 2008

This archive was generated by hypermail 2.1.8 : Tue Sep 09 2008 - 23:14:11 EDT