
import se.datadosen.jalbum.AlbumBean;
import se.datadosen.jalbum.CompiledScript;

public class BPPCompiledScript extends CompiledScript
{
	public BPPCompiledScript(AlbumBean albumBean)
	{
		super(albumBean);
		updateMyVars();
	}

	protected String getBPPGeneratedImageDirectory()
	{
		return /*engine.getThumbnailDirectory() + "/" +*/ Constants.SKIN_BPP_GENERATED_IMAGE_DIR;
	}

	protected void log(String str)
	{
		log(str, null);
	}

	protected void log(Throwable e)
	{
		log(null, e);
	}

	protected void log(String str, Throwable e)
	{
		if( str!=null )
			System.out.println(str);

		if( e!=null )
			e.printStackTrace(System.out);
	}

	protected void displayMessage(String msg)
	{
		if( window!=null )
			window.messageBox(msg);
		else
			System.out.println(msg);
	}

	public void updateVars()
	{
		super.updateVars();
		updateMyVars();
	}

	private void updateMyVars()
	{
		this.style = engine.getStyle();

		if( this.originalPath==null && engine.isCopyOriginals() )
			this.originalPath = "../" + fileName;
	}
}
