01 /*
02 * Copyright 1998-1999 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package java.awt.dnd;
27
28 import java.awt.Insets;
29 import java.awt.Point;
30
31 /**
32 * During DnD operations it is possible that a user may wish to drop the
33 * subject of the operation on a region of a scrollable GUI control that is
34 * not currently visible to the user.
35 * <p>
36 * In such situations it is desirable that the GUI control detect this
37 * and institute a scroll operation in order to make obscured region(s)
38 * visible to the user. This feature is known as autoscrolling.
39 * <p>
40 * If a GUI control is both an active <code>DropTarget</code>
41 * and is also scrollable, it
42 * can receive notifications of autoscrolling gestures by the user from
43 * the DnD system by implementing this interface.
44 * <p>
45 * An autoscrolling gesture is initiated by the user by keeping the drag
46 * cursor motionless with a border region of the <code>Component</code>,
47 * referred to as
48 * the "autoscrolling region", for a predefined period of time, this will
49 * result in repeated scroll requests to the <code>Component</code>
50 * until the drag <code>Cursor</code> resumes its motion.
51 *
52 * @version 1.20, 05/05/07
53 * @since 1.2
54 */
55
56 public interface Autoscroll {
57
58 /**
59 * This method returns the <code>Insets</code> describing
60 * the autoscrolling region or border relative
61 * to the geometry of the implementing Component.
62 * <P>
63 * This value is read once by the <code>DropTarget</code>
64 * upon entry of the drag <code>Cursor</code>
65 * into the associated <code>Component</code>.
66 * <P>
67 * @return the Insets
68 */
69
70 public Insets getAutoscrollInsets();
71
72 /**
73 * notify the <code>Component</code> to autoscroll
74 * <P>
75 * @param cursorLocn A <code>Point</code> indicating the
76 * location of the cursor that triggered this operation.
77 */
78
79 public void autoscroll(Point cursorLocn);
80
81 }
|