psdi.webclient.applet.wfcanvas.diagram.dnd

Class WorkflowDropTargetContextPeer

  • java.lang.Object
    • psdi.webclient.applet.wfcanvas.diagram.dnd.WorkflowDropTargetContextPeer
  • All Implemented Interfaces:
    java.awt.dnd.peer.DropTargetContextPeer


    public class WorkflowDropTargetContextPeer
    extends java.lang.Object
    implements java.awt.dnd.peer.DropTargetContextPeer
    This class substitutes for the native drag and drop handler which doesn't work with the Java plugin.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected boolean accepted 
      protected int actions 
      protected java.awt.datatransfer.Transferable t 
      protected java.awt.dnd.DropTarget target 
    • Constructor Summary

      Constructors 
      Constructor and Description
      WorkflowDropTargetContextPeer(java.awt.dnd.DropTarget target, java.awt.datatransfer.Transferable t)
      Constructs the WorkflowDropTargetContextPeer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void acceptDrag(int dragAction)
      Called to accept the drag
      void acceptDrop(int dropAction)
      Called to accept the drop
      void dropComplete(boolean success)
      Signal that the drop is complete
      java.awt.dnd.DropTarget getDropTarget()
      Gets the DropTarget associated with this peer
      int getTargetActions()
      Gets the current Target actions
      java.awt.datatransfer.Transferable getTransferable()
      Gets the transferable
      java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
      Gets the (remote) DataFlavors from the peer
      boolean isTransferableJVMLocal()
      Returns whether or not the transferable is in the same JVM as the target.
      void rejectDrag()
      Called to reject the drag
      void rejectDrop()
      Called to reject the drop
      void setTargetActions(int actions)
      Update the peer's notion of the Target's actions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • target

        protected java.awt.dnd.DropTarget target
      • actions

        protected int actions
      • t

        protected java.awt.datatransfer.Transferable t
      • accepted

        protected boolean accepted
    • Constructor Detail

      • WorkflowDropTargetContextPeer

        public WorkflowDropTargetContextPeer(java.awt.dnd.DropTarget target,
                                             java.awt.datatransfer.Transferable t)
        Constructs the WorkflowDropTargetContextPeer
        Parameters:
        target - The current drop target
        t - The transferable
    • Method Detail

      • setTargetActions

        public void setTargetActions(int actions)
        Update the peer's notion of the Target's actions
        Specified by:
        setTargetActions in interface java.awt.dnd.peer.DropTargetContextPeer
        Parameters:
        actions - The target actions
      • getTargetActions

        public int getTargetActions()
        Gets the current Target actions
        Specified by:
        getTargetActions in interface java.awt.dnd.peer.DropTargetContextPeer
        Returns:
        The target actions
      • getDropTarget

        public java.awt.dnd.DropTarget getDropTarget()
        Gets the DropTarget associated with this peer
        Specified by:
        getDropTarget in interface java.awt.dnd.peer.DropTargetContextPeer
        Returns:
        The drop target
      • getTransferDataFlavors

        public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
        Gets the (remote) DataFlavors from the peer
        Specified by:
        getTransferDataFlavors in interface java.awt.dnd.peer.DropTargetContextPeer
        Returns:
        The data flavors
      • getTransferable

        public java.awt.datatransfer.Transferable getTransferable()
                                                           throws java.awt.dnd.InvalidDnDOperationException
        Gets the transferable
        Specified by:
        getTransferable in interface java.awt.dnd.peer.DropTargetContextPeer
        Returns:
        The transferable
        Throws:
        java.awt.dnd.InvalidDnDOperationException
      • isTransferableJVMLocal

        public boolean isTransferableJVMLocal()
        Returns whether or not the transferable is in the same JVM as the target. Always true for this handler
        Specified by:
        isTransferableJVMLocal in interface java.awt.dnd.peer.DropTargetContextPeer
        Returns:
        True if in the same JVM
      • acceptDrag

        public void acceptDrag(int dragAction)
        Called to accept the drag
        Specified by:
        acceptDrag in interface java.awt.dnd.peer.DropTargetContextPeer
      • rejectDrag

        public void rejectDrag()
        Called to reject the drag
        Specified by:
        rejectDrag in interface java.awt.dnd.peer.DropTargetContextPeer
      • acceptDrop

        public void acceptDrop(int dropAction)
        Called to accept the drop
        Specified by:
        acceptDrop in interface java.awt.dnd.peer.DropTargetContextPeer
      • rejectDrop

        public void rejectDrop()
        Called to reject the drop
        Specified by:
        rejectDrop in interface java.awt.dnd.peer.DropTargetContextPeer
      • dropComplete

        public void dropComplete(boolean success)
        Signal that the drop is complete
        Specified by:
        dropComplete in interface java.awt.dnd.peer.DropTargetContextPeer
        Parameters:
        success - True if successful false if not