/// <summary> /// Constructs a <code>DragSourceDragEvent</code> given the specified /// <code>DragSourceContext</code>, user drop action, target drop action, /// modifiers and coordinates. /// <para> /// The arguments <code>dropAction</code> and <code>action</code> should /// be one of <code>DnDConstants</code> that represents a single action. /// The argument <code>modifiers</code> should be either a bitwise mask /// of old <code>java.awt.event.InputEvent.*_MASK</code> constants or a /// bitwise mask of extended <code>java.awt.event.InputEvent.*_DOWN_MASK</code> /// constants. /// This constructor does not throw any exception for invalid <code>dropAction</code>, /// <code>action</code> and <code>modifiers</code>. /// /// </para> /// </summary> /// <param name="dsc"> the <code>DragSourceContext</code> associated with this /// event. </param> /// <param name="dropAction"> the user drop action. </param> /// <param name="action"> the target drop action. </param> /// <param name="modifiers"> the modifier keys down during event (shift, ctrl, /// alt, meta) /// Either extended _DOWN_MASK or old _MASK modifiers /// should be used, but both models should not be mixed /// in one event. Use of the extended modifiers is /// preferred. </param> /// <param name="x"> the horizontal coordinate for the cursor location </param> /// <param name="y"> the vertical coordinate for the cursor location /// </param> /// <exception cref="IllegalArgumentException"> if <code>dsc</code> is <code>null</code>. /// </exception> /// <seealso cref= java.awt.event.InputEvent /// @since 1.4 </seealso> public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers, int x, int y) : base(dsc, x, y) { TargetActions_Renamed = action; GestureModifiers_Renamed = modifiers; this.DropAction_Renamed = dropAction; if ((modifiers & ~(JDK_1_3_MODIFIERS | JDK_1_4_MODIFIERS)) != 0) { InvalidModifiers = true; } else if ((GestureModifiers != 0) && (GestureModifiersEx == 0)) { SetNewModifiers(); } else if ((GestureModifiers == 0) && (GestureModifiersEx != 0)) { SetOldModifiers(); } else { InvalidModifiers = true; } }
/// <summary> /// Construct a <code>DragSourceDropEvent</code> for a drop, given the /// <code>DragSourceContext</code>, the drop action, a <code>boolean</code> /// indicating if the drop was successful, and coordinates. /// <para> /// The argument <code>action</code> should be one of <code>DnDConstants</code> /// that represents a single action. /// This constructor does not throw any exception for invalid <code>action</code>. /// /// </para> /// </summary> /// <param name="dsc"> the <code>DragSourceContext</code> /// associated with this <code>DragSourceDropEvent</code> </param> /// <param name="action"> the drop action </param> /// <param name="success"> a boolean indicating if the drop was successful </param> /// <param name="x"> the horizontal coordinate for the cursor location </param> /// <param name="y"> the vertical coordinate for the cursor location /// </param> /// <exception cref="IllegalArgumentException"> if <code>dsc</code> is <code>null</code>. /// /// @since 1.4 </exception> public DragSourceDropEvent(DragSourceContext dsc, int action, bool success, int x, int y) : base(dsc, x, y) { DropSuccess_Renamed = success; DropAction_Renamed = action; }
/// <summary> /// Construct a <code>DragSourceEvent</code> given a specified /// <code>DragSourceContext</code>, and coordinates of the cursor /// location. /// </summary> /// <param name="dsc"> the <code>DragSourceContext</code> </param> /// <param name="x"> the horizontal coordinate for the cursor location </param> /// <param name="y"> the vertical coordinate for the cursor location /// </param> /// <exception cref="IllegalArgumentException"> if <code>dsc</code> is <code>null</code>. /// /// @since 1.4 </exception> public DragSourceEvent(DragSourceContext dsc, int x, int y) : base(dsc) { LocationSpecified = true; this.x = x; this.y = y; }
/// <summary> /// Construct a <code>DragSourceDropEvent</code> /// for a drag that does not result in a drop. /// The coordinates for this <code>DragSourceDropEvent</code> /// are not specified, so <code>getLocation</code> will return /// <code>null</code> for this event. /// </summary> /// <param name="dsc"> the <code>DragSourceContext</code> /// </param> /// <exception cref="IllegalArgumentException"> if <code>dsc</code> is <code>null</code>. /// </exception> /// <seealso cref= DragSourceEvent#getLocation </seealso> public DragSourceDropEvent(DragSourceContext dsc) : base(dsc) { DropSuccess_Renamed = false; }
/// <summary> /// Construct a <code>DragSourceEvent</code> /// given a specified <code>DragSourceContext</code>. /// The coordinates for this <code>DragSourceEvent</code> /// are not specified, so <code>getLocation</code> will return /// <code>null</code> for this event. /// </summary> /// <param name="dsc"> the <code>DragSourceContext</code> /// </param> /// <exception cref="IllegalArgumentException"> if <code>dsc</code> is <code>null</code>. /// </exception> /// <seealso cref= #getLocation </seealso> public DragSourceEvent(DragSourceContext dsc) : base(dsc) { LocationSpecified = false; this.x = 0; this.y = 0; }