Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4092103

constructor java.awt.dnd.DragSourceContext ignores offset parameter

XMLWordPrintable

    • 1.2beta4
    • sparc
    • solaris_2.5
    • Verified



      Name: sdC67446 Date: 11/12/97


      constructor java.awt.dnd.DragSourceContext doesn't set parameter offset

      Here is the JDK Specification:
      --------------------------------------------------
       public DragSourceContext(DragSource ds,
                                DragSourceContextPeer dscp,
                                Component c,
                                int a,
                                Image dragImage,
                                Point offset,
                                Transferable t,
                                DragSourceListener dsl)

           construct a DragSourceContext (called from DragSource)

           Parameters:
                ds - The DragSource that originated this operation
                dscp - The DragSourceContextPeer for this operation
                a - The operation(s)
                dragImage - The image to drag (or null)
                offset - The offset of the image origin from the hotspot at the instant of the triggering event
                t - The Transferable
                dsl - The DragSourceListener

      Here is the test demonstrating the bug:
      -----------------Test.java------------------------
      import java.awt.dnd.*;
      import java.awt.Point;

      public class Test {
          public static void main(String[] args) {
              Point offset = new Point(0,0);
              DragSourceContext dsc = new DragSourceContext(null,null,null,0,null,offset,null,null);
              if (!offset.equals(dsc.getDragImageOffset()))
                  System.out.println("Mistake.");

          }
      }

      ---------Output from the test---------------------
      Mistake.
      --------------------------------------------------
      ======================================================================

            lcablesunw Larry Cable (Inactive)
            sdmitriesunw Sergei Dmitriev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: