mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
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:
@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user