Drop Location

I am using a TransferHandler to handle drag and drop events in my application. I've extended the default TransferHandler to support different data flavors. My only problem is that I need to know the location within my custom component where a drop takes place. The method:
boolean     importData(JComponent comp, Transferable t) however, does not provide me with that information. I'm aware of the DropTargetListener interface and its drop() method, however, its dragOver() method does not behave similarly enough to a mouseDragged() method of a mouseMotionlistener (they are invoked with differing semantics) - and I need mouseDragged semantics.
Help me if you can.

So is this impossible? Ok forgetting the whole TransferHandler approach, has anyone done it another way?
I have implemented my own DragGestureListener, DragSourceListener, and DropTargetListener, but I haven't gotten the kind of behaviour that I expected. For example, in DragGestureListener i've implemented the
void dragGestureRecognized(DragGestureEvent dge)method as follows:
dragGestureEvent.startDrag(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR),
          image,new Point(), new CustomTransferable(),customDragSourceListener);
/*Where image is a BufferedImage*/The problem here becomes that the image never shows up, although it shows up if I display it elsewhere in the application. If you've seen this before (no show image) and know a solution, let me know. The DragSourceListener still does not behave as I would like it to though.
If anyone of you know where I can find an in-depth explanation of the Drag and Drop architecture and semantics (NOT the Java Tutorial) let me know too.
Thanks.

