Using substancelaf.configFile properly

View: New views
4 Messages — Rating Filter:   Alert me  

Using substancelaf.configFile properly

by Legéndi Richárd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys!

Sorry for being so lame, but I cannot figure out what am I doing wrong.
I've modified the sample application to make it use the settings from a
prop file instead of setting the -Dxxx flags.

Well, I guess I totally miss out the point, because it's not working as
I expected :-)

I just want to set the button sharper to the Standard one, but it still
uses the Classic one.
Although, I'm sure the config file is parsed correctly, because if I set
the substancelaf.enableInvertedThemes flag, I can access them from the
menu...

So, any hints about what I'm doing wrong? I'm playing with this for
hours now, but haven't found any solution :-)

Sincerely,
Richard

The config file I'm using:   (walkthrough.conf)
------------------------
substancelaf.buttonShaper=org.jvnet.substance.button.StandardButtonShaper
#substancelaf.enableInvertedThemes


The modified source:
---------------------
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.jvnet.substance.button.StandardButtonShaper;
import org.jvnet.substance.skin.SubstanceRavenLookAndFeel;

public class Walkthrough extends JFrame {
    public Walkthrough() {
        super("Sample app");
        this.setLayout(new FlowLayout());
        this.add(new JButton("button"));
        this.add(new JCheckBox("check"));
        this.add(new JLabel("label"));

        this.setSize(new Dimension(250, 80));
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        JFrame.setDefaultLookAndFeelDecorated(true);
        System.setProperty("substancelaf.configFile", "walkthrough.conf");
       
        try {
         
UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel");
          // It's working this way:
          //SubstanceRavenLookAndFeel.setCurrentButtonShaper( new
StandardButtonShaper() );
        } catch (Exception e) {
          System.out.println("Substance Raven Graphite failed to
initialize");
        }
       
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            Walkthrough w = new Walkthrough();
            w.setVisible(true);
          }
        });
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown Re: Using substancelaf.configFile properly

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

On the face of it, the configuration looks correct. You can put a breakpoint in PropertiesFileParamReader (in org.jvnet.substance.utils.params package) and its getButtonShaperProperty() method to see if the properties file has been correctly found and parsed.

Note that version 5.0 removes support for pretty much all VM parameterss specified in [1] and [2]. User code is encouraged to move to use custom skins to specify custom UI appearance.

Thanks
Kirill

[1] http://www.pushing-pixels.org/?p=295
[2] https://substance.dev.java.net/release-info/5.0/api-change-overview.html

----- Original Message ----
From: Legéndi Richárd Olivér <roante@...>
To: users@...
Sent: Tuesday, May 20, 2008 6:30:20 AM
Subject: Using substancelaf.configFile properly

Hi guys!

Sorry for being so lame, but I cannot figure out what am I doing wrong.
I've modified the sample application to make it use the settings from a
prop file instead of setting the -Dxxx flags.

Well, I guess I totally miss out the point, because it's not working as
I expected :-)

I just want to set the button sharper to the Standard one, but it still
uses the Classic one.
Although, I'm sure the config file is parsed correctly, because if I set
the substancelaf.enableInvertedThemes flag, I can access them from the
menu...

So, any hints about what I'm doing wrong? I'm playing with this for
hours now, but haven't found any solution :-)

Sincerely,
Richard

The config file I'm using:  (walkthrough.conf)
------------------------
substancelaf.buttonShaper=org.jvnet.substance.button.StandardButtonShaper
#substancelaf.enableInvertedThemes


The modified source:
---------------------
import java.awt.Dimension;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.jvnet.substance.button.StandardButtonShaper;
import org.jvnet.substance.skin.SubstanceRavenLookAndFeel;

public class Walkthrough extends JFrame {
    public Walkthrough() {
        super("Sample app");
        this.setLayout(new FlowLayout());
        this.add(new JButton("button"));
        this.add(new JCheckBox("check"));
        this.add(new JLabel("label"));

        this.setSize(new Dimension(250, 80));
        this.setLocationRelativeTo(null);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        JFrame.setDefaultLookAndFeelDecorated(true);
        System.setProperty("substancelaf.configFile", "walkthrough.conf");
     
        try {
         
UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel");
          // It's working this way:
          //SubstanceRavenLookAndFeel.setCurrentButtonShaper( new
StandardButtonShaper() );
        } catch (Exception e) {
          System.out.println("Substance Raven Graphite failed to
initialize");
        }
     
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            Walkthrough w = new Walkthrough();
            w.setVisible(true);
          }
        });
    }
}


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



Re: Using substancelaf.configFile properly

by Legéndi Richárd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Oh, now I see, thanks for the links Kirill!! Now its clear.

    "Removed most of the VM flags. The only two flags are for tracing memory allocation and heap status. Use skin / image watermark / configuration APIs."

Richard

Kirill Grouchnikov wrote:
Hi,

On the face of it, the configuration looks correct. You can put a breakpoint in PropertiesFileParamReader (in org.jvnet.substance.utils.params package) and its getButtonShaperProperty() method to see if the properties file has been correctly found and parsed.

Note that version 5.0 removes support for pretty much all VM parameterss specified in [1] and [2]. User code is encouraged to move to use custom skins to specify custom UI appearance.

Thanks
Kirill

[1] http://www.pushing-pixels.org/?p=295
[2] https://substance.dev.java.net/release-info/5.0/api-change-overview.html
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...

Parent Message unknown Re: Using substancelaf.configFile properly

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

The old VM flags should still work under 4.3 and earlier. This is why i have asked you to debug that method and see if the location of the config file is specified correctly.

Thanks
Kirill

----- Original Message ----
From: Legéndi Richárd Olivér <roante@...>
To: users@...
Sent: Wednesday, May 21, 2008 6:11:47 AM
Subject: Re: Using substancelaf.configFile properly

Oh, now I see, thanks for the links Kirill!! Now its clear.

    "Removed most of the VM flags. The only two flags are for tracing memory allocation and heap status. Use skin / image watermark / configuration APIs."

Richard

Kirill Grouchnikov wrote:
Hi,

On the face of it, the configuration looks correct. You can put a breakpoint in PropertiesFileParamReader (in org.jvnet.substance.utils.params package) and its getButtonShaperProperty() method to see if the properties file has been correctly found and parsed.

Note that version 5.0 removes support for pretty much all VM parameterss specified in [1] and [2]. User code is encouraged to move to use custom skins to specify custom UI appearance.

Thanks
Kirill

[1] http://www.pushing-pixels.org/?p=295
[2] https://substance.dev.java.net/release-info/5.0/api-change-overview.html
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...

LightInTheBox - Buy quality products at wholesale price