001    package jigcell.compare;
002    
003    import java.awt.datatransfer.Transferable;
004    import javax.swing.Icon;
005    
006    /**
007     * A generic transfer agent for a source of data that supports reading.
008     * 
009     * <p>
010     * This code is licensed under the DARPA BioCOMP Open Source License.  See LICENSE for more details.
011     * </p>
012     *
013     * @author Nicholas Allen
014     */
015    
016    public interface IReadableDataSource extends IDataSource, Transferable {
017    
018       /**
019        * Option indicating the suggested description for acting on this data source
020        */
021    
022       String OPTION_READDESCRIPTION = "IReadableDataSource.description";
023    
024       /**
025        * Option indicating the suggested icon for this data source
026        */
027    
028       String OPTION_READICON = "IReadableDataSource.icon";
029    
030       /**
031        * A prediction on the type of data this source contains.
032        */
033    
034       Class getPredictedContents ();
035    
036       /**
037        * The read description option.
038        */
039    
040       String getReadDescriptionOption ();
041    
042       /**
043        * The read description icon.
044        */
045    
046       Icon getReadIconOption ();
047    
048       /**
049        * The contents of this data source or the first available content if multiple objects are supported.
050        */
051    
052       Object read () throws Exception;
053    
054       /**
055        * Sets the read description option.
056        *
057        * @param description Description
058        */
059    
060       void setReadDescriptionOption (String description);
061    
062       /**
063        * Sets the read description icon.
064        *
065        * @param icon Icon
066        */
067    
068       void setReadIconOption (Icon icon);
069    }