Ver código fonte

build file tweak and begin of WPCMGr ui

LH 7 anos atrás
pai
commit
f65f3937a6

+ 544 - 529
UpidTK/src/main/java/de/nplusc/upidgen/DependencyManager.java

@@ -1,529 +1,544 @@
-/*
- * Copyright (C) 2015 iZc
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-package de.nplusc.upidgen;
-
-
-import de.nplusc.izc.tools.IOtools.DBWriter;
-import de.nplusc.izc.tools.baseTools.Tools;
-import java.util.LinkedList;
-import javax.swing.DefaultListModel;
-import javax.swing.UIManager;
-
-
-/**
- *
- * @author LH
- */
-public class DependencyManager extends javax.swing.JFrame
-{
-            DefaultListModel lm = null,lm2 = null;;
-    /**
-     * Creates new form DependencyManager
-     */
-    public DependencyManager()
-    {
-                                try {
-	    UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
-	} catch( Exception e ) { 
-	    //e.printStackTrace();
-	}
-        initComponents();
-        lm= ((DefaultListModel)listUpidsAndDependencySet.getModel());
-        lm2= ((DefaultListModel)lstAlternatives.getModel());
-    }
-
-    /**
-     * This method is called from within the constructor to
-     * initialize the form.
-     * WARNING: Do NOT modify this code. The content of this method is
-     * always regenerated by the Form Editor.
-     */
-    @SuppressWarnings("unchecked")
-    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
-    private void initComponents() {
-
-        jScrollPane1 = new javax.swing.JScrollPane();
-        listUpidsAndDependencySet = new javax.swing.JList();
-        jScrollPane2 = new javax.swing.JScrollPane();
-        lstAlternatives = new javax.swing.JList();
-        toMainList = new javax.swing.JButton();
-        jSeparator1 = new javax.swing.JSeparator();
-        jSeparator2 = new javax.swing.JSeparator();
-        jSeparator3 = new javax.swing.JSeparator();
-        toMain = new javax.swing.JButton();
-        refresh = new javax.swing.JButton();
-        addDependency = new javax.swing.JButton();
-        addalternateDep = new javax.swing.JButton();
-        cxFin = new javax.swing.JCheckBox();
-        cxMultiresolve = new javax.swing.JCheckBox();
-        cxForceRes = new javax.swing.JCheckBox();
-        jScrollPane3 = new javax.swing.JScrollPane();
-        txaComm = new javax.swing.JTextArea();
-        jLabel1 = new javax.swing.JLabel();
-
-        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
-
-        listUpidsAndDependencySet.setModel(new DefaultListModel());
-        listUpidsAndDependencySet.addMouseListener(new java.awt.event.MouseAdapter() {
-            public void mouseClicked(java.awt.event.MouseEvent evt) {
-                listUpidsAndDependencySetMouseClicked(evt);
-            }
-        });
-        jScrollPane1.setViewportView(listUpidsAndDependencySet);
-
-        lstAlternatives.setModel(new DefaultListModel());
-        lstAlternatives.addMouseListener(new java.awt.event.MouseAdapter() {
-            public void mouseClicked(java.awt.event.MouseEvent evt) {
-                lstAlternativesMouseClicked(evt);
-            }
-        });
-        jScrollPane2.setViewportView(lstAlternatives);
-
-        toMainList.setText(".toMainList()");
-        toMainList.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                toMainListActionPerformed(evt);
-            }
-        });
-
-        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
-
-        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
-
-        toMain.setText(".toMain()");
-        toMain.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                toMainActionPerformed(evt);
-            }
-        });
-
-        refresh.setText(".refresh()");
-        refresh.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                refreshActionPerformed(evt);
-            }
-        });
-
-        addDependency.setText(".add(\"Dependency\")");
-        addDependency.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                addDependencyActionPerformed(evt);
-            }
-        });
-
-        addalternateDep.setText(".add(\"alterantive dependency\");");
-        addalternateDep.addActionListener(new java.awt.event.ActionListener() {
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
-                addalternateDepActionPerformed(evt);
-            }
-        });
-
-        cxFin.setText("Finalized");
-        cxFin.setEnabled(false);
-
-        cxMultiresolve.setText("Mehrfacherfüllbar");
-        cxMultiresolve.setEnabled(false);
-
-        cxForceRes.setText("zwingend nötig");
-        cxForceRes.setEnabled(false);
-
-        txaComm.setColumns(20);
-        txaComm.setEditable(false);
-        txaComm.setRows(5);
-        jScrollPane3.setViewportView(txaComm);
-
-        jLabel1.setText("Weitere Vermerke");
-
-        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
-        getContentPane().setLayout(layout);
-        layout.setHorizontalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(layout.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
-                    .addGroup(layout.createSequentialGroup()
-                        .addComponent(refresh)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addComponent(toMainList))
-                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
-                    .addGroup(layout.createSequentialGroup()
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 1007, javax.swing.GroupLayout.PREFERRED_SIZE))
-                    .addGroup(layout.createSequentialGroup()
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                            .addGroup(layout.createSequentialGroup()
-                                .addComponent(addDependency)
-                                .addGap(29, 29, 29)
-                                .addComponent(addalternateDep))
-                            .addGroup(layout.createSequentialGroup()
-                                .addGap(18, 18, 18)
-                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 544, javax.swing.GroupLayout.PREFERRED_SIZE))
-                            .addGroup(layout.createSequentialGroup()
-                                .addGap(115, 115, 115)
-                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                                    .addGroup(layout.createSequentialGroup()
-                                        .addComponent(cxFin)
-                                        .addGap(37, 37, 37)
-                                        .addComponent(cxMultiresolve)
-                                        .addGap(26, 26, 26)
-                                        .addComponent(cxForceRes))
-                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 376, javax.swing.GroupLayout.PREFERRED_SIZE))))
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                            .addGroup(layout.createSequentialGroup()
-                                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))
-                            .addComponent(toMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
-                        .addContainerGap())))
-        );
-        layout.setVerticalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jSeparator1)
-            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(toMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                    .addComponent(addDependency)
-                    .addComponent(addalternateDep))
-                .addGap(18, 18, 18)
-                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addGroup(layout.createSequentialGroup()
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
-                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
-                            .addComponent(jSeparator2)))
-                    .addGroup(layout.createSequentialGroup()
-                        .addGap(74, 74, 74)
-                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                            .addComponent(cxFin)
-                            .addComponent(cxMultiresolve)
-                            .addComponent(cxForceRes))
-                        .addGap(18, 18, 18)
-                        .addComponent(jLabel1)
-                        .addGap(8, 8, 8)
-                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))))
-            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
-                .addContainerGap()
-                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
-                    .addComponent(toMainList)
-                    .addComponent(refresh))
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(jScrollPane1)
-                .addContainerGap())
-        );
-
-        pack();
-    }// </editor-fold>//GEN-END:initComponents
-    
-    public DBWriter dbc = PublicStorage.dbc;
-    private String selectedUpid = "NOP";
-    boolean onTop = true;
-    private void toMainActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_toMainActionPerformed
-    {//GEN-HEADEREND:event_toMainActionPerformed
-        Ifatzeh.sel.setVisible(true);
-        this.setVisible(false);
-    }//GEN-LAST:event_toMainActionPerformed
-
-    private void refreshActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_refreshActionPerformed
-    {//GEN-HEADEREND:event_refreshActionPerformed
-        refreshList();
-    }//GEN-LAST:event_refreshActionPerformed
-
-    private void toMainListActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_toMainListActionPerformed
-    {//GEN-HEADEREND:event_toMainListActionPerformed
-        selectedUpid="NOP";
-        onTop=true;
-        refreshList();
-    }//GEN-LAST:event_toMainListActionPerformed
-
-    private void listUpidsAndDependencySetMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_listUpidsAndDependencySetMouseClicked
-    {//GEN-HEADEREND:event_listUpidsAndDependencySetMouseClicked
-        String load = (String)listUpidsAndDependencySet.getSelectedValue();
-        if(onTop)
-        {
-            
-            selectedUpid=load;
-            refreshList();
-            onTop=false;
-            return;
-        }
-        loadDependencyDataset(load);
-        updateAlternateDependencysList(load);
-    }//GEN-LAST:event_listUpidsAndDependencySetMouseClicked
-
-    private void addDependencyActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_addDependencyActionPerformed
-    {//GEN-HEADEREND:event_addDependencyActionPerformed
-        addDependency();
-    }//GEN-LAST:event_addDependencyActionPerformed
-
-    private void addalternateDepActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_addalternateDepActionPerformed
-    {//GEN-HEADEREND:event_addalternateDepActionPerformed
-        String src = (listUpidsAndDependencySet.getSelectedValue()+"").split("\\|")[1];
-        String availDep = (listUpidsAndDependencySet.getSelectedValue()+"").split("\\|")[0];
-        //String availDep = dbc.querySingleCell("Select DependencyID from DependencyLink,Dependency where Upid20='"+src+
-            //    "' and DependencyLink.dependencyID = Dependency.DependencyID and Target='"+baseDep+"'");
-        String gids = dbc.querySingleCell("Select ExchangeableGID from dependency where DependencyID="+availDep);
-        if(gids.equals("0"))
-        {
-            String gname = Tools.getInputString("Gruppenname bitte");
-            dbc.write("Insert into glist values(null,'"+gname+"')");
-            String gid = dbc.querySIngleColumn("Select gid from glist where name='"+gname+"' ORDER BY GID desc")[0];
-                                                    //hack um den gerade eingefügen bei gleichem namen zu erwischen
-            //UPDATE table_name
-            //SET column1=value, column2=value2,...
-            //WHERE some_column=some_value
-            dbc.write("Insert into dependencyExchg values(null,'"+src+"',"+gid+")");
-            dbc.write("Update Dependency Set ExchangeableGID="+gid+" where DependencyID="+availDep);
-            gids=gid;
-            Tools.DebugHelperPrint("Init", true, "UpidTK.enableDebug");
-        }
-        if(gids.equals("0"))//Dbg-Code
-        {
-            Tools.DebugHelperPrint("FickFotze", true, "UpidTK.enableDebug");
-        }
-        
-        
-        
-        
-        addDependency(false,null,Integer.valueOf(gids));
-        refreshList();
-        updateAlternateDependencysList(availDep);
-
-    }//GEN-LAST:event_addalternateDepActionPerformed
-
-    private void lstAlternativesMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_lstAlternativesMouseClicked
-    {//GEN-HEADEREND:event_lstAlternativesMouseClicked
-        String SelectedAltUpid = ((String)lstAlternatives.getSelectedValue()).split("\\|")[1];
-        //int selme = lm.lastIndexOf(SelectedAltUpid);
-        String depID = dbc.querySingleCell("Select Dependency.DependencyID from DependencyLink,Dependency where Upid20='"+selectedUpid+
-                "' and DependencyLink.dependencyID = Dependency.DependencyID and Target='"+SelectedAltUpid+"'");
-        listUpidsAndDependencySet.setSelectedValue(depID+"|"+SelectedAltUpid, true);
-        listUpidsAndDependencySetMouseClicked(evt);
-    }//GEN-LAST:event_lstAlternativesMouseClicked
-    public void loadDependencyDataset(String loadInf)
-    {
-        String[] DepIDsForTrg = dbc.querySIngleColumn("Select DependencyID from Dependency where Target='"+loadInf.substring(3)+"'");
-        String[] DepIDsforSrc = dbc.querySIngleColumn("Select DependencyID from dependencyLink where UPID20='"+selectedUpid+"'");
-        boolean fnd = false;
-        String did = "-1";
-        for (String avsrc : DepIDsforSrc)
-        {
-            for (String avtrg : DepIDsForTrg)
-            {
-                if(!fnd && avsrc.equals(avtrg))
-                {
-                    fnd=true;
-                    did = avsrc;
-                }
-            }
-        }
-        String[] depdataSet = dbc.querySingleRow("Select * from dependency where DependencyID="+did,6);
-        //Refid,DependencyID,Target,Flags,ExcahgeableGID,Comments
-        
-        String flagsrc = depdataSet[3].substring(2);
-        String Comm = depdataSet[5];
-        txaComm.setText(Comm);
-        
-        
-        //finalized,muliresolve,forceReq;
-        boolean fin = false,multiresolve=false,forceReq=false;
-        if(flagsrc.substring(0,1).equals("X"))
-            fin = true;
-        if(flagsrc.substring(1,2).equals("X"))
-            multiresolve = true;
-        if(flagsrc.substring(2,3).equals("X"))
-            forceReq = true;
-        cxFin.setSelected(fin);
-        cxMultiresolve.setSelected(multiresolve);
-        cxForceRes.setSelected(forceReq);
-        
-    }
-    
-    public void refreshList()
-    {
-        cxFin.setSelected(false);
-        cxMultiresolve.setSelected(false);
-        cxForceRes.setSelected(false);
-        txaComm.setText("");
-        lm.clear();
-
-        String upid=selectedUpid;
-        if(upid.equals("NOP"))
-        {
-
-            String[][]availUpidsWithLink = dbc.queryTable("Select Upid20,LinkageID from upidlst where Version=2",2);
-            
-            
-            //LinkedList<String> availUpids = new LinkedList<>();
-            for (String[] Upidlin : availUpidsWithLink)
-            {
-                String depSet = dbc.querySingleCell("Select DependencyLink from objreg2 where LinkageID="+Upidlin[1]);
-                if(depSet.equals("Enabled"))
-                {
-                    lm.addElement(Upidlin[0]);
-                }
-            }
-            
-            return;
-        }
-        try{
-        String[] availDependencyIDs = dbc.querySIngleColumn("Select DependencyID from dependencyLink where UPID20='"+selectedUpid+"'");
-        String[]  availDependencys = new String[availDependencyIDs.length];
-        if(availDependencys.length<=0)
-            return;
-
-        for (int i = 0; i < availDependencys.length; i++)
-        {
-            String depid = availDependencyIDs[i];
-            if(depid==null)
-                {
-                    Tools.DebugHelperPrint("FickFotze", true, "UpidTK.enableDebug");
-                    return;
-                }
-            availDependencys[i] = availDependencyIDs[i]+"|"+dbc.querySingleCell("Select Target from Dependency where DependencyID="+depid);
-            
-        }
-        for (String DID : availDependencys)
-        {
-            lm.addElement(DID);
-            //lm.addElement(lm);<--- gibt nen fetten StackOverflow
-            
-        }
-        }
-        catch (Exception e)
-        {
-            Tools.DebugHelperPrint("Listfail()", true, "UpidTK.enableDebug");
-        }
-    }
-    
-    public void updateAlternateDependencysList(String depId)
-    {
-        lm2.clear();
-        String gids = dbc.querySingleCell("Select ExchangeableGID from dependency where DependencyID="+depId.split("\\|")[0]);
-        String[] upids = dbc.querySIngleColumn("Select VariantTarget from dependencyexchg where GroupID="+gids);
-        for (int i = 0; i < upids.length; i++)
-        {
-           lm2.addElement(gids+"|"+upids[i]);
-        }
-    }
-    public void addDependency(boolean preFilledUpid,String Upid,int gid)
-    {
-        String addUpid="null";
-        if(!preFilledUpid)
-        {
-        String[] avilUpids = dbc.querySIngleColumn("Select Upid20 from Upidlst");
-        addUpid = Tools.listSelectorPopup(avilUpids, "Welche Upid soll dependency sein");
-        }
-        else
-            addUpid = Upid;
-        
-        
-        dbc.write("Insert into DependencyLink values(null,'"+selectedUpid+"')"); 
-        String currentID = dbc.querySingleCell("Select DependencyId from DependencyLink where Upid20='"+selectedUpid+"' ORDER by DependencyID DESC;");//Hack mit erstem element     
-        
-        LinkedList<String> Flags = new LinkedList<>();
-        //this.failOut();
-        boolean fin = Tools.dlg(true,"Dependency finalisieren?","Dadurch ist sie nicht mehr änderbar","Ja","Nein");
-        if(fin)
-            Flags.add("X");
-        else
-            Flags.add("D");
-        boolean mult = Tools.dlg(true,"Mehrfacherfüllung möglich","","Ja","Nein");
-        if(mult)
-            Flags.add("X");
-        else
-            Flags.add("D");
-        
-        boolean forced = Tools.dlg(true,"Zwingend erforderlich","","Ja","Nein");
-        if(forced)
-            Flags.add("X");
-        else
-            Flags.add("D");
-        String falgtrg = Flags.size()+"|";
-        for (String falg : Flags)
-        {
-            falgtrg +=falg;
-        }
-        String comm = Tools.getInputString("Kommentar?", true);
-        //Flags=finalized|multiResolve|forcedRequire
-        dbc.write("Insert into dependency values(null,"+currentID+",'"+addUpid+"','"+falgtrg+"',"+gid+",'"+comm+"')");
-        
-        if(gid>0)
-        {
-            dbc.write("Insert into dependencyExchg values(null,'"+addUpid+"',"+gid+")");
-        }
-
-        
-        
-        
-        
-        //refID,DependencyID,Target,Flags,0(ExchangableID,wird geändert wenn benötigt,0=Default->not enab)
-        
-    }
-    public void addDependency()
-    {
-        addDependency(false,null,0);
-    }
-    
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String args[])
-    {
-                        try {
-	    UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
-	} catch( Exception e ) { 
-	    //e.printStackTrace();
-	}
-        /*
-         * Create and display the form
-         */
-        java.awt.EventQueue.invokeLater(new Runnable()
-        {
-
-            public void run()
-            {
-                new DependencyManager().setVisible(true);
-            }
-        });
-    }
-    // Variables declaration - do not modify//GEN-BEGIN:variables
-    private javax.swing.JButton addDependency;
-    private javax.swing.JButton addalternateDep;
-    private javax.swing.JCheckBox cxFin;
-    private javax.swing.JCheckBox cxForceRes;
-    private javax.swing.JCheckBox cxMultiresolve;
-    private javax.swing.JLabel jLabel1;
-    private javax.swing.JScrollPane jScrollPane1;
-    private javax.swing.JScrollPane jScrollPane2;
-    private javax.swing.JScrollPane jScrollPane3;
-    private javax.swing.JSeparator jSeparator1;
-    private javax.swing.JSeparator jSeparator2;
-    private javax.swing.JSeparator jSeparator3;
-    private javax.swing.JList listUpidsAndDependencySet;
-    private javax.swing.JList lstAlternatives;
-    private javax.swing.JButton refresh;
-    private javax.swing.JButton toMain;
-    private javax.swing.JButton toMainList;
-    private javax.swing.JTextArea txaComm;
-    // End of variables declaration//GEN-END:variables
-}
+/*
+ * Copyright (C) 2015 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package de.nplusc.upidgen;
+
+
+import de.nplusc.izc.tools.IOtools.DBWriter;
+import de.nplusc.izc.tools.baseTools.Tools;
+import java.util.LinkedList;
+import javax.swing.DefaultListModel;
+import javax.swing.UIManager;
+
+
+/**
+ *
+ * @author LH
+ */
+public class DependencyManager extends javax.swing.JFrame
+{
+            DefaultListModel lm = null,lm2 = null;;
+    /**
+     * Creates new form DependencyManager
+     */
+    public DependencyManager()
+    {
+                                try {
+	    UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
+	} catch( Exception e ) { 
+	    //e.printStackTrace();
+	}
+        initComponents();
+        lm= ((DefaultListModel)listUpidsAndDependencySet.getModel());
+        lm2= ((DefaultListModel)lstAlternatives.getModel());
+    }
+
+    /**
+     * This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents()
+    {
+
+        jScrollPane1 = new javax.swing.JScrollPane();
+        listUpidsAndDependencySet = new javax.swing.JList();
+        jScrollPane2 = new javax.swing.JScrollPane();
+        lstAlternatives = new javax.swing.JList();
+        toMainList = new javax.swing.JButton();
+        jSeparator1 = new javax.swing.JSeparator();
+        jSeparator2 = new javax.swing.JSeparator();
+        jSeparator3 = new javax.swing.JSeparator();
+        toMain = new javax.swing.JButton();
+        refresh = new javax.swing.JButton();
+        addDependency = new javax.swing.JButton();
+        addalternateDep = new javax.swing.JButton();
+        cxFin = new javax.swing.JCheckBox();
+        cxMultiresolve = new javax.swing.JCheckBox();
+        cxForceRes = new javax.swing.JCheckBox();
+        jScrollPane3 = new javax.swing.JScrollPane();
+        txaComm = new javax.swing.JTextArea();
+        jLabel1 = new javax.swing.JLabel();
+
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+        listUpidsAndDependencySet.setModel(new DefaultListModel());
+        listUpidsAndDependencySet.addMouseListener(new java.awt.event.MouseAdapter()
+        {
+            public void mouseClicked(java.awt.event.MouseEvent evt)
+            {
+                listUpidsAndDependencySetMouseClicked(evt);
+            }
+        });
+        jScrollPane1.setViewportView(listUpidsAndDependencySet);
+
+        lstAlternatives.setModel(new DefaultListModel());
+        lstAlternatives.addMouseListener(new java.awt.event.MouseAdapter()
+        {
+            public void mouseClicked(java.awt.event.MouseEvent evt)
+            {
+                lstAlternativesMouseClicked(evt);
+            }
+        });
+        jScrollPane2.setViewportView(lstAlternatives);
+
+        toMainList.setText(".toMainList()");
+        toMainList.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                toMainListActionPerformed(evt);
+            }
+        });
+
+        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
+
+        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
+
+        toMain.setText(".toMain()");
+        toMain.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                toMainActionPerformed(evt);
+            }
+        });
+
+        refresh.setText(".refresh()");
+        refresh.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                refreshActionPerformed(evt);
+            }
+        });
+
+        addDependency.setText(".add(\"Dependency\")");
+        addDependency.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                addDependencyActionPerformed(evt);
+            }
+        });
+
+        addalternateDep.setText(".add(\"alterantive dependency\");");
+        addalternateDep.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                addalternateDepActionPerformed(evt);
+            }
+        });
+
+        cxFin.setText("Finalized");
+        cxFin.setEnabled(false);
+
+        cxMultiresolve.setText("Mehrfacherfüllbar");
+        cxMultiresolve.setEnabled(false);
+
+        cxForceRes.setText("zwingend nötig");
+        cxForceRes.setEnabled(false);
+
+        txaComm.setColumns(20);
+        txaComm.setEditable(false);
+        txaComm.setRows(5);
+        jScrollPane3.setViewportView(txaComm);
+
+        jLabel1.setText("Weitere Vermerke");
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(refresh)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addComponent(toMainList))
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                        .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 1007, javax.swing.GroupLayout.PREFERRED_SIZE))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addGroup(layout.createSequentialGroup()
+                                .addComponent(addDependency)
+                                .addGap(29, 29, 29)
+                                .addComponent(addalternateDep))
+                            .addGroup(layout.createSequentialGroup()
+                                .addGap(18, 18, 18)
+                                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 544, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addGroup(layout.createSequentialGroup()
+                                .addGap(115, 115, 115)
+                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                                    .addGroup(layout.createSequentialGroup()
+                                        .addComponent(cxFin)
+                                        .addGap(37, 37, 37)
+                                        .addComponent(cxMultiresolve)
+                                        .addGap(26, 26, 26)
+                                        .addComponent(cxForceRes))
+                                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 376, javax.swing.GroupLayout.PREFERRED_SIZE))))
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addGroup(layout.createSequentialGroup()
+                                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addComponent(toMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE))
+                        .addContainerGap())))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addComponent(jSeparator1)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(toMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addComponent(addDependency)
+                    .addComponent(addalternateDep))
+                .addGap(18, 18, 18)
+                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(layout.createSequentialGroup()
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
+                            .addComponent(jSeparator2)))
+                    .addGroup(layout.createSequentialGroup()
+                        .addGap(74, 74, 74)
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                            .addComponent(cxFin)
+                            .addComponent(cxMultiresolve)
+                            .addComponent(cxForceRes))
+                        .addGap(18, 18, 18)
+                        .addComponent(jLabel1)
+                        .addGap(8, 8, 8)
+                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))))
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(toMainList)
+                    .addComponent(refresh))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jScrollPane1)
+                .addContainerGap())
+        );
+
+        pack();
+    }// </editor-fold>//GEN-END:initComponents
+    
+    public DBWriter dbc = PublicStorage.dbc;
+    private String selectedUpid = "NOP";
+    boolean onTop = true;
+    private void toMainActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_toMainActionPerformed
+    {//GEN-HEADEREND:event_toMainActionPerformed
+        Ifatzeh.sel.setVisible(true);
+        this.setVisible(false);
+    }//GEN-LAST:event_toMainActionPerformed
+
+    private void refreshActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_refreshActionPerformed
+    {//GEN-HEADEREND:event_refreshActionPerformed
+        refreshList();
+    }//GEN-LAST:event_refreshActionPerformed
+
+    private void toMainListActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_toMainListActionPerformed
+    {//GEN-HEADEREND:event_toMainListActionPerformed
+        selectedUpid="NOP";
+        onTop=true;
+        refreshList();
+    }//GEN-LAST:event_toMainListActionPerformed
+
+    private void listUpidsAndDependencySetMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_listUpidsAndDependencySetMouseClicked
+    {//GEN-HEADEREND:event_listUpidsAndDependencySetMouseClicked
+        String load = (String)listUpidsAndDependencySet.getSelectedValue();
+        if(onTop)
+        {
+            
+            selectedUpid=load;
+            refreshList();
+            onTop=false;
+            return;
+        }
+        loadDependencyDataset(load);
+        updateAlternateDependencysList(load);
+    }//GEN-LAST:event_listUpidsAndDependencySetMouseClicked
+
+    private void addDependencyActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_addDependencyActionPerformed
+    {//GEN-HEADEREND:event_addDependencyActionPerformed
+        addDependency();
+    }//GEN-LAST:event_addDependencyActionPerformed
+
+    private void addalternateDepActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_addalternateDepActionPerformed
+    {//GEN-HEADEREND:event_addalternateDepActionPerformed
+        String src = (listUpidsAndDependencySet.getSelectedValue()+"").split("\\|")[1];
+        String availDep = (listUpidsAndDependencySet.getSelectedValue()+"").split("\\|")[0];
+        //String availDep = dbc.querySingleCell("Select DependencyID from DependencyLink,Dependency where Upid20='"+src+
+            //    "' and DependencyLink.dependencyID = Dependency.DependencyID and Target='"+baseDep+"'");
+        String gids = dbc.querySingleCell("Select ExchangeableGID from dependency where DependencyID="+availDep);
+        if(gids.equals("0"))
+        {
+            String gname = Tools.getInputString("Gruppenname bitte");
+            dbc.write("Insert into glist values(null,'"+gname+"')");
+            String gid = dbc.querySIngleColumn("Select gid from glist where name='"+gname+"' ORDER BY GID desc")[0];
+                                                    //hack um den gerade eingefügen bei gleichem namen zu erwischen
+            //UPDATE table_name
+            //SET column1=value, column2=value2,...
+            //WHERE some_column=some_value
+            dbc.write("Insert into dependencyExchg values(null,'"+src+"',"+gid+")");
+            dbc.write("Update Dependency Set ExchangeableGID="+gid+" where DependencyID="+availDep);
+            gids=gid;
+            Tools.DebugHelperPrint("Init", true, "UpidTK.enableDebug");
+        }
+        if(gids.equals("0"))//Dbg-Code
+        {
+            Tools.DebugHelperPrint("FickFotze", true, "UpidTK.enableDebug");
+        }
+        
+        
+        
+        
+        addDependency(false,null,Integer.valueOf(gids));
+        refreshList();
+        updateAlternateDependencysList(availDep);
+
+    }//GEN-LAST:event_addalternateDepActionPerformed
+
+    private void lstAlternativesMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_lstAlternativesMouseClicked
+    {//GEN-HEADEREND:event_lstAlternativesMouseClicked
+        String SelectedAltUpid = ((String)lstAlternatives.getSelectedValue()).split("\\|")[1];
+        //int selme = lm.lastIndexOf(SelectedAltUpid);
+        String depID = dbc.querySingleCell("Select Dependency.DependencyID from DependencyLink,Dependency where Upid20='"+selectedUpid+
+                "' and DependencyLink.dependencyID = Dependency.DependencyID and Target='"+SelectedAltUpid+"'");
+        listUpidsAndDependencySet.setSelectedValue(depID+"|"+SelectedAltUpid, true);
+        listUpidsAndDependencySetMouseClicked(evt);
+    }//GEN-LAST:event_lstAlternativesMouseClicked
+    public void loadDependencyDataset(String loadInf)
+    {
+        String[] DepIDsForTrg = dbc.querySIngleColumn("Select DependencyID from Dependency where Target='"+loadInf.substring(3)+"'");
+        String[] DepIDsforSrc = dbc.querySIngleColumn("Select DependencyID from dependencyLink where UPID20='"+selectedUpid+"'");
+        boolean fnd = false;
+        String did = "-1";
+        for (String avsrc : DepIDsforSrc)
+        {
+            for (String avtrg : DepIDsForTrg)
+            {
+                if(!fnd && avsrc.equals(avtrg))
+                {
+                    fnd=true;
+                    did = avsrc;
+                }
+            }
+        }
+        String[] depdataSet = dbc.querySingleRow("Select * from dependency where DependencyID="+did,6);
+        //Refid,DependencyID,Target,Flags,ExcahgeableGID,Comments
+        
+        String flagsrc = depdataSet[3].substring(2);
+        String Comm = depdataSet[5];
+        txaComm.setText(Comm);
+        
+        
+        //finalized,muliresolve,forceReq;
+        boolean fin = false,multiresolve=false,forceReq=false;
+        if(flagsrc.substring(0,1).equals("X"))
+            fin = true;
+        if(flagsrc.substring(1,2).equals("X"))
+            multiresolve = true;
+        if(flagsrc.substring(2,3).equals("X"))
+            forceReq = true;
+        cxFin.setSelected(fin);
+        cxMultiresolve.setSelected(multiresolve);
+        cxForceRes.setSelected(forceReq);
+        
+    }
+    
+    public void refreshList()
+    {
+        cxFin.setSelected(false);
+        cxMultiresolve.setSelected(false);
+        cxForceRes.setSelected(false);
+        txaComm.setText("");
+        lm.clear();
+
+        String upid=selectedUpid;
+        if(upid.equals("NOP"))
+        {
+
+            String[][]availUpidsWithLink = dbc.queryTable("Select Upid20,LinkageID from upidlst where Version=2",2);
+            
+            
+            //LinkedList<String> availUpids = new LinkedList<>();
+            for (String[] Upidlin : availUpidsWithLink)
+            {
+                String depSet = dbc.querySingleCell("Select DependencyLink from objreg2 where LinkageID="+Upidlin[1]);
+                if(depSet.equals("Enabled"))
+                {
+                    lm.addElement(Upidlin[0]);
+                }
+            }
+            
+            return;
+        }
+        try{
+        String[] availDependencyIDs = dbc.querySIngleColumn("Select DependencyID from dependencyLink where UPID20='"+selectedUpid+"'");
+        String[]  availDependencys = new String[availDependencyIDs.length];
+        if(availDependencys.length<=0)
+            return;
+
+        for (int i = 0; i < availDependencys.length; i++)
+        {
+            String depid = availDependencyIDs[i];
+            if(depid==null)
+                {
+                    Tools.DebugHelperPrint("FickFotze", true, "UpidTK.enableDebug");
+                    return;
+                }
+            availDependencys[i] = availDependencyIDs[i]+"|"+dbc.querySingleCell("Select Target from Dependency where DependencyID="+depid);
+            
+        }
+        for (String DID : availDependencys)
+        {
+            lm.addElement(DID);
+            //lm.addElement(lm);<--- gibt nen fetten StackOverflow
+            
+        }
+        }
+        catch (Exception e)
+        {
+            Tools.DebugHelperPrint("Listfail()", true, "UpidTK.enableDebug");
+        }
+    }
+    
+    public void updateAlternateDependencysList(String depId)
+    {
+        lm2.clear();
+        String gids = dbc.querySingleCell("Select ExchangeableGID from dependency where DependencyID="+depId.split("\\|")[0]);
+        String[] upids = dbc.querySIngleColumn("Select VariantTarget from dependencyexchg where GroupID="+gids);
+        for (int i = 0; i < upids.length; i++)
+        {
+           lm2.addElement(gids+"|"+upids[i]);
+        }
+    }
+    public void addDependency(boolean preFilledUpid,String Upid,int gid)
+    {
+        String addUpid="null";
+        if(!preFilledUpid)
+        {
+        String[] avilUpids = dbc.querySIngleColumn("Select Upid20 from Upidlst");
+        addUpid = Tools.listSelectorPopup(avilUpids, "Welche Upid soll dependency sein");
+        }
+        else
+            addUpid = Upid;
+        
+        
+        dbc.write("Insert into DependencyLink values(null,'"+selectedUpid+"')"); 
+        String currentID = dbc.querySingleCell("Select DependencyId from DependencyLink where Upid20='"+selectedUpid+"' ORDER by DependencyID DESC;");//Hack mit erstem element     
+        
+        LinkedList<String> Flags = new LinkedList<>();
+        //this.failOut();
+        boolean fin = Tools.dlg(true,"Dependency finalisieren?","Dadurch ist sie nicht mehr änderbar","Ja","Nein");
+        if(fin)
+            Flags.add("X");
+        else
+            Flags.add("D");
+        boolean mult = Tools.dlg(true,"Mehrfacherfüllung möglich","","Ja","Nein");
+        if(mult)
+            Flags.add("X");
+        else
+            Flags.add("D");
+        
+        boolean forced = Tools.dlg(true,"Zwingend erforderlich","","Ja","Nein");
+        if(forced)
+            Flags.add("X");
+        else
+            Flags.add("D");
+        String falgtrg = Flags.size()+"|";
+        for (String falg : Flags)
+        {
+            falgtrg +=falg;
+        }
+        String comm = Tools.getInputString("Kommentar?", true);
+        //Flags=finalized|multiResolve|forcedRequire
+        dbc.write("Insert into dependency values(null,"+currentID+",'"+addUpid+"','"+falgtrg+"',"+gid+",'"+comm+"')");
+        
+        if(gid>0)
+        {
+            dbc.write("Insert into dependencyExchg values(null,'"+addUpid+"',"+gid+")");
+        }
+
+        
+        
+        
+        
+        //refID,DependencyID,Target,Flags,0(ExchangableID,wird geändert wenn benötigt,0=Default->not enab)
+        
+    }
+    public void addDependency()
+    {
+        addDependency(false,null,0);
+    }
+    
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[])
+    {
+                        try {
+	    UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
+	} catch( Exception e ) { 
+	    //e.printStackTrace();
+	}
+        /*
+         * Create and display the form
+         */
+        java.awt.EventQueue.invokeLater(new Runnable()
+        {
+
+            public void run()
+            {
+                new DependencyManager().setVisible(true);
+            }
+        });
+    }
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton addDependency;
+    private javax.swing.JButton addalternateDep;
+    private javax.swing.JCheckBox cxFin;
+    private javax.swing.JCheckBox cxForceRes;
+    private javax.swing.JCheckBox cxMultiresolve;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JScrollPane jScrollPane2;
+    private javax.swing.JScrollPane jScrollPane3;
+    private javax.swing.JSeparator jSeparator1;
+    private javax.swing.JSeparator jSeparator2;
+    private javax.swing.JSeparator jSeparator3;
+    private javax.swing.JList listUpidsAndDependencySet;
+    private javax.swing.JList lstAlternatives;
+    private javax.swing.JButton refresh;
+    private javax.swing.JButton toMain;
+    private javax.swing.JButton toMainList;
+    private javax.swing.JTextArea txaComm;
+    // End of variables declaration//GEN-END:variables
+}

