// Copyright 1996, Marimba Inc. All Rights Reserved.


// @(#)ResourceWidget.java, 1.4, 11/13/96





package marimba.gui;





import java.awt.*;





import marimba.persist.*;





/**


 * A resource widget. This widget refers to one


 * or more external resources.


 *


 * @author	Arthur van Hoff


 * @version 	1.4, 11/13/96


 */


public abstract class ResourceWidget extends Widget {


    /**


     * The source file for this resource.


     * @see #getSource


     * @see #setSource


     */


    public String src;





    /**


     * Preload. If true the loading of the resource


     * should start as soon as the widget is loaded,


     * if false, it starts when the widget is first


     * visible.


     */


    public boolean preload;





    /**


     * Get the properties of this widget.


     */


    public void getProperties(PropertyList list) {


	super.getProperties(list);


	list.setURL("src", src, null);


	list.setBoolean("preload", preload, false);


    }





    /**


     * Set the properties of this widget.


     */


    public void setProperties(PropertyList list) {


	super.setProperties(list);


	src = list.getURL("src", null);


	preload = list.getBoolean("preload", false);


    }





    /**


     * Get the source.


     * @see #src


     */


    public String getSource() {


	return src;


    }





    /**


     * Set the source. This method calls setValue(String).


     * @see #src


     * @see Widget#setValue


     */


    public void setSource(String src) {


	setValue(src);


    }





    /**


     * Debugging.


     */


    public void paramString(StringBuffer buf) {


	super.paramString(buf);


	buf.append(",src=");


	buf.append(src);


    }


}


