01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * See the License for the specific language governing rights and
10: * limitations under the License.
11: *
12: * The Initial Developer of the Original Code is Simulacra Media Ltd.
13: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14: *
15: * All Rights Reserved.
16: *
17: * Contributor(s):
18: */
19: package org.openharmonise.him.configuration.lnf;
20:
21: import javax.swing.SwingUtilities;
22: import javax.swing.UIManager;
23: import javax.swing.UnsupportedLookAndFeelException;
24:
25: import org.openharmonise.him.configuration.*;
26: import org.openharmonise.him.window.*;
27:
28: /**
29: * Class to represent Java Look and Feel options.
30: *
31: * @author Matthew Large
32: * @version $Revision: 1.1 $
33: *
34: */
35: public class ConfigLnF {
36:
37: /**
38: * Configuration dialog.
39: */
40: private ConfigDialog m_dialog = null;
41:
42: /**
43: *
44: */
45: protected ConfigLnF() {
46: }
47:
48: /**
49: * Classname of Java Look and Feel.
50: */
51: private String m_sClassName = null;
52:
53: /**
54: * Constructs a new look and feel option.
55: *
56: * @param sClassName Classname of Java Look and Feel
57: * @param dialog onfiguration dialog
58: */
59: public ConfigLnF(String sClassName, ConfigDialog dialog) {
60: super ();
61: this .m_dialog = dialog;
62: this .m_sClassName = sClassName;
63: }
64:
65: /**
66: * Sets the Content Manager look and feel to this option.
67: *
68: */
69: public void setLookAndFeel() {
70: try {
71: UIManager.setLookAndFeel(m_sClassName);
72: SwingUtilities.updateComponentTreeUI(DisplayManager
73: .getInstance().getMainWindow());
74: SwingUtilities.updateComponentTreeUI(this .m_dialog);
75: } catch (ClassNotFoundException e) {
76: e.printStackTrace();
77: } catch (InstantiationException e) {
78: e.printStackTrace();
79: } catch (IllegalAccessException e) {
80: e.printStackTrace();
81: } catch (UnsupportedLookAndFeelException e) {
82: e.printStackTrace();
83: }
84: }
85:
86: }
|