+ 7 - 4
WPCMGr/build.gradle

@@ -68,15 +68,18 @@ dependencies{
 	compile "org.yaml:snakeyaml:+"
 	compile 'org.ini4j:ini4j:0.5.2'
 	compile 'mysql:mysql-connector-java:5.1.6'
-        compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.1'
+    compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.1'
 	compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.1'
 	compile group: 'org.apache.logging.log4j', name: 'log4j-iostreams', version: '2.1'
-        compile 'org.fusesource.jansi:jansi:1.11'
-        compile 'commons-cli:commons-cli:1.3'
+    compile 'org.fusesource.jansi:jansi:1.11'
+    compile 'commons-cli:commons-cli:1.3'
 	compile(project(':ToolKit')) {
         transitive = false
-        compile(project(':external:java-progressbar'))
+        
     }
+    compile(project(':external:java-progressbar'))
+    compile 'net.java.dev.jna:jna:4.1.0'
+    compile 'net.java.dev.jna:jna-platform:4.1.0'
 
 
 	

BIN
WPCMGr/lib/jnafilechooser-api-0.1-SNAPSHOT.jar


BIN
WPCMGr/lib/jnafilechooser-win32-0.1-SNAPSHOT.jar


+ 1 - 12
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/MainWindow.form

@@ -27,16 +27,5 @@
     <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   </AuxValues>
 
-  <Layout>
-    <DimensionLayout dim="0">
-      <Group type="103" groupAlignment="0" attributes="0">
-          <EmptySpace min="0" pref="400" max="32767" attributes="0"/>
-      </Group>
-    </DimensionLayout>
-    <DimensionLayout dim="1">
-      <Group type="103" groupAlignment="0" attributes="0">
-          <EmptySpace min="0" pref="300" max="32767" attributes="0"/>
-      </Group>
-    </DimensionLayout>
-  </Layout>
+  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignCardLayout"/>
 </Form>

+ 67 - 13
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/MainWindow.java

@@ -16,21 +16,85 @@
  */
 package de.nplusc.izc.Utilities.WPCMgr.UI;
 
+import de.nplusc.izc.Utilities.WPCMgr.WPCUtils;
+import de.nplusc.izc.tools.baseTools.Messagers;
+import java.awt.CardLayout;
+import java.io.FileNotFoundException;
+import java.util.HashMap;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
 /**
  *
  * @author iZc <nplusc.de>
  */
 public class MainWindow extends javax.swing.JFrame
 {
-
+    private CardLayout lay;
+    private WallpaperManager mgr;
+    private Settings settingsui;
+    private ScreenLayouter layouter;
+    
+    private static final Logger l = LogManager.getLogger();
+    private HashMap<String,Object> settings;
+    private String loadedPath;
     /**
      * Creates new form MainWindow
      */
     public MainWindow()
     {
         initComponents();
+        lay=(CardLayout) this.getContentPane().getLayout();
+        this.getContentPane().add(new WelcomeScreen(this),WelcomeScreen.ID);
+        this.pack();
+        this.setVisible(true);
     }
 
+    void loadCache(String loadPath) throws FileNotFoundException
+    {
+        settings = WPCUtils.getConfig(loadPath);
+        loadedPath=loadedPath;
+        mgr=new WallpaperManager(this);
+        settingsui=new Settings(this);
+        this.getContentPane().add(settingsui,Settings.ID);
+        this.getContentPane().add(mgr,WallpaperManager.ID);
+        lay.show(this.getContentPane(), WallpaperManager.ID);
+        this.pack();
+    }
+    
+    HashMap<String,Object> getSettings()
+    {
+        return settings;
+    }
+    
+    void revertSettings()
+    {
+        try
+        {
+            settings = WPCUtils.getConfig(loadedPath);
+        }
+        catch (FileNotFoundException ex)
+        {
+            Messagers.SingleLineMsg("Cache got corrupted", "Quit");
+            System.exit(1);
+        }
+    }
+    
+    void unloadCache()
+    {
+        
+    }
+    
+    void showSettings()
+    {
+        lay.show(this.getContentPane(), Settings.ID);
+    }
+    
+    void showManager()
+    {
+        lay.show(this.getContentPane(), WallpaperManager.ID);
+    }
+    
     /**
      * This method is called from within the constructor to
      * initialize the form.
@@ -47,17 +111,7 @@ public class MainWindow extends javax.swing.JFrame
         jButton1.setText("jButton1");
 
         setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
-
-        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
-        getContentPane().setLayout(layout);
-        layout.setHorizontalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 400, Short.MAX_VALUE)
-        );
-        layout.setVerticalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 300, Short.MAX_VALUE)
-        );
+        getContentPane().setLayout(new java.awt.CardLayout());
 
         pack();
     }// </editor-fold>//GEN-END:initComponents
@@ -106,7 +160,7 @@ public class MainWindow extends javax.swing.JFrame
         {
             public void run()
             {
-                new MainWindow().setVisible(true);
+                new MainWindow();
             }
         });
     }

+ 388 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/ScreenLayouter.form

@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jPanel4" min="-2" max="-2" attributes="0"/>
+              <EmptySpace type="unrelated" max="-2" attributes="0"/>
+              <Component id="jPanel3" max="32767" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="panelScreenPreview" min="-2" max="-2" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Component id="btnOkay" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
+                      <Component id="btnCancel" min="-2" max="-2" attributes="0"/>
+                  </Group>
+              </Group>
+              <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="jPanel4" min="-2" max="-2" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="panelScreenPreview" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="1" attributes="0">
+                          <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="3" attributes="0">
+                              <Component id="btnOkay" alignment="3" min="-2" max="-2" attributes="0"/>
+                              <Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                      </Group>
+                  </Group>
+                  <Component id="jPanel3" alignment="0" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Container class="javax.swing.JPanel" name="panelScreenPreview">
+
+      <Layout>
+        <DimensionLayout dim="0">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <EmptySpace min="0" pref="674" max="32767" attributes="0"/>
+          </Group>
+        </DimensionLayout>
+        <DimensionLayout dim="1">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <EmptySpace min="0" pref="365" max="32767" attributes="0"/>
+          </Group>
+        </DimensionLayout>
+      </Layout>
+    </Container>
+    <Container class="javax.swing.JPanel" name="jPanel2">
+      <Properties>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
+            <TitledBorder title="Define Monitor"/>
+          </Border>
+        </Property>
+      </Properties>
+
+      <Layout>
+        <DimensionLayout dim="0">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="103" alignment="0" groupAlignment="0" attributes="0">
+                          <Group type="102" alignment="1" attributes="0">
+                              <Component id="jLabel1" min="-2" pref="45" max="-2" attributes="0"/>
+                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                          </Group>
+                          <Group type="102" alignment="0" attributes="0">
+                              <Component id="jLabel2" min="-2" pref="48" max="-2" attributes="0"/>
+                              <EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
+                          </Group>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
+                      </Group>
+                  </Group>
+                  <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                      <Group type="102" attributes="0">
+                          <Group type="103" groupAlignment="1" max="-2" attributes="0">
+                              <Component id="jTextField2" pref="68" max="32767" attributes="0"/>
+                              <Component id="jTextField1" max="32767" attributes="0"/>
+                          </Group>
+                          <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
+                              <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                              <Component id="jTextField4" pref="78" max="32767" attributes="0"/>
+                              <Component id="jTextField3" max="32767" attributes="0"/>
+                          </Group>
+                      </Group>
+                      <Component id="jTextField5" max="32767" attributes="0"/>
+                  </Group>
+                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Component id="btnAddScreen" min="-2" max="-2" attributes="0"/>
+                      <Component id="jButton2" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace min="0" pref="22" max="32767" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+        <DimensionLayout dim="1">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" alignment="0" attributes="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" attributes="0">
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Group type="103" groupAlignment="0" attributes="0">
+                                  <Group type="103" groupAlignment="3" attributes="0">
+                                      <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
+                                      <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
+                                      <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/>
+                                  </Group>
+                                  <Component id="jLabel3" alignment="1" min="-2" max="-2" attributes="0"/>
+                              </Group>
+                              <Component id="btnAddScreen" alignment="0" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                          <EmptySpace type="separate" max="-2" attributes="0"/>
+                          <Group type="103" groupAlignment="0" attributes="0">
+                              <Group type="103" groupAlignment="3" attributes="0">
+                                  <Component id="jTextField2" alignment="3" min="-2" max="-2" attributes="0"/>
+                                  <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
+                                  <Component id="jTextField4" alignment="3" min="-2" max="-2" attributes="0"/>
+                              </Group>
+                              <Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
+                          </Group>
+                      </Group>
+                      <Component id="jButton2" alignment="1" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jTextField5" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace pref="24" max="32767" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+      </Layout>
+      <SubComponents>
+        <Component class="javax.swing.JLabel" name="jLabel1">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Width"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel2">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Height"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel3">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="X"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel4">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Y"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JTextField" name="jTextField1">
+        </Component>
+        <Component class="javax.swing.JTextField" name="jTextField2">
+        </Component>
+        <Component class="javax.swing.JTextField" name="jTextField3">
+        </Component>
+        <Component class="javax.swing.JTextField" name="jTextField4">
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel5">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Name"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JTextField" name="jTextField5">
+        </Component>
+        <Component class="javax.swing.JButton" name="btnAddScreen">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Save Monitor"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JButton" name="jButton2">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Discard"/>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+    <Component class="javax.swing.JButton" name="btnOkay">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Okay"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOkayActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="btnCancel">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Cancel"/>
+      </Properties>
+    </Component>
+    <Container class="javax.swing.JPanel" name="jPanel3">
+      <Properties>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
+            <TitledBorder title="Monitors"/>
+          </Border>
+        </Property>
+      </Properties>
+
+      <Layout>
+        <DimensionLayout dim="0">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" attributes="0">
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" attributes="0">
+                          <EmptySpace max="-2" attributes="0"/>
+                          <Component id="jScrollPane2" pref="0" max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" attributes="0">
+                          <Component id="btnMonitorAdd" min="-2" pref="56" max="-2" attributes="0"/>
+                          <EmptySpace pref="54" max="32767" attributes="0"/>
+                          <Component id="btnRemoveMonitor" min="-2" pref="49" max="-2" attributes="0"/>
+                      </Group>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+        <DimensionLayout dim="1">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" alignment="0" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Component id="jScrollPane2" min="-2" pref="443" max="-2" attributes="0"/>
+                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="btnMonitorAdd" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="btnRemoveMonitor" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace min="0" pref="14" max="32767" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+      </Layout>
+      <SubComponents>
+        <Container class="javax.swing.JScrollPane" name="jScrollPane2">
+          <AuxValues>
+            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+          </AuxValues>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+          <SubComponents>
+            <Component class="javax.swing.JList" name="lstMonitors">
+              <Properties>
+                <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+                  <Connection code="new DefaultListModel&lt;String&gt;()&#xa;" type="code"/>
+                </Property>
+              </Properties>
+              <AuxValues>
+                <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+              </AuxValues>
+            </Component>
+          </SubComponents>
+        </Container>
+        <Component class="javax.swing.JButton" name="btnMonitorAdd">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="+"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JButton" name="btnRemoveMonitor">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="-"/>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+    <Container class="javax.swing.JPanel" name="jPanel4">
+      <Properties>
+        <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+          <Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
+            <TitledBorder title="Monitor Strips"/>
+          </Border>
+        </Property>
+      </Properties>
+
+      <Layout>
+        <DimensionLayout dim="0">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="jScrollPane1" min="-2" pref="148" max="-2" attributes="0"/>
+                          <EmptySpace max="32767" attributes="0"/>
+                      </Group>
+                      <Group type="102" alignment="0" attributes="0">
+                          <Component id="btnAddMonstrip" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace max="32767" attributes="0"/>
+                          <Component id="btnRemoveMonstrip" min="-2" pref="45" max="-2" attributes="0"/>
+                          <EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
+                      </Group>
+                  </Group>
+              </Group>
+          </Group>
+        </DimensionLayout>
+        <DimensionLayout dim="1">
+          <Group type="103" groupAlignment="0" attributes="0">
+              <Group type="102" alignment="0" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Component id="jScrollPane1" min="-2" pref="440" max="-2" attributes="0"/>
+                  <EmptySpace type="separate" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="btnAddMonstrip" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="btnRemoveMonstrip" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace pref="11" max="32767" attributes="0"/>
+              </Group>
+          </Group>
+        </DimensionLayout>
+      </Layout>
+      <SubComponents>
+        <Container class="javax.swing.JScrollPane" name="jScrollPane1">
+          <AuxValues>
+            <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+          </AuxValues>
+
+          <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+          <SubComponents>
+            <Component class="javax.swing.JList" name="lstMonStrips">
+              <Properties>
+                <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+                  <Connection code="new DefaultListModel&lt;String&gt;()" type="code"/>
+                </Property>
+              </Properties>
+              <AuxValues>
+                <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
+              </AuxValues>
+            </Component>
+          </SubComponents>
+        </Container>
+        <Component class="javax.swing.JButton" name="btnAddMonstrip">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="+"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JButton" name="btnRemoveMonstrip">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="-"/>
+          </Properties>
+        </Component>
+      </SubComponents>
+    </Container>
+  </SubComponents>
+</Form>

+ 326 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/ScreenLayouter.java

@@ -0,0 +1,326 @@
+/*
+ * Copyright (C) 2017 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.nplusc.izc.Utilities.WPCMgr.UI;
+
+import javax.swing.DefaultListModel;
+
+/**
+ *
+ * @author iZc <nplusc.de>
+ */
+public class ScreenLayouter extends javax.swing.JPanel
+{
+    public static final String ID ="SCREENLAYOUTER";
+    MainWindow parent;
+    /**
+     * Creates new form ScreenLayouter
+     */
+    public ScreenLayouter(MainWindow w)
+    {
+        parent=w;
+        initComponents();
+    }
+
+    /**
+     * This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents()
+    {
+
+        panelScreenPreview = new javax.swing.JPanel();
+        jPanel2 = new javax.swing.JPanel();
+        jLabel1 = new javax.swing.JLabel();
+        jLabel2 = new javax.swing.JLabel();
+        jLabel3 = new javax.swing.JLabel();
+        jLabel4 = new javax.swing.JLabel();
+        jTextField1 = new javax.swing.JTextField();
+        jTextField2 = new javax.swing.JTextField();
+        jTextField3 = new javax.swing.JTextField();
+        jTextField4 = new javax.swing.JTextField();
+        jLabel5 = new javax.swing.JLabel();
+        jTextField5 = new javax.swing.JTextField();
+        btnAddScreen = new javax.swing.JButton();
+        jButton2 = new javax.swing.JButton();
+        btnOkay = new javax.swing.JButton();
+        btnCancel = new javax.swing.JButton();
+        jPanel3 = new javax.swing.JPanel();
+        jScrollPane2 = new javax.swing.JScrollPane();
+        lstMonitors = new javax.swing.JList<>();
+        btnMonitorAdd = new javax.swing.JButton();
+        btnRemoveMonitor = new javax.swing.JButton();
+        jPanel4 = new javax.swing.JPanel();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        lstMonStrips = new javax.swing.JList<>();
+        btnAddMonstrip = new javax.swing.JButton();
+        btnRemoveMonstrip = new javax.swing.JButton();
+
+        javax.swing.GroupLayout panelScreenPreviewLayout = new javax.swing.GroupLayout(panelScreenPreview);
+        panelScreenPreview.setLayout(panelScreenPreviewLayout);
+        panelScreenPreviewLayout.setHorizontalGroup(
+            panelScreenPreviewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 674, Short.MAX_VALUE)
+        );
+        panelScreenPreviewLayout.setVerticalGroup(
+            panelScreenPreviewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 365, Short.MAX_VALUE)
+        );
+
+        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Define Monitor"));
+
+        jLabel1.setText("Width");
+
+        jLabel2.setText("Height");
+
+        jLabel3.setText("X");
+
+        jLabel4.setText("Y");
+
+        jLabel5.setText("Name");
+
+        btnAddScreen.setText("Save Monitor");
+
+        jButton2.setText("Discard");
+
+        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
+        jPanel2.setLayout(jPanel2Layout);
+        jPanel2Layout.setHorizontalGroup(
+            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel2Layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
+                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
+                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
+                        .addGroup(jPanel2Layout.createSequentialGroup()
+                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
+                            .addGap(9, 9, 9)))
+                    .addGroup(jPanel2Layout.createSequentialGroup()
+                        .addComponent(jLabel5)
+                        .addGap(24, 24, 24)))
+                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                    .addGroup(jPanel2Layout.createSequentialGroup()
+                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+                            .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
+                            .addComponent(jTextField1))
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addComponent(jLabel4)
+                            .addComponent(jLabel3))
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                            .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)
+                            .addComponent(jTextField3)))
+                    .addComponent(jTextField5))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(btnAddScreen)
+                    .addComponent(jButton2))
+                .addGap(0, 22, Short.MAX_VALUE))
+        );
+        jPanel2Layout.setVerticalGroup(
+            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel2Layout.createSequentialGroup()
+                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(jPanel2Layout.createSequentialGroup()
+                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                                    .addComponent(jLabel1)
+                                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                                .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING))
+                            .addComponent(btnAddScreen))
+                        .addGap(18, 18, 18)
+                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                                .addComponent(jLabel4)
+                                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                            .addComponent(jLabel2)))
+                    .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jLabel5)
+                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addContainerGap(24, Short.MAX_VALUE))
+        );
+
+        btnOkay.setText("Okay");
+        btnOkay.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                btnOkayActionPerformed(evt);
+            }
+        });
+
+        btnCancel.setText("Cancel");
+
+        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Monitors"));
+
+        lstMonitors.setModel(new DefaultListModel<String>()
+        );
+        jScrollPane2.setViewportView(lstMonitors);
+
+        btnMonitorAdd.setText("+");
+
+        btnRemoveMonitor.setText("-");
+
+        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
+        jPanel3.setLayout(jPanel3Layout);
+        jPanel3Layout.setHorizontalGroup(
+            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel3Layout.createSequentialGroup()
+                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(jPanel3Layout.createSequentialGroup()
+                        .addContainerGap()
+                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
+                    .addGroup(jPanel3Layout.createSequentialGroup()
+                        .addComponent(btnMonitorAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 54, Short.MAX_VALUE)
+                        .addComponent(btnRemoveMonitor, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)))
+                .addContainerGap())
+        );
+        jPanel3Layout.setVerticalGroup(
+            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel3Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 443, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(btnMonitorAdd)
+                    .addComponent(btnRemoveMonitor))
+                .addGap(0, 14, Short.MAX_VALUE))
+        );
+
+        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Monitor Strips"));
+
+        lstMonStrips.setModel(new DefaultListModel<String>());
+        jScrollPane1.setViewportView(lstMonStrips);
+
+        btnAddMonstrip.setText("+");
+
+        btnRemoveMonstrip.setText("-");
+
+        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
+        jPanel4.setLayout(jPanel4Layout);
+        jPanel4Layout.setHorizontalGroup(
+            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel4Layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(jPanel4Layout.createSequentialGroup()
+                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                    .addGroup(jPanel4Layout.createSequentialGroup()
+                        .addComponent(btnAddMonstrip)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                        .addComponent(btnRemoveMonstrip, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addGap(14, 14, 14))))
+        );
+        jPanel4Layout.setVerticalGroup(
+            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(jPanel4Layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 440, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addGap(18, 18, 18)
+                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(btnAddMonstrip)
+                    .addComponent(btnRemoveMonstrip))
+                .addContainerGap(11, Short.MAX_VALUE))
+        );
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(panelScreenPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addGap(18, 18, 18)
+                        .addComponent(btnOkay)
+                        .addGap(70, 70, 70)
+                        .addComponent(btnCancel)))
+                .addGap(28, 28, 28))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(panelScreenPreview, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addGap(18, 18, 18)
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                                .addComponent(btnOkay)
+                                .addComponent(btnCancel))))
+                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void btnOkayActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnOkayActionPerformed
+    {//GEN-HEADEREND:event_btnOkayActionPerformed
+        // TODO add your handling code here:
+    }//GEN-LAST:event_btnOkayActionPerformed
+
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton btnAddMonstrip;
+    private javax.swing.JButton btnAddScreen;
+    private javax.swing.JButton btnCancel;
+    private javax.swing.JButton btnMonitorAdd;
+    private javax.swing.JButton btnOkay;
+    private javax.swing.JButton btnRemoveMonitor;
+    private javax.swing.JButton btnRemoveMonstrip;
+    private javax.swing.JButton jButton2;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel2;
+    private javax.swing.JLabel jLabel3;
+    private javax.swing.JLabel jLabel4;
+    private javax.swing.JLabel jLabel5;
+    private javax.swing.JPanel jPanel2;
+    private javax.swing.JPanel jPanel3;
+    private javax.swing.JPanel jPanel4;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JScrollPane jScrollPane2;
+    private javax.swing.JTextField jTextField1;
+    private javax.swing.JTextField jTextField2;
+    private javax.swing.JTextField jTextField3;
+    private javax.swing.JTextField jTextField4;
+    private javax.swing.JTextField jTextField5;
+    private javax.swing.JList<String> lstMonStrips;
+    private javax.swing.JList<String> lstMonitors;
+    private javax.swing.JPanel panelScreenPreview;
+    // End of variables declaration//GEN-END:variables
+}

+ 51 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/ScreenPreview.java

@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.nplusc.izc.Utilities.WPCMgr.UI;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Set;
+
+/**
+ *
+ * @author iZc <nplusc.de>
+ */
+class ScreenPreview
+{
+    
+    private static final Color[] colorsAvail = {Color.BLUE,Color.CYAN,Color.DARK_GRAY,Color.GRAY,Color.GREEN,Color.LIGHT_GRAY,Color.MAGENTA,
+        Color.ORANGE,Color.PINK,Color.RED,Color.WHITE,Color.YELLOW
+    };
+    public static void drawScreens(LinkedHashMap<String, List<Integer>> screens,
+                HashMap<String, List<String>> monstrips,
+                Image img,
+                String selectedScreen
+            )
+    {
+        Set<String> screensUnused = new HashSet<String>(screens.keySet()); //transfer required to avoid stripping screens out of the hashmap
+        Graphics2D g = (Graphics2D)img.getGraphics();
+        g.setColor(Color.BLACK);
+        g.fillRect(0, 0, img.getWidth(null), img.getHeight(null));
+        
+    }
+}

+ 128 - 16
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/Settings.form

@@ -8,6 +8,9 @@
       </Properties>
     </Component>
   </NonVisualComponents>
+  <Events>
+    <EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
+  </Events>
   <AuxValues>
     <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
     <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@@ -26,10 +29,18 @@
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
-                  <Component id="jPanel3" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="jPanel3" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Group type="103" groupAlignment="0" max="-2" attributes="0">
+                          <Component id="btnSave" max="32767" attributes="0"/>
+                          <Component id="btnCancel" pref="126" max="32767" attributes="0"/>
+                      </Group>
+                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                  </Group>
                   <Group type="102" attributes="0">
                       <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
-                      <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
                       <Component id="jPanel1" max="32767" attributes="0"/>
                   </Group>
               </Group>
@@ -46,7 +57,15 @@
                   <Component id="jPanel1" max="32767" attributes="0"/>
               </Group>
               <EmptySpace type="unrelated" max="-2" attributes="0"/>
-              <Component id="jPanel3" max="32767" attributes="0"/>
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <Component id="jPanel3" max="32767" attributes="0"/>
+                  <Group type="102" attributes="0">
+                      <Component id="btnSave" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace type="separate" max="-2" attributes="0"/>
+                      <Component id="btnCancel" min="-2" max="-2" attributes="0"/>
+                      <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                  </Group>
+              </Group>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
       </Group>
@@ -65,15 +84,104 @@
       <Layout>
         <DimensionLayout dim="0">
           <Group type="103" groupAlignment="0" attributes="0">
-              <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+              <Group type="102" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Component id="jLabel2" alignment="0" min="-2" pref="87" max="-2" attributes="0"/>
+                      <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
+                      <Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace pref="39" max="32767" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Component id="outputPath" alignment="0" min="-2" pref="558" max="-2" attributes="0"/>
+                      <Component id="jSlider1" min="-2" pref="558" max="-2" attributes="0"/>
+                      <Component id="jPanel4" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace max="-2" attributes="0"/>
+              </Group>
+              <Group type="102" alignment="0" attributes="0">
+                  <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
+                  <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+              </Group>
           </Group>
         </DimensionLayout>
         <DimensionLayout dim="1">
           <Group type="103" groupAlignment="0" attributes="0">
-              <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+              <Group type="102" alignment="1" attributes="0">
+                  <EmptySpace max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Group type="102" attributes="0">
+                          <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                          <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
+                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+                      </Group>
+                      <Component id="jPanel4" max="32767" attributes="0"/>
+                  </Group>
+                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="3" attributes="0">
+                      <Component id="outputPath" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace type="unrelated" max="-2" attributes="0"/>
+                  <Group type="103" groupAlignment="0" attributes="0">
+                      <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
+                      <Component id="jSlider1" min="-2" max="-2" attributes="0"/>
+                  </Group>
+                  <EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
+              </Group>
           </Group>
         </DimensionLayout>
       </Layout>
+      <SubComponents>
+        <Component class="javax.swing.JSlider" name="jSlider1">
+          <Properties>
+            <Property name="majorTickSpacing" type="int" value="10"/>
+            <Property name="minorTickSpacing" type="int" value="1"/>
+            <Property name="paintLabels" type="boolean" value="true"/>
+            <Property name="paintTicks" type="boolean" value="true"/>
+            <Property name="snapToTicks" type="boolean" value="true"/>
+            <Property name="value" type="int" value="80"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel2">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Quality"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JTextField" name="outputPath">
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel3">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Target Directory"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel4">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Screen layout"/>
+          </Properties>
+        </Component>
+        <Component class="javax.swing.JLabel" name="jLabel5">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Click to Edit"/>
+          </Properties>
+        </Component>
+        <Container class="javax.swing.JPanel" name="jPanel4">
+
+          <Layout>
+            <DimensionLayout dim="0">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <EmptySpace min="0" pref="539" max="32767" attributes="0"/>
+              </Group>
+            </DimensionLayout>
+            <DimensionLayout dim="1">
+              <Group type="103" groupAlignment="0" attributes="0">
+                  <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+              </Group>
+            </DimensionLayout>
+          </Layout>
+        </Container>
+      </SubComponents>
     </Container>
     <Container class="javax.swing.JPanel" name="jPanel2">
       <Properties>
@@ -87,12 +195,12 @@
       <Layout>
         <DimensionLayout dim="0">
           <Group type="103" groupAlignment="0" attributes="0">
-              <Component id="jScrollPane1" max="32767" attributes="0"/>
               <Group type="102" attributes="0">
                   <Component id="addProfile" min="-2" max="-2" attributes="0"/>
-                  <EmptySpace pref="90" max="32767" attributes="0"/>
+                  <EmptySpace max="32767" attributes="0"/>
                   <Component id="deleteHighlightedProfile" min="-2" max="-2" attributes="0"/>
               </Group>
+              <Component id="jScrollPane1" min="-2" pref="157" max="-2" attributes="0"/>
           </Group>
         </DimensionLayout>
         <DimensionLayout dim="1">
@@ -119,14 +227,8 @@
           <SubComponents>
             <Component class="javax.swing.JList" name="lstProfiles">
               <Properties>
-                <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
-                  <StringArray count="5">
-                    <StringItem index="0" value="Item 1"/>
-                    <StringItem index="1" value="Item 2"/>
-                    <StringItem index="2" value="Item 3"/>
-                    <StringItem index="3" value="Item 4"/>
-                    <StringItem index="4" value="Item 5"/>
-                  </StringArray>
+                <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+                  <Connection code="new DefaultListModel&lt;String&gt;()" type="code"/>
                 </Property>
               </Properties>
               <AuxValues>
@@ -163,7 +265,7 @@
                   <EmptySpace max="-2" attributes="0"/>
                   <Component id="jLabel1" min="-2" pref="112" max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
-                  <Component id="imagemagickpath" pref="381" max="32767" attributes="0"/>
+                  <Component id="imagemagickpath" pref="260" max="32767" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
                   <Component id="selectImageMagickPath" min="-2" max="-2" attributes="0"/>
                   <EmptySpace min="-2" pref="252" max="-2" attributes="0"/>
@@ -198,5 +300,15 @@
         </Component>
       </SubComponents>
     </Container>
+    <Component class="javax.swing.JButton" name="btnSave">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Save"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JButton" name="btnCancel">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Cancel"/>
+      </Properties>
+    </Component>
   </SubComponents>
 </Form>

+ 128 - 16
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/Settings.java

@@ -16,18 +16,25 @@
  */
 package de.nplusc.izc.Utilities.WPCMgr.UI;
 
+import de.nplusc.izc.Utilities.WPCMgr.WPCUtils;
+import java.util.HashMap;
+import java.util.Set;
+import javax.swing.DefaultListModel;
+
 /**
  *
  * @author iZc <nplusc.de>
  */
 public class Settings extends javax.swing.JPanel
 {
-
+    public static final String ID ="SETTINGS";
+    MainWindow parent;
     /**
      * Creates new form Settings
      */
-    public Settings()
+    public Settings(MainWindow w)
     {
+        parent=w;
         initComponents();
     }
 
@@ -44,6 +51,13 @@ public class Settings extends javax.swing.JPanel
 
         jTextField1 = new javax.swing.JTextField();
         jPanel1 = new javax.swing.JPanel();
+        jSlider1 = new javax.swing.JSlider();
+        jLabel2 = new javax.swing.JLabel();
+        outputPath = new javax.swing.JTextField();
+        jLabel3 = new javax.swing.JLabel();
+        jLabel4 = new javax.swing.JLabel();
+        jLabel5 = new javax.swing.JLabel();
+        jPanel4 = new javax.swing.JPanel();
         jPanel2 = new javax.swing.JPanel();
         jScrollPane1 = new javax.swing.JScrollPane();
         lstProfiles = new javax.swing.JList<>();
@@ -53,30 +67,92 @@ public class Settings extends javax.swing.JPanel
         selectImageMagickPath = new javax.swing.JButton();
         imagemagickpath = new javax.swing.JTextField();
         jLabel1 = new javax.swing.JLabel();
+        btnSave = new javax.swing.JButton();
+        btnCancel = new javax.swing.JButton();
 
         jTextField1.setText("jTextField1");
 
+        addComponentListener(new java.awt.event.ComponentAdapter()
+        {
+            public void componentShown(java.awt.event.ComponentEvent evt)
+            {
+                formComponentShown(evt);
+            }
+        });
+
         jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Profile-specific settings"));
 
+        jSlider1.setMajorTickSpacing(10);
+        jSlider1.setMinorTickSpacing(1);
+        jSlider1.setPaintLabels(true);
+        jSlider1.setPaintTicks(true);
+        jSlider1.setSnapToTicks(true);
+        jSlider1.setValue(80);
+
+        jLabel2.setText("Quality");
+
+        jLabel3.setText("Target Directory");
+
+        jLabel4.setText("Screen layout");
+
+        jLabel5.setText("Click to Edit");
+
+        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
+        jPanel4.setLayout(jPanel4Layout);
+        jPanel4Layout.setHorizontalGroup(
+            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 539, Short.MAX_VALUE)
+        );
+        jPanel4Layout.setVerticalGroup(
+            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGap(0, 0, Short.MAX_VALUE)
+        );
+
         javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
         jPanel1.setLayout(jPanel1Layout);
         jPanel1Layout.setHorizontalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 0, Short.MAX_VALUE)
+            .addGroup(jPanel1Layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jLabel3)
+                    .addComponent(jLabel4))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(outputPath, javax.swing.GroupLayout.PREFERRED_SIZE, 558, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 558, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addContainerGap())
+            .addGroup(jPanel1Layout.createSequentialGroup()
+                .addComponent(jLabel5)
+                .addGap(0, 0, Short.MAX_VALUE))
         );
         jPanel1Layout.setVerticalGroup(
             jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGap(0, 0, Short.MAX_VALUE)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
+                .addContainerGap()
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addGroup(jPanel1Layout.createSequentialGroup()
+                        .addComponent(jLabel4)
+                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addComponent(jLabel5)
+                        .addGap(0, 0, Short.MAX_VALUE))
+                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(outputPath, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jLabel3))
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jLabel2)
+                    .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                .addGap(36, 36, 36))
         );
 
         jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Profile Selector"));
 
