Package javax.swing

Examples of javax.swing.LookAndFeel


      if(!"".equals(Util.getProperty("swing.defaultlaf", ""))) {
        return;
      }
    } catch (Exception ignored) { }

    LookAndFeel origLF = UIManager.getLookAndFeel();
    if(origLF != null && !customLF.containsKey(origLF.getClass().getName())) {
      customLF.put(origLF.getClass().getName(), origLF);
      Activator.log.debug("Saved orig L&F " + origLF.getClass().getName());
    }
    try {
      boolean bUseCustomLF = false;
      if(origLF == null) {
        Activator.log.debug("Setting Knopflerfish L&F since no LF was set");
        bUseCustomLF = true;
      } else {
        if(origLF.getClass().getName().startsWith("com.l2fprod.gui.plaf.skin")) {
          Activator.log.debug("Skipping Knopflerfish L&F since SkinLF seems to be active");
        } else if(-1 != origLF.getClass().getName().indexOf("apple.")) {
          Activator.log.debug("Skipping Knopflerfish L&F since Apple LF seems to be active");
        } else {
          Activator.log.debug("Overriding LF " + origLF.getClass().getName() +
                             " with Knopflerfish LF");
          bUseCustomLF = true;
        }
      }
      if(bUseSystemLF) {
View Full Code Here


      final Class<?> beanClass = JavaUtil.getProjectClassLoader(java_project).loadClass(className);
      if (Component.class.isAssignableFrom(beanClass)) {
        String lnf = getBeanClassLnf(beanClass);
        ILookAndFeelAdapter lnfAdapter = ExtensionRegistry.getLnfAdapter(lnf);
        if (lnfAdapter != null) {
          LookAndFeel newlnf = lnfAdapter.getLookAndFeelInstance();
          Component bean = (Component) runWithLnf(newlnf, new ISyncUITask() {
           
            public Object doTask() throws Throwable {
              return createBeanFromClass(beanClass);
            }
View Full Code Here

    Class<?> clazz = JARLoader.forName(name);

    for(Class<?> superClazz = clazz; superClazz != null; superClazz = superClazz.getSuperclass()) {
      // Check if it's a look and feel
      if(superClazz.equals(LookAndFeel.class)) {
        LookAndFeel laf = (LookAndFeel)clazz.newInstance();
        UIManager.installLookAndFeel(laf.getName(), name);
        break;
      }

      // Check the interfaces
      for(Class<?> cif : superClazz.getInterfaces()) {
View Full Code Here

        // Try to load the LaF from the class path
        UIManager.setLookAndFeel(lafi.getClassName());
        UIManager.getDefaults().put("ClassLoader", lafi.getClass().getClassLoader());
      } catch(ClassNotFoundException ex) {
        // Couldn't find it; check the JARLoader
        LookAndFeel laf = (LookAndFeel)JARLoader.forName(lafi.getClassName()).newInstance();
        UIManager.setLookAndFeel(laf);
        UIManager.getDefaults().put("ClassLoader", JARLoader.getClassLoader());
      }

      lookAndFeel = lafi.getName();
View Full Code Here

    JLabel label = new JLabel();
    ComponentUI buttonUI = UIManager.getUI(button);
    ComponentUI labelUI = UIManager.getUI(label);
    MultiButtonUI multiButtonUI = new MultiButtonUI();
    MultiLabelUI multiLabelUI = new MultiLabelUI();
    LookAndFeel auxLaf = new SyserrLookAndFeel();

    // without auxiliary look and feels createUIs returns UI fron default
    // look and feel
    assertEquals(buttonUI, MultiLookAndFeel.createUIs(multiButtonUI,
        multiButtonUI.uis, button));
View Full Code Here

  public void test(TestHarness harness)     
  {
    LookAndFeel[] lafs = UIManager.getAuxiliaryLookAndFeels();
    harness.check(lafs, null);
  
    LookAndFeel laf = new MyLookAndFeel();
    UIManager.addAuxiliaryLookAndFeel(laf);
    lafs = UIManager.getAuxiliaryLookAndFeels();
    harness.check(lafs.length, 1);
    harness.check(lafs[0], laf);
    UIManager.removeAuxiliaryLookAndFeel(laf);
View Full Code Here

    test2(harness);
  }
 
  private void test1(TestHarness harness)
  {
    LookAndFeel laf = new MyLookAndFeel();
    harness.check(UIManager.getAuxiliaryLookAndFeels(), null);
    UIManager.addAuxiliaryLookAndFeel(laf);
    LookAndFeel[] auxLafs = UIManager.getAuxiliaryLookAndFeels();
    harness.check(auxLafs.length, 1);
    harness.check(auxLafs[0], laf);
View Full Code Here

  {
    harness.checkPoint("test2");
    // first check that we are starting with 0 auxiliary LAFs
    harness.check(UIManager.getAuxiliaryLookAndFeels(), null);
   
    LookAndFeel laf1 = new MyLookAndFeel();
    LookAndFeel laf2 = new MyLookAndFeel();
    LookAndFeel laf3 = new MyLookAndFeel();
    LookAndFeel laf4 = new MyLookAndFeel();
   
    UIManager.addAuxiliaryLookAndFeel(laf1);
    UIManager.addAuxiliaryLookAndFeel(laf2);
    UIManager.addAuxiliaryLookAndFeel(laf3);
    UIManager.addAuxiliaryLookAndFeel(laf4);
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness
  {
    LookAndFeel laf1 = new MyLookAndFeel();
    try
    {
      UIManager.addPropertyChangeListener(this);
      UIManager.setLookAndFeel(laf1);
      harness.check(UIManager.getLookAndFeel(), laf1);
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    LookAndFeel laf = new MyLookAndFeel();
    harness.check(UIManager.getAuxiliaryLookAndFeels(), null);
    UIManager.addAuxiliaryLookAndFeel(laf);
    LookAndFeel[] auxLafs = UIManager.getAuxiliaryLookAndFeels();
    harness.check(auxLafs.length, 1);
    harness.check(auxLafs[0], laf);
View Full Code Here

TOP

Related Classes of javax.swing.LookAndFeel

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.