當前位置: 首頁>>代碼示例>>Java>>正文


Java SplashScreen.update方法代碼示例

本文整理匯總了Java中java.awt.SplashScreen.update方法的典型用法代碼示例。如果您正苦於以下問題:Java SplashScreen.update方法的具體用法?Java SplashScreen.update怎麽用?Java SplashScreen.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.SplashScreen的用法示例。


在下文中一共展示了SplashScreen.update方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: splashMessage

import java.awt.SplashScreen; //導入方法依賴的package包/類
private static void splashMessage(String message, int progress) {
    SplashScreen splash = SplashScreen.getSplashScreen();
    int maxProgress = 100;
    if (splash != null) {
        Graphics2D g = splash.createGraphics();
        g.setComposite(AlphaComposite.Clear);
        g.fillRect(0, 0, splash.getSize().width, splash.getSize().height);
        g.setPaintMode();
        g.setColor(Color.BLACK);
        g.setFont(new Font("SansSerif", Font.BOLD, 10));
        g.drawString(message, 35, splash.getSize().height / 2 + 20);
        g.drawRect(35, splash.getSize().height / 2 + 30, splash.getSize().width - 70, 9);
        g.fillRect(37, splash.getSize().height / 2 + 32, (progress * (splash.getSize().width - 68) / maxProgress), 5);
        splash.update();
    }
}
 
開發者ID:IARC-CSU,項目名稱:CanReg5,代碼行數:17,代碼來源:CanRegClientApp.java

示例2: updateSplashMessage

import java.awt.SplashScreen; //導入方法依賴的package包/類
private static void updateSplashMessage(SplashScreen splash, String message) {
	// Splash screen may not be present
	if (splash != null) {
		Font font = new Font(Font.SANS_SERIF, Font.PLAIN, 10);
		Graphics2D g = splash.createGraphics();
		g.setFont(font);
		g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

		// Wipe out any previous text
		g.setColor(new Color(238, 238, 238)); // #EEEEEE
		g.setPaintMode();
		g.fillRect(12, 70, 250, 30); // (x,y) is top left corner of area

		// Draw next text
		g.setColor(new Color(96, 96, 96)); // #606060
		g.setPaintMode();
		g.drawString(message, 17, 86); // (x,y) is baseline of text

		splash.update();
	}
}
 
開發者ID:kaikramer,項目名稱:keystore-explorer,代碼行數:22,代碼來源:KSE.java

示例3: updateSplash

import java.awt.SplashScreen; //導入方法依賴的package包/類
/**
 * Updates the text displayed in the splash screen (normal launch only).
 * 
 * @param splash
 * 		The splash screen to update.
 * @param msg
 * 		The text message to display.
 */
private static void updateSplash(SplashScreen splash, String msg)
{	if(splash!=null)
	{	Graphics2D g = (Graphics2D)splash.createGraphics();
		Rectangle size = splash.getBounds();
		g.setComposite(AlphaComposite.Clear);
		g.fillRect(0,0,size.width,size.height);
		g.setPaintMode();
		g.setFont(new Font("Arial",Font.PLAIN,10));
		g.setColor(new Color(0,0,0,100));
		for(int i=0;i<GuiMiscTools.STARTUP_LEGAL.length;i++)
			g.drawString(GuiMiscTools.STARTUP_LEGAL[i],70,90+i*10);
		g.setColor(GuiColorTools.COLOR_SPLASHSCREEN_TEXT);
        g.drawString(msg,70,315);
        splash.update();
	}
}
 
開發者ID:vlabatut,項目名稱:totalboumboum,代碼行數:25,代碼來源:Launcher.java

示例4: drawOnSplash

import java.awt.SplashScreen; //導入方法依賴的package包/類
private static void drawOnSplash(int percent) {
    SplashScreen splash = SplashScreen.getSplashScreen();
    if (splash == null) {
        System.out.println("No Splash Screen");
        return;
    }

    Rectangle bounds = splash.getBounds();
    Graphics2D g = splash.createGraphics();

    int height = 20;
    int x = 2;
    int y = bounds.height - height - 2;
    int width = bounds.width - 4;

    Color brightPurple = new Color(76, 36, 121);
    g.setColor(brightPurple);
    g.fillRect(x, y, width * percent / 100, height);
    splash.update();
}
 