-        lstProfiles.setModel(new javax.swing.AbstractListModel<String>()
-        {
-            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
-            public int getSize() { return strings.length; }
-            public String getElementAt(int i) { return strings[i]; }
-        });
+        lstProfiles.setModel(new DefaultListModel<String>());
         jScrollPane1.setViewportView(lstProfiles);
 
         addProfile.setText("+");
@@ -87,11 +163,11 @@ public class Settings extends javax.swing.JPanel
         jPanel2.setLayout(jPanel2Layout);
         jPanel2Layout.setHorizontalGroup(
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addComponent(jScrollPane1)
             .addGroup(jPanel2Layout.createSequentialGroup()
                 .addComponent(addProfile)
-                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                 .addComponent(deleteHighlightedProfile))
+            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
         );
         jPanel2Layout.setVerticalGroup(
             jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -118,7 +194,7 @@ public class Settings extends javax.swing.JPanel
                 .addContainerGap()
                 .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(imagemagickpath, javax.swing.GroupLayout.DEFAULT_SIZE, 381, Short.MAX_VALUE)
+                .addComponent(imagemagickpath, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(selectImageMagickPath)
                 .addGap(252, 252, 252))
@@ -133,6 +209,10 @@ public class Settings extends javax.swing.JPanel
                 .addGap(0, 56, Short.MAX_VALUE))
         );
 
