home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / dnd / DragSourceDropEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.8 KB  |  75 lines

  1. /*
  2.  * @(#)DragSourceDropEvent.java    1.4 98/03/18
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt.dnd;
  16.  
  17. import java.awt.dnd.DragSourceEvent;
  18. import java.awt.dnd.DnDConstants;
  19.  
  20. /**
  21.  * <p>
  22.  * The DragSourceDropEvent is delivered from the DragSourceContextPeer,
  23.  * via the DragSourceContext, to its currently registered DragSourceListener.
  24.  * It contains sufficient information for the originator of the operation
  25.  * to provide appropriate feedback to the end user when the operation completes.
  26.  * </p>
  27.  *
  28.  * @version 1.4
  29.  * @since JDK1.2
  30.  *
  31.  */
  32.  
  33. public class DragSourceDropEvent extends DragSourceEvent {
  34.  
  35.     /**
  36.      * construct a DragSourceDropEvent for a drop
  37.      */
  38.  
  39.     public DragSourceDropEvent(DragSourceContext dsc, int action, boolean success) {
  40.     super(dsc);
  41.  
  42.     dropSuccess = success;
  43.     dropAction  = action;
  44.     }
  45.  
  46.     /**
  47.      * construct a DragSourceDropEvent for a drag that does not result in a drop
  48.      */
  49.  
  50.     public DragSourceDropEvent(DragSourceContext dsc) {
  51.     super(dsc);
  52.  
  53.     dropSuccess = false;
  54.     }
  55.  
  56.     /**
  57.      * @return if the drop was successful
  58.      */
  59.  
  60.     public boolean getDropSuccess() { return dropSuccess; }
  61.  
  62.     /**
  63.      * @return the action performed by the target on the subject of the drop
  64.      */
  65.  
  66.     public int getDropAction() { return dropAction; }
  67.  
  68.     /*
  69.      * fields
  70.      */
  71.  
  72.     private boolean dropSuccess;
  73.     private int        dropAction   = DnDConstants.ACTION_NONE;
  74. }
  75.