|
Sweet Home 3D 4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.TransferHandler
com.eteks.sweethome3d.swing.LocatedTransferHandler
public abstract class LocatedTransferHandler
Transfer handler that stores the dropped location of mouse pointer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.TransferHandler |
---|
TransferHandler.DropLocation, TransferHandler.TransferSupport |
Field Summary |
---|
Fields inherited from class javax.swing.TransferHandler |
---|
COPY, COPY_OR_MOVE, LINK, MOVE, NONE |
Constructor Summary | |
---|---|
LocatedTransferHandler()
|
Method Summary | |
---|---|
boolean |
canImport(JComponent destination,
DataFlavor[] flavors)
Adds a listener to the drop target of destination that
will keep track of the current drop location and returns the value returned
by canImportFlavor method. |
protected abstract boolean |
canImportFlavor(DataFlavor[] flavors)
Returns true if flavors contains a flavor that
can be imported by this transfer handler. |
protected void |
dragEntered(JComponent destination,
Transferable transferable,
int dragAction)
Called once transferable data entered in destination component
during a drag and drop operation. |
protected void |
dragExited(JComponent destination)
Called once the cursor left destination component during a drag and drop operation. |
protected void |
dragMoved(JComponent destination,
Transferable transferable,
int dragAction)
Called when transferable data moved in destination component
during a drag and drop operation. |
protected Point |
getDropLocation()
Returns the location where mouse pointer was dropped in screen coordinates. |
protected List<String> |
getModelContents(List<File> files,
ContentManager contentManager)
Returns the model contents among files. |
protected boolean |
isDrop()
Returns true if current operation is a drag and drop. |
Methods inherited from class javax.swing.TransferHandler |
---|
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData, importData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocatedTransferHandler()
Method Detail |
---|
public final boolean canImport(JComponent destination, DataFlavor[] flavors)
destination
that
will keep track of the current drop location and returns the value returned
by canImportFlavor
method.
Once drop is finished the listener will be removed.
canImport
in class TransferHandler
protected void dragEntered(JComponent destination, Transferable transferable, int dragAction)
transferable
data entered in destination
component
during a drag and drop operation. Subclasses should override this method if they are
interested by this event.
dragAction
- the current drag action (TransferHandler.COPY
, TransferHandler.MOVE
or TransferHandler.LINK
)protected void dragMoved(JComponent destination, Transferable transferable, int dragAction)
transferable
data moved in destination
component
during a drag and drop operation. Subclasses should override this method if they are
interested by this event.
dragAction
- the current drag action (TransferHandler.COPY
, TransferHandler.MOVE
or TransferHandler.LINK
)protected void dragExited(JComponent destination)
destination
component during a drag and drop operation.
Subclasses should override this method if they are interested by this event.
protected abstract boolean canImportFlavor(DataFlavor[] flavors)
true
if flavors
contains a flavor that
can be imported by this transfer handler. Subclasses should override this
method to return which flavors it supports.
protected Point getDropLocation()
IllegalStateException
- if current operation isn't a drag and drop.protected boolean isDrop()
true
if current operation is a drag and drop.
protected List<String> getModelContents(List<File> files, ContentManager contentManager)
|
Sweet Home 3D 4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() |
© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License |