/* BeanShell init file. Run every time an album is generated with this skin */

import se.datadosen.jalbum.JAFilter;
import javax.swing.*;

String shColor = "#98994D";
String bgColor = "#E3DEA7";

// This skin requires at least Java 1.4, check and report if not.
if (System.getProperty("java.specification.version").compareTo("1.4") < 0) {
	JOptionPane.showMessageDialog(window, "This skin requires at least Java 1.4.\nPlease update from http://www.java.com and reinstall JAlbum", "Java version problem", JOptionPane.ERROR_MESSAGE);
	throw new OperationAbortedException();
}

// Set filters
XBorderFilter xb = new XBorderFilter();
if (thumbnailFrames) {
	xb.setFrWidth("1,1,2");
	xb.setFrCol("#B9AC4C,#E9DF86,#FFFFDD");
}

if (thumbnailShadows) {
	xb.setShWidth(8);
	xb.setShDrop("soft");
	xb.setShCol(shColor);
	xb.setBgCol(bgColor);
}
engine.addFilter(new PropertySettingFilterWrapper(xb), JAFilter.THUMBNAILS_POSTSCALE_STAGE);

if (flowerOrnament) {
	LogoFilter lf = new LogoFilter();
	lf.setSrc(new File(skinDirectory, "png/flower.png").toURL().toString());
	lf.setValign("bottom");
	lf.setOffset(-2);
	lf.setVoffset(2);
	engine.addFilter(lf, JAFilter.THUMBNAILS_POSTSCALE_STAGE);
}

XBorderFilter xb2 = new XBorderFilter();
if (closeupFrames) {
	xb2.setFrWidth("" + 8);
	xb2.setFrCol(frameColor);
}
if (closeupShadows) {
	xb2.setShWidth(8);
	xb2.setShCol(shColor);
	xb2.setShDrop("soft");
	xb2.setBgCol(bgColor);
	xb2.setBgFile(new File(skinResDirectory, "mainbg.jpg").getAbsolutePath());
	xb2.setBgOffX(28);
	xb2.setBgOffY(30);
}
engine.addFilter(xb2, JAFilter.CLOSEUPS_POSTSCALE_STAGE);
