Enum DropAction

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DropAction>

    public enum DropAction
    extends java.lang.Enum<DropAction>
    Enumeration defining supported drop actions.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      COPY
      The "copy" action.
      LINK
      The "link" action.
      MOVE
      The "move" action.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DropAction getDropAction​(int nativeDropAction)
      Convert a native drop action to one of these values.
      static DropAction getDropAction​(java.awt.event.InputEvent event)
      Using the same logic as Keyboard.getDropAction(), determinen the appropriate action given the current keyboard modifiers (platform-dependent).
      int getMask()  
      java.awt.Cursor getNativeCursor()  
      int getNativeDropAction()  
      static int getSourceActions​(int supported)
      Get a bitmask of native source actions from a bitmask of our values.
      static int getSupportedDropActions​(int sourceActions)
      Get the bitmask of the supported drop actions from the given native drop actions bitmask.
      boolean isSelected​(int dropActions)
      Given a bitmask of the possible drop actions (from a source), decide if this action (represented by its mask) is selected in the given bitmask.
      static DropAction valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DropAction[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • COPY

        public static final DropAction COPY
        The "copy" action.
      • MOVE

        public static final DropAction MOVE
        The "move" action.
      • LINK

        public static final DropAction LINK
        The "link" action.
    • Method Detail

      • values

        public static DropAction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DropAction c : DropAction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DropAction valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getMask

        public int getMask()
        Returns:
        The bitmask for this value (2 ** ordinal).
      • getNativeDropAction

        public int getNativeDropAction()
        Returns:
        The native drop action for this action.
      • getNativeCursor

        public java.awt.Cursor getNativeCursor()
        Returns:
        The native cursor for this action.
      • isSelected

        public boolean isSelected​(int dropActions)
        Given a bitmask of the possible drop actions (from a source), decide if this action (represented by its mask) is selected in the given bitmask.
        Parameters:
        dropActions - The bitmask of supported drop actions.
        Returns:
        Whether or not this action is in the bitmask.
      • getSourceActions

        public static int getSourceActions​(int supported)
        Get a bitmask of native source actions from a bitmask of our values.
        Parameters:
        supported - The supported actions bitmask.
        Returns:
        The native action bitmask.
      • getDropAction

        public static DropAction getDropAction​(int nativeDropAction)
        Convert a native drop action to one of these values.
        Parameters:
        nativeDropAction - The native value.
        Returns:
        The corresponding one of our values.
      • getSupportedDropActions

        public static int getSupportedDropActions​(int sourceActions)
        Get the bitmask of the supported drop actions from the given native drop actions bitmask.
        Parameters:
        sourceActions - The native supported actions.
        Returns:
        Translated bitmask of our supported actions.
      • getDropAction

        public static DropAction getDropAction​(java.awt.event.InputEvent event)
        Using the same logic as Keyboard.getDropAction(), determinen the appropriate action given the current keyboard modifiers (platform-dependent).
        Parameters:
        event - The current event with all the current state.
        Returns:
        The appropriate one of our values for the event.