Browse Source

fixed a initialize bug and a UI bug on iZpl

LH 6 years ago
parent
commit
d8d98fb390

+ 189 - 186
QuickStuff/src/main/java/PV/UI.java

@@ -1,186 +1,189 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package PV;
-
-import de.nplusc.izc.tools.IOtools.DBWriter;
-import de.nplusc.izc.tools.IOtools.FileTK;
-import javax.swing.table.DefaultTableModel;
-
-/**
- *
- * @author LH
- */
-public class UI extends javax.swing.JFrame
-{
-
-    /**
-     * Creates new form UI
-     */
-    public UI()
-    {
-        initComponents();
-        
-        String fp = "D:\\loa\\000004\\in.sqlite";
-        String fp2="D:\\loa\\000004\\out.txt";
-        DBWriter dbw = new DBWriter("", fp, "", "", DBWriter.DBTYPE_SQLite);
-        //String[][] items = dbw.queryTable("SELECT url , id FROM moz_places");
-        String[][] idmap = dbw.queryTable("SELECT place_id , visit_date from moz_historyvisits  ORDER BY visit_date");
-       // List<String> l = new ArrayList<>();
-        StringBuilder sb = new StringBuilder();
-         int i=0;
-         int j=0;
-         int k=0;
-         boolean c = false;
-      //   if(idmap.length>50000){c=true;
-      //   System.out.println("chunkered");
-      //   }
-        for (String[] ue : idmap)
-        {
-            String date = (new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date (Long.valueOf(ue[1])/1000)));
-            String datafield=dbw.querySingleCell("SELECT url FROM moz_places where id = "+ue[0]);
-            
-            //if(datafield.contains("trafficholder.com"))
-            {
-            
-            ((DefaultTableModel)tblT.getModel()).setValueAt(datafield, i, 0);
-            ((DefaultTableModel)tblT.getModel()).setValueAt(date, i, 1);
-            ((DefaultTableModel)tblT.getModel()).addRow(new String[]{""});
-            i++;
-            
-            sb.append(date).append("|").append(datafield).append("\n");
-            }
-            j++;
-            System.out.println(j+"/"+idmap.length);
-        /*    if(c)
-            {
-                if(i%50000==0&&i!=0)
-                {
-                    FileTK.writeFile(sb.toString(), fp2+"chunk_"+k);
-                    sb=new StringBuffer();
-                    k++;
-                }
-            }
-            */
-        }
-        
-       if(!c)
-       {
-           FileTK.writeFile(sb.toString(), fp2);
-       }
-        //dbw.closeConn();
-    }
-
-    /**
-     * 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">                          
-    private void initComponents()
-    {
-
-        jScrollPane1 = new javax.swing.JScrollPane();
-        tblT = new javax.swing.JTable();
-
-        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
-
-        tblT.setModel(new javax.swing.table.DefaultTableModel(
-            new Object [][]
-            {
-                {null, null}
-            },
-            new String []
-            {
-                "URL", "Zeitpunkt"
-            }
-        )
-        {
-            Class[] types = new Class []
-            {
-                java.lang.String.class, java.lang.String.class
-            };
-
-            public Class getColumnClass(int columnIndex)
-            {
-                return types [columnIndex];
-            }
-        });
-        jScrollPane1.setViewportView(tblT);
-
-        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
-        getContentPane().setLayout(layout);
-        layout.setHorizontalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(layout.createSequentialGroup()
-                .addGap(30, 30, 30)
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 816, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(102, Short.MAX_VALUE))
-        );
-        layout.setVerticalGroup(
-            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-            .addGroup(layout.createSequentialGroup()
-                .addContainerGap()
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 530, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(27, Short.MAX_VALUE))
-        );
-
-        pack();
-    }// </editor-fold>                        
-
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String args[])
-    {
-        /* Set the Nimbus look and feel */
-        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
-        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
-         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
-         */
-        try
-        {
-            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
-            {
-                if ("Nimbus".equals(info.getName()))
-                {
-                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
-                    break;
-                }
-            }
-        }
-        catch (ClassNotFoundException ex)
-        {
-            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        }
-        catch (InstantiationException ex)
-        {
-            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        }
-        catch (IllegalAccessException ex)
-        {
-            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        }
-        catch (javax.swing.UnsupportedLookAndFeelException ex)
-        {
-            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
-        }
-        //</editor-fold>
-
-        /* Create and display the form */
-        java.awt.EventQueue.invokeLater(new Runnable()
-        {
-            public void run()
-            {
-                new UI().setVisible(true);
-            }
-        });
-    }
-    // Variables declaration - do not modify                     
-    private javax.swing.JScrollPane jScrollPane1;
-    private javax.swing.JTable tblT;
-    // End of variables declaration                   
-}
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package PV;
+
+import de.nplusc.izc.tools.IOtools.DBWriter;
+import de.nplusc.izc.tools.IOtools.FileTK;
+import javax.swing.table.DefaultTableModel;
+
+/**
+ *
+ * @author LH
+ */
+public class UI extends javax.swing.JFrame
+{
+
+    /**
+     * Creates new form UI
+     */
+    public UI()
+    {
+        initComponents();
+        
+        String fp = "D:\\loa\\000010\\in.sqlite";
+        String fp2="D:\\loa\\000010\\out.txt";
+        DBWriter dbw = new DBWriter("", fp, "", "", DBWriter.DBTYPE_SQLite);
+        //String[][] items = dbw.queryTable("SELECT url , id FROM moz_places");
+        String[][] idmap = dbw.queryTable("SELECT place_id , visit_date from moz_historyvisits  ORDER BY visit_date");
+       // List<String> l = new ArrayList<>();
+        StringBuilder sb = new StringBuilder();
+         int i=0;
+         int j=0;
+         int k=0;
+         boolean c = false;
+      //   if(idmap.length>50000){c=true;
+      //   System.out.println("chunkered");
+      //   }
+        for (String[] ue : idmap)
+        {
+            String date = (new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date (Long.valueOf(ue[1])/1000)));
+            String datafield=dbw.querySingleCell("SELECT url FROM moz_places where id = "+ue[0]);
+            
+            if(datafield.contains("mail.google.com"))
+            {
+            
+            ((DefaultTableModel)tblT.getModel()).setValueAt(datafield, i, 0);
+            ((DefaultTableModel)tblT.getModel()).setValueAt(date, i, 1);
+            ((DefaultTableModel)tblT.getModel()).addRow(new String[]{""});
+            i++;
+            
+            sb.append(date).append("|").append(datafield).append("\n");
+            }
+            j++;
+            if(j%1000==0)
+            {
+                System.out.println(j+"/"+idmap.length);
+            }
+        /*    if(c)
+            {
+                if(i%50000==0&&i!=0)
+                {
+                    FileTK.writeFile(sb.toString(), fp2+"chunk_"+k);
+                    sb=new StringBuffer();
+                    k++;
+                }
+            }
+            */
+        }
+        
+       if(!c)
+       {
+           FileTK.writeFile(sb.toString(), fp2);
+       }
+        //dbw.closeConn();
+    }
+
+    /**
+     * 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">                          
+    private void initComponents()
+    {
+
+        jScrollPane1 = new javax.swing.JScrollPane();
+        tblT = new javax.swing.JTable();
+
+        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+
+        tblT.setModel(new javax.swing.table.DefaultTableModel(
+            new Object [][]
+            {
+                {null, null}
+            },
+            new String []
+            {
+                "URL", "Zeitpunkt"
+            }
+        )
+        {
+            Class[] types = new Class []
+            {
+                java.lang.String.class, java.lang.String.class
+            };
+
+            public Class getColumnClass(int columnIndex)
+            {
+                return types [columnIndex];
+            }
+        });
+        jScrollPane1.setViewportView(tblT);
+
+        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+        getContentPane().setLayout(layout);
+        layout.setHorizontalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addGap(30, 30, 30)
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 816, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(102, Short.MAX_VALUE))
+        );
+        layout.setVerticalGroup(
+            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+            .addGroup(layout.createSequentialGroup()
+                .addContainerGap()
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 530, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addContainerGap(27, Short.MAX_VALUE))
+        );
+
+        pack();
+    }// </editor-fold>                        
+
+    /**
+     * @param args the command line arguments
+     */
+    public static void main(String args[])
+    {
+        /* Set the Nimbus look and feel */
+        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
+        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
+         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
+         */
+        try
+        {
+            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
+            {
+                if ("Nimbus".equals(info.getName()))
+                {
+                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
+                    break;
+                }
+            }
+        }
+        catch (ClassNotFoundException ex)
+        {
+            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        catch (InstantiationException ex)
+        {
+            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        catch (IllegalAccessException ex)
+        {
+            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        catch (javax.swing.UnsupportedLookAndFeelException ex)
+        {
+            java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+        }
+        //</editor-fold>
+
+        /* Create and display the form */
+        java.awt.EventQueue.invokeLater(new Runnable()
+        {
+            public void run()
+            {
+                new UI().setVisible(true);
+            }
+        });
+    }
+    // Variables declaration - do not modify                     
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JTable tblT;
+    // End of variables declaration                   
+}

+ 10 - 2
iZpl/src/main/java/de/nplusc/izc/iZpl/API/PluginManager.java

@@ -153,10 +153,12 @@ public class PluginManager
         //PluginHandling stage 2: call the prepareUpgrade handler
         if(firstrunmode||updateInit)
         {
+            l.info("Calling the plugin upgrade event");
             int pluginCount =detectedPlugins.size();
             for (int i = 0; i < pluginCount; i++)
             {
                 Plugin p = detectedPlugins.get(i);
+                l.trace("Initializing {}",p.getPluginName());
                 p.prepareUpgrade();
                 Main.updatePluginLoadProgress(pluginCount, i, p.getPluginName());
             }
@@ -178,6 +180,7 @@ public class PluginManager
                 }
             }
         }
