/** 
 * This script is being run when a skin is selected
 * The script produces a simple custom user interface.
 */
 
import se.datadosen.component.*;
import se.datadosen.util.*;

// Controls that are to be imported into JAlbum as variables
ControlPanel ui = new ControlPanel() {

	JCheckBox closeupFrames = new JCheckBox("Frames");
	JCheckBox closeupShadows = new JCheckBox("Shadows");

	JCheckBox thumbnailFrames = new JCheckBox("Frames");
	JCheckBox thumbnailShadows = new JCheckBox("Shadows");

	// Ornament
	JCheckBox topLeftOrnament = new JCheckBox("Top left");
	JCheckBox topRightOrnament = new JCheckBox("Top right");
	JCheckBox bottomLeftOrnament = new JCheckBox("Bottom left");
	JCheckBox bottomRightOrnament = new JCheckBox("Bottom right");
	
	JCheckBox grayThumbnails = new JCheckBox("Grayscale");
	JCheckBox cropThumbnails = new JCheckBox("Crop");
	JCheckBox grayCloseups = new JCheckBox("Grayscale");
	JColorSelector frameColor = new JColorSelector("Frame color");
};

ui.frameColor.setColor("white");

// Layout controls easily similar to how text is added in a word processor
ui.bottomLeftOrnament.setSelected(true);
ui.thumbnailFrames.setSelected(true);
ui.thumbnailShadows.setSelected(true);
ui.closeupFrames.setSelected(true);
ui.closeupShadows.setSelected(true);
ui.cropThumbnails.setSelected(true);
ui.cropThumbnails.setEnabled(false);

ui.add("p", new JLabel("Note: Album must be rebuilt for changes to take effect"));

ControlPanel decoration = new ControlPanel("Ornament");
decoration.add(ui.topLeftOrnament);
decoration.add("tab", ui.topRightOrnament);
decoration.add("br", ui.bottomLeftOrnament);
decoration.add("tab", ui.bottomRightOrnament);
ui.add("p hfill", decoration);

ControlPanel thumbnails = new ControlPanel("Thumbnails");
thumbnails.add(ui.grayThumbnails);
thumbnails.add(ui.thumbnailFrames);
thumbnails.add(ui.thumbnailShadows);
thumbnails.add(ui.cropThumbnails);
ui.add("br hfill", thumbnails);

ControlPanel closeups = new ControlPanel("Closeups");
closeups.add(ui.grayCloseups);
closeups.add(ui.closeupFrames);
closeups.add(ui.closeupShadows);

ui.add("br hfill", closeups);

ui.add("br", new JLabel("Frame color"));
ui.add(ui.frameColor);

// Finally install components into JAlbum
window.setSkinUI(ui);
