home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / IBM VisualAge for Java Enterprise v4.0 Retail / ivj40 / setup / IDE.Cab / F77539_SmartGuideManager.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-04-25  |  4.7 KB  |  189 lines

  1. package com.ibm.ivb.sguides;
  2.  
  3. import com.ibm.ivb.sguides.basic.BasicLookAndFeel;
  4. import java.awt.Color;
  5. import java.awt.Font;
  6. import java.util.Enumeration;
  7. import java.util.Hashtable;
  8. import javax.swing.LookAndFeel;
  9. import javax.swing.UIDefaults;
  10. import javax.swing.UIManager;
  11. import javax.swing.UnsupportedLookAndFeelException;
  12.  
  13. public class SmartGuideManager {
  14.    private static final String kCBIBMCopyright = "(c) Copyright IBM Corporation 1998";
  15.    private static SmartGuideManager manager = null;
  16.    private static Hashtable managers;
  17.    private Hashtable properties = new Hashtable();
  18.    // $FF: renamed from: lf javax.swing.LookAndFeel
  19.    private LookAndFeel field_0;
  20.    private MultiLineListener hyperlinkListener;
  21.  
  22.    protected SmartGuideManager() {
  23.       this.properties.put("BackButtonText", "<<Back");
  24.       this.properties.put("NextButtonText", "Next>>");
  25.       this.properties.put("BackButtonM", new Character('B'));
  26.       this.properties.put("NextButtonM", new Character('N'));
  27.       this.properties.put("FinishButtonText", "Finish");
  28.       this.properties.put("FinishButtonM", new Character('F'));
  29.       this.properties.put("CancelButtonText", "Cancel");
  30.       this.properties.put("HelpButtonText", "Help");
  31.       this.properties.put("NavigationButtonText", "Navigate");
  32.       this.properties.put("IncompletePageError", "Page is not complete.");
  33.    }
  34.  
  35.    /** @deprecated */
  36.    public Font getClientFont() {
  37.       return null;
  38.    }
  39.  
  40.    /** @deprecated */
  41.    public Color getCommonBackground() {
  42.       return null;
  43.    }
  44.  
  45.    public MultiLineListener getHyperlinkListener() {
  46.       return this.hyperlinkListener;
  47.    }
  48.  
  49.    public LookAndFeel getLookAndFeel() {
  50.       return this.field_0;
  51.    }
  52.  
  53.    public static SmartGuideManager getManager() {
  54.       if (manager == null) {
  55.          manager = new SmartGuideManager();
  56.       }
  57.  
  58.       return manager;
  59.    }
  60.  
  61.    public static SmartGuideManager getManager(String var0) {
  62.       if (managers == null) {
  63.          managers = new Hashtable();
  64.       }
  65.  
  66.       SmartGuideManager var1 = (SmartGuideManager)managers.get(var0);
  67.       if (var1 == null) {
  68.          var1 = new SmartGuideManager();
  69.          managers.put(var0, var1);
  70.       }
  71.  
  72.       return var1;
  73.    }
  74.  
  75.    public Object getProperty(String var1) {
  76.       return this.properties.get(var1);
  77.    }
  78.  
  79.    Hashtable getPropertyCopy() {
  80.       return (Hashtable)this.properties.clone();
  81.    }
  82.  
  83.    /** @deprecated */
  84.    public int getUILook() {
  85.       return 0;
  86.    }
  87.  
  88.    /** @deprecated */
  89.    public int getUIStyle() {
  90.       return 0;
  91.    }
  92.  
  93.    public void initialize() {
  94.       this.initializeImpl(true, false);
  95.    }
  96.  
  97.    public void initialize(boolean var1) {
  98.       this.initializeImpl(true, var1);
  99.    }
  100.  
  101.    void initializeImpl(boolean var1, boolean var2) {
  102.       if (var2) {
  103.          try {
  104.             UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
  105.          } catch (ClassNotFoundException var4) {
  106.             System.out.println(var4);
  107.          } catch (UnsupportedLookAndFeelException var5) {
  108.             System.out.println(var5);
  109.          } catch (IllegalAccessException var6) {
  110.             System.out.println(var6);
  111.          } catch (InstantiationException var7) {
  112.             System.out.println(var7);
  113.          } catch (ClassCastException var8) {
  114.             System.out.println(var8);
  115.          }
  116.       }
  117.  
  118.       if (var1) {
  119.          this.setLookAndFeel((LookAndFeel)(new BasicLookAndFeel()));
  120.       }
  121.  
  122.    }
  123.  
  124.    /** @deprecated */
  125.    public boolean isImageFiltered() {
  126.       return true;
  127.    }
  128.  
  129.    public void putProperty(String var1, Object var2) {
  130.       if (var2 != null) {
  131.          this.properties.put(var1, var2);
  132.       } else {
  133.          if (this.properties.get(var1) != null) {
  134.             this.properties.remove(var1);
  135.          }
  136.  
  137.       }
  138.    }
  139.  
  140.    /** @deprecated */
  141.    public void setClientFont(Font var1) {
  142.    }
  143.  
  144.    /** @deprecated */
  145.    public void setCommonBackground(Color var1) {
  146.    }
  147.  
  148.    public void setHyperlinkListener(MultiLineListener var1) {
  149.       this.hyperlinkListener = var1;
  150.    }
  151.  
  152.    /** @deprecated */
  153.    public void setImageFiltered(boolean var1) {
  154.    }
  155.  
  156.    public void setLookAndFeel(String var1) {
  157.       if (this.field_0 == null) {
  158.          this.initializeImpl(false, false);
  159.       }
  160.  
  161.       try {
  162.          this.field_0 = (LookAndFeel)Class.forName(var1).newInstance();
  163.          this.setLookAndFeel(this.field_0);
  164.       } catch (Exception var3) {
  165.          System.out.println(var3);
  166.       }
  167.    }
  168.  
  169.    public void setLookAndFeel(LookAndFeel var1) {
  170.       this.field_0 = var1;
  171.       UIDefaults var2 = var1.getDefaults();
  172.       Enumeration var3 = ((Hashtable)var2).keys();
  173.  
  174.       while(var3.hasMoreElements()) {
  175.          String var4 = (String)var3.nextElement();
  176.          UIManager.put(var4, var2.get(var4));
  177.       }
  178.  
  179.    }
  180.  
  181.    /** @deprecated */
  182.    public void setUILook(int var1) {
  183.    }
  184.  
  185.    /** @deprecated */
  186.    public void setUIStyle(int var1) {
  187.    }
  188. }
  189.