+        l.info("Calling the plugin init event");
         //PluginHandling stage 3: initialize the plugins
         for (PlaybackPlugin playbackPlugin : registeredPlayBackAdapters)
         {
@@ -266,8 +269,12 @@ public class PluginManager
         try
         {
             EventQueue.invokeAndWait(()->{
-                registeredUIs.add(new IZplGUIDefault());
-                registeredUIs.add(new IZplGUISkinnable());
+                IZplGUIDefault gui = new IZplGUIDefault();
+                IZplGUISkinnable sgui = new IZplGUISkinnable();
+                registeredUIs.add(gui);
+                registeredUIs.add(sgui);
+                detectedPlugins.add(gui);
+                detectedPlugins.add(sgui);
             });
         }
         catch (InterruptedException ex)
@@ -335,6 +342,7 @@ public class PluginManager
                         if (isplugin)
                         {
                             Plugin pluginInstance = (Plugin) clazz.newInstance();
+                            detectedPlugins.add(pluginInstance);
                             if (isUIPlugin)
                             {
                                 registeredUIs.add((UIPlugin) pluginInstance);

+ 20 - 0
iZpl/src/main/java/de/nplusc/izc/iZpl/GUI/PlayListManagingSkinnable.java

@@ -181,8 +181,13 @@ public class PlayListManagingSkinnable extends JPanel implements MouseMotionList
         boolean tp = gd.isWindowTranslucencySupported(java.awt.GraphicsDevice.WindowTranslucency.TRANSLUCENT);
         if (tp)
         {
+            l.info("Transparency enabled");
             setBackground( new Color(0,0,0,0));//freischalten von irregularShapes
         }
+        else
+        {
+            l.error("Transparency barfed out");
+        }
         background = loadImageAux(ed.get("backgroundlayer"));
         paintme = loadImageAux(ed.get("backgroundlayer"));//background ist default deshalb doppeltgemoppelt; auf paintme wird später rumgepinselt
         buttonIxxHilit = loadImageAux(ed.get("button_IXX_hilit"));
@@ -212,6 +217,21 @@ public class PlayListManagingSkinnable extends JPanel implements MouseMotionList
         //paintme.getGraphics().drawImage(buttonIxxHilit, ixb[0], ixb[1], null);
         PA.setdrawIMG(paintme);
         add(PA);
+        if(getRootPane()!=null)
+        {
+            getRootPane().setOpaque(false);
+        }
+        
+            if(wrapper instanceof JFrame)
+        {
+            ((JFrame)wrapper).getRootPane().setOpaque(false);
+        }
+        else if(wrapper instanceof JDialog)
+        {
+            ((JDialog)wrapper).getRootPane().setOpaque(false);
+            ((JDialog)wrapper).setBackground( new Color(0,0,0,0));
+        }
+        
         l.info("skindim="+w+"|"+h);
         
         Container cp = null;

+ 2 - 1
iZplPlugins/rtsslink/src/main/java/de/nplusc/izc/izpl/plugins/rtss/RTSSLink.java

@@ -81,7 +81,7 @@ public class RTSSLink implements PlaybackStatusPlugin
         l.info("Os-data:"+Arrays.toString(osmetadata));
         if (osmetadata[0].equals("windows"))
         {
-            
+            l.info("Extracting RTSSLink natives");
             File target = new File(IZPLApi.PLUGINPATH+File.separator+"RTSSLink"+File.separator+"binaries");
             target.getParentFile().mkdirs();
             if (!target.exists())
@@ -95,6 +95,7 @@ public class RTSSLink implements PlaybackStatusPlugin
                 }
                 catch (IOException ex)
                 {
+                    l.warn("Unable to extract the binaries");
                     ex.printStackTrace();
                 }