import se.datadosen.component.*;
import se.datadosen.util.*;

ControlPanel ui = new ControlPanel() {

    JTextField title       = new JTextField("Your title goes here");
    JTextArea  description = new JTextArea(2,80);
    JTextField gKeywords   = new JTextField("");
    JTextField copyright   = new JTextField("");
};

skinTitle       = "SkinName";
skinVersion     = "?.?";
skinAuthor      = "??????";
skinDescription = "??????";

File skinDescFile = new File(skinDirectory.getAbsolutePath() + "/skin.properties");
    if (skinDescFile.exists()) {
        Map skinData = IO.readMapFile(skinDescFile);
        String text = (String)skinData.get("title");
        if (text != null) skinTitle=text;
        String text = (String)skinData.get("version");
        if (text != null) skinVersion=text;
        String text = (String)skinData.get("author");
        if (text != null) skinAuthor=text;
        String text = (String)skinData.get("description");
        if (text != null) skinDescription=text;
    }


ui.add("left", new JLabel(skinTitle + " v" + skinVersion + ",  by " + skinAuthor));

ui.add("tab", new JLabel("      :      "));
File notesSkin = new File(skinDirectory.getAbsolutePath() + "/notes/notes.htm");
JLinkLabel linkSkin = new JLinkLabel("Skin Notes");
linkSkin.setURL(notesSkin.toString());
linkSkin.setToolTipText("Loads a HTML help file");
ui.add(linkSkin);

File notesPBase = new File("http://www.pbase.com");
ui.add(new JLabel("      :      "));
JLinkLabel linkPBase = new JLinkLabel("PBase Website");
linkPBase.setURL(notesPBase.toString());
linkPBase.setToolTipText("View the PBase web site");
ui.add(linkPBase);

ui.add("br", new JLabel(skinDescription));

JScrollPane sp = new JScrollPane();
sp.getViewport().add(ui.description, null);

// Layout controls easily similar to how text is added in a word processor

JLabel titleLabel = new JLabel("             Album Title");
ui.add("p", titleLabel);
ui.add("tab hfill", ui.title);
ui.add("br", new JLabel(       "Album Description"));
ui.add("tab hfill", sp);
ui.add("br", new JLabel(       "   Album Keywords"));
ui.add("tab hfill", ui.gKeywords);
ui.add("br", new JLabel(       "   Album Copyright"));
ui.add("tab hfill", ui.copyright);

ui.add("p",  new JLabel("The above values will be added to each web page. You can also add labels, comments and "));
ui.add("br", new JLabel("keywords for each image, and replace these values in each folder of the album by using "));
ui.add("br", new JLabel("'properties' files for descriptions.      See"));

File notesSkin2 = new File(skinDirectory.getAbsolutePath() + "/notes/propsfiles.htm");
JLinkLabel linkSkin2 = new JLinkLabel("Properties Files");
linkSkin2.setURL(notesSkin2.toString());
linkSkin2.setToolTipText("Loads a HTML help file explaining how to use 'properties' files");
ui.add(linkSkin2);
ui.add( new JLabel("for details."));


// Configure controls
ui.description.setLineWrap(true);
ui.description.setWrapStyleWord(true);
titleLabel.setEnabled(true);
ui.title.setEnabled(true);

ui.title.setToolTipText("A descriptive title for this web album");
ui.description.setToolTipText("A longer description of the subject matter of this web album");
ui.gKeywords.setToolTipText("Enter keywords to describe the album, each seperated by a comma and space");
ui.copyright.setToolTipText("Enter (c) details for this Album: date and owner");



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