Project

General

Profile

Bug #2770

Bug #2677: fix drawing and functional differences between P2J GUI and 4GL GUI

alert-box visual differences

Added by Greg Shah over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

simpler_alert_box_in_p2j_swing_20151020.png (2.88 KB) Greg Shah, 10/20/2015 04:31 PM

simpler_alert_box_in_progress_20151020.png (4.34 KB) Greg Shah, 10/20/2015 04:31 PM

simpler_alert_box_in_p2j_swing_20151022.png (4.22 KB) Greg Shah, 10/22/2015 09:22 AM

simpler_alert_box_progress_vs_p2j_swing_width_and_height_differs_20151022.png (17.1 KB) Greg Shah, 10/22/2015 09:22 AM

simpler_alert_box_progress_vs_p2j_swing_height_differs_20151022.png (9.21 KB) Greg Shah, 10/22/2015 09:22 AM

simpler_alert_box_progress_vs_p2j_swing_button_height_differs_20151022.png (10.1 KB) Greg Shah, 10/22/2015 09:22 AM

simpler_alert_box_progress_vs_p2j_swing_button_width_is_same_20151022.png (3.05 KB) Greg Shah, 10/22/2015 09:22 AM

alert-box_icons_compare.png (5.48 KB) Hynek Cihlar, 04/22/2016 03:56 AM

icons_antialiasing.png (4.71 KB) Hynek Cihlar, 04/24/2016 03:29 PM

History

#1 Updated by Greg Shah over 8 years ago

The P2J version of alert-box has 3 visual differences as compared to the Progress version.

Progress:

P2J (branch 1811s revision 11003):

Here are the problems:

  1. The size of the P2J alert-box is too big.
  2. The default button "No" doesn't have the focus (pressing space or enter should select the default button and close the alert-box, in P2J we must use the mouse).
  3. The window close button should be drawn as disabled.

The 3D border issue is also visible above, but it is being worked in #2763, not here.

#2 Updated by Greg Shah over 8 years ago

I did run this with updated text metrics, so the sizing problem shouldn't be due to that.

#3 Updated by Hynek Cihlar over 8 years ago

The differences resolved in 1811s revision 11011.

The checkin also adds proper handling of window caption close button.

Note that a regression broke all the keyboard input, this is being solved.

#4 Updated by Hynek Cihlar over 8 years ago

1811s revision 11014 fixes an unhandled exception when alert-box closed through the window caption button.

#5 Updated by Greg Shah over 8 years ago

OK, this is very close now.

P2J Swing:

There are still slight size differences.

(The top alert-box is Progress and bottom is P2J.)

1. Both width and height differ. Part of the problem is that there is 1 extra pixel in the border of P2J.

(The left/below alert-box is Progress and above/right is P2J.)

2. The titlebar is 1 pixel too tall in P2J.

3. The icon is too big in P2J.

(The lower/below alert-box is Progress and above/top is P2J.)

(The left/below alert-box is Progress and above/right is P2J.)

4. The button widths are OK, but the positioning is off by a pixel.

5. The button heights are off by 1 pixel.

#6 Updated by Greg Shah about 8 years ago

  • Target version changed from Milestone 12 to Milestone 16

#7 Updated by Hynek Cihlar about 8 years ago

Greg Shah wrote:

3. The icon is too big in P2J.

Greg, I just realized the icon sizes are equal. Your screenshot from native 4GL seems to be somehow deformed. I am attaching the screenshot capturing the icons from my devsrv01 (left icon on the image) session and P2J.

#8 Updated by Greg Shah about 8 years ago

When you say devsrv01, did you mean winsrv01?

#9 Updated by Hynek Cihlar about 8 years ago

Greg Shah wrote:

When you say devsrv01, did you mean winsrv01?

Yes :-).

#10 Updated by Hynek Cihlar about 8 years ago

Hynek Cihlar wrote:

Greg Shah wrote:

When you say devsrv01, did you mean winsrv01?

Yes :-).

Actually I meant windev01. When you connect remotely do you maybe rescale the resolution?

#11 Updated by Greg Shah about 8 years ago

Sorry, my mistake too, I also meant windev01. :)

I did not intentionally scale the resolution, but it may have happened anyway. If the size is right, then we won't worry about that issue.

Did you look at the changes in #3048? How do those affect this task?

#12 Updated by Hynek Cihlar about 8 years ago

Greg Shah wrote:

Sorry, my mistake too, I also meant windev01. :)

I did not intentionally scale the resolution, but it may have happened anyway. If the size is right, then we won't worry about that issue.

Did you look at the changes in #3048? How do those affect this task?

I don't think the changes in #3048 affect this task.

#13 Updated by Hynek Cihlar about 8 years ago

Eugenie, when I rasterize alert-box icon using SharpPNGTranscoder I get a very distorted output. But if I use the unmodified Batik PNGTranscoder directly, I get the expected output. See below.

What do you advise?

#14 Updated by Eugenie Lyzenko about 8 years ago

Hynek Cihlar wrote:

Eugenie, when I rasterize alert-box icon using SharpPNGTranscoder I get a very distorted output. But if I use the unmodified Batik PNGTranscoder directly, I get the expected output. See below.

What do you advise?

The SharpPNGTranscoder just turns anti-alias off. It was introduced for drawing all solid icons like scrollbar buttons. And this is how the batik package works with image.

What is the original image? What is your goal? You need to have the image without anti-alias?

If you need antialias to be off and want to have some predefined picture in P2J the approach is:
- take original picture
- make a change to original picture to adjust the final result.

There ane no shortcuts here. You will have to find out how the changes in original picture produces the final result. Pixel by pixel.

The better way if the image size is constant I guess is to use simple bitmap. And no BATIK or other third party image handling tools.

#15 Updated by Hynek Cihlar about 8 years ago

2770a rebased against trunk 11012, the branch is now at rev 11014.

#16 Updated by Greg Shah about 8 years ago

Can you provide an update on this work?

#17 Updated by Hynek Cihlar about 8 years ago

Greg Shah wrote:

Can you provide an update on this work?

The core changes are in place. And the issues above addressed.

TODOs are, retest after rebase against trunk 11012 and minor code cleanup.

#18 Updated by Hynek Cihlar about 8 years ago

2770a rebased against trunk 11015, the branch is now at rev 11017.

#19 Updated by Hynek Cihlar about 8 years ago

Hynek Cihlar wrote:

Greg Shah wrote:

Can you provide an update on this work?

The core changes are in place. And the issues above addressed.

TODOs are, retest after rebase against trunk 11012 and minor code cleanup.

There is one more regression, the window can be resized only by its right/bottom edges, but not the top/left ones. I am working on this right now.

#20 Updated by Hynek Cihlar about 8 years ago

2770a rebased against trunk 11016, the branch is now at rev 11024.

#21 Updated by Greg Shah about 8 years ago

Is this ready for code review?

#22 Updated by Hynek Cihlar about 8 years ago

Please review 2770a revision 11025.

The revision resolves the ALERT-BOX layout issues mentioned in the above notes. It also resolves Swing window resizing issues - resizing cursor sometime not appearing, sometime disappearing unexpectedly, window resizing sometime moving the whole window. Plus other related fixes.

The revision passes GUI regression tests. Since the changes are only in GUI code, no ChUI regression testing is needed.

#23 Updated by Hynek Cihlar about 8 years ago

Greg Shah wrote:

Is this ready for code review?

Revision 11025 is.

#24 Updated by Hynek Cihlar about 8 years ago

Eugenie Lyzenko wrote:

The better way if the image size is constant I guess is to use simple bitmap. And no BATIK or other third party image handling tools.

Eugenie, please review 2770a revision 11025. It contains changes related to the subject above.

#25 Updated by Hynek Cihlar about 8 years ago

2770a 11025 also resolves #3067.

#26 Updated by Greg Shah about 8 years ago

Code Review Task Branch 2770a Revision 11025

I'm generally fine with the changes.

