Java Swing Look and Feel isSubstanceInstalled()

Here you can find the source of isSubstanceInstalled()

Description

Returns whether the currently installed LookAndFeel is Substance.

License

BSD License

Return

Whether the currently installed LookAndFeel is Substance.

Declaration

public static boolean isSubstanceInstalled() 

Method Source Code

//package com.java2s;
/*//from   ww  w.j  a v  a 2 s  . c  o  m
 * 11/11/2010
 *
 * SubstanceUtils.java - Utility methods for Java 1.4-compatible applications
 * looking to support Substance 6.1 if the current JRE is 1.6+.
 * Copyright (C) 2003 Robert Futrell
 * http://fifesoft.com/rtext
 * Licensed under a modified BSD license.
 * See the included license file for details.
 */

import javax.swing.LookAndFeel;
import javax.swing.UIManager;

public class Main {
    /**
     * Returns whether the currently installed LookAndFeel is Substance.
     *
     * @return Whether the currently installed LookAndFeel is Substance.
     */
    public static boolean isSubstanceInstalled() {
        return isASubstanceLookAndFeel(UIManager.getLookAndFeel());
    }

    /**
     * Returns whether a given LookAndFeel is a Substance LookAndFeel.
     *
     * @param laf The LookAndFeel.
     * @return Whether it is a Substance LookAndFeel.
     * @see #isASubstanceLookAndFeel(String)
     * @see #isSubstanceInstalled()
     */
    public static boolean isASubstanceLookAndFeel(LookAndFeel laf) {
        return isASubstanceLookAndFeel(laf.getClass().getName());
    }

    /**
     * Returns whether a given LookAndFeel is a Substance LookAndFeel.
     *
     * @param lafName The LookAndFeel's class name.
     * @return Whether it is a Substance LookAndFeel.
     * @see #isASubstanceLookAndFeel(LookAndFeel)
     * @see #isSubstanceInstalled()
     */
    public static boolean isASubstanceLookAndFeel(String lafName) {
        return lafName.indexOf(".Substance") > -1;
    }
}

Related

  1. isNimbusGTKTheme()
  2. isNimbusLookAndFeel()
  3. isNimbusLookAndFeel()
  4. isPlasticLaf()
  5. isQuaqua()
  6. isSynth()
  7. isSystemLookAndFeel()
  8. isUnderIntelliJLaF()
  9. isUnderWindowsClassicLookAndFeel()