+        btnSave.setText("Save");
+
+        btnCancel.setText("Cancel");
+
         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
         this.setLayout(layout);
         layout.setHorizontalGroup(
@@ -140,10 +220,16 @@ public class Settings extends javax.swing.JPanel
             .addGroup(layout.createSequentialGroup()
                 .addContainerGap()
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                        .addGap(18, 18, 18)
+                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
+                            .addComponent(btnSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                            .addComponent(btnCancel, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE))
+                        .addGap(0, 0, Short.MAX_VALUE))
                     .addGroup(layout.createSequentialGroup()
                         .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+                        .addGap(18, 18, 18)
                         .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                 .addContainerGap())
         );
@@ -155,23 +241,49 @@ public class Settings extends javax.swing.JPanel
                     .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                     .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
-                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                    .addGroup(layout.createSequentialGroup()
+                        .addComponent(btnSave)
+                        .addGap(18, 18, 18)
+                        .addComponent(btnCancel)
+                        .addGap(0, 0, Short.MAX_VALUE)))
                 .addContainerGap())
         );
     }// </editor-fold>//GEN-END:initComponents
 
+    private void formComponentShown(java.awt.event.ComponentEvent evt)//GEN-FIRST:event_formComponentShown
+    {//GEN-HEADEREND:event_formComponentShown
+        
+        HashMap<String,Object> settings = parent.getSettings();
+        imagemagickpath.setText((String) settings.get("imagemagick"));
+        HashMap<String,Object> profiles_storage = (HashMap<String,Object>) settings.get("profiles");
+        Set<String> profile_ids = profiles_storage.keySet();
+        ((DefaultListModel<String>)lstProfiles.getModel()).clear();
+        profile_ids.forEach(((DefaultListModel<String>)lstProfiles.getModel())::addElement);
+    }//GEN-LAST:event_formComponentShown
+
 
     // Variables declaration - do not modify//GEN-BEGIN:variables
     private javax.swing.JButton addProfile;
