Java Swing UIManager usingOcean()

Here you can find the source of usingOcean()

Description

Returns true if we're using the Ocean Theme under the MetalLookAndFeel.

License

Open Source License

Declaration

public static boolean usingOcean() 

Method Source Code

//package com.java2s;
/*/*ww w.  j  a v  a  2s  .  c o  m*/
 * UIUtils.java  2/6/13 1:04 PM
 *
 * Copyright (C) 2012-2013 Nick Ma
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

import javax.swing.UIManager;

import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.metal.OceanTheme;

public class Main {
    /**
     * Returns true if we're using the Ocean Theme under the
     * MetalLookAndFeel.
     */
    public static boolean usingOcean() {
        if (isMetalLookAndFeel()) {
            return (MetalLookAndFeel.getCurrentTheme() instanceof OceanTheme);
        }
        return false;
    }

    /**
     * Returns whether the current applied look and feel is
     * the MetalLookAndFeel
     *
     * @return true | false
     */
    public static boolean isMetalLookAndFeel() {
        return UIManager.getLookAndFeel() instanceof MetalLookAndFeel;
    }
}

Related

  1. traceSubstanceApiUsage(Component comp, String message)
  2. useLNF()
  3. useLnf(String lnfClassName)
  4. usingLnf(String lnfClass)
  5. usingMetalLnf()