Ignore:
Timestamp:
2013-09-07T17:52:27+02:00 (11 years ago)
Author:
Don-vip
Message:

Make some defensive copies of user-supplied arrays, move QuadStateCheckBox to widgets package, javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/FileDrop.java

    r6104 r6221  
    2424import java.util.ArrayList;
    2525import java.util.Arrays;
    26 import java.util.EventObject;
    2726import java.util.List;
    2827import java.util.TooManyListenersException;
     
    474473
    475474    /**
    476      * This is the event that is passed to the
    477      * {@link FileDrop.Listener#filesDropped filesDropped(...)} method in
    478      * your {@link FileDrop.Listener} when files are dropped onto
    479      * a registered drop target.
    480      *
    481      * <p>I'm releasing this code into the Public Domain. Enjoy.</p>
    482      *
    483      * @author  Robert Harder
    484      * @author  rob@iharder.net
    485      * @version 1.2
    486      */
    487     public static class Event extends EventObject {
    488 
    489         private File[] files;
    490 
    491         /**
    492          * Constructs an {@link Event} with the array
    493          * of files that were dropped and the
    494          * {@link FileDrop} that initiated the event.
    495          *
    496          * @param files The array of files that were dropped
    497          * @param source The event source
    498          */
    499         public Event( File[] files, Object source ) {
    500             super( source );
    501             this.files = files;
    502         }   // end constructor
    503 
    504         /**
    505          * Returns an array of files that were dropped on a
    506          * registered drop target.
    507          *
    508          * @return array of files that were dropped
    509          */
    510         public File[] getFiles() {
    511             return files;
    512         }   // end getFiles
    513 
    514     }   // end inner class Event
    515 
    516     /* ********  I N N E R   C L A S S  ******** */
    517 
    518     /**
    519475     * At last an easy way to encapsulate your custom objects for dragging and dropping
    520476     * in your Java programs!
Note: See TracChangeset for help on using the changeset viewer.