⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nimrodlfutils.java

📁 Java自定义窗体JsFrame。简介见:http://jason0086.spaces.live.com/Blog/cns!A797D0C5C0C13C92!518.entry
💻 JAVA
字号:
package com.hfkj.jsframe.example;

import java.awt.Color;
import java.io.FileInputStream;
import java.util.Properties;

import com.nilo.plaf.nimrod.NimRODLookAndFeel;
import com.nilo.plaf.nimrod.NimRODTheme;

/**
 * 
 * @version 1.0 01/05/09
 * @author Jason (MSN:www.jason0086.com@hotmail.com)
 */
public class NimRodLfUtils {
	
	/**
	 * Returns the nimrod look and feel corresponding the file with the path specified by the given string.
	 * @param themeFile the path of the theme's file
	 * @return the nimrod look and feel
	 */
	public static NimRODLookAndFeel getLookAndFeel(String themeFile) {
		NimRODLookAndFeel xLaf = null;
		if ((themeFile != null) 
				&& (themeFile.length() > 0)) {
			try {
				NimRODTheme xThm = new NimRODTheme();
	        	xLaf = new NimRODLookAndFeel();
				Properties xPrp = new Properties();
				xPrp.load(new FileInputStream(themeFile));
				if (xPrp.getProperty("nimrodlf.selection") != null) {
					xThm.setPrimary(Color.decode(xPrp.getProperty("nimrodlf.selection")));
				}
				if (xPrp.getProperty("nimrodlf.background") != null) {
					xThm.setSecondary(Color.decode(xPrp.getProperty("nimrodlf.background")));
				}
				if (xPrp.getProperty("nimrodlf.p1") != null) {
					xThm.setPrimary1(Color.decode(xPrp.getProperty("nimrodlf.p1")));
				}
				if (xPrp.getProperty("nimrodlf.p2") != null) {
					xThm.setPrimary2(Color.decode(xPrp.getProperty("nimrodlf.p2")));
				}
				if (xPrp.getProperty("nimrodlf.p3") != null) {
					xThm.setPrimary3(Color.decode(xPrp.getProperty("nimrodlf.p3")));
				}
				if (xPrp.getProperty("nimrodlf.s1") != null) {
					xThm.setSecondary1(Color.decode(xPrp.getProperty("nimrodlf.s1")));
				}
				if (xPrp.getProperty("nimrodlf.s2") != null) {
					xThm.setSecondary2(Color.decode(xPrp.getProperty("nimrodlf.s2")));
				}
				if (xPrp.getProperty("nimrodlf.s3") != null) {
					xThm.setSecondary3(Color.decode(xPrp.getProperty("nimrodlf.s3")));
				}
				if (xPrp.getProperty("nimrodlf.w") != null) {
					xThm.setWhite(Color.decode(xPrp.getProperty("nimrodlf.w")));
				}
				if (xPrp.getProperty("nimrodlf.b") != null) {
					xThm.setBlack(Color.decode(xPrp.getProperty("nimrodlf.b")));
				}
				if (xPrp.getProperty("nimrodlf.menuOpacity") != null) {
					xThm.setMenuOpacity(Integer.parseInt(xPrp.getProperty("nimrodlf.menuOpacity")));
				}
				if (xPrp.getProperty("nimrodlf.frameOpacity") != null) {
					xThm.setFrameOpacity(Integer.parseInt(xPrp.getProperty("nimrodlf.frameOpacity")));
				}
				// set theme
				NimRODLookAndFeel.setCurrentTheme(xThm);
	        } catch ( Exception ex) {
				ex.printStackTrace();
			}
	        return xLaf;
		}
		return null;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -