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 / DragSourceDragEvent.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.2 KB  |  96 lines

  1. /*
  2.  * @(#)DragSourceDragEvent.java    1.3 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.  
  19. /**
  20.  * <p>
  21.  * The DragSourceDragEvent is delivered from the DragSourceContextPeer,
  22.  * via the DragSourceContext, to the currently registered DragSourceListener.
  23.  * It contains state regarding the current state of the operation to enable
  24.  * the operations initiator to provide the end user with the appropriate
  25.  * drag over feedback.
  26.  * </p>
  27.  *
  28.  * @version 1.3
  29.  * @since JDK1.2
  30.  *
  31.  */
  32.  
  33. public class DragSourceDragEvent extends DragSourceEvent {
  34.  
  35.     /**
  36.      * construct a DragSourceEvent
  37.      */
  38.  
  39.     public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int actions, int modifiers) {
  40.     super(dsc);
  41.     
  42.     targetActions    = actions;
  43.     gestureModifiers = modifiers;
  44.     this.dropAction  = dropAction;
  45.     }
  46.  
  47.     /**
  48.      * construct a DragSourceEvent
  49.      */
  50.  
  51.     public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int actions, int modifiers, boolean isLocal) {
  52.     this(dsc, dropAction, actions, modifiers);
  53.     
  54.     isLocalDT = isLocal;
  55.     }
  56.  
  57.     /**
  58.      * @return the DragSourceContext that sourced this event
  59.      */
  60.  
  61.     public int getTargetActions() {
  62.     return targetActions;
  63.     }
  64.  
  65.     /**
  66.      * @return the current device modifiers
  67.      */
  68.  
  69.     public int getGestureModifiers() {
  70.     return gestureModifiers;
  71.     }
  72.  
  73.     /**
  74.      * @return if the current Target is in the same JVM or not.
  75.      */
  76.  
  77.     public boolean isLocalDropTarget() {
  78.     return isLocalDT;
  79.     }
  80.  
  81.     /**
  82.      * @return the currently selected drop action
  83.      */
  84.  
  85.     public int getDropAction() { return dropAction; }
  86.  
  87.     /*
  88.      * fields
  89.      */
  90.  
  91.     private int        targetActions    = DnDConstants.ACTION_NONE;
  92.     private int        dropAction       = DnDConstants.ACTION_NONE;
  93.     private int        gestureModifiers = 0;
  94.     private boolean isLocalDT         = false;
  95. }
  96.