Package javax.swing.plaf

Examples of javax.swing.plaf.FontUIResource


      Font font = UIManagerExt.getSafeFont("Label.font", new Font("Dialog", Font.PLAIN, 12));
      font = font.deriveFont(Font.BOLD, 13f);
     
      defaults.add(JXTipOfTheDay.uiClassID, BasicTipOfTheDayUI.class.getName());
      defaults.add("TipOfTheDay.font", UIManagerExt.getSafeFont("TextPane.font",
                new FontUIResource("Serif", Font.PLAIN, 12)));
      defaults.add("TipOfTheDay.tipFont", new FontUIResource(font));
      defaults.add("TipOfTheDay.background", new ColorUIResource(Color.WHITE));
      defaults.add("TipOfTheDay.icon",
              LookAndFeel.makeIcon(BasicTipOfTheDayUI.class, "resources/TipOfTheDay24.gif"));
      defaults.add("TipOfTheDay.border", new BorderUIResource(
              BorderFactory.createLineBorder(new Color(117, 117, 117))));
View Full Code Here


            new Font("Dialog", Font.PLAIN, 12));
    font = font.deriveFont(13f);
   
    defaults.add(JXTipOfTheDay.uiClassID, WindowsTipOfTheDayUI.class.getName());
    defaults.add("TipOfTheDay.background", new ColorUIResource(Color.GRAY));
    defaults.add("TipOfTheDay.font", new FontUIResource(font));
    defaults.add("TipOfTheDay.icon",
            LookAndFeel.makeIcon(WindowsTipOfTheDayUI.class, "resources/tipoftheday.png"));
    defaults.add("TipOfTheDay.border" ,new BorderUIResource(new WindowsTipOfTheDayUI.TipAreaBorder()));

    UIManagerExt.addResourceBundle(
View Full Code Here

  protected void addBasicDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
    super.addBasicDefaults(addon, defaults);
   
    defaults.add(JXTitledPanel.uiClassID, "org.jdesktop.swingx.plaf.basic.BasicTitledPanelUI");
    defaults.add("JXTitledPanel.titleFont", UIManagerExt.getSafeFont("Button.font",
            new FontUIResource("Dialog", Font.PLAIN, 12)));
    defaults.add("JXTitledPanel.titleForeground", new ColorUIResource(Color.WHITE));
    defaults.add("JXTitledPanel.titlePainter", new PainterUIResource<JXTitledPanel>(
              new MattePainter(
                      new GradientPaint(0, 0, Color.LIGHT_GRAY, 0, 1, Color.GRAY), true)));
    defaults.add("JXTitledPanel.captionInsets", new InsetsUIResource(4, 12, 4, 12));
View Full Code Here

        defaults.add(JXHeader.uiClassID, "org.jdesktop.swingx.plaf.basic.BasicHeaderUI");
        //TODO image is missing
        defaults.add("JXHeader.defaultIcon",
                LookAndFeel.makeIcon(HeaderAddon.class, "basic/resources/header-default.png"));
        //TODO use safe methods
        defaults.add("JXHeader.titleFont", new FontUIResource(UIManager.getFont("Label.font").deriveFont(Font.BOLD)));
        defaults.add("JXHeader.titleForeground", UIManager.getColor("Label.foreground"));
        defaults.add("JXHeader.descriptionFont", UIManager.getFont("Label.font"));
        defaults.add("JXHeader.descriptionForeground", UIManager.getColor("Label.foreground"));
        defaults.add("JXHeader.background",
                UIManagerExt.getSafeColor("control", new ColorUIResource(Color.decode("#C0C0C0"))));
View Full Code Here

        if (safeFont == null) {
            safeFont = defaultFont;
        }
       
        if (!(safeFont instanceof UIResource)) {
            safeFont = new FontUIResource(safeFont);
        }
       
        return safeFont;
    }
View Full Code Here

        if (result instanceof Color) {
            return new ColorUIResource((Color)result);
        }
        if (result instanceof Font) {
            return new FontUIResource((Font)result);
        }

        return (result == null) ? defaultValue : result;
    }
View Full Code Here

    private static void changeMenuFont() {
        try {
            Font f = (FontUIResource) UIManager.get(MENU_FONT_KEYS[0]);
            f = f.deriveFont(Font.PLAIN);
            f = new FontUIResource(f);
            for (int i = 0;   i < MENU_FONT_KEYS.length;   i++)
                UIManager.put(MENU_FONT_KEYS[i], f);
        } catch (Exception e) {}
    }
View Full Code Here

        MutableComboBoxModel model = new DefaultComboBoxModel();
        // <snip> JXTitledPanel configure title properties
        // Font options (based on default)
        Font baseFont = UIManager.getFont("JXTitledPanel.titleFont");
        model.addElement(new DisplayInfo<Font>("Default ", baseFont));
        Font italicFont = new FontUIResource(baseFont.deriveFont(Font.ITALIC));
        model.addElement(new DisplayInfo<Font>("Derived (Italic)" , italicFont));
        Font bigFont = new FontUIResource(baseFont.deriveFont(baseFont.getSize2D() * 2));
        model.addElement(new DisplayInfo<Font>("Derived (Doubled Size) ", bigFont));
        // </snip>
        return model;
    }
View Full Code Here

        this.delegate = delegate;
        this.extra = extra;
    }

    private Font getWrappedFont(Font systemFont) {
        return new FontUIResource(systemFont.getFontName(), systemFont
                .getStyle(), systemFont.getSize() + extra);
    }
View Full Code Here

      this.delegate = delegate;
      this.extra = extra;
    }

    private FontUIResource getWrappedFont(FontUIResource systemFont) {
      return new FontUIResource(systemFont.getFontName(), systemFont
          .getStyle(), systemFont.getSize() + extra);
    }
View Full Code Here

TOP

Related Classes of javax.swing.plaf.FontUIResource

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.