OSDN Git Service

MOD: Tempolary Bugfix for restore dialog potition. Bug# 10746
authorTakuya Ono <takuya-o@users.sourceforge.jp>
Sun, 22 Jul 2007 22:48:54 +0000 (22:48 +0000)
committerTakuya Ono <takuya-o@users.sourceforge.jp>
Sun, 22 Jul 2007 22:48:54 +0000 (22:48 +0000)
deploy/mdc.zip
src/org/jent/checksmtp/ApplicationUI.java
src/org/jent/checksmtp/ToListUI.java

index 845bad5..b5f37ce 100644 (file)
Binary files a/deploy/mdc.zip and b/deploy/mdc.zip differ
index 6dd1407..7b11a23 100644 (file)
@@ -7,9 +7,11 @@
 package org.jent.checksmtp;
 
 import java.awt.Dimension;
+import java.awt.Point;
 import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import javax.swing.JFrame;
 
 /**
  *
@@ -367,8 +369,17 @@ public class ApplicationUI extends javax.swing.JFrame {
   }//GEN-LAST:event_jButtonCancelActionPerformed
   
   private boolean isModifiedPotition() {
-    int x = this.getX();  //TODO: get real potition on screen.
-    int y = this.getY();
+    int x = 0;
+    int y = 0;
+    if ( getExtendedState() == JFrame.NORMAL ) {
+      Point locationPoint = getLocationOnScreen(); //TODO: IllegalComponentStateException
+      x = locationPoint.x;
+      y = locationPoint.y;
+    } else {
+      //Unexpect logic. Because this method call from pushed "OK" button.
+      x = getX();
+      y = getY();
+    }  
     int h = this.getHeight();
     int w = this.getWidth();
     boolean modified = false;
index 5a7f475..f3e8a09 100644 (file)
@@ -7,6 +7,7 @@
 package org.jent.checksmtp;
 
 import java.awt.Dimension;
+import java.awt.Point;
 import java.awt.Toolkit;
 import java.util.List;
 
@@ -172,8 +173,9 @@ public class ToListUI extends javax.swing.JFrame {
   }//GEN-LAST:event_jButtonOKActionPerformed
   
   private boolean restorePosition() {
-    int x = this.getX();  //TODO: get real potition on screen.
-    int y = this.getY();
+    Point locationPoint = getLocationOnScreen();  //TODO: IllegalComponentStateException
+    int x = locationPoint.x;
+    int y = locationPoint.y;
     int h = this.getHeight();
     int w = this.getWidth();
     boolean modified = false;