Package com.commander4j.util

Source Code of com.commander4j.util.JSplashScreenUtils

package com.commander4j.util;

import com.commander4j.sys.Common;
import com.commander4j.sys.JWindowProgress;
import com.commander4j.sys.JWindowSplash;

public class JSplashScreenUtils
{

  public static void hide()
  {
    if (Common.displaySplashScreen)
    {
      if (Common.splash != null)
      {
        Common.splash.setVisible(false);
      }
      if (Common.progress != null)
      {
        Common.progress.setVisible(false);
      }
    }
  }

  public static void show()
  {
    if (Common.displaySplashScreen)
    {
      if (Common.splash != null)
      {
        Common.splash.setVisible(true);
      }
      if (Common.progress != null)
      {
        Common.progress.setVisible(true);
      }
    }
  }

  public static void updateProgress(int progress, String message)
  {
    if (Common.displaySplashScreen)
    {
      if (Common.progress != null)
      {
        JWait.milliSec(Common.splashDelay);
        Common.progress.update(progress, message);
      }
    }
  }

  public static void remove()
  {
    if (Common.displaySplashScreen)
    {
      Common.splash.dispose();
      Common.progress.dispose();
      Common.splash = null;
      Common.progress = null;
    }

  }

  public static void create()
  {
    if (Common.displaySplashScreen)
    {
      Common.splash = new JWindowSplash();
      Common.progress = new JWindowProgress(Common.splash.getImageDimensions());
    }
  }

}
TOP

Related Classes of com.commander4j.util.JSplashScreenUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.