/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.nplusc.izc.iZpl;

import de.nplusc.izc.iZpl.GUI.PlayListManagingBackend;
import de.nplusc.izc.iZpl.GUI.PlayListManagingDefault;
import de.nplusc.izc.iZpl.GUI.PlayListManagingSkinnable;
import de.nplusc.izc.tools.UiToolz.IZSkinFile;
import java.io.FileReader;
import org.yaml.snakeyaml.Yaml;

/**
 *
 * @author LH
 */
public class TestClass
{
    public static void main(final String args2[])
    {
        try
        {
            /*  
              PlProcessorV2 ppp = new PlProcessorV2();
              ppp.InitializeOnPath("D:\\mp3\\iZpl\\rxe.izpl");
              String plif = new Yaml().dump(ppp);
              FileTK.writeFile(plif, "D:\\mp3\\iZpl\\testpl\\testout.iZdump");
              //HashMap<String,PlayListItem> xxx = (HashMap<String,PlayListItem>) new Yaml().load(plif);
              */
              
              IZSkinFile f = new Yaml().loadAs(new FileReader("T:\\icns\\iZpl\\skdev\\skindef.izmeta"), IZSkinFile.class);
              PlProcessorV2 ppp = new Yaml().loadAs(new FileReader("D:\\mp3\\iZpl\\rxe.iZcont"), PlProcessorV2.class);
              PlayListManagingBackend.initPPP(ppp);
              //new PlayListManagingDefault().setVisible(true);
              PlayListManagingSkinnable t =  new PlayListManagingSkinnable(f, "T:\\icns\\izpl\\skdev");
              t.setVisible(true);
             
             /* IZSkinFile f = new IZSkinFile("iZplaylist");
              HashMap<String,int[]> ep = f.getElementPositions();
              
              
              //min
              ep.put("button_min_point_1",new int[]{10, 10});
              ep.put("button_min_point_2",new int[]{60, 10});
              ep.put("button_min_point_3",new int[]{80, 30});
              ep.put("button_min_point_4",new int[]{30, 30});
              //ixx
              ep.put("button_IXX_point_1",new int[]{10, 10});
              ep.put("button_IXX_point_2",new int[]{60, 10});
              ep.put("button_IXX_point_3",new int[]{80, 30});
              ep.put("button_IXX_point_4",new int[]{30, 30});
              //hide
              ep.put("button_hide_point_1",new int[]{0, 10});
              ep.put("button_hide_point_2",new int[]{40, 50});
              ep.put("button_hide_point_3",new int[]{40, 140});
              ep.put("button_hide_point_4",new int[]{0, 100});
              
              ep.put("button_reload_point_1",new int[]{0, 0});
              ep.put("button_reload_point_2",new int[]{50, 50});
              ep.put("button_reload_point_3",new int[]{50, 800});
              ep.put("button_reload_point_4",new int[]{30, 100});
              ep.put("button_reload_point_5",new int[]{30, 140});
              ep.put("button_reload_point_6",new int[]{0, 110});
              
              ep.put("button_force_point_1",new int[]{40, 10});
              ep.put("button_force_point_2",new int[]{70, 40});
              ep.put("button_force_point_3",new int[]{70, 115});
              ep.put("button_force_point_4",new int[]{40, 145});
              ep.put("button_force_point_5",new int[]{0, 145});
              ep.put("button_force_point_6",new int[]{0, 50});

              ep.put("button_min",new int[]{700, 0});
              ep.put("button_IXX",new int[]{750, 0});
              ep.put("button_hide",new int[]{890, 320});
              ep.put("button_reload",new int[]{890, 420});
              ep.put("button_force",new int[]{880, 570});
              
              ep.put("tablestart",new int[]{90,40});
              ep.put("scrollbarstart",new int[]{820,40});
              
              HashMap<String,String> ed = f.getElementData();
              ed.put("backgroundlayer","GuiBase_wide.png");
              ed.put("tablewidth","730");
              ed.put("tableheight","660");
              ed.put("lineheight","15");
              ed.put("scrollbarknob","SLIDER.png");
              ed.put("button_IXX_clicked","IXX_clicked.png");
              ed.put("button_IXX_hilit","IXX_hilit.png");
              ed.put("button_min_clicked","min_clicked.png");
              ed.put("button_min_hilit","min_hilit.png");        
              ed.put("button_reload_clicked","reload_clicked.png");
              ed.put("button_reload_hilit","reload_hilit.png");       
              ed.put("button_force_clicked","force_clicked.png");
              ed.put("button_force_hilit","force_hilit.png");       
              ed.put("button_hide_clicked","hide_clicked.png");
              ed.put("button_hide_hilit","hide_hilit.png");
              //730,660
              
              
              FileTK.writeFile(new Yaml().dump(f), "T:\\icns\\iZpl\\skdev\\skindef.izmeta");/**/
              
              //System.out.println();
              /**
               * Pfad zu skins: iZplaylist-dir/skins/*.iZskin; 
               * 
               * Definition Skin-metadata (skindef.izmeta
               * //namen der objekte;
               * //backgroundlayer -> basis-oberfläche;GFX
               * //tablestart -> obere linke ecke der labels
               * //tablewidth -> breite der labels
               * //tableheight -> höhe der tabelle
               * //scrollbarstart -> obere linke ecke des sliders; Höhe = tableheight
               * //scrollbarknob -> nippel des sliders;GFX
               * //lineheight -> höhe einer einzelnen Zeile -> bestimmt Zeilenzahl
               * //mode=_clicked/_hilit
               * //button_IXX<_mode> -> schließenschaltfläche;GFX
               * //button_min<_mode> -> Minimierenbutton;GFX
               * //button_reload<_mode> -> neuladen-button;GFX
               * //button_force<_mode> -> erzwingen-button;GFX
               * //button_hide<_mode> -> ausblenden-button;GFX
               * //button_<buttonname> -> basepoint des buttons
               * 
               * //button_<buttonname>_point_N = Polygonpunkt der Selektierungszone relativ zu seinem nullpunkt...
               * 
               * 
               */

              //280,0 @min_base
              //min_point1=10,10
              //min_point2=60,10
              //min_point3=80.30
              //min_point4=30,30
              //330,0 @ixx_base
              //ixx_point1=10,10
              //ixx_point2=60,10
              //ixx_point3=80.30
              //ixx_point4=30,30
              //470,320 @button_hide
              //hide_point1=0,10
              //hide_point2=40,50
              //hide_point3=40,140
              //hide_point4=0,100
              //470,420 @button_reload
              //reload_point1=0,0
              //reload_point2=50,50
              //reload_point3=50,80
              //reload_point4=30,100
              //reload_point5=30,140
              //reload_point6=0,110
              //460,570 @button_force
              //force_point1=40,10
              //force_point2=70,40
              //force_point3=70,115
              //force_point4=40,145
              //force_point5=0,145
              //force_point6=0,50
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
        

    }
}
