Package com.sun.jna.platform.dnd
Class GhostedDragImage
- java.lang.Object
-
- com.sun.jna.platform.dnd.GhostedDragImage
-
public class GhostedDragImage extends Object
Provide a ghosted drag image for use during drags whereDragSource.isDragImageSupported()
returns false.Its location in screen coordinates may be changed via
move(java.awt.Point)
.When the image is no longer needed, invoke
dispose()
, which hides the graphic immediately, orreturnToOrigin()
, which moves the image to its original location and then disposes it.
-
-
Constructor Summary
Constructors Constructor Description GhostedDragImage(Component dragSource, Icon icon, Point initialScreenLoc, Point cursorOffset)
Create a ghosted drag image, using the given icon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Make all ghosted images go away.void
move(Point screenLocation)
Move the ghosted image to the requested location.void
returnToOrigin()
Animate the ghosted image returning to its origin.void
setAlpha(float alpha)
Set the transparency of the ghosted image.
-
-
-
Constructor Detail
-
GhostedDragImage
public GhostedDragImage(Component dragSource, Icon icon, Point initialScreenLoc, Point cursorOffset)
Create a ghosted drag image, using the given icon.- Parameters:
dragSource
- source of the dragicon
- image to be drawninitialScreenLoc
- initial screen location of the imagecursorOffset
- offset of the cursor from the image origin
-
-
Method Detail
-
setAlpha
public void setAlpha(float alpha)
Set the transparency of the ghosted image.- Parameters:
alpha
- transparency level
-
dispose
public void dispose()
Make all ghosted images go away.
-
move
public void move(Point screenLocation)
Move the ghosted image to the requested location.- Parameters:
screenLocation
- Where to draw the image, in screen coordinates
-
returnToOrigin
public void returnToOrigin()
Animate the ghosted image returning to its origin.
-
-