?? nimrodlfutils.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;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -