1. /*
  2. * @(#)Autoscroll.java 1.13 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.dnd;
  8. import java.awt.Insets;
  9. import java.awt.Point;
  10. /**
  11. * During DnD operations it is possible that a user may wish to drop the
  12. * subject of the operation on a region of a scrollable GUI control that is
  13. * not currently visible to the user.
  14. * <p>
  15. * In such situations it is desirable that the GUI control detect this
  16. * and institute a scroll operation in order to make obscured region(s)
  17. * visible to the user. This feature is known as autoscrolling.
  18. * <p>
  19. * If a GUI control is both an active <code>DropTarget</code>
  20. * and is also scrollable, it
  21. * can receive notifications of autoscrolling gestures by the user from
  22. * the DnD system by implementing this interface.
  23. * <p>
  24. * An autoscrolling gesture is initiated by the user by keeping the drag
  25. * cursor motionless with a border region of the <code>Component</code>,
  26. * referred to as
  27. * the "autoscrolling region", for a predefined period of time, this will
  28. * result in repeated scroll requests to the <code>Component</code>
  29. * until the drag <code>Cursor</code> resumes its motion.
  30. *
  31. * @version 1.13, 12/19/03
  32. * @since 1.2
  33. */
  34. public interface Autoscroll {
  35. /**
  36. * This method returns the <code>Insets</code> describing
  37. * the autoscrolling region or border relative
  38. * to the geometry of the implementing Component.
  39. * <P>
  40. * This value is read once by the <code>DropTarget</code>
  41. * upon entry of the drag <code>Cursor</code>
  42. * into the associated <code>Component</code>.
  43. * <P>
  44. * @return the Insets
  45. */
  46. public Insets getAutoscrollInsets();
  47. /**
  48. * notify the <code>Component</code> to autoscroll
  49. * <P>
  50. * @param cursorLocn A <code>Point</code> indicating the
  51. * location of the cursor that triggered this operation.
  52. */
  53. public void autoscroll(Point cursorLocn);
  54. }