/**
 * Copyright (c) 2011, Martin Foster <martin@ethereal-realms.org>
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 * 
 *     * Redistributions of source code must retain the above copyright notice, 
 *       this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright 
 *       notice, this list of conditions and the following disclaimer in the 
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the Ethereal-Realms.org nor the names of its
 *       contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package org.lyra.Interface;

import java.awt.Image;
import java.util.HashMap;
import java.util.Map;

import javax.swing.ImageIcon;

import org.lyra.Lyra;

/**
 * Constants exists exclusively to provide a consistent set of values between
 * classes.  This in return makes it easier to maintain a consistent look and
 * feel.
 * <p>
 * @author Martin Foster
 * @version 1.0.1,  %Revision, 95%, %LastChangedDate, 12/03/11 9:59PM%
 */
public final class Constants {

	/*
	 * CONSTANTS
	 */
	private static final int LABEL_WIDTH = 150;
	private static final int LABEL_SPACE = 15;
	private static final int ROW_SPACE = 3;
	private static final int SECT_SPACE = 10;
	private static final int WIDGET_HEIGHT = 4;
	private static final int WIDGET_WIDTH = 4;
	private static final int NORMAL_SPACE = 10;
	private static final int SMALL_SPACE = 5;
	private static final int INDENT_SPACE = 15;
	private static final int SCREEN_BUFFER = 75;
	private static final int TIP_INITIAL = 750;
	private static final int TIP_RESHOW = 750;
	private static final int TIP_DISMISS = 1500;
	private static final int ART_SIZE = 64;
	private static final int RATING_MAX = 5;
	
	/**
	 * Map that contains a list of all known icons for cleaner interfacing.
	 * Provides a consistent and hopefully centrally modifiable section for
	 * filenames.
	 */
	@SuppressWarnings("serial")
	public static final Map<String,String> fileIcons = new HashMap<String,String>(){
		{
			// Prompt Section
			put("Prompt-Question","Prompt-Question.png");
			put("Prompt-Volume","Prompt-Volume.png");
			put("Prompt-Crossfade","Prompt-Crossfade.png");
			put("Prompt-Notice","Prompt-Notice.png");
			put("Prompt-Pass","Prompt-Pass.png");
			put("Prompt-Fail","Prompt-Fail.png");
			
			// General Buttons
			put("Button-Accept","Button-Accept.png");
			put("Button-Cancel","Button-Cancel.png");
			put("Button-Test","Button-Gear.png");
			put("Button-Help","Button-Help.png");
			put("Button-Addition","Control-Plus.png");
			put("Button-Remove","Control-Minus.png");
			
			// Control Features
			put("Control-Shuffle","Control-Shuffle.png");
			put("Control-Remove","Control-Remove.png");
			put("Control-Delete","Control-Remove.png");
			put("Control-Clear","Control-Clear.png");
			put("Control-Save","Control-Save.png");

			// Help Viewer
			put("Help-Printer","Acrobat-Printer.png");
			put("Help-Search","Acrobat-Search.png");
			put("Help-Pane","Acrobat-Pane.png");
			put("Help-First","Acrobat-First.png");
			put("Help-Previous","Acrobat-Prev.png");
			put("Help-Next","Acrobat-Next.png");
			put("Help-Last","Acrobat-Last.png");
			put("Help-Width","Acrobat-Width.png");
			put("Help-ZoomIn","Acrobat-Zoom-In.png");
			put("Help-ZoomOut","Acrobat-Zoom-Out.png");
			put("Help-Pan","Acrobat-Pan.png");
			put("Help-Select","Acrobat-Select.png");

			// Playback Controls
			put("Playback-Previous","Player-Previous.png");
			put("Playback-Next","Player-Next.png");
			put("Playback-Stop","Player-Stop.png");
			put("Playback-Play","Player-Play.png");
			put("Playback-Pause","Player-Pause.png");
			
			// Window Shifts
			put("Playback-Fullscreen","Player-Fullscreen.png");
			put("Playback-Compact","Player-Fullscreen.png");

			// Player Options
			put("Options-Volume","Options-Volume.png");
			put("Options-Crossfade","Options-Crossfade.png");
			put("Options-Random-False","Options-Random-False.png");
			put("Options-Random-True","Options-Random-True.png");
			put("Options-Repeat-True","Options-Repeat-True.png");
			put("Options-Repeat-False","Options-Repeat-False.png");
			put("Options-Single-False","Options-Single-False.png");
			put("Options-Single-True","Options-Single-True.png");
			put("Options-Volume","Options-Volume.png");
			put("Options-Mute","Options-Mute.png");
			
			// Integration Buttons
			put("LastDotFm-Small","LastDotFm-Small.png");
			put("LastDotFm-Large","LastDotFm.png");
			
			// Rating Images
			put("Rating-None","Rating-No.png");
			put("Rating-Full","Rating-Full.png");
			put("Rating-Empty","Rating-Empty.png");
		}
	  };
	  
	
	/**
	 * Map that contains filenames for various help documents that may be
	 * accessed at any time.
	 */
	@SuppressWarnings("serial")
	public static final Map<String,String> fileHelp = new HashMap<String,String>(){
		{
			// Prompt Section
			put("Help-Display","Help.pdf");
			put("Help-Frequently","Frequently.pdf");
			put("Help-About","About.pdf");
		}
	  };
	  
	  
	/**
	 * Label width is used in the generation of table like structures as a way
	 * to enforce the width of labels for a consistent look and feel.
	 * <p>
	 * @return Integer containing label width
	 */
	public static final int getLabelWidth() {
		return LABEL_WIDTH;
	}
	// End of getLabelWidth Method


