//[skeleton1.
import java.io.*;

/**
 * An encapsulation of a section of in a document
 *
 * This is used in an example of event bubbling
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class Section extends AbstractDocumentElement
{
    private String        face, pointSize, style;


    /**
     * Default Constructor
     */
    public Section()
    {
       super();       
       face      = null;       
       pointSize = null;
       style     = null;       
    }


    /**
     * Get the parent of this EventHandler
     *
     * @return  The parent
     */
    public EventHandler getParent()
    {
       return null;       
    }


    /**
     * Handle a font face change event
     *
     * Note: These events are handled by this Section
     *
     * @param face    The new font face (e.g., TimesRoman)
     */
    protected boolean handleFaceChange(String face)
    {
	this.face = face;
        return true;        
    }


    /**
     * Handle a font size change event
     *
     * @param pointSize    The new font size (e.g., 12)
     */
    protected boolean handleSizeChange(String pointSize)
    {
	this.pointSize = pointSize;
        return true;        
    }


    /**
     * Handle a font style change event
     *
     * @param style    The new font style (e.g., Italic)
     */
    protected boolean handleStyleChange(String style)
    {
	this.style = style;
        return true;        
    }
//]skeleton1.

    /**
     * Print this Section
     *
     * @param out   The PrintStream to use
     */
    public void print(PrintStream  out)
    {
	out.println("Face: "+face+"\t"+"Size: "+pointSize+"\tStyle: "+style);
    }
//[skeleton2.

}
//]skeleton2.
