Question about Drag & Drop operation!

Who can give me an explaination about the methods in class DragSourceDragEvent
getUserAction()
getDropAction()
getTargetActions()
I 've read the api document , but it really conveied a unclear concept, Hope anybody can give me detaided explaination
thanks a lot!

Have a look Here
Regards

Similar Messages

  • Faking Drag&Drop operation to external application

    Hello,
    a rather complicated issue. in my program i have a JTable, and i can drag&drop from this jtable
    to external programs like windows explorer by clicking the mouse and moving it from the table
    to the external program.
    how can i reproduce this exact behaviour WITHOUT user intervention?
    in other words, how can i do this programmatically, creating a drop source at the start point,
    then move the mouse, and release it above a specified location on the screen?
    is this even possible in java (as we're running in a VM) ?

    it has it's problems.
    for example, if the drop point is above the source point, moving the mouse with the robot sometimes marks all entries in the table instead of performing a drag&drop operation. also, it seems that without a delay between the moves, strange things happen. so here is an updated version which workes 99% flawlessly for me.
    package trakker;
    import java.awt.Point;
    import java.awt.Robot;
    import java.awt.event.InputEvent;
    import java.util.logging.Level;
    * this thread fakes a drag & drop operation to the traktor decks
    public class LoadDeckThread implements Runnable
         Point source;          // where was the mouse pointer before operation?
         Point track;          // where is the point of the track in the jlist?
         Point target;          // where do we move the track to?
         // constructor
         public LoadDeckThread(Point pTrack, Point pSource, Point pMoveTo)
              track = pTrack;
              source = pSource;
              target = pMoveTo;
         // thread run
         public void run()
              try
                   // create a new robot
                   Robot robot = new Robot();
                   robot.setAutoDelay(100);
                   // move the mouse to the track in the jlist
                   robot.mouseMove(track.x, track.y);
                   // click and hold
                   robot.mousePress(InputEvent.BUTTON1_MASK);
                   robot.waitForIdle();
                   // move to the left to prevent list scrolling
                   robot.mouseMove(50, target.y);
                   // and to the topleft of our app
                   Point p = Util.mainWnd.getLocation();
                   robot.mouseMove(p.x, p.y);
                   // move the mouse to the specified deck
                   robot.mouseMove(target.x, target.y);
                   // wait some time (otherwise it doesn't work?)
                   //robot.delay(500);
                   robot.waitForIdle();
                   // release the mouse
                   robot.mouseRelease(InputEvent.BUTTON1_MASK);
                   robot.waitForIdle();
                   // move back to the track
                   robot.mouseMove(track.x, track.y);
                   robot.waitForIdle();
                   robot.mousePress(InputEvent.BUTTON1_MASK);
                   robot.mouseRelease(InputEvent.BUTTON1_MASK);
                   // now move back where we were
                   robot.mouseMove(source.x, source.y);
                   robot.waitForIdle();
                   robot = null;
              catch(Exception ex)
                   Util.log("Cannot invoke robot for drag&drop: " + ex.getMessage(), Level.SEVERE);
    } instead of to close tags ;=)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Hi All, I have question about the iMac operating system. I have the last updated. The problem when I manage the place of the folder windows they are all mixing up. I mean they not on the place where I left them. how to set they stay on the same place. Tks

    Hi All, I have question about the iMac operating system. I have the last updated. The problem when I manage the place of the folder windows they are all mixing up. I mean they not on the place where I left them. how to set they stay on the same place? I know there are different possibilities to set.
    I tried but it not helped for me. What I can do? How and where can set this they stay on their place?
    Thanks.
    laci

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • A question about drag and drop

    I have multiple images which can be dragged and dropped in a canvas. How can I get information about pictures into dataGrid, for instance the name and value (price) of an image? Currently my images are in array like this:
    private function init():void {
    currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    private var imgExampleCurrentIndexNumber:Number = 0;
    private var imageExampleArray:Array =
    "assets/image1.png",
    "assets/image1.png"
    and they are run with loop like this:
    [Bindable] protected function get currentExampleImage():String {
        return _currentExampleImage;
    protected function set currentExampleImage(value:String) : void {
        _currentExampleImage = value;
    private function nextExampleImage(e:MouseEvent):void {
        if(imgExampleCurrentIndexNumber < imageExampleArray.length - 1)
        imgExampleCurrentIndexNumber++;
        currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    else
        imgExampleCurrentIndexNumber = 0;
        currentExampleImage = imageExampleArray[imgExampleCurrentIndexNumber];
    So the question is that how can I set and get the name and the value of an image when it is dropped on a canvas and that information to be shown in a separate datagrid? Should I be using objects or classes? This is the drop function:
    private function doDragDrop(event:DragEvent):void
        var img:Image;
        if (event.dragInitiator.parent == whiteBoard)
            img = event.dragInitiator as Image;    
        else
            img = new Image();
            img.source = (event.dragInitiator as Image).source;
            img.addEventListener(MouseEvent.MOUSE_DOWN, doDragStart);
            whiteBoard.addChild(img);        
               img.x = event.localX - (event.dragSource.dataForFormat("localX") as Number);
               img.y = event.localY - (event.dragSource.dataForFormat("localY") as Number)
    Thanks beforehand and feel free to ask more information something is unclear.
    Message was edited by: SerpentChimera

    There's a separate empty datagrid in my application and the main intention is to make the information of each image (those dragged and dropped onto a canvas that is a designing area) being shown in the datagrid's columns Name - Quantity - Price. Those values should be obtained from each image but I'm currently unaware of the technique how the information could be added to the images.
    For instance Example1.png has a price value of 150€ and when that image is moved onto a canvas, the name and price should be shown in the datagrid and thus there should be simultaneous changes in the Quantity-column when I move the same image onto a canvas many times. Those images can also be removed from the canvas area and then the quantity should decrease. Obviously that same function should work on other images we have in a menu from where the images are dragged and then moved and dropped in the canvas. If I move Example1.png four times there should be Example1 in the name column, 4 in the quantity column and 600€ in the price column and of course all of them in the same row.
    Pay attention to the code I put into the first post. You may suggest better options how I can sort-of-import (couldn't invent better term) images to the application.
    Later there will be a row in the end of the datagrid/chart where the total price of every object that are moved on the canvas should be shown but that's another story.
    Hopefully this made some sense to the whole thing.

  • Help need in drag drop operation in AIR application

    I would like to know if there is a way to drag and drop an attachment file from an desktop mail client application(similar to MSoutlook)  into an AIR application and make it accessible to the AIR application.
    I did experiments with this the drag operation and its giving AIR a File Promise List format as its file type.
    But I'm not exactly sure how to make use of it once it is dropped. The examples in web explains how to manupilate File Promises list format from an AIR application to the desktop.
    There is not much explainations about droping a file promise list format into an AIR app. your valuable help will be greatly appreciated.

    Dear all,
    Is the above mentioned task feasible or not?.If not do mention any other way for implementing this functionality or close to it.
    Thanks

  • Very basic question regarding drag/drop files in 10.6.5

    Just (finally) updated to Snow Leopard and the simple way of dragging a file to the bar (just above the list of items in the folder) so as to move it to that folder no longer works.
    I prefer not to drag it to above other files in the folder and hoping that the file won't end up in a folder (which has now happened several times).
    There must be a simple-no-brainer way of doing this as there was before in 10.5 and as far back as I can remember (been using Macs since the mid-90's).
    Why did Apple decide to change this? Did they find a simpler way that I haven't figured out?
    Thanks for any advice.
    RonL

    MacRumors forum answered my question almost immediately... and yes they acknowledged that Apple had changed this in Snow Leopard for no good reason.
    On both my Leopard and Snow Leopard systems, you cannot drag a file to the title bar (not the "name bar"). On both systems, you can drag a file to the empty space in a window. I just tested to make sure. So, either your description of the problem is completely and utterly inadequate, you are misunderstanding what was said on MacRumors, or someone on MacRumors doesn't know what they're talking about.
    How long have you guys been using Macs?
    26 years, like baltwo. As a Mac support professional, programmer, web designer and more. I've forgotten more about Macs than you have ever known, I'm sure. Nobody here is impressed that you have used Macs for a little more than half that time, and your rudeness is most definitely not appreciated.
    It's one thing to not give me an answer... no problem, fine, but it is an entirely different thing to say that what I have done for years, and that has worked easily for me, has never worked.
    You claim that it changed with Snow Leopard. Clearly, it did not. As I've said, I have both Leopard and Snow Leopard systems and have verified that as fact. Once upon a time you could drag to the title bar, but I honestly don't have any idea when that behavior changed. I'd guess in 10.0, but have no way to verify that at this point.

  • A simple question about Drag and Relate navigation

    Dear experts
    I have found SAP help or related manuals only good at talking difficult things such as how to customise the drag and relate targets, etc.  However, after I followed exactly and then how to test.
    Then I just see pieces of information, very unstructured.  Spending me a whole day, even I can't get a good simple example on how to really perform a drag and relate at least for the proof of concept at EP 6.0.   It spent a lot of time in describing what the navgiation panels about, what drag and relate targets.  Then how to do it in once transversal.  That is, with all customisation, how to drag and relate an object.
    My step is with iview A, shows a purchase order details showing a drag and relate enabled object like vendor no.
    Then I try to drag this vendor no. to a display vendor iview, iview B.
    I have known I have to put iview A and iview B to a Drag-and-relate targets.  I am sure I have done this.  Does it mean opening the portal, I will see both iview A and iview B appearing at the same time in the drag-and-relate target area?  However, in my case, it is not, iview A only appears in that area when I load it once, same to view B.  When I load iview B, iview A links from D&R target will be wiped off.  Then how I can drag an item from iview A to B while each one of them can only appear at any time.
    Can anyone give me a simple guide (don't give me an internet link from help.com) I have been tired of this.
    First, I would to make sure if my so called self-learnt drag-and-relate simple action is correct in the steps or really I have made something wrong in the customisation or even a bug there.
    Can anyone on the planet have this experience, pls. act as my teacher in this area?
    Rgds
    Stephen

    Thanks
    I have tried the 1st way already.  But I can see both iviews existing in the D & R targets.  Now I try to drag an item with business object BUS2002 from iview A to relate to LFA1 of iview B of the same back end system.
    But iview B shown up with that data of LFA1 shown up (in my case the vendor no.)
    I have used autocomplete relationship and I have checked it has been well-defined already.  Also check from metadata at backend they are both active.
    Do you have any clues to the pitfall in my case?
    Rgds

  • Question about air drop.

    I have an iMac and mac book pro and it is great to be able to air drop files from one to the other. Does anyone know of a way to air drop (or other means) to transfer iPhoto contents from one computer to the other?

    Works here in Aperture (so should also work in iPhoto) -  just drag a photo out of that and drop onto a machine in Air Drop, done. Cheers!

  • Question about the conitional operator

    Hello! This may be a dumb question, but I still don't know the answer! =D
    I know the conditional operator is an operator and not a statement, and I was reading a site http://sophia.dtp.fmph.uniba.sk/javastuff/javacourse/week2/16.html that said this works:
    name.equals("Rumpelstiltskin") ? give_back_child() : laugh();
    which I guess makes sense. But when I tried to compile a code just like this, it complains it's not a statement
    What am I doing wrong?

    Ah okay... So you always need a LHS for the conditional operator? I thought that in this case, since a function is being called, then the function is the statement. Sorta like:
    if(a == b)
      doThis();
    else
      doThat();So I have to store the result of a == b in c, for example, if I wanted to use the conditional operator? Even though "c" would be of no use to me whatsoever?

  • Question about IPSec Drops

                       I'm having a problem with a customer with traffic being sent over IPSec.
    From the show crypto session detail command I see that the ipsec flow is dropping the packets
        180 permit ip 161.228.156.192 0.0.0.31 host 160.131.225.47 (444 matches)    190 permit ip 161.228.156.192 0.0.0.31 host 160.131.225.48 (3 matches)   IPSEC FLOW: permit ip 161.228.156.192/255.255.255.224 host 160.131.225.47         Active SAs: 0, origin: crypto map
            Inbound:  #pkts dec'ed 0 drop 0 life (KB/Sec) 0/0
            Outbound: #pkts enc'ed 0 drop 444 life (KB/Sec) 0/0
      IPSEC FLOW: permit ip 161.228.156.192/255.255.255.224 host 160.131.225.48
            Active SAs: 0, origin: crypto map
            Inbound:  #pkts dec'ed 0 drop 0 life (KB/Sec) 0/0
            Outbound: #pkts enc'ed 0 drop 3 life (KB/Sec) 0/0
    My ACL is showing that the exact packets being sent are being dropped
        180 permit ip 161.228.156.192 0.0.0.31 host 160.131.225.47 (444 matches)
        190 permit ip 161.228.156.192 0.0.0.31 host 160.131.225.48 (3 matches)
    My thinking is that the packets being sent are somehow not matching what the ipsec parameters are and it is dropping those packets, but I am just wondering why they would match.

    i read that IKE phase one  for IPSEC uses the asymetric cryptography and the second uses the symetric one.
    both can be the case but as a general rule it's not correct.
    should i understand that with pre-shared key there is no asymetric cryptography in IKE phase 1?
    yes and no ... ;-)
    You always have the Key-Agreement with Diffie-Hellman which is also an asymetric mechanism. That takes place both with PSK and digital certificates (rsa-sig).
    For authentication - and that's probably what you are referring to - with PSKs there is no public-key operation but a couple of hash-operations.If you authenticate with digital certificates you have plenty of public-key operations where digital signatures are computed and also checked.
    Don't stop after you've improved your network! Improve the world by lending money to the working poor:
    http://www.kiva.org/invitedby/karsteni

  • Question about EWS - The operation has timed out

    hi everyone,
    I'm developing a solution which uses public folder database in Exchange Server to store tasks:
    - We use 1 account to access to public folder database by using EWS.
    - Currently, this public folder database contains 60000 tasks and they are being accessed by 700 users, they always have the following exception: 
    04/23/2015 09:41:15:  - The request failed. The operation has timed out
    Message :The request failed. The operation has timed out
    Source :Microsoft.Exchange.WebServices
    Stack Trace :   at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.GetEwsHttpWebResponse(IEwsHttpWebRequest request)
       at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ValidateAndEmitRequest(IEwsHttpWebRequest& request)
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems[TItem](IEnumerable`1 parentFolderIds, SearchFilter searchFilter, String queryString, ViewBase view, Grouping groupBy, ServiceErrorHandling errorHandlingMode)
       at Microsoft.Exchange.WebServices.Data.ExchangeService.FindItems(FolderId parentFolderId, SearchFilter searchFilter, ViewBase view, Grouping groupBy)
    Please help.
    Thanks a lot.
    Phuc

    Thanks Glen for your reply.
    Here is a code block which retrieve the number of task of some groups
    foreach (var bu in request.BusinessUnits)
    SearchFilter businessUnitFilter = new SearchFilter.IsEqualTo(BusinessUnitAliasProp, bu);//, ContainmentMode.FullString, ComparisonMode.IgnoreCase);
    SearchFilter[] filters = new SearchFilter[] { actualOwnerFilter, statusFilter, businessUnitFilter };
    var filterCollection = new SearchFilter.SearchFilterCollection(LogicalOperator.And, filters);
    GroupedFindItemsResults<Item> taskResults = this.exchangeService.FindItems(_publicFolderId, filterCollection, itemView, groupByApplication);
    if (taskResults != null && taskResults.ItemGroups != null)
    foreach (var groupItem in taskResults.ItemGroups)
    if (!dict.ContainsKey(groupItem.GroupIndex))
    dict.Add(groupItem.GroupIndex, new Dictionary<string, int>());
    if (!dict[groupItem.GroupIndex].ContainsKey(bu))
    dict[groupItem.GroupIndex].Add(bu, groupItem.Items.Count);
    Please let me know if it's too complex and might affect to the performance of Exchange Server

  • Two questions: about volatile and operator

    Howdy!
    I need a little info on these lil' critters I've got here...
    First: What is the volatile modifier...? What does it do...?
    And second: What is the >>> or <<< operator...? First I just assumed they were bit rotation, but now I'm not so sure... I've used bit shifting operators before, but a webpage I found recently says Java doesn't have support for these operators...? What the...?
    That is all... :)

    volatile is described here
    http://java.sun.com/docs/books/jls/third_edition/html/classes.html#36930
    and the shift operators at
    http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#5121

  • Newbie question about dragging

    Hi there,
    I'm trying to create an Apollo application where I can move
    buttons around a canvas. When I try the code below, my entire
    canvas/application ends up moving with the button:
    <mx:Canvas width="100%" height="100%">
    <mx:Button x="10" y="10" label="Test Button"
    mouseDown="startDrag()" mouseUp="stopDrag()"/>
    </mx:Canvas>
    </mx:ApolloApplication>
    I also tried the DragManager object, but it seems that it
    only detects the current button as a valid drop target. How can I
    reposition a button within a canvas?
    Thanks,
    Charles

    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=dragdrop_081_14.html

  • Question about not like operator

    HI,
    This where clause omitting ABC% , but I wanted to exclude some conditions I want my sql to return COLUMNA = 'ABCD' but exclude everything else 'ABC%'
    how do I fix this?
    WHERE COLUMNA NOT LIKE '%ABC'
    AND COLUMNA NOT LIKE 'ABC%'
    AND COLUMNA NOT LIKE '%XYZ'
    AND COLUMNA NOT LIKE 'XYZ%'
    Expected result:
    ABCD
    AAAA
    BBBB
    etc

    Hi,
    Here's one way:
    WHERE   COLUMNA NOT LIKE '%ABC'
    AND      (   COLUMNA NOT LIKE 'ABC%'
         OR  COLUMNA  =          'ABCD'
    AND      COLUMNA NOT LIKE '%XYZ'
    AND      COLUMNA NOT LIKE 'XYZ%'

  • Question about the new operator

    Hi All,
    Could anyone tell me if the evaluation of new-expression causes the invocation of the construtor Object() in class java.lang.object or does it just invoke the constructor of the class for which the object is being declared??
    Thanks in advance.
    Meera.

    It invokes the constructor of the declaring class. This constructor then calls the constructor of its super class. So yes, it will end up calling the constructor in class Object.

Maybe you are looking for

  • Error in creating the Domain from template in WLS 10.3.2

    Hi All, I am using WLS 10.3.2 and I need to create a domain from the template of my existing domain. I followed these steps while creating my existing domain: I chose these 2 while creating my existing domain ** WebLogic Portal - 10.3.2.0* ** Weblogi

  • Setting up a connection pool to ms sql database

    Hi I am trying to create a connection pool to talk to an MSSQL database, and could not manage to ping the DB (Operation 'pingConnectionPool' failed in 'resources' Config Mbean.) . What set of properties need to be included for connection pool to an M

  • How can I get the Iso 5 off my iPad

    I got the new iso 5 update and it change the music set up to a **** one that I have to see album artwork when in the artist cuz it will not let me put het in list form. There is no play all button when I pick an artist and want to hear songs of multi

  • Webdynpro abap-method for saving updated values in new database table

    Hi Experts, I am creating an ALV  application in weddynpro abap where i have given update button to update fields & save button to save values in mastertable,but whenever i am updating & saving ,it will overwrit previous values. For this,I need  to c

  • Specifying JRE version in webpage (not using default set in Plugin)

    Hiya, I'm trying to set it up so our app loads a specific version of JRE (1.4.2_12) even though v 1.5 is installed on the machine and set as the default in the plugin. Cant change the default from being v1.5 in the plugin as it is needed by other app