開發者ID:CoEIA,項目名稱:DEM,代碼行數:21,代碼來源:Splasher.java

示例5: drawSplash

import java.awt.SplashScreen; //導入方法依賴的package包/類
/**
 * スプラッシュを描畫する.
 */
public static void drawSplash() {
    // スプラッシュスクリーンの取得
    SplashScreen splash = SplashScreen.getSplashScreen();
    if(splash == null) return;
    //スプラッシュ畫像のセット
    setSplashImage(splash);
    
    // スプラッシュに描畫を行う
    Graphics2D g = splash.createGraphics();
    g.setRenderingHint(
            RenderingHints.KEY_TEXT_ANTIALIASING,
            RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    g.setFont(new Font("Meiryo", Font.PLAIN, 15));
    g.setColor(Color.BLACK);
    g.drawString("loading...", 80, 200);
    g.setColor(Color.WHITE);
    g.setFont(new Font("Meiryo", Font.BOLD, 12));
    g.drawString(AppInfo.APP_TITLE, 30, 150);
    g.dispose();
    
    // スプラッシュの更新
    splash.update();
}
 
開發者ID:tohhy,項目名稱:olivia-swing,代碼行數:27,代碼來源:OliviaSwingLauncher.java

示例6: updateSplashIfNeeded

import java.awt.SplashScreen; //導入方法依賴的package包/類
private static void updateSplashIfNeeded(String message[]) {
	boolean headless_check = isHeadless();

	if (!headless_check) {
		SplashScreen splash = SplashScreen.getSplashScreen();
		if (splash == null)
			return;
		if (splash.isVisible()) {
			//Get a graphics overlay for the splash screen
			Graphics2D g = splash.createGraphics();
			//Do some drawing on the graphics object
			//Now update to the splash screen

			g.setComposite(AlphaComposite.Clear);
			g.fillRect(0,0,400,70);
			g.setPaintMode();
			g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
			g.setColor(Color.BLACK);
			g.setFont(new Font("Arial",Font.BOLD,11));
			for (int i=0;i<message.length;i++)
				g.drawString(message[i], 13, 16*i+10);
			splash.update();
		}
	}
}
 
開發者ID:LSIR,項目名稱:gsn,代碼行數:26,代碼來源:Main.java

示例7: createSplash

import java.awt.SplashScreen; //導入方法依賴的package包/類
static void createSplash(){
	Graphics2D g = null;
    final SplashScreen splash = SplashScreen.getSplashScreen();
    if (splash == null) createFrameWithoutSplash();
    else {
     g = splash.createGraphics();  
     renderSplashFrame(g, 1, "Initializing");
     splash.update();
     renderSplashFrame(g, 2, "Loading Icons");
     splash.update();
     Icon.loadIcons();
     renderSplashFrame(g, 3, "Loading Frame");
     splash.update();
     Frame.getInstance().setIconImage(Icon.icon("icon").getImage());
     Frame.getInstance().setTitle("GdxStudio");
	 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	 Frame.getInstance().setSize(screenSize);
	 Frame.getInstance().setLocation(0, 0);
	 Frame.getInstance().setLocationRelativeTo(null);
	 renderSplashFrame(g, 4, "Loading Explorer");
     splash.update();
     renderSplashFrame(g, 5, "Loading SideBar");
     splash.update();
     Frame.getInstance().initSideBar();
     renderSplashFrame(g, 6, "Loading Status Bar");
     splash.update();
     Frame.getInstance().initStatusBar();
     renderSplashFrame(g, 7, "Loading Content");
     splash.update();
     Frame.getInstance().initContent();
     renderSplashFrame(g, 8, "Loading ToolBar");
     splash.update();
     Frame.getInstance().initToolBar();
     renderSplashFrame(g, 9, "Finished");
     splash.update();   
    }
}
 
開發者ID:pyros2097,項目名稱:GdxStudio,代碼行數:38,代碼來源:GdxStudio.java


注:本文中的java.awt.SplashScreen.update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。