Class JDPDragItem

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----JDPDragItem

public class JDPDragItem
extends Panel
Class JDPDragItem represents a class to handle drag and drop of components and/or graphic rectangles such as those drawn in a JDPTreePicker component.


Constructor Index

 o JDPDragItem(JDPUser, Panel)
Creates a drag and drop handler.

Method Index

 o addDragComponent(Component, Panel, Object)
Add a component to the list of those being tracked for drag events.
 o addDragRectangle(Rectangle, Image, Panel, Object)
Add a rectangle to the list of those being tracked for drag events.
 o addDragRectangle(Rectangle, Image, Panel, Object, JDPTreeBranch)
Add a rectangle to the list of those being tracked for drag events.
 o addDropComponent(Component, Container, Object, String)
Add a component to the list of those being tracked for drop events.
 o addDropComponent(Component, Panel, Object, String)
Add a component to the list of those being tracked for drop events.
 o addDropRectangle(Rectangle, Panel, Object, String)
Add a Rectangle to the list of those being tracked for drop events.
 o addDropRectangle(Rectangle, Panel, Object, String, JDPTreeBranch)
Add a Rectangle to the list of those being tracked for drop events.
 o getDraggedBranch(JDPTreePicker)
Get the branches down to the one that was just dragged and dropped.
 o getDraggedComponent()
Get the component that was just dragged and dropped.
 o getDragRectangle()
Get the rectangle that was just dragged and dropped.
 o getDroppedBranch(JDPTreePicker)
Get the branches down to the one that was just dropped on.
 o getDroppedComponent()
Get the component that was just dropped on.
 o getDropRectangle()
Get the rectangle that was just dropped on.
 o handleEvent(Event)
 o layout()
 o paint(Graphics)
 o removeAllComponents()
Remove all the components and rectangles that are currently being tracked for drag and drop events.
 o removeAllComponents(Component)
Remove all the components and rectangles that are currently being tracked for drag and drop events that have the specific parent component.
 o removeComponent(Component)
Remove a component that is currently being tracked for drag and drop events.
 o removeDropComponents(Component)
Remove all the components and rectangles that are currently being tracked for drop events only and that have the specific parent component.
 o setTarget(Panel)
Set the main parent panel that this one is added to.
 o update(Graphics)

Constructors

 o JDPDragItem
 public JDPDragItem(JDPUser user,
                    Panel targetPanel)
Creates a drag and drop handler. On one is required per main panel. This instance should be created first and added to the parent panel before any other component is added.

Parameters:
JDPUser - the global user parameter used to pass handles in JDP.
the - main panel that is one will be added to.

Methods

 o setTarget
 public void setTarget(Panel targetPanel)
Set the main parent panel that this one is added to.

Parameters:
the - main panel that is one will be added to.
 o removeAllComponents
 public void removeAllComponents()
Remove all the components and rectangles that are currently being tracked for drag and drop events.

 o removeAllComponents
 public void removeAllComponents(Component parent)
Remove all the components and rectangles that are currently being tracked for drag and drop events that have the specific parent component.

Parameters:
parent - the parent component of the one being tracked.
 o removeDropComponents
 public void removeDropComponents(Component parent)
Remove all the components and rectangles that are currently being tracked for drop events only and that have the specific parent component.

Parameters:
parent - the parent component of the one being tracked.
 o addDragComponent
 public void addDragComponent(Component thisComponent,
                              Panel parent,
                              Object dropKey)
Add a component to the list of those being tracked for drag events.

Parameters:
dragComponent - the component to be tracked.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
 o addDropComponent
 public void addDropComponent(Component thisComponent,
                              Container parent,
                              Object dropKey,
                              String dropMessage)
Add a component to the list of those being tracked for drop events.

Parameters:
dropComponent - the component to be tracked.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
dropMessage - the message to display in the status bas when a drop component is dragged over this drop component.
 o addDropComponent
 public void addDropComponent(Component thisComponent,
                              Panel parent,
                              Object dropKey,
                              String dropMessage)
Add a component to the list of those being tracked for drop events.

Parameters:
dropComponent - the component to be tracked.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
dropMessage - the message to display in the status bas when a drop component is dragged over this drop component.
 o addDragRectangle
 public void addDragRectangle(Rectangle thisRectangle,
                              Image dragFromImage,
                              Panel parent,
                              Object dropKey)
Add a rectangle to the list of those being tracked for drag events.

Parameters:
dragRectangle - the rectangle to be tracked.
dragFromImage - the handle to the complete Image that this rectangle comes from.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
 o addDragRectangle
 public void addDragRectangle(Rectangle thisRectangle,
                              Image dragFromImage,
                              Panel parent,
                              Object dropKey,
                              JDPTreeBranch thisBranch)
Add a rectangle to the list of those being tracked for drag events.

Parameters:
dragRectangle - the rectangle to be tracked.
dragFromImage - the handle to the complete Image that this rectangle comes from.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
thisBranch - the tree branch for this Rectangle.
 o addDropRectangle
 public void addDropRectangle(Rectangle thisRectangle,
                              Panel parent,
                              Object dropKey,
                              String dropMessage)
Add a Rectangle to the list of those being tracked for drop events.

Parameters:
dropRectangle - the rectangle to be tracked.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
dropMessage - the message to display in the status bas when a drop component is dragged over this drop component.
 o addDropRectangle
 public void addDropRectangle(Rectangle thisRectangle,
                              Panel parent,
                              Object dropKey,
                              String dropMessage,
                              JDPTreeBranch thisBranch)
Add a Rectangle to the list of those being tracked for drop events.

Parameters:
dropRectangle - the rectangle to be tracked.
parent - the parent component of the one to be tracked.
dropKey - the key object which specifies which objects this one can be dropped on.
dropMessage - the message to display in the status bas when a drop component is dragged over this drop component.
thisBranch - the tree branch for this Rectangle.
 o removeComponent
 public void removeComponent(Component thisComponent)
Remove a component that is currently being tracked for drag and drop events.

Parameters:
component - the component to be removed from being tracked.
 o getDragRectangle
 public Rectangle getDragRectangle()
Get the rectangle that was just dragged and dropped.

Returns:
rectangle that was just dragged. Returns null if a component was dragged.
 o getDropRectangle
 public Rectangle getDropRectangle()
Get the rectangle that was just dropped on.

Returns:
rectangle that was just dropped on. Returns null if a component was dropped on.
 o getDraggedComponent
 public Component getDraggedComponent()
Get the component that was just dragged and dropped.

Returns:
the component that was just dragged. Returns null if a component was not dragged.
 o getDroppedComponent
 public Component getDroppedComponent()
Get the component that was just dropped on.

Returns:
the component that was just dropped on. Returns null if a component was not dropped on.
 o getDraggedBranch
 public JDPTreeBranch[] getDraggedBranch(JDPTreePicker thisTree)
Get the branches down to the one that was just dragged and dropped.

Returns:
array of branches to the one just dragged. Returns null if not dragged from specified tree.
 o getDroppedBranch
 public JDPTreeBranch[] getDroppedBranch(JDPTreePicker thisTree)
Get the branches down to the one that was just dropped on.

Returns:
array of branches to the one just dropped on. Returns null if not dropped on specified tree.
 o layout
 public void layout()
Overrides:
layout in class Container
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Container
 o update
 public void update(Graphics g)
Overrides:
update in class Component
 o handleEvent
 public boolean handleEvent(Event evt)
Overrides:
handleEvent in class Component