Bug 59995 - Allow user to change font size with 2 new menu items and use "jmeter.hidpi.scale.factor" for scaling fonts
Summary: Allow user to change font size with 2 new menu items and use "jmeter.hidpi.sc...
Status: NEEDINFO
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.0
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2016-08-12 13:00 UTC by Gabor Szabo
Modified: 2017-02-25 19:35 UTC (History)
2 users (show)



Attachments
Patch implementing the feature (9.60 KB, patch)
2017-01-25 13:47 UTC, UbikLoadPack support
Details | Diff
Screenshot showing that the fonts does not get scaled evenly (33.70 KB, image/png)
2017-01-28 15:33 UTC, Felix Schumacher
Details
Enable zooming by pressing ctrl and using the mousewheel (915 bytes, patch)
2017-01-28 15:51 UTC, Felix Schumacher
Details | Diff
Before Zoom on Windows 7 PRO (146.01 KB, image/png)
2017-02-11 21:29 UTC, Philippe Mouawad
Details
After Zoom on Windows 7 PRO (148.80 KB, image/png)
2017-02-11 21:30 UTC, Philippe Mouawad
Details
Before Zoom On MacOSX ElCapitan (385.57 KB, image/png)
2017-02-11 21:36 UTC, Philippe Mouawad
Details
After Zoom On MacOSX ElCapitan (433.48 KB, image/png)
2017-02-11 21:36 UTC, Philippe Mouawad
Details
After Zoom on Linux Mint (63.16 KB, image/png)
2017-02-11 21:39 UTC, Graham Russell
Details
After Zoom on Linux Mint with CrossPlatform LaF (80.48 KB, image/png)
2017-02-25 19:35 UTC, Graham Russell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Szabo 2016-08-12 13:00:48 UTC
Allow the user to change the font size of the application.

The regular Command-+ does not work on JMeter on OSX. If would be nice if that would work, or if at least there was a menu option to change the font size.
It is quite important for presentations.
Comment 1 UbikLoadPack support 2017-01-25 13:47:58 UTC
Created attachment 34672 [details]
Patch implementing the feature

Hello,
Find attached a patch that implement the following:
- 2 menu items in Options Zoom In / Zoom Out to increase/decrease font
- Improves Bug 58426 by taking into account the jmeter.hidpi.scale.factor and jmeter.hidpi.mode properties for Fonts. If jmeter.hidpi.mode is true, then the jmeter.hidpi.scale.factor will be used to increase font size

This is very useful as currently on Windows (Using Windows or Windows Classic Laf) for example, the fonts are really very tiny on a standard configuration.
This makes the UI much clearer.

Regards
Comment 2 Philippe Mouawad 2017-01-25 17:08:49 UTC
Author: pmouawad
Date: Wed Jan 25 17:08:26 2017
New Revision: 1780244

URL: http://svn.apache.org/viewvc?rev=1780244&view=rev
Log:
Bug 59995 - Allow user to change font size with 2 new menu items and use "jmeter.hidpi.scale.factor" for scaling fonts
Contributed by UbikLoadPack
Bugzilla Id: 59995

Added:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ZoomInOut.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 Felix Schumacher 2017-01-28 15:33:35 UTC
Created attachment 34689 [details]
Screenshot showing that the fonts does not get scaled evenly

As mentioned on the dev list, not all fonts seem to get scaled evenly well.
Comment 4 Felix Schumacher 2017-01-28 15:51:43 UTC
Created attachment 34690 [details]
Enable zooming by pressing ctrl and using the mousewheel

This patch registers a mousewheel listener on the MainFrame, that lets the user zoom by pressing ctrl and turning the mousewheel.

It will not work on the JSyntaxTextArea :(
Comment 5 Philippe Mouawad 2017-01-30 12:27:12 UTC
Wheel mouse Patch works for me on Mac OSX El Capitan
Comment 6 Felix Schumacher 2017-02-10 20:37:35 UTC
Date: Fri Feb 10 20:35:29 2017
New Revision: 1782519

URL: http://svn.apache.org/viewvc?rev=1782519&view=rev
Log:
Use instanceof instead of a string compare to get the font objects to scale.
Differentiate between Fonts and the more special FontUIResource instances.
Store the new Font instances in the UIDefaults instead of the UIManager.
The last change is needed on ubuntu to make the zoom feature usable for more
then one step.

Bugzilla Id: 59995

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
Comment 7 Felix Schumacher 2017-02-10 20:40:35 UTC
Date: Fri Feb 10 20:40:08 2017
New Revision: 1782521

URL: http://svn.apache.org/viewvc?rev=1782521&view=rev
Log:
Register a mousewheel listener to enable zooming with ctrl+mouswheel up/down.

Bugzilla Id: 59995

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/MainFrame.java
Comment 8 Philippe Mouawad 2017-02-10 20:54:39 UTC
(In reply to Felix Schumacher from comment #6)
> Date: Fri Feb 10 20:35:29 2017
> New Revision: 1782519
> 
> URL: http://svn.apache.org/viewvc?rev=1782519&view=rev
> Log:
> Use instanceof instead of a string compare to get the font objects to scale.
> Differentiate between Fonts and the more special FontUIResource instances.
> Store the new Font instances in the UIDefaults instead of the UIManager.
> The last change is needed on ubuntu to make the zoom feature usable for more
> then one step.
> 
> Bugzilla Id: 59995
> 
> Modified:
>     jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java

HI Felix,
On MacOS it does not work.
2017-02-10 21:55:15,583 ERROR o.a.j.JMeter: Uncaught exception: 
java.util.ConcurrentModificationException: null
	at java.util.Hashtable$Enumerator.next(Hashtable.java:1378) ~[?:1.8.0_112]
	at org.apache.jmeter.util.JMeterUtils.lambda$0(JMeterUtils.java:1174) ~[ApacheJMeter_core.jar:3.2-SNAPSHOT.20170210]
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) ~[?:1.8.0_112]
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756) ~[?:1.8.0_112]
	at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:1.8.0_112]
	at java.awt.EventQueue$3.run(EventQueue.java:709) ~[?:1.8.0_112]
	at java.awt.EventQueue$3.run(EventQueue.java:703) ~[?:1.8.0_112]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_112]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) ~[?:1.8.0_112]
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:726) ~[?:1.8.0_112]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [?:1.8.0_112]
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_112]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_112]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_112]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_112]
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_112]
Comment 9 Felix Schumacher 2017-02-11 19:11:46 UTC
Should be fixed now, but could you re-test it, to be sure?

Date: Sat Feb 11 10:00:04 2017
New Revision: 1782571

URL: http://svn.apache.org/viewvc?rev=1782571&view=rev
Log:
Make a copy of the keySet as we are modifying the collection.

Bugzilla Id: 59995

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
Comment 10 Philippe Mouawad 2017-02-11 21:09:35 UTC
(In reply to Felix Schumacher from comment #9)
> Should be fixed now, but could you re-test it, to be sure?

It works fine on Windows and MacOSX.
> 
> Date: Sat Feb 11 10:00:04 2017
> New Revision: 1782571
> 
> URL: http://svn.apache.org/viewvc?rev=1782571&view=rev
> Log:
> Make a copy of the keySet as we are modifying the collection.
> 
> Bugzilla Id: 59995
> 
> Modified:
>     jmeter/trunk/src/core/org/apache/jmeter/util/JMeterUtils.java
Comment 11 Philippe Mouawad 2017-02-11 21:29:35 UTC
Created attachment 34746 [details]
Before Zoom on Windows 7 PRO
Comment 12 Philippe Mouawad 2017-02-11 21:30:20 UTC
Created attachment 34747 [details]
After Zoom on Windows 7 PRO
Comment 13 Philippe Mouawad 2017-02-11 21:36:16 UTC
Created attachment 34748 [details]
Before Zoom On MacOSX ElCapitan
Comment 14 Philippe Mouawad 2017-02-11 21:36:47 UTC
Created attachment 34749 [details]
After Zoom On MacOSX ElCapitan
Comment 15 Graham Russell 2017-02-11 21:39:20 UTC
Created attachment 34750 [details]
After Zoom on Linux Mint
Comment 16 Philippe Mouawad 2017-02-11 21:46:07 UTC
(In reply to Graham Russell from comment #15)
> Created attachment 34750 [details]
> After Zoom on Linux Mint

Thanks Graham, would you say that display improves with this feature or not on Linux Mint ?
Thanks
Comment 17 Graham Russell 2017-02-11 22:07:10 UTC
Sorry, by "before" do you mean JM 3.1 and trunk or do you mean between rev 1780244 and 1782519 or 1782571?

I've also noticed that if you use the ctrl + scrollwhell to increase it stops zooming (in or out) once a scrollbar appears and you have to zoom out (many times) using the menu before the scrollbar disappears.

Maybe this could be fixed (or at least helped) by setting a max zoom level?

You can also zoom very far out, which also doesn't seem so useful.

My current opinion of this feature on Mint is that it isn't an improvement as it stands - it appears that only some of the title text changes size.

A reset zoom option might also be very useful.

Thanks
Comment 18 Philippe Mouawad 2017-02-11 22:25:01 UTC
(In reply to Graham Russell from comment #17)
> Sorry, by "before" do you mean JM 3.1 and trunk or do you mean between rev
> 1780244 and 1782519 or 1782571?

By before I meant without zoom.

> 
> I've also noticed that if you use the ctrl + scrollwhell to increase it
> stops zooming (in or out) once a scrollbar appears and you have to zoom out
> (many times) using the menu before the scrollbar disappears.
> 
> Maybe this could be fixed (or at least helped) by setting a max zoom level?
> 
> You can also zoom very far out, which also doesn't seem so useful.
> 
> My current opinion of this feature on Mint is that it isn't an improvement
> as it stands - it appears that only some of the title text changes size.
> 
> A reset zoom option might also be very useful.

Yes , those would be helpful.
But I'd like to understand before why on different versions of Windows/Devices, display is so different. 
If nothing can be done, I'm not sure this feature should be enabled by default.


> 
> Thanks
Comment 19 Graham Russell 2017-02-11 22:34:51 UTC
(In reply to Philippe Mouawad from comment #18)
> (In reply to Graham Russell from comment #17)
> > Sorry, by "before" do you mean JM 3.1 and trunk or do you mean between rev
> > 1780244 and 1782519 or 1782571?
> 
> By before I meant without zoom.
> 
> > 
> > I've also noticed that if you use the ctrl + scrollwhell to increase it
> > stops zooming (in or out) once a scrollbar appears and you have to zoom out
> > (many times) using the menu before the scrollbar disappears.
> > 
> > Maybe this could be fixed (or at least helped) by setting a max zoom level?
> > 
> > You can also zoom very far out, which also doesn't seem so useful.
> > 
> > My current opinion of this feature on Mint is that it isn't an improvement
> > as it stands - it appears that only some of the title text changes size.
> > 
> > A reset zoom option might also be very useful.
> 
> Yes , those would be helpful.
> But I'd like to understand before why on different versions of
> Windows/Devices, display is so different. 
> If nothing can be done, I'm not sure this feature should be enabled by
> default.

I agree.

It could be switchable but then this adds additional complexity in config, code and docs which might not be worth it?

Would another solution to the original problem (of presentations) be to use some accessibility software e.g. Windows magnifier?

> 
> > 
> > Thanks
Comment 20 Graham Russell 2017-02-25 19:35:25 UTC
Created attachment 34778 [details]
After Zoom on Linux Mint with CrossPlatform LaF