JavaTM 2 Platform
Std. Ed. v1.3.1

com.apple.mrj.dnd
Class DragPrivateAccess

java.lang.Object
  |
  +--com.apple.mrj.dnd.DragPrivateAccess

Deprecated. As of MacOSX 10.2, replaced by Java2 DnD.

public class DragPrivateAccess
extends Object

An access-controlled object that exposes unsafe drag-n-drop APIs. Only one caller (typically the AWT peers or other application framework) may instantiate or access the factory. Other clients go through that framework, whose public API should provide safety and security.


Constructor Summary
DragPrivateAccess()
          Deprecated. Creates a DragPrivateAccess.
 
Method Summary
 IncomingDrag createIncomingDrag(int dragRef)
          Deprecated. Creates an IncomingDrag from an existing Mac OS DragRef ID, presumably the ID passed into a DragTrackingHandler callback.
 OutgoingDrag createOutgoingDrag()
          Deprecated. Creates a new OutgoingDrag with no items/flavors.
 OutgoingDrag getCurrentOutgoingDrag()
          Deprecated. Returns the OutgoingDrag currently being tracked, or null if none.
 void getModifiers(Drag drag, short[] outNow, short[] outAtPress, short[] outAtRelease)
          Deprecated. Returns the state of the modifier keys at current moment, at the time the mouse was pressed, and at the time the mouse was released.
 void postTrack(OutgoingDrag drag, short err)
          Deprecated. Restores state after TrackDrag.
 void preTrack(OutgoingDrag drag, Object source)
          Deprecated. Sets up state before TrackDrag.
 void setCurrentDestination(IncomingDrag d, Object destination)
          Deprecated. Should be called from the framework's drag-tracking handler.
 void setIncomingDragRef(int ref)
          Deprecated. Should be called from the framework's drag-tracking handler.
 boolean track(OutgoingDrag drag, Object source, byte[] eventRecord, int rgnHandle)
          Deprecated. Tracks a drag-n-drop operation; returns after the drop is complete, with a boolean value that indicates whether a target accepted the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragPrivateAccess

public DragPrivateAccess()
                  throws SecurityException
Deprecated. 
Creates a DragPrivateAccess. For security reasons, only one DragPrivateAccess can be created, typically at initialization time by the application framework (e.g. the AWT peers.) That way other code cannot perform these dangerous operations.
Method Detail

createIncomingDrag

public IncomingDrag createIncomingDrag(int dragRef)
Deprecated. 
Creates an IncomingDrag from an existing Mac OS DragRef ID, presumably the ID passed into a DragTrackingHandler callback.

This call is unsafe, since an incorrect DragRef passed in will create a bogus object that will crash when called. The only DragRef that should be used is one passed in via a registered Drag Manager tracking or receive handler.


createOutgoingDrag

public OutgoingDrag createOutgoingDrag()
Deprecated. 
Creates a new OutgoingDrag with no items/flavors. This isn't unsafe, but the app framework should control how drags are created, typically allowing them to be created only when a drag gesture occurs.
See Also:
OutgoingDrag#OutgoingDrag, DragGestureEvent#createDrag

track

public boolean track(OutgoingDrag drag,
                     Object source,
                     byte[] eventRecord,
                     int rgnHandle)
Deprecated. 
Tracks a drag-n-drop operation; returns after the drop is complete, with a boolean value that indicates whether a target accepted the data.

preTrack

public void preTrack(OutgoingDrag drag,
                     Object source)
Deprecated. 
Sets up state before TrackDrag. Called internally by track. If clients need to call TrackDrag themselves, they should call this first, but always call postDrag afterwards!

postTrack

public void postTrack(OutgoingDrag drag,
                      short err)
Deprecated. 
Restores state after TrackDrag. Called internally by track. If clients need to call TrackDrag themselves, they should call this afterwards.
Parameters:
err - The OSErr returned from TrackDrag

getModifiers

public void getModifiers(Drag drag,
                         short[] outNow,
                         short[] outAtPress,
                         short[] outAtRelease)
Deprecated. 
Returns the state of the modifier keys at current moment, at the time the mouse was pressed, and at the time the mouse was released. If you don't care about one or more of these times, pass null for the corresponding parameter. Note that these are Mac modifier values, not AWT modifiers.

getCurrentOutgoingDrag

public OutgoingDrag getCurrentOutgoingDrag()
Deprecated. 
Returns the OutgoingDrag currently being tracked, or null if none.

setIncomingDragRef

public void setIncomingDragRef(int ref)
Deprecated. 
Should be called from the framework's drag-tracking handler. At the start of kDragTrackingEnterHandler, pass in the current DragRef. At the end of kDragTrackingLeaveHandler, pass in zero.

setCurrentDestination

public void setCurrentDestination(IncomingDrag d,
                                  Object destination)
Deprecated. 
Should be called from the framework's drag-tracking handler. Pass in the current IncomingDrag being handled, and the current destination GUI object that it's over.

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.