worldwind (0.5.0-8) centerScreen.diff

Summary

 src/gov/nasa/worldwind/examples/ApplicationTemplate.java |    7 +++++--
 src/gov/nasa/worldwind/examples/Shapes.java              |    5 ++++-
 src/gov/nasa/worldwind/examples/ViewIteration.java       |    4 +++-
 3 files changed, 12 insertions(+), 4 deletions(-)

    
download this patch

Patch contents

diff -ur worldwind-0.5.0.orig/src/gov/nasa/worldwind/examples/ApplicationTemplate.java worldwind-0.5.0/src/gov/nasa/worldwind/examples/ApplicationTemplate.java
--- worldwind-0.5.0.orig/src/gov/nasa/worldwind/examples/ApplicationTemplate.java	2008-05-02 18:09:56.000000000 +0200
+++ worldwind-0.5.0/src/gov/nasa/worldwind/examples/ApplicationTemplate.java	2008-08-18 15:13:23.000000000 +0200
@@ -76,11 +76,13 @@
         public AppFrame()
         {
             this.initialize(true, true, false);
+			this.setLocationRelativeTo(null); 
         }
 
         public AppFrame(boolean includeStatusBar, boolean includeLayerPanel, boolean includeStatsPanel)
         {
             this.initialize(includeStatusBar, includeLayerPanel, includeStatsPanel);
+			this.setLocationRelativeTo(null); 
         }
 
         private void initialize(boolean includeStatusBar, boolean includeLayerPanel, boolean includeStatsPanel)
@@ -120,14 +122,15 @@
             this.pack();
 
             // Center the application on the screen.
-            Dimension prefSize = this.getPreferredSize();
+			/*            Dimension prefSize = this.getPreferredSize();
             Dimension parentSize;
             java.awt.Point parentLocation = new java.awt.Point(0, 0);
             parentSize = Toolkit.getDefaultToolkit().getScreenSize();
             int x = parentLocation.x + (parentSize.width - prefSize.width) / 2;
             int y = parentLocation.y + (parentSize.height - prefSize.height) / 2;
-            this.setLocation(x, y);
+            this.setLocation(x, y);*/
             this.setResizable(true);
+			this.setLocationRelativeTo(null); 
         }
 
         public Dimension getCanvasSize()
diff -ur worldwind-0.5.0.orig/src/gov/nasa/worldwind/examples/Shapes.java worldwind-0.5.0/src/gov/nasa/worldwind/examples/Shapes.java
--- worldwind-0.5.0.orig/src/gov/nasa/worldwind/examples/Shapes.java	2008-05-02 18:09:56.000000000 +0200
+++ worldwind-0.5.0/src/gov/nasa/worldwind/examples/Shapes.java	2008-08-18 15:19:50.000000000 +0200
@@ -72,6 +72,7 @@
             this.getContentPane().add(controlPanel, BorderLayout.WEST);
             this.pack();
 
+			/*
             // Center the application on the screen.
             Dimension prefSize = this.getPreferredSize();
             Dimension parentSize;
@@ -79,7 +80,9 @@
             parentSize = Toolkit.getDefaultToolkit().getScreenSize();
             int x = parentLocation.x + (parentSize.width - prefSize.width) / 2;
             int y = parentLocation.y + (parentSize.height - prefSize.height) / 2;
-            this.setLocation(x, y);
+            this.setLocation(x, y);*/
+			this.setLocationRelativeTo(null); 
+
             this.setResizable(true);
 
             wwjPanel.getWwd().addRenderingListener(new RenderingListener()
diff -ur worldwind-0.5.0.orig/src/gov/nasa/worldwind/examples/ViewIteration.java worldwind-0.5.0/src/gov/nasa/worldwind/examples/ViewIteration.java
--- worldwind-0.5.0.orig/src/gov/nasa/worldwind/examples/ViewIteration.java	2008-05-02 18:09:54.000000000 +0200
+++ worldwind-0.5.0/src/gov/nasa/worldwind/examples/ViewIteration.java	2008-08-18 15:13:02.000000000 +0200
@@ -68,7 +68,7 @@
             this.getContentPane().add(wwjPanel, BorderLayout.CENTER);
             this.getContentPane().add(controlPanel, BorderLayout.WEST);
             this.pack();
-
+			/*
             // Center the application on the screen.
             Dimension prefSize = this.getPreferredSize();
             Dimension parentSize;
@@ -77,6 +77,8 @@
             int x = parentLocation.x + (parentSize.width - prefSize.width) / 2;
             int y = parentLocation.y + (parentSize.height - prefSize.height) / 2;
             this.setLocation(x, y);
+			*/
+			this.setLocationRelativeTo(null); 
             this.setResizable(true);
         }