[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] Conflict of interest w/ SelectionModel
|
Hi Jesse working on the SelectionView,
There is a bit of a disconnect between the existing model and what I was
expecting.
I was expecting the the "data model" similar to that represented by
Collection<java.util.Map.Entry<Layer,FeatureResults>> getFeatures().
This is the model I would like to edit using the SelectionView and a
Query builder.
Understandably this is not the model you want to work with when
implementing selection tools, that model seems to be:
List<Selection> getSelections();
where:
interface Selection {
public Filter getFilter(Layer layer);
}
The only implementation of which is FilterQuery( GeometryFilter ) - and
is what the various selection tools create during the course of their
opperation. This works quite nicly for undo redo support, but will
interact poorly with the idea of Layers having a Selectable state, and
so on.
The implementation of SelectionModelImpl.getFeatures is also suspect -
for a given layer several Map.Entrys may exist, presumably these are
implicitly bound together by client code with an OR?
I think what I will do is change Selection to be something like:
interface LayerSelection {
Layer layer;
Filter filter; // can use OR to produce a single fitler out of many
}
And to maintain something easy for Tool writers to call SelectionModel
can have a select( Filter ) method, this will churn through the list of
available Layers and only produce LayerSelections for those that are
selectable.
Jody