[udig-devel] Axios tools DoubleClickRunAcceptWithProviderBehavior

Jody Garnett jgarnett at refractions.net
Fri Jan 11 15:48:06 PST 2008


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?
>     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.

Fun fun fun.
Jody


More information about the udig-devel mailing list