[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [udig-devel] Drag and Drop and beyond.
|
Hi!
Did this get fixed? (see email below)
I still can't get my string to be accepted on the drop.
The dragStart and dragSourceData methods in the DragListener on the
source object get called fine.
But the accept method of the Drop class never gets called.
(Not even the construtor of the Drop class seems to get called!).
Not sure if it is something I am doing wrong.
The extension code I have is:
<extension point="net.refractions.udig.ui.dropAction">
<action
class="info.ecosensus.udig.actions.IconDropAction"
name="Icon Drag And Drop">
<destination
class="net.refractions.udig.project.ILayer"/>
<acceptedType class="org.eclipse.swt.widgets.Table"/>
</action>
</extension>
(was not sure what the accetedType should be. I have tried various
things)
I have attached the IconDropAction class (drop) and the IconView class
(drag source)
Any ideas?
Michelle
-----Original Message-----
From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jesse
Eichar
Sent: 02 November 2005 17:50
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Drag and Drop and beyond.
Hmmm. It isn't the SLDDropAction that is consuming the event it sounds
like the WizardDropAction is consuming the event. I think you may have
found a bug. I'm looking at the code and it seems to always accept the
string regardless of whether it can understand it. That said I'm not
sure why your extension is not being called. As far as I know the code
does not consume the data. All the actions that are valid should be
ran.
Have you put a break point in the accept method to see if it is being
called?
Jesse
M.S.Bachler wrote:
>Hi!
>
>I am probably asking a stupid question, but I have written a small
>plugin to accept a string drop and display a message of the string,
>(just to get started).
>
>The problem is, I am not sure my code ever gets activated.
>I assume that SLDDropAction code is taking the action before it gets to
>me?
>
>My project,xml action is:
>
> <extension point="net.refractions.udig.ui.dropAction">
> <action
>
>class="net.refractions.udig.test1.actions.StringDropAction"
> name="String Drag and Drop">
> <destination class="net.refractions.udig.project.ILayer"/>
> <acceptedType class="java.lang.String"/>
> </action>
> </extension>
>
>StringDropAction class extends IDropAction.
>
>Am I on the right track?
>What do I need to do to get my code to be able to process the drop? All
>I get is a dialog window come up asking me to select a data source.
>
>Thanks
>
>Michelle
>
>-----Original Message-----
>From: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx
>[mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jesse
>Eichar
>Sent: 01 November 2005 01:52
>To: User-friendly Desktop Internet GIS
>Subject: Re: [udig-devel] Drag and Drop and beyond.
>
>
>[snip]
>
>
>
>>I am trying to understand how to start approaching the D&D stuff I
>>need
>>
>>
>
>
>
>>to do. If I drop a string or image file onto a Map, I assume it would
>>need to create a new layer in the layer manager (and assuming I have
>>programmed where), ultimately store the data in the database and then
>>render the feature.
>>
>>
>>
>>
>Are you going to be developing on uDig 1.1 or 1.0.x? I have done a lot
>of the difficult work so there is a nice framework for 1.1 but the
>downside is that it not being released until later this month. I don't
>know what your timeline is like.
>
>You can look at
>net.refractions.udig.project.ui.internal.actions.DropAction for an
>example of an action taken when a url is dropped on a a layer. The
>declaration of the drop action in the project.xml goes something like:
> <action
>
>class="net.refractions.udig.project.ui.internal.actions.SLDDropAction"
> name="SLD Drag and Drop">
> <destination class="net.refractions.udig.project.ILayer"/>
> <acceptedType class="java.io.File"/>
> <acceptedType class="java.net.URL"/>
> <acceptedType class="java.lang.String"/>
> </action>
>
>I'm going to put this example in the drag and drop documenation I wrote
>for you.
>
>
>
>>So I need to deal with Map, LayerManager, RenderManager, Catalogue,
>>Feature and probably more? Ahhh! I feel sleepless nights coming on.
>>
>>
>>
>>
>This depends on the work flow and requirements. Suppose you drop a
>string on layer in LayersView and the drop action creates a feature by
>interpreting the string and adds it to the layer. In this case can use
>the Layer.getResource() method to get a FeatureStore (Class used for
>adding/removing features from a datastore) and add the feature using
the
>
>FeatureStore. In this case all you need to know is the Layer and
>FeatureStore API.
>
>Now suppose you drop a image that some how specifies a layer and all
>the
>
>features in the layer. In this case you need to know Map, Layer,
>Catalog, Feature, DataStore, etc...
>
>Hope this helps.
>
>Jesse
>_______________________________________________
>User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
>http://lists.refractions.net/mailman/listinfo/udig-devel
>_______________________________________________
>User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
>http://lists.refractions.net/mailman/listinfo/udig-devel
>
>
_______________________________________________
User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel
Attachment:
IconsView.java
Description: IconsView.java
Attachment:
IconDropAction.java
Description: IconDropAction.java