You will need to maintain a list of all the draw commands you added; in order to make them non active when you are done. Please note that you will get better performance by having a single draw command (of your own design) which you modify to ask it to draw multiple lines...
Jody On Fri, May 1, 2009 at 4:22 PM, karthik shravanam <[email protected]> wrote: > I have drawn multiple lines on the map to calculate the distance and on the > Double Click i want to erase them and start fresh. > If i use drawcommand.setvalid(false) and after that i repaint the page only > the last line is getting erased and if i use array of com mands for drawing > the lines and then i try to delete the lines on double click using the for > loop, the for loop does not seem to work. i am pasting the code below: > @Override > protected void onMouseDoubleClicked(MapMouseEvent e ) { > System.out.println("inside double clicked" + pointsCount); > for(int i=0; i < pointsCount; i++) > { > System.out.println("inside double clicked" + i); > command[i].setValid(false); > > } > getContext().getViewportPane().repaint(); > getContext().getSelectedLayer().refresh(null); > > > } > Can you please give me your suggestions as to how i can solve this. > Thanks > > On Thu, Apr 30, 2009 at 12:56 AM, Jesse Eichar <[email protected]> > wrote: >> >> huh. I got caught by a change of subject. >> >> On Thu, Apr 30, 2009 at 5:59 AM, Jody Garnett <[email protected]> >> wrote: >>> >>> Please invalidate a the draw command used to draw the lin in response >>> to tool feedback. >>> >>> The draw commands are kept in a queue and always drawn; if you set the >>> draw command to invald (ie command.setActive( false) ) it will be >>> removed from the queue. >>> >>> See http://udig.refractions.net/confluence/display/DEV/3+Draw+Command >>> >>> I have added your question to the page to help the next person >>> Jody >>> >>> >>> On Thu, Apr 30, 2009 at 1:13 PM, karthik shravanam >>> <[email protected]> wrote: >>> > Hi All, >>> > I am working on a plug-in feature for the uDig,i have a question >>> > regarding >>> > as to how to clear the lines when we double click on the mouse, when >>> > we >>> > have selected a portion of the map and want to start over from a >>> > different >>> > point instead of the previous point. >>> > I am trying to refresh the map ,clear the lines and then repaint. Can >>> > some >>> > one please tell me if i am doing it the correct way because i am having >>> > some >>> > problem with it and can't seem to get it working. >>> > I was wondering if clearing the lines drawn can be done in the same >>> > layer or >>> > do we have to add a different layer on top of it? >>> > Can some one please suggest. >>> > It would be of great help if you can point me to an example for a Mouse >>> > DoubleClickEvent procedure to clear the lines. >>> > >>> > Thanks for the help in advance. >>> > Thanks, >>> > karthik. >>> > _______________________________________________ >>> > User-friendly Desktop Internet GIS (uDig) >>> > http://udig.refractions.net >>> > http://lists.refractions.net/mailman/listinfo/udig-devel >>> > >>> > >>> _______________________________________________ >>> User-friendly Desktop Internet GIS (uDig) >>> http://udig.refractions.net >>> http://lists.refractions.net/mailman/listinfo/udig-devel >> >> >> _______________________________________________ >> User-friendly Desktop Internet GIS (uDig) >> http://udig.refractions.net >> http://lists.refractions.net/mailman/listinfo/udig-devel >> > > > _______________________________________________ > User-friendly Desktop Internet GIS (uDig) > http://udig.refractions.net > http://lists.refractions.net/mailman/listinfo/udig-devel > > _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel
