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.
-
JDPDragItem(JDPUser, Panel)
- Creates a drag and drop handler.
-
addDragComponent(Component, Panel, Object)
- Add a component to the list of those being tracked for drag events.
-
addDragRectangle(Rectangle, Image, Panel, Object)
- Add a rectangle to the list of those being tracked for drag events.
-
addDragRectangle(Rectangle, Image, Panel, Object, JDPTreeBranch)
- Add a rectangle to the list of those being tracked for drag events.
-
addDropComponent(Component, Container, Object, String)
- Add a component to the list of those being tracked for drop events.
-
addDropComponent(Component, Panel, Object, String)
- Add a component to the list of those being tracked for drop events.
-
addDropRectangle(Rectangle, Panel, Object, String)
- Add a Rectangle to the list of those being tracked for drop events.
-
addDropRectangle(Rectangle, Panel, Object, String, JDPTreeBranch)
- Add a Rectangle to the list of those being tracked for drop events.
-
getDraggedBranch(JDPTreePicker)
- Get the branches down to the one that was just dragged and dropped.
-
getDraggedComponent()
- Get the component that was just dragged and dropped.
-
getDragRectangle()
- Get the rectangle that was just dragged and dropped.
-
getDroppedBranch(JDPTreePicker)
- Get the branches down to the one that was just dropped on.
-
getDroppedComponent()
- Get the component that was just dropped on.
-
getDropRectangle()
- Get the rectangle that was just dropped on.
-
handleEvent(Event)
-
-
layout()
-
-
paint(Graphics)
-
-
removeAllComponents()
- Remove all the components and rectangles that are currently being tracked
for drag and drop events.
-
removeAllComponents(Component)
- Remove all the components and rectangles that are currently being tracked
for drag and drop events that have the specific parent component.
-
removeComponent(Component)
- Remove a component that is currently being tracked
for drag and drop events.
-
removeDropComponents(Component)
- Remove all the components and rectangles that are currently being tracked
for drop events only and that have the specific parent component.
-
setTarget(Panel)
- Set the main parent panel that this one is added to.
-
update(Graphics)
-
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.
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.
removeAllComponents
public void removeAllComponents()
- Remove all the components and rectangles that are currently being tracked
for drag and drop events.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
layout
public void layout()
- Overrides:
- layout in class Container
paint
public void paint(Graphics g)
- Overrides:
- paint in class Container
update
public void update(Graphics g)
- Overrides:
- update in class Component
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component