Package javax.swing

Examples of javax.swing.LookAndFeel


      if (name.equals("apply")) {
        LnF lnf = (LnF) dataModel.getValue("lnf.value");
        Theme theme = (Theme) dataModel.getValue("theme.value");
        String licenseCode = (String) dataModel.getValue("license");

        LookAndFeel lnfInstance = lnf.create(theme == null ? null : theme.clazz, licenseCode);
        UIManager.setLookAndFeel(lnfInstance);
        GUIUtils.updateAllWidgets();
      } else if (name.equals("close")) {
        frame.dispose();
      }
View Full Code Here


    }

    public LookAndFeel create(String themeClass, String licenseCode) throws GUIException {
      try {
        Class lnfClass = Class.forName(clazz);
        LookAndFeel lnfInstance = (LookAndFeel) lnfClass.newInstance();
        return lnfInstance;
      } catch (Exception e) {
        throw new GUIException("Error while creating Look And Feel", e);
      }
    }
View Full Code Here

        Method method = lnfClass.getMethod("setProperty", new Class[] { String.class, String.class });
        method.invoke(null, new Object[] { "alloy.licenseCode", licenseCode });

        Constructor constructor =
          lnfClass.getConstructor(new Class[] { Class.forName("com.incors.plaf.alloy.AlloyTheme")});
        LookAndFeel lnfInstance =
          (LookAndFeel) constructor.newInstance(new Object[] { Class.forName(themeClass).newInstance()});

        return lnfInstance;
      } catch (Exception e) {
        throw new GUIException("Error while setting theme", e);
View Full Code Here

        }
        // do not install already installed LAF.
        if (skip) continue;
        try {
          Class c = Class.forName(classname);
          LookAndFeel laf = (LookAndFeel)c.newInstance();
          UIManager.installLookAndFeel(laf.getName(), classname);
          // Skip this laf on error
        } catch (ClassNotFoundException e) {
        } catch (InstantiationException e) {
        } catch (IllegalAccessException e) {
        }
      }
    }

    String laf = Run.getProperties().getString("plugin.lookandfeel.default","");
    if (laf.equals("")) laf = "com.incors.plaf.kunststoff.KunststoffLookAndFeel";
    try {
      UIManager.setLookAndFeel((LookAndFeel)Class.forName(laf).newInstance());
      // Keep default look and feel on error, otherwise apply it imediately
      if (JSynoptic.gui!=null) SwingUtilities.updateComponentTreeUI(JSynoptic.gui.getOwner());
    } catch (UnsupportedLookAndFeelException e) {
View Full Code Here

      for (int i=0; i<infos.length; ++i) {
        if (classname.equals(infos[i].getClassName())) skip = true;
      }
      // do not install already installed LAF.
      if (skip) continue;
      LookAndFeel laf = null;
      try {
        Class c = Class.forName(classname);
        laf = (LookAndFeel)c.newInstance();
      } catch (ClassNotFoundException e) {
        // should not happen since we precisely looked in the classpath
      } catch (InstantiationException e) {
        // skip this laf
      } catch (IllegalAccessException e) {
        // skip this laf
      }
      if (laf==null) continue;
      // Now check if the laf installed itself...
      infos = UIManager.getInstalledLookAndFeels();
      skip = false;
      for (int i=0; i<infos.length; ++i) {
        if (classname.equals(infos[i].getClassName())) skip = true;
      }
      // do not install already installed LAF.
      if (skip) continue;
      UIManager.installLookAndFeel(laf.getName(), classname);
    }
   
    // Save in the user properties
    infos = UIManager.getInstalledLookAndFeels();
    String property = null;
View Full Code Here

    int indexCounter = 0;
    while (it.hasNext()) {
      LookAndFeelAdapter current = (LookAndFeelAdapter)it.next();
      boolean gotIt = false;
      try {
        LookAndFeel lf = (LookAndFeel) Class.forName(current.getClassName()).newInstance();
        gotIt = lf.isSupportedLookAndFeel();
      }
      catch (Exception e) {}
      current.installed = gotIt;
      if (currClsName.equalsIgnoreCase(current.getClassName()))
        result =  indexCounter;
View Full Code Here

    public static LayoutStyle getSharedInstance() {
        Object layoutImpl = UIManager.get("LayoutStyle.instance");
        if (layoutImpl != null && (layoutImpl instanceof LayoutStyle)) {
            return (LayoutStyle)layoutImpl;
        }
        LookAndFeel currentLAF = UIManager.getLookAndFeel();
        if (layoutStyle == null || currentLAF != laf) {
            laf = currentLAF;
            String lafID= laf.getID();
            if (USE_CORE_LAYOUT_STYLE) {
                layoutStyle = new SwingLayoutStyle();
View Full Code Here

  private LookAndFeelManager() {
  }

  public void init() {
    try {
      LookAndFeel laf = new PlasticXPLookAndFeel();
      UIManager.setLookAndFeel(laf);
      logger.info("Look and feel set to: {}", UIManager.getLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
      throw new IllegalStateException(e);
    }
View Full Code Here

    id++;

    this.lfManager = lfManager;

    final LookAndFeel currentLF = UIManager.getLookAndFeel();
    final String currentLFName  = currentLF!=null ? currentLF.getName() : null;

    final UIManager.LookAndFeelInfo[] iLF
      = UIManager.getInstalledLookAndFeels();

    Vector classes = new Vector();
    Vector names   = new Vector();

    for(Enumeration e = lfManager.customLF.keys(); e.hasMoreElements(); ) {
      String className = (String)e.nextElement();
      LookAndFeel lf   = (LookAndFeel)lfManager.customLF.get(className);
      String name      = lf.getName();

      // Check if custom LF is included in installed LFs
      boolean bIncluded = false;
      for (int i=0;  i < iLF.length; i++) {
  if(iLF[i].getClassName().equals(className)) {
View Full Code Here

    final String newLFClassName     = rb.getActionCommand();
    final String newLFName          = rb.getText();
    final String currentLFClassName = UIManager.getLookAndFeel().getName();


    LookAndFeel cLF = (LookAndFeel)lfManager.customLF.get(newLFClassName);

    if(cLF != null) {     // First, check if it any of the custom LFs
      try {

 
  Activator.log.debug("set custom LF classloader to" + cLF.getClass().getClassLoader());
  UIManager.getLookAndFeelDefaults().put("ClassLoader", cLF.getClass().getClassLoader());

  Activator.log.debug("set custom LF " + newLFClassName);
  UIManager.setLookAndFeel(cLF);
 
  for(Iterator it = roots.iterator(); it.hasNext();) {
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.