1. In WindowBorder, please put a line break before the implements.

2. How does the AbstractContainer change affect ChUI?

#27 Updated by Eugenie Lyzenko about 8 years ago

Eugenie, please review 2770a revision 11025. It contains changes related to the subject above.

Three considerations:
1. Did you classify all cases when the aliasing must be on and when must be off? We need to avoid 4GL - P2J visual mismatch.
2. In AlertBoxGuiImpl the icon image coordinate has hardcoded coords dependent on PADDING character unit related coord. Why not to just center the image withing rectangle? What if the font size is changing, will the image position be OK.
3. Your drawImage() does not use image transparency, is it intentional? Does the 4GL show the same behavior?

#28 Updated by Hynek Cihlar about 8 years ago

Greg Shah wrote:

Code Review Task Branch 2770a Revision 11025

I'm generally fine with the changes.

1. In WindowBorder, please put a line break before the implements.

Resolved in 11026. I also added one more javadoc.

2. How does the AbstractContainer change affect ChUI?

The changed method is only executed in GUI context.

#29 Updated by Hynek Cihlar about 8 years ago

Eugenie Lyzenko wrote:

Eugenie, please review 2770a revision 11025. It contains changes related to the subject above.

Three considerations:
1. Did you classify all cases when the aliasing must be on and when must be off? We need to avoid 4GL - P2J visual mismatch.

There is only one case ATM where antialiasing needs to be ON, and that is the ALERT-BOX icons.

2. In AlertBoxGuiImpl the icon image coordinate has hardcoded coords dependent on PADDING character unit related coord. Why not to just center the image withing rectangle? What if the font size is changing, will the image position be OK.

The icon position depends on Windows message box font size theme settings.

3. Your drawImage() does not use image transparency, is it intentional? Does the 4GL show the same behavior?

Although the icons use transparency, I didn't have a need to turn that flag on. The source SVGs have transparent backgrounds (they don't contain any drawings) and so Batik rasterizer creates the rastered images with correct transparency.

For which cases is the transparency flag needed anyway?

#30 Updated by Greg Shah about 8 years ago

Please merge 2770a to trunk.

#31 Updated by Hynek Cihlar about 8 years ago

2770a merged to trunk as revision 11017. The branch has been archived.

#32 Updated by Hynek Cihlar about 8 years ago

  • % Done changed from 0 to 100
  • Status changed from New to WIP

#33 Updated by Greg Shah about 8 years ago

  • Status changed from WIP to Closed

#34 Updated by Hynek Cihlar about 8 years ago

Please review task branch 2770b revision 11018, it fixes GUI regressions caused by assigning widget IDs to all BorderedPanelGuiImpl instances.

#35 Updated by Greg Shah about 8 years ago

Code Review Task Branch 2770b Revision 11018

The changes are fine.

Please add the embedded mode fix to this branch (when you have it ready).

#36 Updated by Hynek Cihlar about 8 years ago

2770b revision 11019 fixes main window border being drawn even when the driver doesn't support window decorations. Please review.

#37 Updated by Greg Shah about 8 years ago

Code Review Task Branch 2770b Revision 11019

The changes are fine.

#38 Updated by Hynek Cihlar about 8 years ago

2770a rebased against trunk 11019, the branch is now at rev 11022.

#39 Updated by Hynek Cihlar about 8 years ago

2770b revision 11025 resolves regressions introduced by 2770a, fixes selection of next active window when modal window with no visible owner is being hidden and attempts to fix Swing JFrame sometime not focusing when JFrame.requestFocus() called right after the window is made visible.

GUI regression tests passed, ChUI regression testing is not needed as the changes only affect GUI code.

Please review.

#40 Updated by Greg Shah about 8 years ago

Code Review Task Branch 2770b Revision 11025

I'm fine with the changes.

Please merge to trunk.

#41 Updated by Hynek Cihlar about 8 years ago

2770b merged to trunk as revision 11020. The branch was archived.

#42 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 16 to Cleanup and Stabilization for GUI

Also available in: Atom PDF