|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.TransferHandler com.cosylab.gui.components.util.CosyTransferHandler
public abstract class CosyTransferHandler
CosyTransferHandler
is a common TransferHandler for cosy
displyers.
Nested Class Summary | |
---|---|
static interface |
CosyTransferHandler.MouseFilter
MouseFilter can notify if certain MouseEvent can trigger the
DnD event. |
Nested classes/interfaces inherited from class javax.swing.TransferHandler |
---|
javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport |
Field Summary | |
---|---|
protected boolean |
isDragging
|
Fields inherited from class javax.swing.TransferHandler |
---|
COPY, COPY_OR_MOVE, LINK, MOVE, NONE |
Constructor Summary | |
---|---|
CosyTransferHandler(boolean receiveEnabled,
boolean exportEnabled)
Creates new instance of CosyTransferHandler. |
Method Summary | |
---|---|
void |
addMouseFilter(CosyTransferHandler.MouseFilter f)
Adds a mouse filter to this handler. |
protected boolean |
canDrag(javax.swing.JComponent comp)
Return true if this component can start drag gesture for provided component. |
boolean |
canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] transferFlavors)
|
protected java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent c)
Yop may override this method to implement own transferable or override just methods, which are perscribed by transferable. |
protected void |
exportDone(javax.swing.JComponent source,
java.awt.datatransfer.Transferable data,
int action)
|
CosyTransferHandler.MouseFilter[] |
getMouseFilters()
Returns all mouse filters assigned to this handler |
int |
getSourceActions(javax.swing.JComponent c)
|
abstract java.lang.Object |
getTransferData(java.awt.datatransfer.DataFlavor flavor)
|
abstract java.awt.datatransfer.DataFlavor[] |
getTransferDataFlavors()
|
void |
hookTransferHandler(javax.swing.JComponent comp)
Hooks transfer handler to the given component, using the exising import/export enables flags. |
void |
hookTransferHandler(javax.swing.JComponent comp,
boolean canReceive,
boolean canExport)
Hooks transfer handler to the given component. |
boolean |
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
|
boolean |
isExportEnabled()
Returns true if drag is enabled. |
protected boolean |
isMouseDragGesture(java.awt.event.MouseEvent e)
|
boolean |
isReceiveEnabled()
Returns true if drop is enabled. |
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
static void |
registerTransferHandler(javax.swing.JComponent parent,
javax.swing.TransferHandler newT,
javax.swing.JComponent... comps)
|
void |
removeMouseFilter(CosyTransferHandler.MouseFilter f)
Removes a mouse filter from this handler. |
void |
setExportEnabled(boolean exportEnabled,
javax.swing.JComponent comp)
Enables/disables the drag. |
void |
setReceiveEnabled(boolean receiveEnabled,
javax.swing.JComponent comp)
Enables/disables the drop on the given component |
void |
unhookTransferHandler(javax.swing.JComponent comp)
Unhook transfer handler from the given component. |
Methods inherited from class javax.swing.TransferHandler |
---|
canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData, importData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean isDragging
Constructor Detail |
---|
public CosyTransferHandler(boolean receiveEnabled, boolean exportEnabled)
property
- reciveEnabled
- exportEnabled
- Method Detail |
---|
public static final void registerTransferHandler(javax.swing.JComponent parent, javax.swing.TransferHandler newT, javax.swing.JComponent... comps)
public void hookTransferHandler(javax.swing.JComponent comp)
comp
- public void unhookTransferHandler(javax.swing.JComponent comp)
comp
- public void hookTransferHandler(javax.swing.JComponent comp, boolean canReceive, boolean canExport)
comp
- component to hookcanReceive
- true if drop should be enabledcanExport
- true if drag should be enabledprotected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
createTransferable
in class javax.swing.TransferHandler
public abstract java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
getTransferData
in interface java.awt.datatransfer.Transferable
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
isDataFlavorSupported
in interface java.awt.datatransfer.Transferable
public abstract java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface java.awt.datatransfer.Transferable
public boolean canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] transferFlavors)
canImport
in class javax.swing.TransferHandler
public int getSourceActions(javax.swing.JComponent c)
getSourceActions
in class javax.swing.TransferHandler
protected boolean isMouseDragGesture(java.awt.event.MouseEvent e)
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
protected void exportDone(javax.swing.JComponent source, java.awt.datatransfer.Transferable data, int action)
exportDone
in class javax.swing.TransferHandler
protected boolean canDrag(javax.swing.JComponent comp)
comp
-
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public boolean isExportEnabled()
public boolean isReceiveEnabled()
public void setExportEnabled(boolean exportEnabled, javax.swing.JComponent comp)
exportEnabled
- true if drag is enabledcomp
- component on which the drag should be enabled/disabledpublic void setReceiveEnabled(boolean receiveEnabled, javax.swing.JComponent comp)
reciveEnabled
- true if drop should be enabledcomp
- component on which the drop should be enabled/disabledpublic void addMouseFilter(CosyTransferHandler.MouseFilter f)
f
- public void removeMouseFilter(CosyTransferHandler.MouseFilter f)
f
- public CosyTransferHandler.MouseFilter[] getMouseFilters()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |