From db9c487d37ca9a55dfcdbaf051427e4159172e0b Mon Sep 17 00:00:00 2001 From: phib Date: Tue, 20 Apr 2010 01:06:56 +0000 Subject: [PATCH] Frame position on multiple monitors incorrect. Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2975622 --- client/src/org/adempiere/apps/graph/HtmlDashboard.java | 2 +- client/src/org/compiere/apps/AArchive.java | 6 +++++- client/src/org/compiere/apps/APanel.java | 2 +- client/src/org/compiere/apps/ARequest.java | 6 +++++- client/src/org/compiere/apps/form/VGenPanel.java | 2 +- client/src/org/compiere/print/Viewer.java | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/client/src/org/adempiere/apps/graph/HtmlDashboard.java b/client/src/org/adempiere/apps/graph/HtmlDashboard.java index 913e873ff4..15e57a35a1 100644 --- a/client/src/org/adempiere/apps/graph/HtmlDashboard.java +++ b/client/src/org/adempiere/apps/graph/HtmlDashboard.java @@ -324,7 +324,7 @@ public class HtmlDashboard extends JPanel implements MouseListener, html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR )); */ int AD_Window_ID=Integer.parseInt(url.getRef()); - AWindow frame = new AWindow(); + AWindow frame = new AWindow(getGraphicsConfiguration()); if (!frame.initWindow(AD_Window_ID, null))//MQuery.getEqualQuery(TableName + "_ID", Record_ID))) return; AEnv.addToWindowManager(frame); diff --git a/client/src/org/compiere/apps/AArchive.java b/client/src/org/compiere/apps/AArchive.java index 5d9605be2d..2c14f69bf0 100644 --- a/client/src/org/compiere/apps/AArchive.java +++ b/client/src/org/compiere/apps/AArchive.java @@ -16,6 +16,7 @@ *****************************************************************************/ package org.compiere.apps; +import java.awt.GraphicsConfiguration; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.PreparedStatement; @@ -71,6 +72,7 @@ public class AArchive implements ActionListener private CMenuItem m_documents = null; /** Where Clause */ StringBuffer m_where = null; + private GraphicsConfiguration m_graphicsconfig = null; /** Logger */ private static CLogger log = CLogger.getCLogger (AArchive.class); @@ -150,6 +152,8 @@ public class AArchive implements ActionListener if (documentCount == 0 && reportCount == 0 && allReports == 0) m_popup.add(Msg.getMsg(Env.getCtx(), "ArchivedNone")); + + m_graphicsconfig = invoker.getGraphicsConfiguration(); // if (invoker.isShowing()) m_popup.show(invoker, 0, invoker.getHeight()); // below button @@ -162,7 +166,7 @@ public class AArchive implements ActionListener public void actionPerformed (ActionEvent e) { int AD_Form_ID = 118; // ArchiveViewer - FormFrame ff = new FormFrame(); + FormFrame ff = new FormFrame(m_graphicsconfig); ff.openForm(AD_Form_ID); ArchiveViewer av = (ArchiveViewer)ff.getFormPanel(); // diff --git a/client/src/org/compiere/apps/APanel.java b/client/src/org/compiere/apps/APanel.java index 7c8c5a7285..25fef04704 100644 --- a/client/src/org/compiere/apps/APanel.java +++ b/client/src/org/compiere/apps/APanel.java @@ -2633,7 +2633,7 @@ public final class APanel extends CPanel if (!cmd_save(true)) return; - FormFrame ff = new FormFrame(); + FormFrame ff = new FormFrame(getGraphicsConfiguration()); String title = vButton.getDescription(); if (title == null || title.length() == 0) title = vButton.getName(); diff --git a/client/src/org/compiere/apps/ARequest.java b/client/src/org/compiere/apps/ARequest.java index a9a14d4c98..4f88b48fed 100644 --- a/client/src/org/compiere/apps/ARequest.java +++ b/client/src/org/compiere/apps/ARequest.java @@ -16,6 +16,7 @@ *****************************************************************************/ package org.compiere.apps; +import java.awt.GraphicsConfiguration; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.PreparedStatement; @@ -89,9 +90,11 @@ public class ARequest implements ActionListener private CMenuItem m_new = null; private CMenuItem m_active = null; private CMenuItem m_all = null; + private GraphicsConfiguration m_graphicsconfig = null; /** Where Clause */ StringBuffer m_where = null; + /** Logger */ private static CLogger log = CLogger.getCLogger (ARequest.class); @@ -104,6 +107,7 @@ public class ARequest implements ActionListener m_new = new CMenuItem(Msg.getMsg(Env.getCtx(), "RequestNew")); m_new.setIcon(Env.getImageIcon("New16.gif")); m_popup.add(m_new).addActionListener(this); + m_graphicsconfig = invoker.getGraphicsConfiguration(); // int activeCount = 0; int inactiveCount = 0; @@ -198,7 +202,7 @@ public class ARequest implements ActionListener } // int AD_Window_ID = 232; // 232=all - 201=my - AWindow frame = new AWindow(); + AWindow frame = new AWindow(m_graphicsconfig); if (!frame.initWindow(AD_Window_ID, query)) return; AEnv.addToWindowManager(frame); diff --git a/client/src/org/compiere/apps/form/VGenPanel.java b/client/src/org/compiere/apps/form/VGenPanel.java index 9d51a0c56b..918ef527a9 100644 --- a/client/src/org/compiere/apps/form/VGenPanel.java +++ b/client/src/org/compiere/apps/form/VGenPanel.java @@ -303,7 +303,7 @@ public class VGenPanel extends CPanel implements ActionListener, ChangeListener, PrintInfo info = new PrintInfo(table.getTableName(),table.get_Table_ID(), Record_ID); ReportEngine re = new ReportEngine(Env.getCtx(), format, query, info); re.print(); - new Viewer(re); + new Viewer(m_frame.getGraphicsConfiguration(), re); } else ReportCtl.startDocumentPrint(genForm.getReportEngineType(), Record_ID, this, Env.getWindowNo(this), true); diff --git a/client/src/org/compiere/print/Viewer.java b/client/src/org/compiere/print/Viewer.java index eb4a9a174b..ec4d58fb7a 100644 --- a/client/src/org/compiere/print/Viewer.java +++ b/client/src/org/compiere/print/Viewer.java @@ -1184,7 +1184,7 @@ public class Viewer extends CFrame */ private void cmd_customize() { - AWindow win = new AWindow (); + AWindow win = new AWindow (getGraphicsConfiguration()); new AWindowListener (win, this); // forwards Window Events int AD_Window_ID = 240; // hardcoded int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();