jdk/src/share/classes/javax/swing/TransferHandler.java
changeset 7959 2e05332a8f5c
parent 5506 202f599c92aa
child 8816 29f983feda95
equal deleted inserted replaced
7793:bcc54a3c2825 7959:2e05332a8f5c
   342          * Calling it when {@code isDrop()} is {@code false} results
   342          * Calling it when {@code isDrop()} is {@code false} results
   343          * in an {@code IllegalStateException}.
   343          * in an {@code IllegalStateException}.
   344          *
   344          *
   345          * @return the drop location
   345          * @return the drop location
   346          * @throws IllegalStateException if this is not a drop
   346          * @throws IllegalStateException if this is not a drop
   347          * @see #isDrop
   347          * @see #isDrop()
   348          */
   348          */
   349         public DropLocation getDropLocation() {
   349         public DropLocation getDropLocation() {
   350             assureIsDrop();
   350             assureIsDrop();
   351 
   351 
   352             if (dropLocation == null) {
   352             if (dropLocation == null) {
   378          * Calling it when {@code isDrop()} is {@code false} results
   378          * Calling it when {@code isDrop()} is {@code false} results
   379          * in an {@code IllegalStateException}.
   379          * in an {@code IllegalStateException}.
   380          *
   380          *
   381          * @param showDropLocation whether or not to indicate the drop location
   381          * @param showDropLocation whether or not to indicate the drop location
   382          * @throws IllegalStateException if this is not a drop
   382          * @throws IllegalStateException if this is not a drop
   383          * @see #isDrop
   383          * @see #isDrop()
   384          */
   384          */
   385         public void setShowDropLocation(boolean showDropLocation) {
   385         public void setShowDropLocation(boolean showDropLocation) {
   386             assureIsDrop();
   386             assureIsDrop();
   387 
   387 
   388             this.showDropLocation = showDropLocation;
   388             this.showDropLocation = showDropLocation;
   404          * @throws IllegalStateException if this is not a drop
   404          * @throws IllegalStateException if this is not a drop
   405          * @throws IllegalArgumentException if an invalid action is specified
   405          * @throws IllegalArgumentException if an invalid action is specified
   406          * @see #getDropAction
   406          * @see #getDropAction
   407          * @see #getUserDropAction
   407          * @see #getUserDropAction
   408          * @see #getSourceDropActions
   408          * @see #getSourceDropActions
   409          * @see #isDrop
   409          * @see #isDrop()
   410          */
   410          */
   411         public void setDropAction(int dropAction) {
   411         public void setDropAction(int dropAction) {
   412             assureIsDrop();
   412             assureIsDrop();
   413 
   413 
   414             int action = dropAction & getSourceDropActions();
   414             int action = dropAction & getSourceDropActions();
   438          *
   438          *
   439          * @return the action chosen for the drop
   439          * @return the action chosen for the drop
   440          * @throws IllegalStateException if this is not a drop
   440          * @throws IllegalStateException if this is not a drop
   441          * @see #setDropAction
   441          * @see #setDropAction
   442          * @see #getUserDropAction
   442          * @see #getUserDropAction
   443          * @see #isDrop
   443          * @see #isDrop()
   444          */
   444          */
   445         public int getDropAction() {
   445         public int getDropAction() {
   446             return dropAction == -1 ? getUserDropAction() : dropAction;
   446             return dropAction == -1 ? getUserDropAction() : dropAction;
   447         }
   447         }
   448 
   448 
   466          *
   466          *
   467          * @return the user drop action
   467          * @return the user drop action
   468          * @throws IllegalStateException if this is not a drop
   468          * @throws IllegalStateException if this is not a drop
   469          * @see #setDropAction
   469          * @see #setDropAction
   470          * @see #getDropAction
   470          * @see #getDropAction
   471          * @see #isDrop
   471          * @see #isDrop()
   472          */
   472          */
   473         public int getUserDropAction() {
   473         public int getUserDropAction() {
   474             assureIsDrop();
   474             assureIsDrop();
   475 
   475 
   476             return (source instanceof DropTargetDragEvent)
   476             return (source instanceof DropTargetDragEvent)
   499          * Calling it when {@code isDrop()} is {@code false} results
   499          * Calling it when {@code isDrop()} is {@code false} results
   500          * in an {@code IllegalStateException}.
   500          * in an {@code IllegalStateException}.
   501          *
   501          *
   502          * @return the drag source's supported drop actions
   502          * @return the drag source's supported drop actions
   503          * @throws IllegalStateException if this is not a drop
   503          * @throws IllegalStateException if this is not a drop
   504          * @see #isDrop
   504          * @see #isDrop()
   505          */
   505          */
   506         public int getSourceDropActions() {
   506         public int getSourceDropActions() {
   507             assureIsDrop();
   507             assureIsDrop();
   508 
   508 
   509             return (source instanceof DropTargetDragEvent)
   509             return (source instanceof DropTargetDragEvent)