What does this parameter do ? (d&d)

Hi there,
I'm working on some d&d code. When I drag, I want to see an image and not only the drag cursor.
There is a parameter in DragGestureEvent where I can put an Image. Is this the image that'll be visually dragged on screen ?? My code:
    e.startDrag(DragSource.DefaultCopyDrop,dragImage, new Point(10,10), new StringSelection("ARF!!"), this); dragImage is an instance of image.
This doesn't show the image. Is there something wrong ?

On Windows, if you want to simulate the drag of the selected image, you have to do it in the DropTargetListener like this :
It is an inner class of the component you want to drag in (Called here MyDraggableComponent : in most cases it's a JTree).
In this component there is an attribute like this :
BufferedImage buffImage;
     final class MyDropTargetListener implements DropTargetListener {
          private Rectangle rect2D = new Rectangle();
          public void dragEnter(DropTargetDragEvent dtde) {
               Point pt = dtde.getLocation();
               paintImmediately(rect2D.getBounds());
               rect2D.setRect((int) pt.getX(),(int) pt.getY(),buffImage.getWidth(),buffImage.getHeight());
               ((Graphics2D) getGraphics()).drawImage(buffImage,(int) pt.getX(),(int) pt.getY(),MyDraggableComponent.this);
          public void dragExit(DropTargetEvent dte) {
               paintImmediately(rect2D.getBounds());
          public void dragOver(DropTargetDragEvent dtde) {
               Point pt = dtde.getLocation();
               paintImmediately(rect2D.getBounds());
               rect2D.setRect((int) pt.getX(),(int) pt.getY(),buffImage.getWidth(),buffImage.getHeight());
               ((Graphics2D) getGraphics()).drawImage(buffImage,(int) pt.getX(),(int) pt.getY(),MyDraggableComponent.this);
          public void dropActionChanged(DropTargetDragEvent dtde) {
               Point pt = dtde.getLocation();
               paintImmediately(rect2D.getBounds());
               rect2D.setRect((int) pt.getX(),(int) pt.getY(),buffImage.getWidth(),buffImage.getHeight());
               ((Graphics2D) getGraphics()).drawImage(buffImage,(int) pt.getX(),(int) pt.getY(),MyDraggableComponent.this);
          public void drop(DropTargetDropEvent dtde) {
               Point pt = dtde.getLocation();
               paintImmediately(rect2D.getBounds());
               rect2D.setRect((int) pt.getX(),(int) pt.getY(),buffImage.getWidth(),buffImage.getHeight());
               ((Graphics2D) getGraphics()).drawImage(buffImage,(int) pt.getX(),(int) pt.getY(),MyDraggableComponent.this);
     }You have to create the buffered image in the method dragGestureRecognized od the DragGestureListener.
For example a DragGestureListener in a JTree called MyDraggableComponent :
     final class TreeDragGestureListener implements DragGestureListener {
          DragSourceListener tdsl;
          public TreeDragGestureListener(DragSourceListener dsl) {
               this.dsl = dsl;
          public void dragGestureRecognized(DragGestureEvent dge) {
               TreePath path = getSelectionPath(); // getselectionpath
               if (path != null) {
                    DefaultMutableTreeNode selectednode = (DefaultMutableTreeNode)path.getLastPathComponent();
                    Rectangle pathBounds = getPathBounds(path); //getpathbounds of selectionpath
                    JLabel lbl = (JLabel)getCellRenderer().getTreeCellRendererComponent(MyDraggableComponent.this, selectednode, false , isExpanded(path),((DefaultTreeModel)getModel()).isLeaf(path.getLastPathComponent()), 0,false);//returning the label
                    lbl.setBounds(pathBounds);//setting bounds to lbl
                    buffImage = new BufferedImage(lbl.getWidth(), lbl.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE);//buffered image reference passing the label's ht and width
                    Graphics2D graphics = buffImage.createGraphics();//creating the graphics for buffered image
                    graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));     //Sets the Composite for the Graphics2D context
                    lbl.setOpaque(false);
                    lbl.paint(graphics); //painting the label on the graphics of the buffered image
                    graphics.dispose();
                    dragSource.startDrag(dge, DragSource.DefaultMoveNoDrop , buffImage, new Point(0,0), new TransferableNode(selectednode), dsl);               
     }I hope this helps,
Denis

Similar Messages

  • What does this parameter do "Force SQLExecute" in the background.

    Can anybody tell me  what does this parameter does  "Force SQLExecute" in the background?
    It is in the sbo file.

    Guarav,
    I searched for your comment "Force SQLExecute" in the slew of BO XI R2 PDFs I have stockpiled away and found this entry in the PDF "boxir2sp2_readme_with_chf.pdf":
    -quote
    CHF14
    ADAPT00597178 Patch ID: 39,211,515
    Description:
    When an SQL server ODBC connection is used, users are unable to create a Desktop Intelligence report that is based on a stored procedure that creates, populates, and then drops a temporary table.
    New Behavior:
    This problem is resolved.
    Known Limitations:
    If users want to execute a stored procedure that creates, populates, and then drops a temporary table in Free-Hand mode, they can modify the odbc.sbo file:
    1. In a text editor, open the odbc.sbo file, which is in the following directory: <BOEINSTALLFOLDER>\BusinessObjects
    Enterprise 11.5\win32_x86\dataAccess\connectionServer\odbc.sbo.
    2. In the sections "MS SQL Server 7.x", "MS SQL Server 2000" and "MS SQL Server 2005", locate the following line:
    <Parameter Name="Force SQLExecute">Procedures</Parameter>
    3. Replace the line with the following:
    <Parameter Name="Force SQLExecute">Always</Parameter>
    -unquote
    So hopefully this tidibit of information helps you to understand the parameter and usage.
    Thanks,
    John

  • What does this parameter do ?

    Hi there,
    I'm working on some d&d code. When I drag, I want to see an image and not only the drag cursor.
    There is a parameter in DragGestureEvent where I can put an Image. Is this the image that'll be visually dragged on screen ?? My code:
        e.startDrag(DragSource.DefaultCopyDrop,dragImage, new Point(10,10), new StringSelection("ARF!!"), this); dragImage is an instance of image.
    This doesn't show the image. Is there something wrong ?

    Too bad. :(
    But the image parameter is the correct parameter to add a custom image ? (perhaps if I want to run this on a macintosh, I will see the picture there?)
    Saddly, in windows there is no way to change the drag
    and drop cursor. On any other OS, a simple search
    should provide the answer.

  • What does this parameter do _disable_logging

    Please explain me about disablelogging parameter. so i can use in my import for speed up import

    Understand, No Problem bec it's test database.
    As u say “ setting disablelogging=true will stop the dbwr process writing redo information to the redo logs. “ done the same.
    i am using oracle 10.2.3, But when i am seeing in my alert log file I am getting following entry.
    Thread 1 advanced to log sequence 38
    Current log# 6 seq# 38 mem# 0: /u01/redo/testdb/redo06.log
    Tue Jan 29 18:43:31 2008
    Thread 1 advanced to log sequence 39
    Current log# 7 seq# 39 mem# 0: /u01/redo/testdb/redo07.log
    Tue Jan 29 18:46:14 2008
    Thread 1 advanced to log sequence 40
    Current log# 8 seq# 40 mem# 0: /u01/redo/testdb/redo08.log
    Tue Jan 29 18:52:27 2008
    Thread 1 advanced to log sequence 41
    Current log# 1 seq# 41 mem# 0: /u01/redo/testdb/redo01.log
    Tue Jan 29 19:00:34 2008
    Thread 1 advanced to log sequence 42
    Current log# 2 seq# 42 mem# 0: /u01/redo/testdb/redo02.log
    Tue Jan 29 19:03:22 2008
    Thread 1 advanced to log sequence 43
    Current log# 3 seq# 43 mem# 0: /u01/redo/testdb/redo03.log
    Tue Jan 29 19:06:25 2008
    Thread 1 advanced to log sequence 44
    Current log# 4 seq# 44 mem# 0: /u01/redo/testdb/redo04.log
    Tue Jan 29 19:09:41 2008
    Thread 1 advanced to log sequence 45
    Current log# 5 seq# 45 mem# 0: /u01/redo/testdb/redo05.log

  • I'm getting the message -50 error when i try to export my project on iMovie '09. What does this mean??

    I'm getting the message -50 error when i try to export my project on iMovie '09. What does this mean??

    Hi
    Error -50 paramErr  Error in user parameter list
    Can there be any external hard disks - if so How is/are it/they formatted ? Must be Mac OS Extended (hfs) if used for Video.
    UNIX/DOS/FAT32/Mac OS Exchange - works for most but not for VIDEO.
    free space on internal boot hard disk? How much ?
    Video codec
    streamingDV, AIC etc. (not .avi, .mp4, .m4v, .wmv etc as they are containers not codecs)
    Pictures
    in what format ? .jpg, .bmp, .tif, else ?
    Audio
    from where/what format ? iTunes, .avi, .mp3, .aiff, else ?
    iMovie/iDVD preference file
    The "com.apple.iMovie.plist" file or "com.apple.iDVD.plist"
    Many users has not observed that there are TWO libraries.
    _ Library - at root level
    _ Library - in user/account folder - THIS IS THE ONE to look into
    from Luke Burns
    I fixed the problem.. but it was very, very strange. I had a very long section for credits and set the line spacing to 1.0.. for some reason this caused it. I removed it, and it worked fine. I put it back, and I couldn't preview or play the video.
    I don't know why that could cause that big of a problem, but it did..
    Klaus1
    You need more free space on your hard drive.
    Where do Your material come from
    Camera
    External hard disk
    USB-memory
    And all are connected so that iMovie can find it ?
    from: jonorparkerjon
    After phone support from apple I ended up creating a new project and adding all 117 clips back in individually till I found out what clips flagged and would not allow me to export. I had 3 I deleted and replaced and everything works now 1hr after tedious work....
    from Karsten S
    Shorter clips than 1,5 sec might be one of the culptrits
    Bengt cont.
    Set-Up might differ
    Mac OS - most probably X.7 or more
    iMovie version - more than iM'11 v. 9.0.4
    Action taken
    Finalizing project - I never do as I never understood the gain to do so
    Share as HD to iDVD - never give any gain but if it works the resulting DVD is less quality than if SD-quality was shared
    fps - set - I only use PAL (25fps)
 
    Yours Bengt W

  • What does this mean:Photoshop 13.1.2 for Creative Cloud Installation failed. Error Code: U44M1P7

    What does this mean:Photoshop 13.1.2 for Creative Cloud Installation failed. Error Code: U44M1P7
    I found the manual update, which worked!
    http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5595&fileID= 5604

    Hi Barbara,
    For failed 13.1.2 update error U44M1P7, Please refer to the solution mentioned in the following threads :
    http://forums.adobe.com/message/5396792#5396792
    http://forums.adobe.com/message/5409050#5409050

  • Why has my monitor suddenly begun to have a moiré pattern all over – it is even showing up on my icons on the dock? It appears to be very thin bright green vertical lines. I have a 2008 iMac which is running 10.6.8. What does this mean?

    Why has my monitor suddenly begun to have a moiré pattern all over – it is even showing up on my icons on the dock? It appears to be very thin bright green vertical lines. I have a 2007 iMac which is running 10.6.8. What does this mean? I've attached some screen shots below.
    Also experiencing some funky issues with my wireless keyboard. With new batteries, it will just stop functioning. Certain keys intermittently won't work. Also the fans go on as soon as I turn the computer on - some times they stay on and sometimes they don't. Ever since upgrading the operating system - I've been having many issues with this iMac. Not happy. Any answers out there?

    Thanks for your reply LexSchellings, There is no disc in the drive and I went through the suggestions you put forward on the phone with Apple support without any luck. I can put a disc in but it pops straight back out again without registering on finder.
    The idea of using an external drive was to enable me to avoid the cost and loss of productivity whilst machine in repair... if I have to take it in to get the old drive removed than I might as well have a new internal drive put in, although I do worry about the reliability of these apple drives given my experience with this one coupled with my limited online research ... on line forums seem to be full of people with the same problem (although perhaps searching such forums is bound to make it seem a common problem as users with perfectly working machines are less likely to post (?)) Your reply suggests that no external drive will work whilst the existing drive is in place.
    As a postscript: I do realise that this is a user forum ...my secondary question was asking if anyone knows how to put forward a case/complaint to Apple... I can't find a link on the support page that would enable me to do so and I was wondering if anyone on this user forum had any ideas/experience..

  • When trying to update my IPad apps I am getting the message "Your Apple ID has been disabled". Still have more than 50$ in my account, so what does this mean ?  What can I do to get my ID enabled again ?

    when I am trying to download IPad updates I get the message "Your Apple ID has been disabled". What does this mean? How do I get my ID enabled again? Still got more than 50$ in my account !

    Reset your Apple ID password here >  Apple - My Apple ID
    More information here >  Apple ID: "This Apple ID has been disabled for security reasons"  appears

  • I'm trying to upgrade to Mountain Lion and I get an error message that says "server error during download; 403 forbidden. What does this mean, what can I do? I had no problem downloading Lion.

    Trying to upgrad to Mountail Lion and got an error message : 403 Forbidden. What does this mean? What can I do? I had no problem when I upgraded to Lion.

    403 Forbidden HTTP status code in response to a request from a client for a web page or resource to indicate that the server refuses to allow the requested action. In other words, the server can be reached, but the server declined to allow the requested access.
    http://en.wikipedia.org/wiki/HTTP_403
    Could you be using a different Apple ID oe such?

  • I am suddenly unable to open my pictures in Adobe Photoshop. It gives the following message: The document "Tina-19.jpg" could not be opened. Photoshop cannot open files in the  "Adobe Photoshop JPEG file" format. What does this mean? I have opened my phot

    I am suddenly unable to open my pictures in Adobe Photoshop. It gives the following message: The document “Tina-19.jpg” could not be opened. Photoshop cannot open files in the  “Adobe Photoshop JPEG file” format.
      What does this mean? I have opened my photos in Adobe Photoshop for years and suddenly I get this message and can't open any of my pictures

    JoeLib wrote:
    You type way faster than me Gene.
    Well, not necessarily in this case.
    According to the time stamp, Gene posted his answer a bit over three hours before you did, Joe.
    Gene's post:       Dec 29, 2014 5:54 PM
    Joe's post:          Dec 29, 2014 8:57 PM

  • What does this message mean:  this apple ID has not yet been used in the iTunes store"? I cant connect using my iphone. But it works in iTunes on my laptop.

    what does this message mean:  this apple ID has not yet been used in the iTunes store"? I cant connect using my iphone. But it works in iTunes on my laptop.

    FAQ apple id http://support.apple.com/kb/HT5622?viewlocale=en_US
    http://support.apple.com/kb/HT1311

  • What does this message mean?  "ITunes has fetected an iPad in recovery mode.  You must restore this iPad before it can be used with ITunes".

    What does this message mean?  "itunes has detected an iPad in recovery mode.  You must restore this iPad before it can be used with ITnes."  How do I restore when every time I connect to my computer I get this message?

    Perhaps the information in this Apple support article will help:
    http://support.apple.com/kb/TS3694#error3004
    Regards.

  • What does this message mean Charging is not supported with this device?

    What does this message mean Charging is not supported with this device?

    You've gotten 2 good answers already, but there's a key assumption in both that you got the message when connecting the iPhone to some other device. If this is the case you can get an adapter in the Apple online store that will allow charging from older devices.
    If, however, this message appears when you are not connected to anything the problem is dirt or moisture in the dock connector at the bottom of the phone. Clean it with a dry toothbrush or air blast.

  • What does this message mean when i dial

    What does this verizon message mean?
    'your call cannot be completed as dialed'
    i got a number on my caller id from my ex's neighborhood
    609-424-xxxx
    its not his (old, home) number, but i am concerned that he got a new number or maybe called from a pay phone--
    he has a history of psychological abuse
    i tried calling the number back from a pay phone from the next county to see if i could find out thatit wasn't him to put my mind at ease..
    but i got the above message
    i dialed the number that was on my caller ID
    would this message come up if it were a payphone that does not take incoming calls?
    why else would i get the message.
    thats the number that came into my caller id, but i am told it can't be completed as dialed..
    i was calling from the 732 area code and did use the full number with the area code
    i tried googling the number and doing a reverse look up
    we live far apart--i don't know anyone else in his town--its too much of a coincidence to just be a wrong number
    there is not enough to file a police report yet

    This seems to suggest that it could be filenames… (see the final posts).
    https://discussions.apple.com/message/7818914?messageID=7818914#7818914?messageI D=7818914
    Replace dashes, underscores, hyphens & any other funky looking characters. Very long filenames of folder paths may cause trouble too.

  • What does this message mean? : "The file name "DSC_0088.jpg" is offline or missing." ?

    What does this message mean? : "The file name "DSC_0088.jpg" is offline or missing."   I am in the process of importing photos from iPhoto (don't really know what I'm doing....) and when I look at one of the imported photos that message pops up.  I know what "DSC_0088.jpg" is.  I don't know what it means that the file is "missing".

    CASpyr,
    Thank you so much for your reply.  I have a couple of bigger issues that I am dealing with: too many photos on my laptop: 40,000! (Of course I have to throw away many of them, but that is time consuming). I have a MacBook Pro and have primarily used IPhoto. I have recently purchased 2 external drives and have transferred my photos to those, but I need a basic education about how photos are stored, copied, etc.  I have recently been told that iPhoto only shows and deals with jpegs, not RAW.  About 1/3 of my photos are RAW, so I purchased Lightroom, so I could do more with those RAW photos.  I have been told by my local Mac store that I need to delete most of my photos from iPhoto, because it's causing problems.  I am reluctant to do so until I am sure that all of the keywords, descriptions and editing I have done to these photos is not lost when deleted from iPhoto. I just watched a tutorial about importing to Lightroom and got out of it that I needed to copy photos from iPhoto to a file on my desktop and then copy to Lightroom.  I did that, it seemed to work.  Then (because of my storage/memory issues) I deleted the photos (just a few as an experiment) from that desktop file.  I'm guessing that is why Lightroom doesn't recognize the the photos.  It seems that (learned from another tutorial) that one uses "Add" , Lightroom is only connecting to the source of the photo, not  actually copying it to the program.  Sounds like I need to use the "Move" feature instead.  My ultimate goal is to store the photos on the 2 external drives and eliminate most of them from my lapop.  So my basic questions have to do with what data (metadata??) is copied from iPhoto to an external drive (RAW???) and what isn't copied. Basic understanding issues,obviously….  I hope this isn't too much to ask.  If you can recommend a book or resource that can explain those basic issues to me I'd appreciate it.  I just got back from a trip and I can't download my new photos until I manage the rest!
    Thanks,
    Nancy

Maybe you are looking for

  • How to make writer PDF form accessible to other users?

    Hello, I have created a form in Adobe Professional version 8. Actually I created it in Word and converted it online to PDF. In the Adobe 8 version I am able to type and complete the form fields, however if I share it with anybody else, who has a lowe

  • Windows Commands on a MAC

    Hi Can anyone help. I'm switching from a PC to a MAC Book Pro and I need to be able to do screen grabs to paste into a word document (on Parallels). If I was doing this on a PC it'd be the 'Alt & Print Screen' Command. How do I do this on a MAC??

  • Esker Interface with SAP

    Hi All,   My Client want to use Esker for Faxing and Emailing of documents. I have few question regarding this mentioned below :- 1. Is there any documnet / link to see the steps involved in configuring or developing the interface between Esker and S

  • Location of CC downloaded update files in Mac Yosemite

    Hi all. I have been using CC on Windows 7 but last week have purchased a Macbook Pro and wanting to keep my hard drive space optimised I want to know when CC downloads updates where does it store these files - I am presuming here that these files are

  • Livecycle on Websphere 6.1--configuring SSL problem

    I have installed and set up adobe livecycle es 8.2 on websphere on an AIX platform.  I'm on page 27 of the Administering Livecycle ES guide but have hit a brick wall in regards to the SSL implementation part. I have an existing websphere DMGR console