Frame position on multiple monitors incorrect.

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2975622
This commit is contained in:
phib 2010-04-20 01:06:56 +00:00
parent 359f90cee2
commit db9c487d37
6 changed files with 14 additions and 6 deletions

View File

@ -324,7 +324,7 @@ public class HtmlDashboard extends JPanel implements MouseListener,
html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR )); html.setCursor(Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ));
*/ */
int AD_Window_ID=Integer.parseInt(url.getRef()); 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))) if (!frame.initWindow(AD_Window_ID, null))//MQuery.getEqualQuery(TableName + "_ID", Record_ID)))
return; return;
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);

View File

@ -16,6 +16,7 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.apps; package org.compiere.apps;
import java.awt.GraphicsConfiguration;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@ -71,6 +72,7 @@ public class AArchive implements ActionListener
private CMenuItem m_documents = null; private CMenuItem m_documents = null;
/** Where Clause */ /** Where Clause */
StringBuffer m_where = null; StringBuffer m_where = null;
private GraphicsConfiguration m_graphicsconfig = null;
/** Logger */ /** Logger */
private static CLogger log = CLogger.getCLogger (AArchive.class); private static CLogger log = CLogger.getCLogger (AArchive.class);
@ -150,6 +152,8 @@ public class AArchive implements ActionListener
if (documentCount == 0 && reportCount == 0 && allReports == 0) if (documentCount == 0 && reportCount == 0 && allReports == 0)
m_popup.add(Msg.getMsg(Env.getCtx(), "ArchivedNone")); m_popup.add(Msg.getMsg(Env.getCtx(), "ArchivedNone"));
m_graphicsconfig = invoker.getGraphicsConfiguration();
// //
if (invoker.isShowing()) if (invoker.isShowing())
m_popup.show(invoker, 0, invoker.getHeight()); // below button m_popup.show(invoker, 0, invoker.getHeight()); // below button
@ -162,7 +166,7 @@ public class AArchive implements ActionListener
public void actionPerformed (ActionEvent e) public void actionPerformed (ActionEvent e)
{ {
int AD_Form_ID = 118; // ArchiveViewer int AD_Form_ID = 118; // ArchiveViewer
FormFrame ff = new FormFrame(); FormFrame ff = new FormFrame(m_graphicsconfig);
ff.openForm(AD_Form_ID); ff.openForm(AD_Form_ID);
ArchiveViewer av = (ArchiveViewer)ff.getFormPanel(); ArchiveViewer av = (ArchiveViewer)ff.getFormPanel();
// //

View File

@ -2633,7 +2633,7 @@ public final class APanel extends CPanel
if (!cmd_save(true)) if (!cmd_save(true))
return; return;
FormFrame ff = new FormFrame(); FormFrame ff = new FormFrame(getGraphicsConfiguration());
String title = vButton.getDescription(); String title = vButton.getDescription();
if (title == null || title.length() == 0) if (title == null || title.length() == 0)
title = vButton.getName(); title = vButton.getName();

View File

@ -16,6 +16,7 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.apps; package org.compiere.apps;
import java.awt.GraphicsConfiguration;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@ -89,9 +90,11 @@ public class ARequest implements ActionListener
private CMenuItem m_new = null; private CMenuItem m_new = null;
private CMenuItem m_active = null; private CMenuItem m_active = null;
private CMenuItem m_all = null; private CMenuItem m_all = null;
private GraphicsConfiguration m_graphicsconfig = null;
/** Where Clause */ /** Where Clause */
StringBuffer m_where = null; StringBuffer m_where = null;
/** Logger */ /** Logger */
private static CLogger log = CLogger.getCLogger (ARequest.class); 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 = new CMenuItem(Msg.getMsg(Env.getCtx(), "RequestNew"));
m_new.setIcon(Env.getImageIcon("New16.gif")); m_new.setIcon(Env.getImageIcon("New16.gif"));
m_popup.add(m_new).addActionListener(this); m_popup.add(m_new).addActionListener(this);
m_graphicsconfig = invoker.getGraphicsConfiguration();
// //
int activeCount = 0; int activeCount = 0;
int inactiveCount = 0; int inactiveCount = 0;
@ -198,7 +202,7 @@ public class ARequest implements ActionListener
} }
// //
int AD_Window_ID = 232; // 232=all - 201=my 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)) if (!frame.initWindow(AD_Window_ID, query))
return; return;
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);

View File

@ -303,7 +303,7 @@ public class VGenPanel extends CPanel implements ActionListener, ChangeListener,
PrintInfo info = new PrintInfo(table.getTableName(),table.get_Table_ID(), Record_ID); PrintInfo info = new PrintInfo(table.getTableName(),table.get_Table_ID(), Record_ID);
ReportEngine re = new ReportEngine(Env.getCtx(), format, query, info); ReportEngine re = new ReportEngine(Env.getCtx(), format, query, info);
re.print(); re.print();
new Viewer(re); new Viewer(m_frame.getGraphicsConfiguration(), re);
} }
else else
ReportCtl.startDocumentPrint(genForm.getReportEngineType(), Record_ID, this, Env.getWindowNo(this), true); ReportCtl.startDocumentPrint(genForm.getReportEngineType(), Record_ID, this, Env.getWindowNo(this), true);

View File

@ -1184,7 +1184,7 @@ public class Viewer extends CFrame
*/ */
private void cmd_customize() private void cmd_customize()
{ {
AWindow win = new AWindow (); AWindow win = new AWindow (getGraphicsConfiguration());
new AWindowListener (win, this); // forwards Window Events new AWindowListener (win, this); // forwards Window Events
int AD_Window_ID = 240; // hardcoded int AD_Window_ID = 240; // hardcoded
int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID(); int AD_PrintFormat_ID = m_reportEngine.getPrintFormat().get_ID();