From: Takuya Ono Date: Sun, 22 Jul 2007 22:48:54 +0000 (+0000) Subject: MOD: Tempolary Bugfix for restore dialog potition. Bug# 10746 X-Git-Tag: Release0_5a~47 X-Git-Url: http://git.osdn.net/view?p=mdc%2FBetaProject.git;a=commitdiff_plain;h=aa0829324fc5d22e8f056405d1d2dbf98480c89b MOD: Tempolary Bugfix for restore dialog potition. Bug# 10746 --- diff --git a/deploy/mdc.zip b/deploy/mdc.zip index 845bad5..b5f37ce 100644 Binary files a/deploy/mdc.zip and b/deploy/mdc.zip differ diff --git a/src/org/jent/checksmtp/ApplicationUI.java b/src/org/jent/checksmtp/ApplicationUI.java index 6dd1407..7b11a23 100644 --- a/src/org/jent/checksmtp/ApplicationUI.java +++ b/src/org/jent/checksmtp/ApplicationUI.java @@ -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; diff --git a/src/org/jent/checksmtp/ToListUI.java b/src/org/jent/checksmtp/ToListUI.java index 5a7f475..f3e8a09 100644 --- a/src/org/jent/checksmtp/ToListUI.java +++ b/src/org/jent/checksmtp/ToListUI.java @@ -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;