[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Swing two screen scenario: Center popup failes  XML
Forum Index -> Development
Author Message
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hello,

on a two screen solution we have the following problem: Double click in a window on the second screen should open a centered popup (on second screen).

First monitor has a 4k resolution, right side second monitor has FHD resolution. The main dialog/window is fully opened on second screen.

The popup appears on the first screen, as the log outputs "2022:01:12 09:51:56:308 | 20 | INFO | Popup Location was set to: 3540/553 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData".

But this seams to be a wrong calculation.

Code:
 		beanToCall.prepareDlg( //
 				vorgabeZeitschemaEinheitStartEnde[0], //
 				vorgabeZeitschemaEinheitStartEnde[1], //
 				vorgabeZeitschemaEinheit, ok, null, ok, modalPopupZeitschemaEinheitAendern);
 
 		modalPopupZeitschemaEinheitAendern.open(EclntConstants.REL_JSP_PATH
 				+ EclntConstants.JSP_ZEITSCHEMA_EINHEIT_BEARBEITEN, "Zeitschema anpassen", 300, 245,
 				new ModalPopup.IModalPopupListener() {
 					public void reactOnPopupClosedByUser() {
 						modalPopupZeitschemaEinheitAendern.close();
 					}
 				});
 		modalPopupZeitschemaEinheitAendern.setLeftTopReferenceCentered();
 
 

Code:
 
 2022:01:12 09:51:56:304 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Default Locale that is used for dateFormat, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:305 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Locale that is used for dateFormat: , DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:305 | 20     | INFO     | ##### LOCALE: Conversion of current date as test: 12.01.2022, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:305 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Default Locale that is used for dateFormat, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:305 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Locale that is used for dateFormat: , DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:305 | 20     | INFO     | ##### LOCALE: Conversion of current date as test: 12.01.2022, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:306 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Default Locale that is used for dateFormat, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:306 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Locale that is used for dateFormat: , DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:306 | 20     | INFO     | ##### LOCALE: Conversion of current date as test: 12.01.2022, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:306 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Default Locale that is used for dateFormat, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:306 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Locale that is used for dateFormat: , DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:306 | 20     | INFO     | ##### LOCALE: Conversion of current date as test: 12.01.2022, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:307 | 20     | INFO     | Sizing to be executed .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | m_sizingBaseWindow = org.eclnt.client.controls.impl.FlatFrame[frame0,4783,-17,2434x1384,invalid,layout=java.awt.BorderLayout,title=CONNECT Produktion - Biedendorf, Ralf,resizable,maximized,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,17,46,2400x1321,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | ********** Finding the x,y posiiton to start popup... .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Sizing Based Window: org.eclnt.client.controls.impl.FlatFrame[frame0,4783,-17,2434x1384,invalid,layout=java.awt.BorderLayout,title=CONNECT Produktion - Biedendorf, Ralf,resizable,maximized,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,17,46,2400x1321,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Sizing Based Window screen location: 4783/-17 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Lefttop calculation result: -1469/1143 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Problable caller is: org.eclnt.client.elements.impl.SCHEDULEITEMElement$MySizeablePane[,0,0,7625x100,alignmentX=0.0,alignmentY=0.0,border=,flags=16777217,maximumSize=,minimumSize=,preferredSize=] .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Screen position of dialog: 3314/1126 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Left top reference was passed: centered: .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | XY Position of left top reference: 5850/553 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | posX adjustment (>): 3540 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:308 | 20     | INFO     | Popup Location was set to: 3540/553 .......... org.eclnt.client.elements.PageElementPopup>applyComponentData
 2022:01:12 09:51:56:309 | 20     | INFO     | Destroying class org.eclnt.client.elements.impl.MESSAGEElement/S25498-null .......... org.eclnt.client.elements.PageParserUpdate>mergeElementsWithPseudoElement
 2022:01:12 09:51:56:309 | 20     | INFO     | Asynchronous message published: ccserverrequestinfo(67) .......... org.eclnt.client.asynch.MessageBusImpl>sendMessage
 2022:01:12 09:51:56:309 | 20     | INFO     | SEQUENCE UPDATE: 7/8 .......... org.eclnt.client.elements.PageParserUpdate>mergeElementsWithPseudoElement
 2022:01:12 09:51:56:309 | 20     | INFO     | Clearing dirty list .......... org.eclnt.client.page.Page>clearDirtyInformation
 2022:01:12 09:51:56:309 | 20     | INFO     | [....8] - <<<<< finished .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | [....0] - >>>>> resizing controls .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | [....0] - ..... resizing, element count: 2 .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | Layouting page element: org.eclnt.client.elements.impl.MODALPOPUPElement .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | Layouting page element: org.eclnt.client.elements.impl.FORMElement .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | [....0] - <<<<< finished .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | [....0] - >>>>> Process invokeLaters .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:309 | 20     | INFO     | [....0] - <<<<< finished .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:310 | 20     | INFO     | BLOCKING: block counter = 0 .......... org.eclnt.client.page.Page>blockBlockingGlassPanes
 2022:01:12 09:51:56:310 | 20     | INFO     | BLOCKING: changing blocking to: false .......... org.eclnt.client.page.Page>blockBlockingGlassPanes
 2022:01:12 09:51:56:310 | 20     | INFO     | BLOCK MANAGEMENT: BLOCKING false .......... org.eclnt.client.controls.impl.BlockingGlassPane>block
 2022:01:12 09:51:56:311 | 20     | INFO     | BLOCK MANAGEMENT: BLOCKING false .......... org.eclnt.client.controls.impl.BlockingGlassPane>block
 2022:01:12 09:51:56:311 | 20     | INFO     | Event queue: >>> RELEASE .......... org.eclnt.client.page.EventBlocker>release
 2022:01:12 09:51:56:311 | 20     | INFO     | Event queue: >>> setting new releaseTimeStamp = 1641977516311 .......... org.eclnt.client.page.EventBlocker>release
 2022:01:12 09:51:56:311 | 20     | INFO     | Consuming events that were queued during server communication - begin .......... org.eclnt.client.page.EventBlocker>consumeQueuedEvents
 2022:01:12 09:51:56:312 | 20     | INFO     | Consuming events that were queued during server communication -end .......... org.eclnt.client.page.EventBlocker>consumeQueuedEvents
 2022:01:12 09:51:56:312 | 20     | INFO     | synch end .......... org.eclnt.client.page.Page>processUpdateResponse
 2022:01:12 09:51:56:312 | 20     | INFO     | synch end .......... org.eclnt.client.page.Page>callServerRun
 2022:01:12 09:51:56:312 | 20     | INFO     | **********(RFiw) CCFOCUSSETTER: in Window:  org.eclnt.client.elements.impl.SCHEDULEITEMElement$MySizeablePane/org.eclnt.client.elements.impl.FIXGRIDElement$3@11d293ee .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocusInWindow
 2022:01:12 09:51:56:444 | 20     | INFO     | Requesting focus for page element j_id_jsp_1299585678_1:connectStartg_sv:_I_1943-g_5/org.eclnt.client.elements.impl.CALENDARFIELDElement .......... org.eclnt.client.elements.PageElement>notifyPageUpdate
 2022:01:12 09:51:56:444 | 20     | INFO     | Requesting focus for componentorg.eclnt.client.controls.impl.FieldWithIcon .......... org.eclnt.client.elements.PageElementColumn>requestFocusInPageElement
 2022:01:12 09:51:56:444 | 20     | INFO     | **********(RF) CCFOCUSSETTER: org.eclnt.client.controls.impl.FieldWithIcon$MyFormattedTextField/org.eclnt.client.elements.impl.CALENDARFIELDElement@665aba64 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:444 | 20     | INFO     | **********(RF) CCFOCUSSETTER: Text: 09.07.2021 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:459 | 20     | INFO     | Requesting focus for component (II) org.eclnt.client.controls.impl.FieldWithIcon .......... org.eclnt.client.elements.PageElementColumn$1>run
 2022:01:12 09:51:56:460 | 20     | INFO     | **********(RF) CCFOCUSSETTER: org.eclnt.client.controls.impl.FieldWithIcon$MyFormattedTextField/org.eclnt.client.elements.impl.CALENDARFIELDElement@665aba64 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:460 | 20     | INFO     | **********(RF) CCFOCUSSETTER: Text: 09.07.2021 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:484 | 20     | INFO     | ********** Window was activated (wl2)! org.eclnt.client.elements.PageElementPopup$MyDialog[/popupZeitschemaEinheitAendern.jsp,3540,553,300x245,invalid,layout=java.awt.BorderLayout,APPLICATION_MODAL,title=Zeitschema anpassen,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,17,46,266x182,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] .......... org.eclnt.client.page.Page$8>windowActivated
 2022:01:12 09:51:56:484 | 20     | INFO     | Focus: Window activated - setting focus! .......... org.eclnt.client.elements.PageElementColumn$MyWindowListner>windowActivated
 2022:01:12 09:51:56:484 | 20     | INFO     | Requesting focus for page element j_id_jsp_1299585678_1:connectStartg_sv:_I_1943-g_5/org.eclnt.client.elements.PageElementColumn$MyWindowListner .......... org.eclnt.client.elements.PageElementColumn$MyWindowListner>windowActivated
 2022:01:12 09:51:56:485 | 20     | INFO     | **********(RF) CCFOCUSSETTER: org.eclnt.client.controls.impl.FieldWithIcon$MyFormattedTextField/org.eclnt.client.elements.PageElementColumn$MyWindowListner@5d4de864 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:485 | 20     | INFO     | **********(RF) CCFOCUSSETTER: Text: 09.07.2021 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:494 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Default Locale that is used for dateFormat, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:494 | 20     | INFO     | ##### LOCALE: CCFormatters.CCDateFormatterFactory: Locale that is used for dateFormat: , DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:494 | 20     | INFO     | ##### LOCALE: Conversion of current date as test: 12.01.2022, DE/de/ .......... org.eclnt.client.controls.util.CCSwingUtil>logLocaleInfo
 2022:01:12 09:51:56:504 | 20     | INFO     | Requesting focus for component (III) org.eclnt.client.controls.impl.FieldWithIcon .......... org.eclnt.client.elements.PageElementColumn$2>run
 2022:01:12 09:51:56:505 | 20     | INFO     | **********(RF) CCFOCUSSETTER: org.eclnt.client.controls.impl.FieldWithIcon$MyFormattedTextField/org.eclnt.client.elements.impl.CALENDARFIELDElement@665aba64 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 2022:01:12 09:51:56:505 | 20     | INFO     | **********(RF) CCFOCUSSETTER: Text: 09.07.2021 .......... org.eclnt.client.controls.util.CCFocusSetter>requestFocus
 

unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Testcase for EC Version: EnterpriseClient_20210215

Steps:

Start (debug)
Start tools
Move tools window to second screen
Open schedule.jsp
Move scroll bar to right
Double click schedule line

The popup opens (may be on first or second screen)
 Filename export_scheduleDoubleclickPopupTest.zip [Disk] Download
 Description
 Filesize 35 Kbytes
 Downloaded:  111 time(s)

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

...we took a look in the meantime. The reason for the mis-calculation is the horizontal scrolling inside the grid (you placed a 6000 pixel wide column)... This confuses the positioning a bit...

Thanks for your example. We try to find a solution that does not put too much fire into the Swing client...

Regards, Björn

Björn Müller, CaptainCasa GmbH
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

May be a helpful hint: The behavior changed with version 20210208. There are some missing log-entries like the adjustment line "<3500". And the popup is places a little bit nearer to the main window.

Regards,
Joachim
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

log: posX adjustment (>): 3540 ....
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5510
Offline

...we found the problem...

Swing has a function component.getLocationOnScreen() returning an X/Y value. With this coordinate we loop through the screen definitions + check in which screen the coordinate is locacted.

Due to the horizontal scrolling in your grid, Swing returns a location which is outside the current screen and is located on the other screen already... We now check the screen coordinates of the component against the screen coordinates that hold the component... - so that the window coordinates overrule the component coordinates...

OK, after some long time I had the pleasure (?) to debug through Swing code again...!

Thanks for your example, which helped a lot. The update is part of next update. (Or earlier on your request.)

Kind regards! Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team