package javax.swing; import java.io.*; import java.awt.*; import javax.swing.border.*; import javax.swing.plaf.*; import javax.swing.plaf.basic.*; import javax.swing.plaf.metal.*; import java.beans.*; public class UIManager implements Serializable { static class LookAndFeelInfo { String name, clazz; LookAndFeelInfo(String name, String clazz) { this.name = name; this.clazz = clazz; } String getName() { return name; } String getClassName() { return clazz; } } static LookAndFeelInfo [] installed = { new LookAndFeelInfo("Metal", "javax.swing.plaf.metal.MetalLookAndFeel") }; static LookAndFeel[] aux_installed; static LookAndFeel look_and_feel = new MetalLookAndFeel(); UIManager() { } static void addPropertyChangeListener(PropertyChangeListener listener) { // Add a PropertyChangeListener to the listener list. } static void addAuxiliaryLookAndFeel(LookAndFeel l) { // Add a LookAndFeel to the list of auxiliary look and feels. if (aux_installed == null) { aux_installed = new LookAndFeel[1]; aux_installed[0] = l; return; } LookAndFeel[] T = new LookAndFeel[ aux_installed.length+1 ]; System.arraycopy(aux_installed, 0, T, 0, aux_installed.length); aux_installed = T; aux_installed[aux_installed.length-1] = l; } static boolean removeAuxiliaryLookAndFeel(LookAndFeel laf) { if (aux_installed == null) return false; for (int i=0;i " + ui + ", for " + target); return ui; } static void installLookAndFeel(String name, String className) // Creates a new look and feel and adds it to the current array. { } static void installLookAndFeel(LookAndFeelInfo info) // Adds the specified look and feel to the current array and then calls setInstalledLookAndFeels(javax.swing.UIManager.LookAndFeelInfo[]). { } static Object put(Object key, Object value) // Stores an object in the defaults table. { return getLookAndFeel().getDefaults().put(key,value); } static void removePropertyChangeListener(PropertyChangeListener listener) // Remove a PropertyChangeListener from the listener list. { } static void setInstalledLookAndFeels(UIManager.LookAndFeelInfo[] infos) // Replaces the current array of installed LookAndFeelInfos. { } static void setLookAndFeel(LookAndFeel newLookAndFeel) { if (look_and_feel != null) look_and_feel.uninitialize(); // Set the current default look and feel using a LookAndFeel object. look_and_feel = newLookAndFeel; look_and_feel.initialize(); // revalidate(); // repaint(); } static void setLookAndFeel(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { // Set the current default look and feel using a class name. Class c = Class.forName(className); LookAndFeel a = (LookAndFeel) c.newInstance(); // throws class-cast-exception setLookAndFeel(a); } }