[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: Fw: [udig-devel] How to get Domain Objects on a Map
|
Jody Garnett wrote:
Jürgen Jacob wrote:
I think this is exactly my current solution creating a resource via
the Catalog. Due to my original problem (dirty MapEditor) Jody
proposed another way via an own datastore and not using the Catalog.
And for this solution I need a way to get the IGeoResource.
So there are two good ideas (lets talk about them in email and see
which one you like):
1- create your own renderer for your domain objects; you can store the
domain object on the layer blackboard; or store a key used to ask for
the domain object from your server or ... etc...
2- create a temporary resource; this will make a memory data store in
the catalog which you can use; perhaps the features here contain an
attribute that has an ID allowing you to look up your domain object
for each feature? This has the isDirty flag problem; you simply want
a way to say "I never want to save this"...
So here is the deal; the create temporary resource method is
responsible for communicating with the "Scratch" space; a series of
MemoryDataStores all wrapped up in an IService / IGeoResource etc...
This scratch space has a workflow (ie wanting to be saved) that you
don't want ...
So lets make you an IService / IGeoResoruce with the functionality you
do want. You can use the scratch space as an example of how to wrap a
MemoryDataStore as an IService / IGeoResource. Copy the code; and
modify it so this is not marked as a "temporary" ... uDig won't
pester you to save this content and life can go on as usual.
Ok.. err... I'm not sure if I got it. But I traced where the setDirty()
method is called in the MapEditor: It's done by a local ILayerListener
that is added to each layer by the IMapCompositionListener et cetera.
And this layerListener is triggered by a layer event that has its origin
... (~10 steps before) ... in the FeatureWriter. As far as I understood
your explanations this won't changed if I use the MemoryDataStore?! I
think I will import the project as source plugin and modify
MapEditor.isDirty(). Not smart but quick.
I also found this preference constants
net.refractions.udig.catalog.internal.PreferenceConstants.P_TEMP_FT
but it doesn't change this behaviour.
Thank you again,
Jürgen