Examples of LookAndFeel


Examples of javax.swing.LookAndFeel

    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

Examples of javax.swing.LookAndFeel

  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

Examples of javax.swing.LookAndFeel

    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

Examples of javax.swing.LookAndFeel

    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

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

Examples of javax.swing.LookAndFeel

      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

Examples of javax.swing.LookAndFeel

    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

Examples of javax.swing.LookAndFeel

        // 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

Examples of javax.swing.LookAndFeel

    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

Examples of javax.swing.LookAndFeel

  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
TOP
Copyright © 2018 www.massapi.com. 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.