Package javax.swing

Examples of javax.swing.UIDefaults


            // Instantiate Aqua but don't install it.
            Class<?>    lnfClass     = Class.forName(UIManager.getSystemLookAndFeelClassName(), true,
                                                     Thread.currentThread().getContextClassLoader());
            LookAndFeel aqua         = (LookAndFeel) lnfClass.newInstance();
            UIDefaults  aquaDefaults = aqua.getDefaults();

            // Use Aqua for any menu UI classes.
            d.put("MenuBarUI", aquaDefaults.get("MenuBarUI"));
            d.put("MenuUI", aquaDefaults.get("MenuUI"));
        } catch (Exception e) {

            // TODO Should we do something with this exception?
            e.printStackTrace();
        }
View Full Code Here


  }

  @Override
  public UIDefaults getDefaults() {

    return new UIDefaults(new Object[] { "ButtonUI", //$NON-NLS-1$
        "javax.swing.plaf.multi.SyserrButtonUI", }) {//$NON-NLS-1$
      @Override
      protected void getUIError(String s) {
        // Remove unneded mesage
      }
View Full Code Here

    public void testAudioActionMap() {
        assertEquals(13, lf.getAudioActionMap().size());
    }

    public void testDefaultsTable() {
        UIDefaults defaults = lf.getDefaults();
        if (isHarmony()) {
            assertEquals(475, defaults.size());
        }
        assertNull(lookAndFeelInstance().getDefaults());
    }
View Full Code Here

    public void testGetAcceleratorForeground() {
        assertEquals(metalTheme.getPrimary1(), metalTheme.getAcceleratorForeground());
    }

    public void testAddCustomEntriesToTable() {
        UIDefaults defs = new UIDefaults();
        metalTheme.addCustomEntriesToTable(defs);
        assertEquals(0, defs.size());
        metalTheme.addCustomEntriesToTable(null);
    }
View Full Code Here

    // Forte never dismissed tool tips, so mirror this.
    ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
  }
  @Override
  public UIDefaults getDefaults() {
    UIDefaults defaults = super.getDefaults();
    defaults.put("OptionPaneUI", "net.helipilot50.stocktrade.displayproject.plaf.Win32OptionPaneUI");
    defaults.put("AuditoryCues.playList", new Object[] {
          "OptionPane.errorSound",
          "OptionPane.informationSound",
          "OptionPane.questionSound",
          "OptionPane.warningSound" });
    defaults.put("OptionPane.informationSound", "sounds/OptionPaneInformation.wav");
    defaults.put("OptionPane.warningSound", "sounds/OptionPaneWarning.wav");
    defaults.put("OptionPane.errorSound", "sounds/OptionPaneError.wav");
    defaults.put("OptionPane.questionSound", "sounds/OptionPaneQuestion.wav");
    defaults.put("OptionPane.sameSizeButtons", true);

    return defaults;
  }
View Full Code Here

    // Forte never dismissed tool tips, so mirror this.
    ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
  }
  @Override
  public UIDefaults getDefaults() {
    UIDefaults defaults = super.getDefaults();
    defaults.put("OptionPaneUI", "DisplayProject.plaf.Win32OptionPaneUI");
    defaults.put("AuditoryCues.playList", new Object[] {
          "OptionPane.errorSound",
          "OptionPane.informationSound",
          "OptionPane.questionSound",
          "OptionPane.warningSound" });
    defaults.put("OptionPane.informationSound", "sounds/OptionPaneInformation.wav");
    defaults.put("OptionPane.warningSound", "sounds/OptionPaneWarning.wav");
    defaults.put("OptionPane.errorSound", "sounds/OptionPaneError.wav");
    defaults.put("OptionPane.questionSound", "sounds/OptionPaneQuestion.wav");
    defaults.put("OptionPane.sameSizeButtons", true);

    return defaults;
  }
View Full Code Here

    // Forte never dismissed tool tips, so mirror this.
    ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
  }
  @Override
  public UIDefaults getDefaults() {
    UIDefaults defaults = super.getDefaults();
    defaults.put("OptionPaneUI", "DisplayProject.plaf.Win32OptionPaneUI");
    defaults.put("AuditoryCues.playList", new Object[] {
          "OptionPane.errorSound",
          "OptionPane.informationSound",
          "OptionPane.questionSound",
          "OptionPane.warningSound" });
    defaults.put("OptionPane.informationSound", "sounds/OptionPaneInformation.wav");
    defaults.put("OptionPane.warningSound", "sounds/OptionPaneWarning.wav");
    defaults.put("OptionPane.errorSound", "sounds/OptionPaneError.wav");
    defaults.put("OptionPane.questionSound", "sounds/OptionPaneQuestion.wav");
    defaults.put("OptionPane.sameSizeButtons", true);

    return defaults;
  }
View Full Code Here

      return; // null for system class loader (?)
    }

    // Does not work: cl.getClass().equals(JarClassLoader.class)
    if (cl.getClass().getName().equals(JarClassLoader.class.getName())) {
      UIDefaults uidef = UIManager.getDefaults();
      Enumeration<?> en = uidef.keys();
      while (en.hasMoreElements()) {
        String sClass = (String) en.nextElement();
        if (sClass.endsWith("UI")) {
          Object obj = uidef.get(sClass);
          // If the obj is java.lang.String load the class,
          // otherwise it's already loaded java.lang.Class
          if (obj instanceof String) {
            Class<?> clazz = cl.loadClass((String) obj);
            uidef.put(clazz.getName(), clazz);
          }
        }
      }
    }
  } // loadLookAndFeel()
View Full Code Here

      return; // null for system class loader (?)
    }

    // Does not work: cl.getClass().equals(JarClassLoader.class)
    if (cl.getClass().getName().equals(JarClassLoader.class.getName())) {
      UIDefaults uidef = UIManager.getDefaults();
      Enumeration<?> en = uidef.keys();
      while (en.hasMoreElements()) {
        String sClass = (String) en.nextElement();
        if (sClass.endsWith("UI")) {
          Object obj = uidef.get(sClass);
          // If the obj is java.lang.String load the class,
          // otherwise it's already loaded java.lang.Class
          if (obj instanceof String) {
            Class<?> clazz = cl.loadClass((String) obj);
            uidef.put(clazz.getName(), clazz);
          }
        }
      }
    }
  } // loadLookAndFeel()
View Full Code Here

        private UIDefaults defaults;
        private List<Object> keys;
       
        public UIDefaultsTableModel() {
            // make a local copy of the defaults table in case the look and feel changes
            defaults = new UIDefaults();
            keys = new ArrayList<Object>();
            UIDefaults realDefaults = UIManager.getDefaults();
            Enumeration keysEnum = realDefaults.keys();
            while (keysEnum.hasMoreElements()) {
                Object key = keysEnum.nextElement();
                if (!defaults.containsKey(key)) {
                    keys.add(key);
                    defaults.put(key, realDefaults.get(key));
                } else {
                    System.out.println("found duplicate key:"+key);
                }
            }
        }
View Full Code Here

TOP

Related Classes of javax.swing.UIDefaults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.