|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DnDComponent
To use drag'n drop on FormSheet the component has to implement this interface and needs
to register itself via FormSheet.registerDnDComponent(DnDComponent)
| Method Summary | |
|---|---|
boolean |
acceptDropPartner(java.awt.Component c)
true, if the component accepts this component a drop target. |
boolean |
allowDrag(java.awt.Point point)
if true, drag is allowed at this point |
boolean |
allowDrop(java.lang.Object item,
int count)
if true, drop is allowed for this component |
void |
finishDragOperation(java.lang.Object item,
int count,
java.awt.Component receiver)
finish the drag'n drop operation |
java.awt.Component |
getBoundingComponent()
get component which defines the range of this component. e.g. a JScrollPane |
DnDMotionComponent |
getDnDMotionComponent(java.lang.Object item,
int count)
get the component which is displayed during drag'n drop operation on FormSheet.getDragLayer() |
java.lang.Object |
getDragItem(java.awt.Point point)
get the item at this point, what will be transfered. |
int |
getDragItemIndex(java.awt.Point point)
index of item at this point. |
java.awt.Component |
getDragSourceComponent()
Component which contains the drag items |
boolean |
getMoreDragItems(java.awt.Point point,
java.lang.Object item,
int count,
int additionalCount)
user requests more items. |
void |
paintHightlightEffect(java.awt.Graphics2D g,
java.awt.Rectangle bounds,
java.awt.Component cmp)
paint drag'n drop highlight effect. drawing takes place on some layer above the standard layer, so the effect can be drawn beyond components bounds |
void |
startDragOperation(java.awt.Point p)
start a drag operation at this point. |
void |
takeDragItem(java.lang.Object item,
int count)
component should take the transferred item with given count |
| Method Detail |
|---|
boolean allowDrop(java.lang.Object item,
int count)
item - item that requests to be droppedcount - number of this items
boolean allowDrag(java.awt.Point point)
point - mouse point in this components coordinate system
void startDragOperation(java.awt.Point p)
allowDrag(Point) is called before and returned true
p - mouse point in this components coordinate system
void finishDragOperation(java.lang.Object item,
int count,
java.awt.Component receiver)
item - item that has been draggedcount - number of this itemsreceiver - component which will receive this itemsjava.lang.Object getDragItem(java.awt.Point point)
point - mouse point in this components coordinate system
int getDragItemIndex(java.awt.Point point)
point - mouse point in this components coordinate system
boolean getMoreDragItems(java.awt.Point point,
java.lang.Object item,
int count,
int additionalCount)
point - mouse point in this components coordinate systemitem - currently transferred itemcount - current number of itemsadditionalCount - requested number of items
boolean acceptDropPartner(java.awt.Component c)
c - component
DnDMotionComponent getDnDMotionComponent(java.lang.Object item,
int count)
FormSheet.getDragLayer()
item - item that is transferredcount - number of transferred items
void takeDragItem(java.lang.Object item,
int count)
item - transferred itemcount - transferred item countjava.awt.Component getBoundingComponent()
JScrollPane
java.awt.Component getDragSourceComponent()
void paintHightlightEffect(java.awt.Graphics2D g,
java.awt.Rectangle bounds,
java.awt.Component cmp)
g - Graphics context which is NOT in components coordinate systembounds - bounds of highlight componentcmp - highlight component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||