API java : DropTargetContext


java.awt.dnd
Class DropTargetContext

java.lang.Object
  extended by java.awt.dnd.DropTargetContext
All Implemented Interfaces:
Serializable

public class DropTargetContext
extends Object
implements Serializable

A DropTargetContext is created whenever the logical cursor associated with a Drag and Drop operation coincides with the visible geometry of a Component associated with a DropTarget. The DropTargetContext provides the mechanism for a potential receiver of a drop operation to both provide the end user with the appropriate drag under feedback, but also to effect the subsequent data transfer if appropriate.

Since:
1.2
See Also:
Serialized Form

Nested Class Summary
protected  class DropTargetContext.TransferableProxy
          TransferableProxy is a helper inner class that implements Transferable interface and serves as a proxy for another Transferable object which represents data transfer for a particular drag-n-drop operation.
 
Method Summary
protected  void acceptDrag(int dragOperation)
          accept the Drag.
protected  void acceptDrop(int dropOperation)
          called to signal that the drop is acceptable using the specified operation.
 void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
          Called when associated with the DropTargetContextPeer.
protected  Transferable createTransferableProxy(Transferable t, boolean local)
          Creates a TransferableProxy to proxy for the specified Transferable.
 void dropComplete(boolean success)
          This method signals that the drop is completed and if it was successful or not.
 Component getComponent()
          This method returns the Component associated with this DropTargetContext.
protected  DataFlavor[] getCurrentDataFlavors()
          get the available DataFlavors of the Transferable operand of this operation.
protected  List<DataFlavor> getCurrentDataFlavorsAsList()
          This method returns a the currently available DataFlavors of the Transferable operand as a java.util.List.
 DropTarget getDropTarget()
          This method returns the DropTarget associated with this DropTargetContext.
protected  int getTargetActions()
          This method returns an int representing the current actions this DropTarget will accept.
protected  Transferable getTransferable()
          get the Transferable (proxy) operand of this operation
protected  boolean isDataFlavorSupported(DataFlavor df)
          This method returns a boolean indicating if the given DataFlavor is supported by this DropTargetContext.
protected  void rejectDrag()
          reject the Drag.
protected  void rejectDrop()
          called to signal that the drop is unacceptable.
 void removeNotify()
          Called when disassociated with the DropTargetContextPeer.
protected  void setTargetActions(int actions)
          This method sets the current actions acceptable to this DropTarget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDropTarget

public DropTarget getDropTarget()
This method returns the DropTarget associated with this DropTargetContext.

Returns:
the DropTarget associated with this DropTargetContext

getComponent

public Component getComponent()
This method returns the Component associated with this DropTargetContext.

Returns:
the Component associated with this Context

addNotify

public void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
Called when associated with the DropTargetContextPeer.

Parameters:
dtcp - the DropTargetContextPeer

removeNotify

public void removeNotify()
Called when disassociated with the DropTargetContextPeer.


setTargetActions

protected void setTargetActions(int actions)
This method sets the current actions acceptable to this DropTarget.

Parameters:
actions - an int representing the supported action(s)

getTargetActions

protected int getTargetActions()
This method returns an int representing the current actions this DropTarget will accept.

Returns:
the current actions acceptable to this DropTarget

dropComplete

public void dropComplete(boolean success)
                  throws InvalidDnDOperationException
This method signals that the drop is completed and if it was successful or not.

Parameters:
success - true for success, false if not

Throws:
InvalidDnDOperationException - if a drop is not outstanding/extant

acceptDrag

protected void acceptDrag(int dragOperation)
accept the Drag.

Parameters:
dragOperation - the supported action(s)

rejectDrag

protected void rejectDrag()
reject the Drag.


acceptDrop

protected void acceptDrop(int dropOperation)
called to signal that the drop is acceptable using the specified operation. must be called during DropTargetListener.drop method invocation.

Parameters:
dropOperation - the supported action(s)

rejectDrop

protected void rejectDrop()
called to signal that the drop is unacceptable. must be called during DropTargetListener.drop method invocation.


getCurrentDataFlavors

protected DataFlavor[] getCurrentDataFlavors()
get the available DataFlavors of the Transferable operand of this operation.

Returns:
a DataFlavor[] containing the supported DataFlavors of the Transferable operand.

getCurrentDataFlavorsAsList

protected List<DataFlavor> getCurrentDataFlavorsAsList()
This method returns a the currently available DataFlavors of the Transferable operand as a java.util.List.

Returns:
the currently available DataFlavors as a java.util.List

isDataFlavorSupported

protected boolean isDataFlavorSupported(DataFlavor df)
This method returns a boolean indicating if the given DataFlavor is supported by this DropTargetContext.

Parameters:
df - the DataFlavor

Returns:
if the DataFlavor specified is supported

getTransferable

protected Transferable getTransferable()
                                throws InvalidDnDOperationException
get the Transferable (proxy) operand of this operation

Returns:
the Transferable
Throws:
InvalidDnDOperationException - if a drag is not outstanding/extant


createTransferableProxy

protected Transferable createTransferableProxy(Transferable t,
                                               boolean local)
Creates a TransferableProxy to proxy for the specified Transferable.

Parameters:
t - the Transferable to be proxied
local - true if t represents the result of a local drag-n-drop operation.
Returns:
the new TransferableProxy instance.

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

7 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-1879
Document créé le 30/08/06 23:53, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/awt/dnd/DropTargetContext.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
0,97 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Le vrai danger, ce n'est pas quand les ordinateurs penseront comme les hommes, c'est quand les hommes penseront comme les ordinateurs.

Sydney J. Harris
 
l'infobrol
Nous sommes le Vendredi 01 Juin 2012, 12:01, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)