Public Member Functions | |
| FileDrop (final PrintStream out, final Component c, final Border dragBorder, final boolean recursive, final Listener listener) | |
| Full constructor with a specified border and debugging optionally turned on. | |
| FileDrop (final PrintStream out, final Component c, final Border dragBorder, final Listener listener) | |
| Constructor with a specified border and debugging optionally turned on. | |
| FileDrop (final Component c, final Border dragBorder, final boolean recursive, final Listener listener) | |
| Constructor with a specified border and the option to recursively set drop targets. | |
| FileDrop (final Component c, final Border dragBorder, final Listener listener) | |
| Constructor with a specified border. | |
| FileDrop (final PrintStream out, final Component c, final boolean recursive, final Listener listener) | |
| Constructor with a default border, debugging optionally turned on and the option to recursively set drop targets. | |
| FileDrop (final PrintStream out, final Component c, final Listener listener) | |
| Constructor with a default border and debugging optionally turned on. | |
| FileDrop (final Component c, final boolean recursive, final Listener listener) | |
| Constructor with a default border and the option to recursively set drop targets. | |
| FileDrop (final Component c, final Listener listener) | |
| Constructs a FileDropwith a default light-blue border and, if c is a Container, recursively sets all elements contained within as drop targets, though only the top level container will change borders. | |
Static Public Member Functions | |
| boolean | remove (PrintStream out, Component c, boolean recursive) |
| Removes the drag-and-drop hooks from the component and optionally from the all children. | |
| boolean | remove (Component c) |
| Removes the drag-and-drop hooks from the component and optionally from the all children. | |
Private Member Functions | |
| boolean | isDragOk (final PrintStream out, final DropTargetDragEvent evt) |
| Determine if the dragged data is a file list. | |
| void | makeDropTarget (final PrintStream out, final Component c, boolean recursive) |
Static Private Member Functions | |
| void | log (PrintStream out, String message) |
Outputs message to out if it's not null. | |
| boolean | supportsDnD () |
Private Attributes | |
| transient DropTargetListener | dropListener |
| transient Border | normalBorder |
Static Private Attributes | |
| Color | defaultBorderColor = new Color (0f, 0f, 1f, 0.25f) |
| Boolean | supportsDnD |
| Discover if the running JVM is modern enough to have drag and drop. | |
Any Component can be dropped onto, but only JComponent s will indicate the drop event with a changed border. <p/>To use this class, construct a new FileDrop by passing it the target component and a Listener to receive notification when file(s) have been dropped. Here is an example: <p/>
<p/>You can specify the border that will appear when files are being dragged by calling the constructor with a Border. Only JComponent s will show any indication with a border. <p/>You can turn on some debugging features by passing a PrintStream object (such as System.out) into the full constructor. A null value will result in no extra debugging information being output. <p/>
I'm releasing this code into the Public Domain. Enjoy.
Original author: Robert Harder, rharder@usa.net
Definition at line 66 of file FileDrop.java.
|
||||||||||||
|
Constructs a FileDropwith a default light-blue border and, if c is a Container, recursively sets all elements contained within as drop targets, though only the top level container will change borders.
Definition at line 89 of file FileDrop.java. References defaultBorderColor. |
|
||||||||||||||||
|
Constructor with a default border and the option to recursively set drop targets.
If your component is a
Definition at line 113 of file FileDrop.java. References defaultBorderColor. |
|
||||||||||||||||
|
Constructor with a default border and debugging optionally turned on.
With Debugging turned on, more status messages will be displayed to
Definition at line 140 of file FileDrop.java. References defaultBorderColor. |
|
||||||||||||||||||||
|
Constructor with a default border, debugging optionally turned on and the option to recursively set drop targets.
If your component is a
Definition at line 172 of file FileDrop.java. References defaultBorderColor. |
|
||||||||||||||||
|
Constructor with a specified border.
Definition at line 194 of file FileDrop.java. |
|
||||||||||||||||||||
|
Constructor with a specified border and the option to recursively set drop targets.
If your component is a
Definition at line 219 of file FileDrop.java. |
|
||||||||||||||||||||
|
Constructor with a specified border and debugging optionally turned on.
With Debugging turned on, more status messages will be displayed to
Definition at line 241 of file FileDrop.java. |
|
||||||||||||||||||||||||
|
Full constructor with a specified border and debugging optionally turned on.
With Debugging turned on, more status messages will be displayed to
Definition at line 269 of file FileDrop.java. References dropListener, isDragOk(), log(), makeDropTarget(), normalBorder, and supportsDnD(). |
|
||||||||||||
|
Determine if the dragged data is a file list.
Definition at line 459 of file FileDrop.java. Referenced by FileDrop(). |
|
||||||||||||
|
Outputs
Definition at line 486 of file FileDrop.java. Referenced by FileDrop(). |
|
||||||||||||||||
|
Definition at line 415 of file FileDrop.java. References dropListener. Referenced by FileDrop(). |
|
||||||||||||||||
|
Removes the drag-and-drop hooks from the component and optionally from the all children. You should call this if you add and remove components after you've set up the drag-and-drop.
Definition at line 521 of file FileDrop.java. |
|
|
Removes the drag-and-drop hooks from the component and optionally from the all children. You should call this if you add and remove components after you've set up the drag-and-drop. This will recursively unregister all components contained within c if c is a Container.
Definition at line 503 of file FileDrop.java. |
|
|
Definition at line 400 of file FileDrop.java. Referenced by FileDrop(). |
|
|
Definition at line 75 of file FileDrop.java. Referenced by FileDrop(). |
|
|
Definition at line 69 of file FileDrop.java. Referenced by FileDrop(), and makeDropTarget(). |
|
|
Definition at line 67 of file FileDrop.java. Referenced by FileDrop(). |
|
|
Discover if the running JVM is modern enough to have drag and drop.
Definition at line 72 of file FileDrop.java. |
1.3.6