Esempio n. 1
0
  public void setLookAndFeel() {
    String lookAndFeel = ControlMain.getSettings().getMainSettings().getLookAndFeel();
    String current = UIManager.getLookAndFeel().getClass().getName();
    boolean lfChanged = !current.equals(lookAndFeel);

    try {
      boolean themeChanged = this.isPlasticThemeChanged();
      if (themeChanged) {
        PlasticTheme inst =
            (PlasticTheme)
                (Class.forName(
                        "com.jgoodies.looks.plastic.theme."
                            + ControlMain.getSettings().getMainSettings().getPlasticTheme()))
                    .newInstance();
        PlasticLookAndFeel.setCurrentTheme(inst);
      }

      if (lfChanged || themeChanged) {
        UIManager.setLookAndFeel(lookAndFeel);
        if (lookAndFeel.indexOf("WindowsLookAndFeel") > -1
            || lookAndFeel.indexOf("WindowsClassicLookAndFeel") > -1) {
          UIManager.put("TextArea.font", new Font("Tahoma", Font.PLAIN, 11));
        }
        if (this.getView() != null) {
          this.getView().repaintGui();
        }
      }
    } catch (Exception e) {
      Logger.getLogger("ControlMainView").warning(e.getMessage());
    }
  }