KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > view > dnd > TopComponentDroppable


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20
21 package org.netbeans.core.windows.view.dnd;
22
23
24 import org.netbeans.core.windows.view.ViewElement;
25 import org.openide.windows.TopComponent;
26
27 import java.awt.*;
28
29
30 /**
31  * Interface which allows container to provide support for dynamic
32  * drop target indication, thus handling possible
33  * drop operations for all its sub components and actually
34  * provides the drop operation to the container.
35  *
36  * @author Peter Zavadsky
37  *
38  * @see DropTargetGlassPane
39  */

40 public interface TopComponentDroppable {
41     /** Gets <code>Shape</code> object needed to used as indicator
42      * of possible drop operation.
43      * @param location within the container's glass pane coordinates */

44     public Shape getIndicationForLocation(Point location);
45
46     /** Gets constraint to be used for specified location
47      * of possible drop operation.
48      * @param location within the container's glass pane coordinates
49      * @return can return <code>null</code> if default constraints should
50      * should be used */

51     public Object JavaDoc getConstraintForLocation(Point location);
52
53     /** Gets actual drop component, i.e. the one which absobs the possible dropped
54      * top component. Used to detect its bounds, for drop indication. */

55     public Component getDropComponent();
56     
57     /** Gets view element into which to perform the drop operation. */
58     public ViewElement getDropViewElement();
59     
60     // XXX
61
/** Checks whether the specified TopComponent can be dropped. */
62     public boolean canDrop(TopComponent transfer, Point location);
63     
64     // XXX
65
/** Checks whether this droppable supports kind of winsys transfer.
66      * Either <code>Constants.MODE_KIND_EDITOR</code> or <code>Constants.MODE_KIND_VIEW or both. */

67     public boolean supportsKind(int kind, TopComponent transfer);
68 }
69
Popular Tags