com.alee.extended.tab
Class DocumentDragViewHandler<T extends DocumentData>

java.lang.Object
  extended by com.alee.extended.tab.DocumentDragViewHandler<T>
All Implemented Interfaces:
DragViewHandler<T>

public class DocumentDragViewHandler<T extends DocumentData>
extends java.lang.Object
implements DragViewHandler<T>

Custom DragViewHandler for WebDocumentPane document.

Author:
Mikle Garin
See Also:
How to use WebDocumentPane, WebDocumentPane, DragManager

Field Summary
protected  WebDocumentPane documentPane
          Document pane which provides this DragViewHandler.
protected static java.awt.Insets margin
          Document description margin.
 
Constructor Summary
DocumentDragViewHandler(WebDocumentPane documentPane)
          Constructs custom DragViewHandler for DocumentData object.
 
Method Summary
 java.awt.datatransfer.DataFlavor getObjectFlavor()
          Returns object flavor that can be used to retrieve dragged object.
 java.awt.image.BufferedImage getView(T document)
          Returns image object representation.
 java.awt.Point getViewRelativeLocation(T document)
          Returns image object representation location relative to mouse location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

margin

protected static final java.awt.Insets margin
Document description margin.


documentPane

protected final WebDocumentPane documentPane
Document pane which provides this DragViewHandler.

Constructor Detail

DocumentDragViewHandler

public DocumentDragViewHandler(WebDocumentPane documentPane)
Constructs custom DragViewHandler for DocumentData object.

Parameters:
documentPane - document pane which provides this DragViewHandler
Method Detail

getObjectFlavor

public java.awt.datatransfer.DataFlavor getObjectFlavor()
Returns object flavor that can be used to retrieve dragged object.

Specified by:
getObjectFlavor in interface DragViewHandler<T extends DocumentData>
Returns:
object flavor that can be used to retrieve dragged object

getView

public java.awt.image.BufferedImage getView(T document)
Returns image object representation.

Specified by:
getView in interface DragViewHandler<T extends DocumentData>
Parameters:
document - object to create image representation for
Returns:
image object representation

getViewRelativeLocation

public java.awt.Point getViewRelativeLocation(T document)
Returns image object representation location relative to mouse location.

Specified by:
getViewRelativeLocation in interface DragViewHandler<T extends DocumentData>
Parameters:
document - object return image representation location for
Returns:
image object representation location relative to mouse location