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