com.sun.jna.examples.dnd

Class GhostedDragImage

public class GhostedDragImage extends Object

Provide a ghosted drag image for use during drags where DragSource#isDragImageSupported returns false.

Its location in screen coordinates may be changed via GhostedDragImage.

When the image is no longer needed, invoke GhostedDragImage, which hides the graphic immediately, or GhostedDragImage, which moves the image to its original location and then disposes it.

Constructor Summary
GhostedDragImage(Component dragSource, Icon icon, Point initialScreenLoc, Point cursorOffset)
Create a ghosted drag image, using the given icon.
Method Summary
voiddispose()
Make all ghosted images go away.
voidmove(Point screenLocation)
Move the ghosted image to the requested location.
voidreturnToOrigin()
Animate the ghosted image returning to its origin.
voidsetAlpha(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: icon image to be drawn initialScreenLoc initial screen location of the image

Method Detail

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.

setAlpha

public void setAlpha(float alpha)
Set the transparency of the ghosted image.
Copyright © 2007-2009 Timothy Wall. All Rights Reserved.