Similar Messages

  • How do show JTree DnD drop location with custom TreeRenderer?

    I am adding DnD support to a JTree with a custom renderer.
    With the custom renderer I am losing the display of drop location on the tree.
    Is there a method to determine if the passed in node object in the getTreeCellRendererComponent is currently a drop location?
    I can tell if the node is selected, but not if a DnD is in action on the tree.
    Thanks,
    Chris

    Is there a method to determine if the passed in node object in the getTreeCellRendererComponent is currently a drop location?
    I can tell if the node is selected, but not if a DnD is in action on the tree.If you are using Java 1.6 you should be able to do something along these lines:Install a TransferHandler on your tree, and override the method canImport() that takes a TransferHandler.TransferSupport as input argument. That method is called repeatedly during the drag process.
    In that method, ask the passed in TransferSupport for the current drop location, by calling getDropLocation(). For a JTree that will return a JTree.DropLocation, which in turn has methods for finding out which node is the current drop target. Store that node in a variable that your renderer can access.

  • Cannot drag and drop image from Safari to Desktop - drop location is unavai

    Drag and drop an image from Safari 2.0.4 to the Mac OS X 10.4.10 Desktop does not save it. Console says:
    "drop location is unavailable"
    Control click over the image and "Save Linked File to the Desktop" works as expected.
    Any hint most welcome. Thanks.

    Why not simply adjust the link for the image in the Links palette? Certainly could be contained in an action, if need be for duplicating and exporting multiple images...
    Mylenium

  • Custom Drop Location Rendering using Java 6 support for JTable DnD

    Can anyone give me some pointers on how to do custom drop location rendering and custom drag images while still using the built-in support for DnD on JTables provided by Java 6?

    I have implemented a solution, though I didn't manage to use TransferSupport.

  • Build Drop Location Nightmare

    I can see that the current build is actually being dropped at this location:
    C:\Builds\1\JS-WebApp\JS-WebApp-Build\bin\_PublishedWebsites\WebApplication1
    In RM I have created a component for the WebApp using XCopy Deployer, and the "Builds with application" option selected. The "Path to package" is set to:
    [Build Drop Location]\_PublishedWebsites\WebApplication1
    But this fails with the following error:
    Package location '#/10015/drop\PublishedWebsites\WebApplication1' does not exist or Deployer user does not have access
    What am I doing wrong?

    I'm having the same errors, including the missing underscore in from of "PublishedWebsites" in the error message.
    I don't know if it's related, but I also get an error when selecting the build to use for the release.  When select either "Latest" or go thru "Select" dialog to pick a build, I get the error:
    It completes the selection and allows me to execute the release.  However, the release then fails with the errors described in this thread.  I also get the following in the Event Log, which points to a bad build definition configuration, or a duplicate
    build number.  I've verified that both are correct.
    Timestamp: 4/29/2015 1:37:02 PM
    Message: TF214010: More than one build was found with build number 20150429.8 and build definition \DevWeb1\*. Only one build was expected. Specify a build without using a wildcard character and try again.: \r\n\r\n   at Microsoft.TeamFoundation.Build.Client.BuildServer.GetBuild(IBuildDefinitionSpec
    buildDefinitionSpec, String buildNumber, String[] informationTypes, QueryOptions queryOptions)
       at Microsoft.TeamFoundation.Release.Builds.TfsOnPrem.TfsOnPremBuildSystem.GetBuildDetails(IBuildServer buildServer, String teamProjectName, String buildDefinition, String buildNumber, String[] informationTypes, QueryOptions queryOptions)
       at Microsoft.TeamFoundation.Release.Builds.TfsOnPrem.TfsOnPremBuildSystem.<>c__DisplayClass55.<SetBuildRetention>b__51()
       at System.Threading.Tasks.Task.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.TeamFoundation.Release.Builds.TfsOnPrem.TfsOnPremBuildSystem.<SetBuildRetention>d__57.MoveNext()
    Category: General
    Priority: -1
    EventId: 0
    Severity: Error
    Title:
    Machine: <servername>
    Application Domain: /LM/W3SVC/3/ROOT-1-130748001029782562
    Process Id: 4644
    Process Name: C:\Windows\SysWOW64\inetsrv\w3wp.exe
    Win32 Thread Id: 1776
    Thread Name:
    Extended Properties:
    I've also restarted the  Microsoft Deployment Agent service, and reentered the password on the account.
    I had the agent-based releases working.  I haven't used them for about a week, and in the time I've set up vNext.  I didn't read anything about the two being incompatible, but could they be conflicting?
    environment: VS/TFS/RM 2013 update 4
    4/29 - I tried Ismael's suggestion of changing to "Copy output to the server".  The build then runs successfully.  But when I set it back to the UNC configuration, I get the errors back again.
    Thanks for any help/thoughts
    Curt Zarger [email protected]

  • I am organizing my external HD and want to move files NOT COPY them. How do I drag and drop folder contents without Mac automatically copying them to the "drop" location?

    I am sorting out all the clutter and duplicate files on my external HD. In doing this I am moving the entire contents of folders to new locations. Some of these folders cointain gigs of info. I do not want to have to spend large amounts of time waiting for hundreds of gigs to copy somewhere then  moving the originals to the trash and wait even longer deleting all of them. All I want to do is move the files up a subfolder, but the way Finder goes aobut doing it can be a 400 GB swing taking hours. How do I just "move" them?

    Check out this discussion. Worked for me.
    http://tinyurl.com/7dmh9p5
    Quote:
    When I do a drag and drop in Finder to move a folder into another folder it makes a copy of the folder in the new location instead of moving it like the help documentation says and like it used to do in Snow Leopard.  I have looked all over in preferences for a setting the contols the move/copy outcome of drag and drop and have been unable to find anything.  Is this the way Lion is supposed to work?
    MacBook Pro, Mac OS X (10.7.1)
    This solved my question by jsd2  on Oct 9, 2011 6:33 AM
    I did a global change of permissions for the entire documents account in the currrent user account using the get info and apply to enclosed items.
    I think what is happening is that the Documents folder normally carries an "everyone deny delete" ACL, meant to protect it from accidental deletion:
    $ ls -lde ~/Documents
    drwx------+ 6 t1  staff  204 Oct  9 08:51 /Users/t1/Documents
    0: group:everyone deny delete
    ACLs are special types of permissions that do not show up in GetInfo, but can get propagated if you click "Apply to Enclosed Items" on a folder that carries them. Affected files that acquire  that ACL would require password authentication to move or delete them.
    I think the following Terminal command (copy and paste it) should remove such ACLs from items within the Documents  folder:
    chmod -RN ~/Documents/*
    Message was edited by: miz_mdk

  • How to know drop location with a transfer handler?

    Using the Swing TransferHandler, there doesn't seem to be a way to figure out the location of the drop!
    Does this mean I must use the older mechanism instead of this new one, my situation here requires that I know where the object is being dropped so that I can add it in the right location.
    Help!

    Hey, anybody using drag & drop at all?!?!
    It's funny, you search around the web and the new features of 1.4 drag & drop are nowhere to be found/discussed!
    :-(

  • Tree Drag & Drop problem identifying drop location

    Item0
    ----- Item1
    ---------- Item11
    ---------- Item12
    ..............................<--------
    ----- Item2
    ---------- Item21
    ---------- Item22
    ----- Item3
    ---------- Item31
    ---------- Item32
    When I drag Item32 to drop at the location pointed by the
    arrow, it can be dropped as :
    1). A third child of Item1 or
    2). A Second child of Item0
    After drop, I need to update the database for Item32's new
    parent change.
    How can we identify new parent whether it is dropped as Case
    1). or Case 2).
    Because the calculateDropIndex return the same index(of
    Item2) and cannot identify...
    Any suggestion?
    Thanks

    Hi guys,
    I ran into the same issue and think I have managed to solve it. Below are the steps I took:
    1. In my dragDrop event I grabbed the drop index by using tree.calculateDropIndex(event) and created a bindable variable [dropIndex] to store the index number.
    2. I created a separate function [tree_getNewParent] to get the new parent from.
    3. In my dragDrop event (I have also tried this with dragComplete) I added a callLater to the function I created in the previous step. I remembered that I had dramas trying to expand items and the solution I found used callLater as the items weren't yet bound. I assume it is the same case here.
    4. Finally in the separate function I set tree.selectedIndex to equal the index I stored in the dragDrop event. Then to access the new parent I simply did a tree.selectedItem.parent()!
    Mine looks something like this:
    [Bindable]
    private var dropIndex:Number;
    private function tree_dragDrop(event:DragEvent):void{
         var dIndex:Number = tree.calcualteDropIndex(event);
         dropIndex = dIndex;
         callLater(tree_getNewParent);
    private function tree_getNewParent():Object{
         tree.selectedIndex = dropIndex; 
         var newParent:Object = new Object();
         newParent = tree.selectedItem.parent();
         return newParent;
    Please let me know how you go.
    Cheers,
    Stu.

  • How do I adjust the size of the window so I can drop videos from other windows? I am trying to decide if I am going to buy this application but there are too many problems already.

    I am trying out the Premiere Elements but I am not sure I will want to continue to use it. First problem:
    How do I get the window to go to a smaller size? I click on the box on the upper right corner but it still covers the whole computer screen and I cannot grab it and move it either. What is going on? I have an HP computer.
    Thanks for any help out there.

    popsierose
    I am assuming that you are on Windows 7, 8, or 8.1 64 bit.
    Not sure if there is another way, but the way that works for me
    a. right click the computer taskbar, and click on Cascade Windows
    b. in the Premiere Elements Expert workspace, go the the bottom right edge of the workspace view, place the mouse cursor at that point until its tip has a diagonal icon, and then drag upward right to left diagonally to give some view of the desktop where I have the file for the drag and drop into Premiere Elements....then drag and drop the supported file into the Timeline or Project Assets or a drag and drop location.
    Please let us know if that worked for you.
    Thank you.
    ATR

  • Move photo in album, view returns to select location

    iPhoto '09  v8.1.1 424 (earlier versions, too)
    Organizing/moving photos in an album:
    When dragging a photo(s) in an album, say to move it from row 20 to row 1, where drag requires an auto scroll by holding the thumbnail at the top edge of album window, iPhoto returns view to row 20 when photo is dropped at row 1.  Same for any drag, up or down, if pick location is off screen from drop location.
    I would like to have the view stay at drop location.  No pref for this.  Any way to fix?
    Or click to select, then mouse scroll, and some hot key click to insert photo at new location (view stays at insert location).
    Also, iPhoto has a very narrow target strip for the auto scroll.  Any way to widen the scroll control area? Or tips to work it?
    Any comment appreciated.
    -B

    That seems to be the default behavior of that version of iPhoto when dragging in an album.  Not much you can do about it at this time. 
    There is a new version of iPhoto 8, iPhoto 8.1.2, that you could update to and see if that helps.
    OT

  • How to get a build definition with Online TFS and a shared drop folder

    Hi,
    We VSTS Premium license. We use online TFS as source control.
    I want to make a build definition. Use Team Explorer for the same.
    I get error message when I enter a shared path as my build drop location.
    Please find below the image showing the difference. Radio box highlighted in Red does not work and Green does. I want to use the shared drop folder option.
    Exception Message: TF270016: An error occurred publishing log files from '' to ''. Details: The network path was not found.
    I found this message in lots of posts and have tried the following - 
    1) Everyone has full access to the folder.
    2) 'NETWORK SERVICE' also has full access.
    But the above didn't work.
    Looks like this is a known one. Can you please suggest a solution?
    Appreciate the help.
    NewbieVSTSTest2013

    Hi NVT, 
    Thanks for your post.
    Yes, Chaminda is right, Hosted Build Controller not support the UNC path. You can install On-premise Build Server for your VSO Account if you want copy build output to UNC drop location. Or we suggest you select Copy build output to Source Control folder
    or Copy to server when you’re using  Host Build Controller.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to push VSO build drop to azure storage account?

    Hi,
    I want to automate the deployment process and setup CI.
    I have Source Control and Build setup on VSO (Git / MsBuild). The build is currently stored by VSO itself and all i get is a download link to a zip. 
    Now i cannot automate the fetch and deployment of this build drop since it requires me to open a browser, login and download the build. (I could probably solve this using browser automation, but i'm not desperate enough.)
    Is there any way to set say a blob storage as the drop location. OR somehow setup a file share on azure and have it drop to that. Or is there an API that would let me download this build drop directly? Am i missing some hidden option or have i overlooked
    something?
    Any help / advise would be very welcome. I don't mind being contacted by your dev / support teams.
    Thanks,
    Brijesh

    Hi Brijesh,
    Based on the description, seems you want to do continuous build and deployment to Azure. And I'd like to know why you need to get the build drop during the process.
    To get the build drop when build the project in Git team project, we can also set to copy the build output to an UNC path in Build default tab of build definition. There is no need to store the build drop to some place in Azure storage.
    Another option is do the continuous deployment by using a CI build defninition. And you can use build process template of "GitContinuousDeploymentTemplate.12.xaml" to do the continuous deployment. Please check the link below for more information.
    If you have any other concerns, please elaborate more details.
    http://azure.microsoft.com/en-us/documentation/articles/cloud-services-continuous-delivery-use-vso-git/
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Af:collectionDragSource and drop not working in Firefor 3

    Hi,
    Collection Drag and drop is not working in firefox 3 (dint checked in firefox2), its working fine in IE7, not sure if this is bug in firefox or adf components or am I missing something?
    You can check by going to the following link, try "Table with a CollectionDragSource"
    http://jdevadf.oracle.com/adffacesdemo/faces/feature/dragAndDrop.jspx
    thanks
    ansar

    I've sort-of got it working under FF3 + TP4, with the drop part of the drag requiring me to offset the mouse drop location. I can't drop directly onto the drop locations, I need to move my mouse slightly to top left of the drop location, then I can drop it.
    Under FF3 + Drop6 (internal Oracle JDev 11g build), this simply doesn't work, a JavaScript error is thrown. As such I'd say the ADF Faces component demo is now out of date for the latest build.
    With the StoreFront demo under FF3, + TP4 where you can drag n drop into the shopping cart, I can also get this to work, but in this case the offset is along way off. Seems to work in IE7 perfectly, though I rarely use IE7, mostly FF, and my FF is highly configured to my own preferences. For example I have a minimum font size set in FF, but don't bother with this for IE.
    I can't get the current StoreFront to run under Drop6.
    When I can get drag n drop to work with TP4 + FF3 with the ADF Faces component demo, the problem seems to be with font sizes on the web page, because if you enlarge/shrink font sizes with the browser, the offset becomes smaller/not an issue.
    All the above are just my experiences, not necessarily yours, just thought I'd share.
    Given the changing behaviour between TP4 + Drop6, I suspect we should wait for the production release to see what the final result is.
    Cheers,
    CM.

  • Drag and Drop Template

    Does anyone know where I could find a Flash drag and drop
    template where the drag objects snap to the drop locations, and the
    check answers button has this functionality each time it's clicked:
    - Displays how many answers are correct and incorrect
    - Snaps the incorrect drag objects back to their original
    positions
    - Makes the correct drag objects immovable
    - Displays something like "These are all correct" message
    when all are done correctly
    I also need the drag and drop to work inside of a movie clip.
    I've found a number of drag and drop templates, but none of
    them can do all of these things. My ActionScript programming is
    basic to intermediate at best, so I can't program it from scratch.
    Thanks!

    the errors following the first are probably a result of the
    syntax error in line 5, calls to _root are somewhat unstable, and
    can often get unexpected results, in this case I think I'd go with
    _parent or _level0, where I'm assuming the array is located.
    Additionally, I don't think that the operator 'add' can be
    used as a 'concatenator', but I think you should check the array
    anyway, instead of all instances within the 'root' MC properties
    list.
    PS. this will only check the target array once, when the MC
    is press the first time, if you are going to drag the MC to a
    target point and then determine if it's being hit you should place
    this in the on(release) handler where it's activate when stopDrag
    occurs. If you want it to continuously make the check while being
    dragged, you should place it inside a repeating loop.
    something more like this:

  • Drop target below image or canvas seems impossible?

    Hi All!
    I am building an app where the user can drag an image from
    one place, and drop it in a few different locations.
    The drop locations are vector images who listen for the
    dragEnter event, they get "highlighted" when an image is dragged
    onto them, and then accepts the dropped image - no problem. This
    all works like a charm.
    The trouble is I need to add a partially transparent PNG
    image on top of it all, and when I do that the image seems to
    consume any dragEnter events that are generated, and the "drop
    spots" below never get notified that something is being dragged
    over them.
    I realize that a PNG image with transparency will not be
    considered TRULY transparent, and that it normally does consume
    mouse events regardless of wether it's transparent or not. The odd
    thing is that you cannot work around this by setting mouseEnabled
    and mouseChildren to false on the image - it still sits there
    effectively blocking the dragEnter events from reaching their
    intended targets.
    If anyone has a workaround or solution to this I'd be very
    grateful!
    Thanks in advance & Best regards
    Culme

    I had to give up on this one for now.
    I created a layer on top which contains the "drop targets",
    and a layer below the PNG image which contains the visual elements
    that get highlighted when stuff is dragged over the drop targets.
    It works, but it seems like a rather lousy solution.
    If anyone figures out a better way of doing it I'm still
    interested.

Maybe you are looking for

  • Get the sum/product of two UDF rows before adding A/R Invoice

    Hi Everyone, I am making some tests here where I am trying to get the sum or product of two UDF rows in a service type A/R invoice where I need to get the product before i even add the document. The query goes like: SELECT T0.[U_UDF1] * T0.[U_UDF2] F

  • MacMini Hangs When Shutting Down

    Hi all. I've tried looking up the answers to this but I have a slightly different issue from others who had issues when shutting down. This started a few months ago.  What happens is when I click to shut down the computer, everything starts closing o

  • GDM doesn't show up anymore after installing catalyst, Xorg works fine

    Hi, I just installed catalyst-hook from Vi0L0 and my situation is this: when I boot my computer the output on the tty1 gets stucked after the checking the filesystem with systemd-fsck and nothing appears after that, no blinking cursor, no prompt that

  • XML parser & hebrew

    I need to read some XML document with hebrew text. When I try to do parse() method on DocumentBuilder I get SAXParseException. What can I do?

  • How to delete iCal sync in .Mac

    I want to delete my iCal info (from my syncs) in .Mac. I created a mess and I want to start over. Problem is when I sync I retrieve the messy info saved on my .mac??? Any ideas? Thanks