[izpack-changes] izpack-src/src/lib/com/izforge/izpack/uninstaller Destroyer.java,1.24,1.25 SelfModifier.java,1.11,1.12 Uninstaller.java,1.18,1.19 UninstallerFrame.java,1.22,1.23

jponge nobody at sheep.berlios.de
Sun Mar 12 18:31:39 CET 2006


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

Modified Files:
	Destroyer.java SelfModifier.java Uninstaller.java 
	UninstallerFrame.java 
Log Message:
Synchronizing HEAD from the changes in branch-3-8.


Index: Destroyer.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/uninstaller/Destroyer.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Destroyer.java	27 Jul 2005 08:57:10 -0000	1.24
+++ Destroyer.java	12 Mar 2006 16:32:27 -0000	1.25
@@ -1,5 +1,5 @@
 /*
- * IzPack - Copyright 2001-2005 Julien Ponge, All Rights Reserved.
+ * IzPack - Copyright 2001-2006 Julien Ponge, All Rights Reserved.
  * 
  * http://www.izforge.com/izpack/
  * http://developer.berlios.de/projects/izpack/

Index: SelfModifier.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/uninstaller/SelfModifier.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- SelfModifier.java	27 Jul 2005 08:57:10 -0000	1.11
+++ SelfModifier.java	12 Mar 2006 16:32:27 -0000	1.12
@@ -1,5 +1,5 @@
 /*
- * IzPack - Copyright 2001-2005 Julien Ponge, All Rights Reserved.
+ * IzPack - Copyright 2001-2006 Julien Ponge, All Rights Reserved.
  * 
  * http://www.izforge.com/izpack/
  * http://developer.berlios.de/projects/izpack/

Index: Uninstaller.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/uninstaller/Uninstaller.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- Uninstaller.java	6 May 2005 20:09:08 -0000	1.18
+++ Uninstaller.java	12 Mar 2006 16:32:27 -0000	1.19
@@ -1,5 +1,5 @@
 /*
- * IzPack - Copyright 2001-2005 Julien Ponge, All Rights Reserved.
+ * IzPack - Copyright 2001-2006 Julien Ponge, All Rights Reserved.
  * 
  * http://www.izforge.com/izpack/
  * http://developer.berlios.de/projects/izpack/
@@ -21,6 +21,7 @@
 
 import java.lang.reflect.Method;
 
+import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 
 /**
@@ -56,16 +57,21 @@
 
     public static void uninstall(String[] args)
     {
-        try
-        {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-            new UninstallerFrame();
-        }
-        catch (Exception err)
-        {
-            System.err.println("- Error -");
-            err.printStackTrace();
-            System.exit(0);
-        }
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run()
+            {
+                try
+                {
+                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+                    new UninstallerFrame();
+                }
+                catch (Exception err)
+                {
+                    System.err.println("- Error -");
+                    err.printStackTrace();
+                    System.exit(0);
+                }
+            }
+        });
     }
 }

Index: UninstallerFrame.java
===================================================================
RCS file: /cvsroot/izpack/izpack-src/src/lib/com/izforge/izpack/uninstaller/UninstallerFrame.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- UninstallerFrame.java	6 May 2005 20:09:08 -0000	1.22
+++ UninstallerFrame.java	12 Mar 2006 16:32:27 -0000	1.23
@@ -1,5 +1,5 @@
 /*
- * IzPack - Copyright 2001-2005 Julien Ponge, All Rights Reserved.
+ * IzPack - Copyright 2001-2006 Julien Ponge, All Rights Reserved.
  * 
  * http://www.izforge.com/izpack/
  * http://developer.berlios.de/projects/izpack/
@@ -22,10 +22,11 @@
 import java.awt.Color;
 import java.awt.Cursor;
 import java.awt.Dimension;
+import java.awt.GraphicsEnvironment;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.Insets;
-import java.awt.Toolkit;
+import java.awt.Point;
 import java.awt.Window;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -47,6 +48,7 @@
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JProgressBar;
+import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 
 import com.izforge.izpack.LocaleDatabase;
@@ -203,10 +205,10 @@
      */
     private 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);
     }
 
     /**
@@ -329,20 +331,30 @@
          * @param name The name of the overall action. Not used here.
          * @param max The maximum value of the progress.
          */
-        public void startAction(String name, int max)
+        public void startAction(final String name, final int max)
         {
-            progressBar.setMinimum(0);
-            progressBar.setMaximum(max);
-            blockGUI();
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run()
+                {
+                    progressBar.setMinimum(0);
+                    progressBar.setMaximum(max);
+                    blockGUI();                    
+                }
+            });
         }
 
         /** The destroyer stops. */
         public void stopAction()
         {
-            progressBar.setString(langpack.getString("InstallPanel.finished"));
-            targetDestroyCheckbox.setEnabled(false);
-            destroyButton.setEnabled(false);
-            releaseGUI();
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run()
+                {
+                    progressBar.setString(langpack.getString("InstallPanel.finished"));
+                    targetDestroyCheckbox.setEnabled(false);
+                    destroyButton.setEnabled(false);
+                    releaseGUI();
+                }
+            });
         }
 
         /**
@@ -351,10 +363,15 @@
          * @param pos The actual position.
          * @param message The message.
          */
-        public void progress(int pos, String message)
+        public void progress(final int pos, final String message)
         {
-            progressBar.setValue(pos);
-            progressBar.setString(message);
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run()
+                {
+                    progressBar.setValue(pos);
+                    progressBar.setString(message);
+                }
+            });
         }
 
         public void nextStep(String step_name, int step_no, int no_of_substeps)




More information about the izpack-changes mailing list