KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > dnd > Autoscroll


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
8 package java.awt.dnd;
9
10 import java.awt.Insets JavaDoc;
11 import java.awt.Point JavaDoc;
12
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.13, 12/19/03
35  * @since 1.2
36  */

37
38 public interface Autoscroll {
39
40     /**
41      * This method returns the <code>Insets</code> describing
42      * the autoscrolling region or border relative
43      * to the geometry of the implementing Component.
44      * <P>
45      * This value is read once by the <code>DropTarget</code>
46      * upon entry of the drag <code>Cursor</code>
47      * into the associated <code>Component</code>.
48      * <P>
49      * @return the Insets
50      */

51
52     public Insets JavaDoc getAutoscrollInsets();
53
54     /**
55      * notify the <code>Component</code> to autoscroll
56      * <P>
57      * @param cursorLocn A <code>Point</code> indicating the
58      * location of the cursor that triggered this operation.
59      */

60
61     public void autoscroll(Point JavaDoc cursorLocn);
62
63 }
64
Popular Tags