[udig-devel] Axios tools DoubleClickRunAcceptWithProviderBehavior

Mauricio Pazos mauricio.pazos at axios.es
Mon Jan 14 12:31:18 PST 2008


On Saturday 12 January 2008, Jody Garnett wrote:
> A few more notes from the trenches; good thing we made a user email list
> :-)
>
> Back to the Axios edit tools,  after some mirth at code complexity we
> have removed the ability of DoubleClickRunAcceptBehaviour to add a point.
>
> How is this possible? AddVertextWhileCreatingBehavior will now do this
> job - all the time. Previously it had taken some steps to prevent the
> addition of duplicated points (and as such it was unable to close a
> polygon or LineString).
> - AddVertextWhileCreatingBehavior .isNotDuplicated( handler, e ) now
> checks to see if the point is closing a linestring and if so allows the
> point to be added
>
> With this out of the way the DoubleClickRunAcceptBehaviour becomes nice
> and clean.
>
> That leaves me the question about the subclass in the Axios tools -
> DoubleClickRunAcceptWithProviderBehavior. I am trying to figure out
> exactly what this class does? It looks like it was grabbing the "last"
> point from the EditBlackboard .. probably to account for the current
> snapping behavior / alignment work?

The provider,ParallelEditPointProvider by example, associated to the 
DoubleClickRunAcceptWithProviderBehavior  is responsible to compute the 
coordinates of the last pont. For ParallelEditPointProvider it is the 
intersect between the parallel segment and the orthogonal line (or reference 
line) 

>
> >     private IEditPointProvider getProvider( EditToolHandler handler ) {
> >         IBlackboard blackboard =
> > handler.getContext().getMap().getBlackboard();
> >         String string = IEditPointProvider.BLACKBOARD_KEY;
> >         IEditPointProvider provider = (IEditPointProvider)
> > blackboard.get(string);
> >         // TODO: this check won't be needed when AbstractEditTool sets
> > a default provider
> >         if (provider == null) {
> >             provider = new DefaultEditPointProvider();
> >         }
> >         return provider;
> >     }
>
> Is there a fork of AddVertextWhileCreatingBehavior that I should update
> to close linestrings / polygons? Basically what should I do with this
> getProvider code? 
> Now that we are no longer closing the geometry in the 
> accept behavior.

Well, we need *different ways* to compute the coordinate for the last vertex. 
In other words, we need compute the last vertex unsing different references: 
mouse positions, the nearest vertex, intersections, etc.
Then, if there are a way to redefine the last interaction, the acceptance 
strategy, the *getProvider* method is not required now.  

>
> Fun fun fun.
> Jody

Unfortunately, today I couldn't compile udig trunk to link axios community 
1.2. Before spend more, could you confirm me if axios community branch 1.2 is 
linked to udig trunk or udig 1.1?

cheers
-- 
Mauricio Pazos

www.axios.es
tel-:+34 94 441 63 84


More information about the udig-devel mailing list