|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.TransferHandler
edu.northwestern.at.utils.swing.ImageTransferable
public class ImageTransferable
Transferable for image files.
Handles the default file types recognized by Java (.gif, .jpeg, .png). The source and destination fields must be JLabels or subclasses thereof.
| Field Summary |
|---|
| Fields inherited from class javax.swing.TransferHandler |
|---|
COPY, COPY_OR_MOVE, MOVE, NONE |
| Constructor Summary | |
|---|---|
ImageTransferable()
|
|
| Method Summary | |
|---|---|
boolean |
canImport(javax.swing.JComponent component,
java.awt.datatransfer.DataFlavor[] flavor)
Check if component can import image. |
java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent component)
Create image transferable. |
int |
getSourceActions(javax.swing.JComponent c)
Return COPY action for a component. |
boolean |
importData(javax.swing.JComponent component,
java.awt.datatransfer.Transferable transferable)
Import image data from a transferable. |
| Methods inherited from class javax.swing.TransferHandler |
|---|
exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageTransferable()
| Method Detail |
|---|
public int getSourceActions(javax.swing.JComponent c)
getSourceActions in class javax.swing.TransferHandlerc - The component.
public boolean canImport(javax.swing.JComponent component,
java.awt.datatransfer.DataFlavor[] flavor)
canImport in class javax.swing.TransferHandlercomponent - The component to check.flavor - Array of transferable flavors the component accepts.
public java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent component)
createTransferable in class javax.swing.TransferHandlercomponent - The component for which to create the transferable.
public boolean importData(javax.swing.JComponent component,
java.awt.datatransfer.Transferable transferable)
importData in class javax.swing.TransferHandlercomponent - The component to which to import data.transferable - The transferable containing the data to import.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||