Package org.pushingpixels.substance.api.fonts

Examples of org.pushingpixels.substance.api.fonts.FontPolicy


    CustomSettingsPolicy(FontPolicy wrappedPolicy) {
      this.wrappedPolicy = wrappedPolicy;
    }

    public FontSet getFontSet(String lafName, UIDefaults table) {
      FontPolicy customPolicy = getCustomPolicy(lafName);
      if (customPolicy != null) {
        return customPolicy.getFontSet(null, table);
      }
      FontSet customFontSet = getCustomFontSet(lafName);
      if (customFontSet != null) {
        return customFontSet;
      }
View Full Code Here


   * @return Control font size.
   */
  public static int getControlFontSize() {
    if (controlFontSize > 0)
      return controlFontSize;
    FontPolicy fPolicy = SubstanceLookAndFeel.getFontPolicy();
    FontSet fSet = fPolicy.getFontSet("Substance", null);
    controlFontSize = fSet.getControlFont().getSize();
    return controlFontSize;
  }
View Full Code Here

            public void run() {
              SubstanceLookAndFeel.setFontPolicy(null);
              final FontSet substanceCoreFontSet = SubstanceLookAndFeel
                  .getFontPolicy().getFontSet("Substance",
                      null);
              FontPolicy newFontPolicy = new FontPolicy() {
                public FontSet getFontSet(String lafName,
                    UIDefaults table) {
                  return new WrapperFontSet(
                      substanceCoreFontSet, newValue);
                }
              };

              SubstanceLookAndFeel.setFontPolicy(newFontPolicy);

              fontSizeLabel.setText(SubstanceLookAndFeel
                  .getFontPolicy().getFontSet("Substance",
                      null).getControlFont().getSize()
                  + " pt.");
            }
          });
        }
      }
    });
    builder.append(fontSizeSlider);

    Icon zoomInIcon = new ImageIcon(Thread.currentThread()
        .getContextClassLoader().getResource(
            "test/check/icons/16/zoom_in.png"));
    JLabel zoomInLabel = new JLabel(zoomInIcon);
    builder.append(zoomInLabel);

    JButton tahoma = new JButton("Tahoma 11");
    tahoma.putClientProperty(
        SubstanceLookAndFeel.BUTTON_NO_MIN_SIZE_PROPERTY, Boolean.TRUE);
    tahoma.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            SubstanceLookAndFeel.setFontPolicy(null);
            FontPolicy newFontPolicy = new FontPolicy() {
              public FontSet getFontSet(String lafName,
                  UIDefaults table) {
                return new Tahoma11FontSet();
              }
            };
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.api.fonts.FontPolicy

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.