+    private javax.swing.JButton btnCancel;
+    private javax.swing.JButton btnSave;
     private javax.swing.JButton deleteHighlightedProfile;
     private javax.swing.JTextField imagemagickpath;
     private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel2;
+    private javax.swing.JLabel jLabel3;
+    private javax.swing.JLabel jLabel4;
+    private javax.swing.JLabel jLabel5;
     private javax.swing.JPanel jPanel1;
     private javax.swing.JPanel jPanel2;
     private javax.swing.JPanel jPanel3;
+    private javax.swing.JPanel jPanel4;
     private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JSlider jSlider1;
     private javax.swing.JTextField jTextField1;
     private javax.swing.JList<String> lstProfiles;
+    private javax.swing.JTextField outputPath;
     private javax.swing.JButton selectImageMagickPath;
     // End of variables declaration//GEN-END:variables
 }

+ 46 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/WallpaperManager.form

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
+              <Component id="btnSettings" min="-2" max="-2" attributes="0"/>
+              <EmptySpace pref="295" max="32767" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="1" attributes="0">
+              <EmptySpace pref="262" max="32767" attributes="0"/>
+              <Component id="btnSettings" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Component class="javax.swing.JButton" name="btnSettings">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Settings"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSettingsActionPerformed"/>
+      </Events>
+    </Component>
+  </SubComponents>
+</Form>

