[izpack-changes] izpack-src/src/lib/com/izforge/izpack/installer InstallerFrame.java,1.48,1.48.4.1 GUIInstaller.java,1.35,1.35.2.1 InstallerBase.java,1.29.4.3,1.29.4.4

jponge nobody at sheep.berlios.de
Tue Jan 3 13:48:37 CET 2006


Update of /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/installer
In directory sheep:/tmp/cvs-serv11741/src/lib/com/izforge/izpack/installer

Modified Files:
      Tag: branch-3-8
	InstallerFrame.java GUIInstaller.java InstallerBase.java 
Log Message:
Second round of commits toward 3.8.1.

Index: InstallerFrame.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/installer/InstallerFrame.java,v
retrieving revision 1.48
retrieving revision 1.48.4.1
diff -u -d -r1.48 -r1.48.4.1
--- InstallerFrame.java	21 Jul 2005 01:20:37 -0000	1.48
+++ InstallerFrame.java	3 Jan 2006 12:48:33 -0000	1.48.4.1
@@ -26,9 +26,10 @@
 import java.awt.Cursor;
 import java.awt.Dimension;
 import java.awt.Font;
+import java.awt.GraphicsEnvironment;
 import java.awt.GridBagConstraints;
 import java.awt.GridLayout;
-import java.awt.Toolkit;
+import java.awt.Point;
 import java.awt.Window;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -397,7 +398,10 @@
             panelsContainer.setVisible(false);
             IzPanel panel = (IzPanel) installdata.panels.get(installdata.curPanelNumber);
             IzPanel l_panel = (IzPanel) installdata.panels.get(last);
-            l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last));
+            //instead of writing data here which leads to duplicated entries in
+            //auto-installation script (bug # 4551), let's make data only immediately before
+            //writing out that script.
+            //l_panel.makeXMLData(installdata.xmlData.getChildAtIndex(last));
 
             if (installdata.curPanelNumber == 0)
             {
@@ -677,10 +681,10 @@
      */
     public void centerFrame(Window frame)
     {
+        Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
         Dimension frameSize = frame.getSize();
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        frame.setLocation((screenSize.width - frameSize.width) / 2,
-                (screenSize.height - frameSize.height) / 2 - 10);
+        frame.setLocation(center.x - frameSize.width / 2,
+                center.y - frameSize.height / 2 - 10);
     }
 
     /**
@@ -805,7 +809,14 @@
     public void writeXMLTree(XMLElement root, OutputStream out) throws Exception
     {
         XMLWriter writer = new XMLWriter(out);
-        writer.write(root);
+        //fix bug# 4551
+        //writer.write(root);
+        for (int i = 0; i < installdata.panels.size(); i++)
+        {
+            IzPanel panel = (IzPanel)installdata.panels.get(i);
+            panel.makeXMLData(installdata.xmlData.getChildAtIndex(i));
+        }
+        writer.write(installdata.xmlData);
     }
 
     /**

Index: GUIInstaller.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/installer/GUIInstaller.java,v
retrieving revision 1.35
retrieving revision 1.35.2.1
diff -u -d -r1.35 -r1.35.2.1
--- GUIInstaller.java	8 Sep 2005 02:51:02 -0000	1.35
+++ GUIInstaller.java	3 Jan 2006 12:48:34 -0000	1.35.2.1
@@ -23,9 +23,11 @@
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.Font;
+import java.awt.GraphicsEnvironment;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
+import java.awt.Point;
 import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -529,9 +531,9 @@
                 setSize(getPreferredSize());
 
             Dimension frameSize = getSize();
-            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-            setLocation((screenSize.width - frameSize.width) / 2,
-                    (screenSize.height - frameSize.height) / 2 - 10);
+            Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint();
+            setLocation(center.x - frameSize.width / 2,
+                    center.y - frameSize.height / 2 - 10);
             setResizable(true);
         }
 

Index: InstallerBase.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/installer/InstallerBase.java,v
retrieving revision 1.29.4.3
retrieving revision 1.29.4.4
diff -u -d -r1.29.4.3 -r1.29.4.4
--- InstallerBase.java	15 Dec 2005 13:39:22 -0000	1.29.4.3
+++ InstallerBase.java	3 Jan 2006 12:48:34 -0000	1.29.4.4
@@ -93,7 +93,8 @@
 
         // We put the Info data as variables
         installdata.setVariable(ScriptParser.APP_NAME, inf.getAppName());
-        installdata.setVariable(ScriptParser.APP_URL, inf.getAppURL());
+        if (inf.getAppURL() != null)
+            installdata.setVariable(ScriptParser.APP_URL, inf.getAppURL());
         installdata.setVariable(ScriptParser.APP_VER, inf.getAppVersion());
 
         // We read the panels order data




More information about the izpack-changes mailing list