Starting skin work.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@6211 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro
2006-11-22 15:28:30 +00:00
committed by derek
parent dd2da9007c
commit 3e3c767790
8 changed files with 34 additions and 12 deletions

View File

@ -10,23 +10,26 @@
package org.jivesoftware;
import com.l2fprod.gui.plaf.skin.Skin;
import com.l2fprod.gui.plaf.skin.SkinLookAndFeel;
import org.jivesoftware.resource.Default;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
import org.jivesoftware.spark.util.log.Log;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import javax.swing.BorderFactory;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
/**
* In many cases, you will need to know the structure of the Spark installation, such as the directory structures, what
@ -138,7 +141,16 @@ public final class Spark {
String classname = UIManager.getSystemLookAndFeelClassName();
if (classname.indexOf("Windows") != -1) {
UIManager.setLookAndFeel(new com.jgoodies.looks.windows.WindowsLookAndFeel());
JFrame.setDefaultLookAndFeelDecorated(true);
File skinDir = new File(Spark.getBinDirectory().getParent(), "xtra/skins").getAbsoluteFile();
File defaultSkin = new File(skinDir, "crystal2themepack.zip");
Skin theSkinToUse = SkinLookAndFeel.loadThemePack(defaultSkin.toURL());
SkinLookAndFeel.setSkin(theSkinToUse);
// finally set the Skin Look And Feel
UIManager.setLookAndFeel(new SkinLookAndFeel());
//UIManager.setLookAndFeel(new com.jgoodies.looks.windows.WindowsLookAndFeel());
}
else if (classname.indexOf("mac") != -1 || classname.indexOf("apple") != -1) {
UIManager.setLookAndFeel(classname);