/*
 * @(#)Displayable.java    2.3  3 December 2003
 *
 * Copyright 2004
 * College of Computer and Information Science
 * Northeastern University
 * Boston, MA  02115
 *
 * The Java Power Tools software may be used for educational
 * purposes as long as this copyright notice is retained intact
 * at the top of all source files.
 *
 * To discuss possible commercial use of this software, 
 * contact Richard Rasala at Northeastern University, 
 * College of Computer and Information Science,
 * 617-373-2462 or rasala@ccs.neu.edu.
 *
 * The Java Power Tools software has been designed and built
 * in collaboration with Viera Proulx and Jeff Raab.
 *
 * Should this software be modified, the words "Modified from 
 * Original" must be included as a comment below this notice.
 *
 * All publication rights are retained.  This software or its 
 * documentation may not be published in any media either
 * in whole or in part without explicit permission.
 *
 * This software was created with support from Northeastern 
 * University and from NSF grant DUE-9950829.
 */

package edu.neu.ccs.gui;

/**
 * <P>Interface to be implemented by a <CODE>Component</CODE> whose
 * input widget values (view state) can be translated to and from a
 * <CODE>{@link String String}</CODE> represenatation.</P>
 *
 * <P>This interface is the equivalent for view objects to what the
 * <CODE>{@link edu.neu.ccs.Stringable Stringable}</CODE> interface 
 * represents for model objects.</P>
 *
 * <P>The functionality of the entire GUI package of the JPT assumes
 * that each classes implementing this interface is a derived class
 * of <CODE>Component</CODE>, although this requirement cannot be
 * policed by a compiler.</P>
 *
 * @author  Jeff Raab
 * @author  Richard Rasala
 * @version 2.3
 * @since   1.0
 * @see edu.neu.ccs.Stringable
 */
public interface Displayable {
    
    /** 
     * Bound property name for the view state of a
     * <CODE>Displayable</CODE> object. 
     */
    public static final String VIEW_STATE = "view.state";
    
    
    /** 
     * Bound property name for the default view state of a
     * <CODE>Displayable</CODE> object. 
     */
    public static final String DEFAULT_VIEW_STATE = "default.view.state";
    
    
    /**
     * Sets the view state for this object to the data state represented 
     * by the given <CODE>String</CODE> data.
     *
     * @param data the new view state for this object
     * @see #getViewState()
     */
    public void setViewState(String data);
    
    
    /**
     * Returns a <CODE>String</CODE> representation of the view state for
     * this object.
     *
     * @return the view state as a <CODE>String</CODE>
     * @see #setViewState(String)
     */
    public String getViewState();
    
    
    /**
     * Sets the default view state for this object to the data state
     * represented by the given <CODE>String</CODE> data.
     *
     * @param data the new default data state for this object
     * @see #getDefaultViewState()
     * @see #reset()
     */
    public void setDefaultViewState(String data);
    
    
    /**
     * Returns a <CODE>String</CODE> representation of the default view
     * state for this object.
     *
     * @return the default view state as a <CODE>String</CODE>
     * @see #setDefaultViewState(String)
     * @see #reset()
     */
    public String getDefaultViewState();
    
    
    /**
     * <P>Resets the view state of this object to the default view state for
     * this object.</P>
     *
     * <P>Equivalent to: <CODE>setViewState(getDefaultViewState())</CODE>.</P>
     *
     * @see #setViewState(String)
     * @see #getDefaultViewState()
     */
    public void reset();
    
    
    /**
     * Sets whether or not this object is enabled.
     *
     * @param isEnabled whether or not this object is enabled
     */
    public void setEnabled(boolean isEnabled);
    
}
