[udig-devel] Reseting the blackboards
Jesse Eichar
jeichar at refractions.net
Thu Aug 9 09:43:49 PDT 2007
Hmmm a good question. The main thing that concerns me clearing the
Map's blackboard as it can have unintended consequences. I wouldn't
do a whole sale clear on it. There are some Constants in a file.
Can't remember the exact name, something like BlackboardConstants.
Jesse
On Aug 9, 2007, at 1:12 AM, tony.roth at GMX.de wrote:
> I'm still working on the polygon based search in my backend systems.
> The user can draw polygons and start a search. This works. To
> 'clean' the map the user can remove the polygons from the map with
> an action (button on toolbar, whatever). To remove the polygons
> from the layer / map:
>
> public void removeAllContent(){
> try{
> FeatureStore fs = layer.getResource(FeatureStore.class, null);
> fs.removeFeatures(Filter.NONE);
> }catch (Exception e){
> // exception handling
> }
> // 1.
> myMap.getBlackBoardInternal().clear;
> // 2.
> EditBlackboardUtil.resetBlackboards(myMap);
> }
>
> The Blackboard and all this stuff confused me a bit.
> Without the last command (#2) the features are removed from the
> layer but the last drawn polygon is still on the Blackboard and
> shown. The last (#2) command removes it from the blackboard.
> The command removes the polygon / shape from the blackboard, but
> since the last feature / polygon was selected (or editable?), the
> marks of the vertices (little green squares) are still on the map.
> To deselect (?) I use the #1 command which clears the blackboard.
> After this action no polygon is selected / editable (somewhere in
> the code I found the explanation of the difference but I forgot it)
> and combined with #2 the map is cleared.
> I fixed my problem. To be honest it was just by trying a lot of
> commands and not because I really know what I have to do.
>
> Is this a valid way or crap? I guess (hope) there exists a much
> easier way to achieve this functionality.
>
> tony roth
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20070809/55c05d2c/attachment.html
More information about the udig-devel
mailing list