Title: Message
 
Actually, I have just seen a System out message that tells me that my drop class is being enstatiated, but the accept method is never  being called.
 
Thanks
 
Michelle
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of M.S.Bachler
Sent: 24 February 2006 11:00
To: User-friendly Desktop Internet GIS
Subject: RE: [udig-devel] Drag and Drop and beyond.

OK,
 
I tried your suggestions, but am still not getting the drop class even enstatiated or the accept method called etc.
I am new to Eclipse and uDig programming so am probably doing something really stupid.
 
My extension is now:
 
<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.graphics.Image"/>
</action>
</extension>
 
The method that creates a table in the tabbed pane in my view class is:
 
private TableViewer createTable(TabFolder folder, UIIconGroup oIconGroup) {
  
    TabFolder tabFolder = folder;     
    Table table = new Table(tabFolder, SWT.NONE);   
    TableViewer viewer = new TableViewer(table);

    UDIGDragDropUtilities.addDragSupport(viewer);
  
    table.setBounds(new org.eclipse.swt.graphics.Rectangle(0,0,258,460));      
  
    TableColumn column = new TableColumn(table, SWT.LEFT);
    column.setText("Icon");
    column.setWidth(65);
  
    TableColumn column2 = new TableColumn(table, SWT.LEFT);
    column2.setText("Name");
    column2.setWidth(150);
    
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
  
    Vector vtItems = oIconGroup.getItems();
    vtItems = UIUtilities.sortList(vtItems);  
    int count = vtItems.size();
    UIIconItem oItem = null;
    TableItem oTableItem = null;  
    for (int i=0; i<count; i++) {
       oItem = (UIIconItem)vtItems.elementAt(i);
       oTableItem = new TableItem(table, SWT.LEFT, i);
       oTableItem.setData(oItem);
       oTableItem.setImage(0, oItem.getImage()); // An org.eclipse.swt.graphics.Image
       oTableItem.setText(1, oItem.getName());   
    } 
  
    return viewer;
 } 
 
Can you spot what I am doing wrong to break the drop?
 
Thanks for your help.
 
Michelle
 
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jesse Eichar
Sent: 23 February 2006 17:40
To: User-friendly Desktop Internet GIS
Subject: Re: [udig-devel] Drag and Drop and beyond.

To add drag and drop to a viewer so that it can properly integrate with uDig use the UDIGDragDropUtilities.addDragSupport(viewer).  This will make it so you can drop what ever your table contains.  So for example if your table contains Image objects then image objects will be dragged from your view.  For a DropAction to work the accepted type must be the object dragged from the viewer.  IE Images.

Jesse


M.S.Bachler wrote:
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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 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
  

_______________________________________________ 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

Reply via email to