/*
Tiamat - a role-playing game framework
ColorScheme.java - stores a color scheme for a dialog or frame
 
 Copyright  (C) 2004-2005 Hugues Johnson
 
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

package com.huguesjohnson.tiamat.graphics;

import com.huguesjohnson.serialization.Formatter;
import com.huguesjohnson.serialization.Storable;
import java.awt.Color;

/** ColorScheme.java - stores a color scheme for a dialog or frame
 * @author Hugues Johnson
 */
public class ColorScheme implements Storable{
    
/* begin public constants */
    /** Default forecolor (99,99,156). */
    public final static Color DEFAULT_FORECOLOR=new Color(99,99,156);
    /** Default backcolor (198,198,198). */
    public final static Color DEFAULT_BACKCOLOR=new Color(198,198,198);
    /** Default bordercolor (99,99,156). */
    public final static Color DEFAULT_BORDERCOLOR=new Color(99,99,156);
    /** Default borderinset color (198,198,198). */
    public final static Color DEFAULT_BORDERINSETCOLOR=new Color(198,198,198);
/* end public constants */

/* begin public properties */
    //the foreground color
    private Color foreColor;
    /** Returns the foreground color. 
     * @return The foreground color.
     */
    public Color getForeColor(){ return(this.foreColor); }
    /** Sets the foreground color. 
     * @param foreColor The new foreground color.
     */
    public void setForeColor(Color foreColor){ this.foreColor=foreColor; }
    //the background color
    private Color backColor ;
    /** Returns the background color. 
     * @return background color.
     */
    public Color getBackColor(){ return(this.backColor); }
    /** Sets the background color. 
     * @param backColor The new background color.
     */
    public void setBackColor(Color backColor){ this.backColor=backColor; }
    //the color of the border
    private Color borderColor;
    /** Returns the border color. 
     * @return border color.
     */
    public Color getBorderColor(){ return(this.borderColor); }
    /** Sets the border color. 
     * @param borderColor The new border color.
     */
    public void setBorderColor(Color borderColor){ this.borderColor=borderColor; }
    //the color of the border inset
    //Color borderInsetColor 
    private Color borderInsetColor;
    /** Returns the border inset color. 
     * @return border inset color.
     */
    public Color getBorderInsetColor(){ return(this.borderInsetColor); }
    /** Sets the border insert color. 
     * @param borderInsetColor The new border inset color color.
     */
    public void setBorderInsetColor(Color borderInsetColor){ this.borderInsetColor=borderInsetColor; }
/* end public properties */
    
/* begin constructors */
    /** Default constructor, uses default settings for everything.
     */
    public ColorScheme(){
        this.setForeColor(ColorScheme.DEFAULT_FORECOLOR);
        this.setBackColor(ColorScheme.DEFAULT_BACKCOLOR);
        this.setBorderColor(ColorScheme.DEFAULT_BORDERCOLOR);
        this.setBorderInsetColor(ColorScheme.DEFAULT_BORDERINSETCOLOR);
    }

    /** Constructor, uses specified colors.
     * @param foreColor The foreground and border color.
     * @param backColor The background and border inset color.
     */
    public ColorScheme(Color foreColor,Color backColor){
        this.setForeColor(foreColor);
        this.setBackColor(backColor);
        this.setBorderColor(foreColor);
        this.setBorderInsetColor(backColor);
    }

    /** Constructor, uses specified colors.
     * @param foreColor The foreground color.
     * @param backColor The background and border inset color.
     * @param borderColor The border color.
     * @param borderInsetColor The border inset color.
     */
    public ColorScheme(Color foreColor,Color backColor,Color borderColor,Color borderInsetColor){
        this.setForeColor(foreColor);
        this.setBackColor(backColor);
        this.setBorderColor(borderColor);
        this.setBorderInsetColor(borderInsetColor);
    }
/* end constructors */
    
/* begin public methods */
    /** The onDeserialize event should be fired after an object is de-serialized.
     * This allows objects to load transient members, set their working directory, and load Storable members if needed.
     * @param formatter the formatter to use to load any storable members
     * @param absoluteDir the working directory since all paths stored in the object should be relative
     */
    public void onDeserialize(Formatter formatter,String absoluteDir){ }   
/* end public methods */
}