	/**
	 * Label width is used in the generation of table like structures as a way
	 * to enforce the space between a label and the associated interface element.
	 * <p>
	 * @return Integer containing space between label and elements.
	 */
	public static final int getLabelSpacer() {
		return LABEL_SPACE;
	}
	// End of getLabelSpacer Method

	
	/**
	 * Enforces the space between row elements when creating table like
	 * elements for display.
	 * <p>
	 * @return Integer containing gap between rows.
	 */
	public static final int getRowGap() {
		return ROW_SPACE;
	}
	// End of getLabelSpacer Method
	
	
	/**
	 * Gap which exists between various elements in order to provide a cleaner
	 * overall look and feel.
	 * <p>
	 * @return Gap that exists between sections.
	 */
	public static final int getSectionGap() {
		return SECT_SPACE;
	}
	// End of getSectionGap Method
	
	
	/**
	 * When generating table-like elements it becomes necessary to add in a
	 * bit of spacing.   This provides the height padding.
	 * <p>
	 * @return Height padding to append.
	 */
	public static final int getPaddingHeight() {
		return WIDGET_HEIGHT;
	}
	// End of getPaddingHeight
	
	
	/**
	 * When generating table-like elements it becomes necessary to add in a
	 * bit of spacing.   This provides the width padding.
	 * <p>
	 * @return Width padding to append.
	 */
	public static final int getPaddingWidth() {
		return WIDGET_WIDTH;
	}
	// End of getPaddingWidth
	
	
	/**
	 * In certain circumstances we need additional spacers even if they are
	 * not directly attached to the above.  This provides a general number.
	 * <p>
	 * @return Integer containing a small spacer.
	 */
	public static final int getSmallGap() {
		return SMALL_SPACE;
	}
	// End of getGeneral Method
	
	
	/**
	 * In certain circumstances we need additional spacers even if they are
	 * not directly attached to the above.  This provides a general number.
	 * <p>
	 * @return Integer containing general spacer.
	 */
	public static final int getNormalGap() {
		return NORMAL_SPACE;
	}
	// End of getGeneral Method


	/**
	 * Space necessary to create an indentation gap.  Used mostly when lining
	 * up against an image.
	 * <p>
	 * @return Integer containing indentation gap.
	 */
	public static final int getIndentGap() {
		return INDENT_SPACE;
	}
	// End of getIndentGap Method
	
	
	/**
	 * Screen buffer is a generic number in order to determine if certain
	 * windows may require a resize.   Due either to window dressing or to
	 * user interface elements such as a status bar.
	 * <p>
	 * @return Integer containing a generic screen buffer for UI elements.
	 */
	public static final int getScreenBuffer() {
		return SCREEN_BUFFER;
	}
	// End of getScreenBuffer Method

	
	/**
	 * Returns the initial delay value. 
	 * <p>
	 * @return An integer representing the initial delay value, in milliseconds.
	 */
	public static final int getTipInitialDelay() {
		return TIP_INITIAL;
	}
	// End of getTipInitialDelay Method

	
	/**
	 * Returns the reshow delay property. 
	 * <p>
	 * @return Integer for re-shown delay property.
	 */
	public static final int getTipReshowDelay() {
		return TIP_RESHOW;
	}
	// End of getTipReshowDelay Method
	
	
	/**
	 * Returns the dismissal delay value. 
	 * <p>
	 * @return An integer representing the dismissal delay value, in milliseconds.
	 */
	public static final int getTipDismissDelay() {
		return TIP_DISMISS;
	}
	// End of getTipDismissDelay Method

	
	/**
	 * Returns the path holding the icon used to decorate the windows.
	 * <p>
	 * @return Image containing path.
	 */
	static public Image getIcon() {
	
		// Icon passed simply
		return new ImageIcon(Lyra.rootProgram.getAbsolutePath() 
	            + Lyra.ICON + "/"
	            + Lyra.LYRA).getImage();
	}
	// End of getIcon
	
	
	/**
	 * Returns the single dimension used to display album art.  Album art
	 * covers are assumed to be square, hence the singular value.
	 * <p>
	 * @return Integer marking width and height.
	 */
	static public int getArtSize() {
		
		// Straight return
		return ART_SIZE;
	}
	// End of getArtSize Method

	
	/**
	 * Returns the maximum number of stars a rating can have.
	 * <p>
	 * @return Integer containing the maximum number a rating can have.
	 */
	static public int getMaxRating() {
		
		// Straight return
		return RATING_MAX;
	}
	// End of getMaxRating Method
	
}


