Add vista support.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6996 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2007-02-06 14:50:28 +00:00
committed by derek
parent e113f06cec
commit c6c234dd9e
2 changed files with 22 additions and 6 deletions

View File

@ -21,7 +21,6 @@ import java.awt.Color;
import java.awt.Font;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
@ -114,12 +113,16 @@ public final class Spark {
String classname = UIManager.getSystemLookAndFeelClassName();
if (classname.indexOf("Windows") != -1) {
try {
UIManager.setLookAndFeel(new SyntheticaBlueMoonLookAndFeel());
SyntheticaLookAndFeel.setFont("Dialog", 11);
if (isVista()) {
UIManager.setLookAndFeel(new com.sun.java.swing.plaf.windows.WindowsLookAndFeel());
}
else {
UIManager.setLookAndFeel(new SyntheticaBlueMoonLookAndFeel());
SyntheticaLookAndFeel.setFont("Dialog", 11);
}
}
catch (ParseException e) {
catch (Exception e) {
e.printStackTrace();
}
}
@ -176,6 +179,16 @@ public final class Spark {
return osName.startsWith("windows");
}
/**
* Returns true if Spark is running on vista.
*
* @return true if running on Vista.
*/
public static boolean isVista() {
final String osName = System.getProperty("os.name").toLowerCase();
return osName.contains("vista");
}
/**
* Return if we are running on a mac.
*