How to change metal look and feel?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
klo
Posts: 8
Joined: Wed Dec 07, 2011 4:43 pm

How to change metal look and feel?

Post by klo »

Hi

I tried latest version on Ubuntu and would like to change default (metal) look and feel, which is only one listed in Options, to something more to date and easier on my eyes, but can't find way how.

Is there such possibility?
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: How to change metal look and feel?

Post by adrian »

Hello,

Thank you for contacting us.

Unfortunately the GTK look and feel(L&F) support is somewhat buggy and has been explicitly disabled in Oxygen.
GTK presents some GUI glitches in Oxygen that could cause stability problems for the application in certain conditions, so it was decided to disable it.
We are currently investigating these problems and they will be fixed in a future version of Oxygen. When this happens, the GTK look and feel will be enabled.

If you want to force the GTK look and feel, then there is a workaround for this.
Go to the Oxygen installation folder and edit the oxygen.vmoptions(or oxygen13.1.vmoptions) file(you can use gedit/kate or vi for editing).
At the end of the file add a new line with:
-Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel

Note that this modification only affects the application when started from the Desktop shortcut or the "oxygen" startup script.
If you usually start it with the "oxygen.sh" script then you will have to edit this .sh script and add in the command line the same -D... parameter.

Afterwards start Oxygen, go to Options -> Preferences -> Global(first item) and make sure the Look and Feel is set to Default. Restart the application to apply the change and you should have GTK L&F.

Let us know if you need further assistance.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
klo
Posts: 8
Joined: Wed Dec 07, 2011 4:43 pm

Re: How to change metal look and feel?

Post by klo »

Thanks Adrian for your assistance.

I already tried that. I first added `-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel` in "oxygen13.1.vmoptions" then in "oxygen.sh", following same older posts here, but there was no GTK option in application Preferences.
Now I added your suggested line `-Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel` but it's same and I don't know much about java.

FYI some other java applications offer this look, but it's not big issue of course, I was only curious if it's possible as I find it too bright and wished more contrast between common UI controls and text/tree UI areas.
Your application looks great even with basic java UI L&F.

Best wishes
klo
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: How to change metal look and feel?

Post by adrian »

We know that in general GTK is no big deal for Java applications, but Oxygen has a lot of components and frameworks that are influenced by the look and feel. Some of these components don't agree with the GTK look and feel and there's little that we can do about that.

-Dswing.defaultlaf will not work, Oxygen overrides that.
Only -Dswing.crossplatformlaf works. Make sure the argument is on a separate line in the .vmoptions file. If there are multiple arguments on a line, only the first is used.

Note that a GTK option will not appear after adding this property. However, if you set the Look and Feel option to Default, Oxygen will use the swing.crossplatformlaf look and feel(that you set to GTK).

ATTENTION: Make sure you also set the Styles option(below the Look and Feel option) to Default. I have just tested in v13.1 and the Eclipse style does not work anymore with the GTK look and feel(the application will fail to start: java.lang.NullPointerException).


If things start to go wrong or the application no longer starts, I suggest removing the -Dswing.crossplatformlaf argument and using Metal instead.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
klo
Posts: 8
Joined: Wed Dec 07, 2011 4:43 pm

Re: How to change metal look and feel?

Post by klo »

It seems that if "-Dswing.crossplatformlaf" option is added at the end in "oxygen13.1.vmoptions" it does not effect, but putting it after "-Dcom.oxygenxml.language" i.e., then it accepts this setting.

After which Oxygen won't start as you noted.
However I tried two other lafs:

1. Nimbus: it starts but some UI elements aren't drawn, and if Oxygen is started from terminal, bunch of Exceptions can be seen
2. Infonode: it works fine it seems, and I think I'll keep it as this

Thanks for your help
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: How to change metal look and feel?

Post by adrian »

1. Nimbus has a few additional problems in Oxygen on top of the ones GTK has. I don't recommend it.
2. The Infonode L&F is from a third party, it's not included in Oxygen. But it should work correctly since it's based on Metal. I'm guessing you unpacked the Infonode jar file in the lib folder.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
klo
Posts: 8
Joined: Wed Dec 07, 2011 4:43 pm

Re: How to change metal look and feel?

Post by klo »

Yes, I put infonode jar file in "lib" folder and point to main class file

Other LAF that seem to work well here is jgoodies plastic
Post Reply