Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.
java.awt.dnd

Class DragGestureEvent

  • All Implemented Interfaces:
    Serializable

    public class DragGestureEvent
    extends EventObject
    A DragGestureEvent is passed to DragGestureListener's dragGestureRecognized() method when a particular DragGestureRecognizer detects that a platform dependent drag initiating gesture has occurred on the Component that it is tracking. The action field of any DragGestureEvent instance should take one of the following values:
    • DnDConstants.ACTION_COPY
    • DnDConstants.ACTION_MOVE
    • DnDConstants.ACTION_LINK
    Assigning the value different from listed above will cause an unspecified behavior.
    See Also:
    DragGestureRecognizer, DragGestureListener, DragSource, DnDConstants, Serialized Form
    • Constructor Detail

      • DragGestureEvent

        public DragGestureEvent(DragGestureRecognizer dgr,
                        int act,
                        Point ori,
                        List<? extends InputEvent> evs)
        Constructs a DragGestureEvent object given by the DragGestureRecognizer instance firing this event, an act parameter representing the user's preferred action, an ori parameter indicating the origin of the drag, and a List of events that comprise the gesture(evs parameter).

        Parameters:
        dgr - The DragGestureRecognizer firing this event
        act - The user's preferred action. For information on allowable values, see the class description for DragGestureEvent
        ori - The origin of the drag
        evs - The List of events that comprise the gesture

        Throws:
        IllegalArgumentException - if any parameter equals null
        IllegalArgumentException - if the act parameter does not comply with the values given in the class description for DragGestureEvent
        See Also:
        DnDConstants
    • Method Detail

      • getSourceAsDragGestureRecognizer

        public DragGestureRecognizer getSourceAsDragGestureRecognizer()
        Returns the source as a DragGestureRecognizer.

        Returns:
        the source as a DragGestureRecognizer
      • getComponent

        public Component getComponent()
        Returns the Component associated with this DragGestureEvent.

        Returns:
        the Component
      • getDragSource

        public DragSource getDragSource()
        Returns the DragSource.

        Returns:
        the DragSource
      • getDragOrigin

        public Point getDragOrigin()
        Returns a Point in the coordinates of the Component over which the drag originated.

        Returns:
        the Point where the drag originated in Component coords.
      • iterator

        public Iterator<InputEvent> iterator()
        Returns an Iterator for the events comprising the gesture.

        Returns:
        an Iterator for the events comprising the gesture
      • toArray

        public Object[] toArray()
        Returns an Object array of the events comprising the drag gesture.

        Returns:
        an array of the events comprising the gesture
      • toArray

        public Object[] toArray(Object[] array)
        Returns an array of the events comprising the drag gesture.

        Parameters:
        array - the array of EventObject sub(types)

        Returns:
        an array of the events comprising the gesture
      • getDragAction

        public int getDragAction()
        Returns an int representing the action selected by the user.

        Returns:
        the action selected by the user
      • getTriggerEvent

        public InputEvent getTriggerEvent()
        Returns the initial event that triggered the gesture.

        Returns:
        the first "triggering" event in the sequence of the gesture
      • startDrag

        public void startDrag(Cursor dragCursor,
                     Transferable transferable)
                       throws InvalidDnDOperationException
        Starts the drag operation given the Cursor for this drag operation and the Transferable representing the source data for this drag operation.
        If a null Cursor is specified no exception will be thrown and default drag cursors will be used instead.
        If a null Transferable is specified NullPointerException will be thrown.
        Parameters:
        dragCursor - The initial Cursor for this drag operation or null for the default cursor handling; see DragSourceContext for more details on the cursor handling mechanism during drag and drop
        transferable - The Transferable representing the source data for this drag operation.
        Throws:
        InvalidDnDOperationException - if the Drag and Drop system is unable to initiate a drag operation, or if the user attempts to start a drag while an existing drag operation is still executing.
        NullPointerException - if the Transferable is null
        Since:
        1.4
      • startDrag

        public void startDrag(Cursor dragCursor,
                     Transferable transferable,
                     DragSourceListener dsl)
                       throws InvalidDnDOperationException
        Starts the drag given the initial Cursor to display, the Transferable object, and the DragSourceListener to use.

        Parameters:
        dragCursor - The initial Cursor for this drag operation or null for the default cursor handling; see DragSourceContext for more details on the cursor handling mechanism during drag and drop
        transferable - The source's Transferable
        dsl - The source's DragSourceListener

        Throws:
        InvalidDnDOperationException - if the Drag and Drop system is unable to initiate a drag operation, or if the user attempts to start a drag while an existing drag operation is still executing.
      • startDrag

        public void startDrag(Cursor dragCursor,
                     Image dragImage,
                     Point imageOffset,
                     Transferable transferable,
                     DragSourceListener dsl)
                       throws InvalidDnDOperationException
        Start the drag given the initial Cursor to display, a drag Image, the offset of the Image, the Transferable object, and the DragSourceListener to use.

        Parameters:
        dragCursor - The initial Cursor for this drag operation or null for the default cursor handling; see DragSourceContext for more details on the cursor handling mechanism during drag and drop
        dragImage - The source's dragImage
        imageOffset - The dragImage's offset
        transferable - The source's Transferable
        dsl - The source's DragSourceListener

        Throws:
        InvalidDnDOperationException - if the Drag and Drop system is unable to initiate a drag operation, or if the user attempts to start a drag while an existing drag operation is still executing.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-java/awt/dnd/draggestureevent.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.

Inhaltsverzeichnis Haut