+ 85 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/WallpaperManager.java

@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2017 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.nplusc.izc.Utilities.WPCMgr.UI;
+
+/**
+ *
+ * @author iZc <nplusc.de>
+ */
+public class WallpaperManager extends javax.swing.JPanel
+{
+    public static final String ID ="WALLPAPERMANAGER";
+    MainWindow parent;
+    /**
+     * Creates new form WallpaperManager
+     */
+    public WallpaperManager(MainWindow w)
+    {
+        parent=w;
+        initComponents();
+    }
+
+    /**
+     * This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents()
+    {
+
+        btnSettings = new javax.swing.JButton();
+
+        btnSettings.setText("Settings");
+        btnSettings.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                btnSettingsActionPerformed(evt);
+            }
+        });
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(28, 28, 28)
+                .addComponent(btnSettings)
+                .addContainerGap(295, Short.MAX_VALUE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addContainerGap(262, Short.MAX_VALUE)
+                .addComponent(btnSettings)
+                .addContainerGap())
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void btnSettingsActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSettingsActionPerformed
+    {//GEN-HEADEREND:event_btnSettingsActionPerformed
+        parent.showSettings();
+    }//GEN-LAST:event_btnSettingsActionPerformed
+
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton btnSettings;
+    // End of variables declaration//GEN-END:variables
+}

+ 64 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/WelcomeScreen.form

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+  <AuxValues>
+    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
+    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+  </AuxValues>
+
+  <Layout>
+    <DimensionLayout dim="0">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="0" attributes="0">
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jButton1" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="loadWallpaperFolder" min="-2" max="-2" attributes="0"/>
+              <EmptySpace max="-2" attributes="0"/>
+              <Component id="jButton3" pref="121" max="32767" attributes="0"/>
+              <EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+    <DimensionLayout dim="1">
+      <Group type="103" groupAlignment="0" attributes="0">
+          <Group type="102" alignment="1" attributes="0">
+              <EmptySpace pref="221" max="32767" attributes="0"/>
+              <Group type="103" groupAlignment="3" attributes="0">
+                  <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="loadWallpaperFolder" alignment="3" min="-2" max="-2" attributes="0"/>
+                  <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
+              </Group>
+              <EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
+          </Group>
+      </Group>
+    </DimensionLayout>
+  </Layout>
+  <SubComponents>
+    <Component class="javax.swing.JButton" name="jButton1">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="New Wallpaper Folder"/>
+      </Properties>
+    </Component>
+    <Component class="javax.swing.JButton" name="loadWallpaperFolder">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Open Wallpaper Folder"/>
+      </Properties>
+      <Events>
+        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="loadWallpaperFolderActionPerformed"/>
+      </Events>
+    </Component>
+    <Component class="javax.swing.JButton" name="jButton3">
+      <Properties>
+        <Property name="text" type="java.lang.String" value="Exit"/>
+      </Properties>
+    </Component>
+  </SubComponents>
+</Form>

+ 136 - 0
WPCMGr/src/main/java/de/nplusc/izc/Utilities/WPCMgr/UI/WelcomeScreen.java

@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2017 iZc
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.nplusc.izc.Utilities.WPCMgr.UI;
+
+import de.nplusc.izc.tools.baseTools.Detectors;
+import de.nplusc.izc.tools.baseTools.Messagers;
+import de.nplusc.izc.tools.baseTools.Tools;
+import java.io.File;
+import java.io.FileNotFoundException;
+import jnafilechooser.api.WindowsFolderBrowser;
+
+/**
+ *
+ * @author iZc <nplusc.de>
+ */
+public class WelcomeScreen extends javax.swing.JPanel
+{
+    public static final String ID ="WELCOMESCREEN";
+    private MainWindow parent;
+    /**
+     * Creates new form WelcomeScreen
+     */
+    public WelcomeScreen(MainWindow w)
+    {
+        parent=w;
+        initComponents();
+    }
+
+    /**
+     * This method is called from within the constructor to
+     * initialize the form.
+     * WARNING: Do NOT modify this code. The content of this method is
+     * always regenerated by the Form Editor.
+     */
+    @SuppressWarnings("unchecked")
+    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
+    private void initComponents()
+    {
+
+        jButton1 = new javax.swing.JButton();
+        loadWallpaperFolder = new javax.swing.JButton();
+        jButton3 = new javax.swing.JButton();
+
+        jButton1.setText("New Wallpaper Folder");
+
+        loadWallpaperFolder.setText("Open Wallpaper Folder");
+        loadWallpaperFolder.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                loadWallpaperFolderActionPerformed(evt);
+            }
+        });
+
+        jButton3.setText("Exit");
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jButton1)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(loadWallpaperFolder)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+                .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)
+                .addGap(14, 14, 14))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
+                .addContainerGap(221, Short.MAX_VALUE)
+                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+                    .addComponent(jButton1)
+                    .addComponent(loadWallpaperFolder)
+                    .addComponent(jButton3))
+                .addGap(47, 47, 47))
+        );
+    }// </editor-fold>//GEN-END:initComponents
+
+    private void loadWallpaperFolderActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_loadWallpaperFolderActionPerformed
+    {//GEN-HEADEREND:event_loadWallpaperFolderActionPerformed
+        String folder = "";
+        if(Detectors.getSystemClassification()[0].equals("windows"))
+        {
+            WindowsFolderBrowser fb = new WindowsFolderBrowser("Select WallpaperCache");
+            File f = fb.showDialog(parent);
+            if(f!=null)
+            {
+                folder = f.getPath();
+            }
+        }
+        else
+        {
+            folder = Tools.FileChooseDlg(parent, true, true, null);
+        }
+                
+        if(!folder.equals("") && new File(folder).exists())
+        {
+            try
+            {
+                parent.loadCache(folder);
+            }
+            catch (FileNotFoundException ex)
+            {
+                Messagers.SingleLineMsg("Invalid Folder", "OK");
+            }
+        }
+        else
+        {
+            Messagers.SingleLineMsg("Invalid Folder", "OK");
+        }
+    }//GEN-LAST:event_loadWallpaperFolderActionPerformed
+
+
+    // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton jButton1;
+    private javax.swing.JButton jButton3;
+    private javax.swing.JButton loadWallpaperFolder;
+    // End of variables declaration//GEN-END:variables
+}

+ 1 - 1
settings.gradle

@@ -1,3 +1,3 @@
-include 'ToolKit','iZpl',  'IZSetup','WPCMgr','UpidTK', 'izstreamer', 'LogBlockHeatMapper','iZlaunch',
+include 'ToolKit','iZpl',  'IZSetup','WPCMGr','UpidTK', 'izstreamer', 'LogBlockHeatMapper','iZlaunch',
 'iZpaqSFX','MazeViewer','TWPUtil',"iZplPlugins:WMP","iZplPlugins:foobar2000_others","iZplPlugins:itunes","iZplPlugins:GameRadio",
 "iZplPlugins:Editor","izpl-shared","iZpl-server","iZplPlugins:Smartphonizer","QuickStuff","external:java-progressbar","iZplPlugins:rtsslink"