Examples of FontPolicy


Examples of com.jgoodies.looks.FontPolicy

                        FontSet fontSet = FontSets.createDefaultFontSet(
                            new Font("Tahoma", Font.PLAIN, fontSizes),    // control font
                            new Font("Tahoma", Font.PLAIN, fontSizes),    // menu font
                            new Font("Tahoma", Font.BOLD, fontSizes)     // title font
                            );
                        FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
                        Plastic3DLookAndFeel.setFontPolicy(fixedPolicy);
                    }

                    //Plastic3DLookAndFeel plLnf = (Plastic3DLookAndFeel) lnf;
                }
                else if ((lnf != null) && (lnf instanceof WindowsLookAndFeel)) {

                    // Set a "model" icon size, so menu items are evenly spaced even though
                    // only some items have icons. We load an arbitrary icon and look at
                    // its size to determine what size to use:
                    int defaultIconSize = GUIGlobals.getImage("open").getIconWidth();
                    com.jgoodies.looks.Options.setDefaultIconSize
                        (new Dimension(defaultIconSize, defaultIconSize));

                    if (overrideDefaultFonts) {
                        FontSet fontSet = FontSets.createDefaultFontSet(
                            new Font("Tahoma", Font.PLAIN, fontSizes),    // control font
                            new Font("Tahoma", Font.PLAIN, fontSizes),    // menu font
                            new Font("Tahoma", Font.BOLD, fontSizes)     // title font
                            );
                        FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet);
                        WindowsLookAndFeel.setFontPolicy(fixedPolicy);
                    }

                    //WindowsLookAndFeel plLnf = (WindowsLookAndFeel) lnf;
                }
View Full Code Here

Examples of com.jgoodies.looks.FontPolicy

        return getFontSet().getWindowTitleFont();
    }

    protected FontSet getFontSet() {
        if (fontSet == null) {
            FontPolicy policy = PlasticLookAndFeel.getFontPolicy();
            fontSet = policy.getFontSet("Plastic", null);
        }
        return fontSet;
    }
View Full Code Here

Examples of contrib.com.jgoodies.looks.common.FontPolicy

    public static LookAndFeel getLightZoneLookAndFeel() {
        LookAndFeel substance = new LightZoneLookAndFeel();

        LightZoneLookAndFeel.setSkin(new LightZoneSkin());

        FontPolicy newFontPolicy = new FontPolicy() {
            public FontSet getFontSet(String lafName,
                                      UIDefaults table) {
                return new LightZoneSkin.LightZoneFontSet();
            }
        };
View Full Code Here

Examples of org.jdesktop.swingx.util.font.FontPolicy

    private void updateFontSet() {
        if (!isBigFontSet()) {
            UIFontUtils.initFontDefaults(UIManager.getDefaults(), null);
        } else {
//            <snip> Install sscaled font
            FontPolicy windowsPolicy = FontPolicies.getDefaultWindowsPolicy();
            FontSet fontSet = windowsPolicy.getFontSet(null, UIManager
                    .getLookAndFeelDefaults());
            WrapperFontSet scaled = new WrapperFontSet(fontSet, 5);
            UIFontUtils.initFontDefaults(UIManager.getDefaults(), scaled);
//            </snip>
        }
View Full Code Here

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

            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);
    zoomInLabel.putClientProperty(
        SubstanceLookAndFeel.USE_THEMED_DEFAULT_ICONS, Boolean.TRUE);
    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

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

        if (currLaf instanceof SubstanceLookAndFeel) {
          SubstanceLookAndFeel.resetLabelBundle();
          if ("CN".equals(countryCode)) {
            final FontSet currFontSet = SubstanceLookAndFeel
                .getFontPolicy().getFontSet("Substance", null);
            SubstanceLookAndFeel.setFontPolicy(new FontPolicy() {
              public FontSet getFontSet(String lafName,
                  UIDefaults table) {
                return new DialogFontSet(currFontSet);
              }
            });
View Full Code Here

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

   * @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

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

              // Get the default font set
              final FontSet substanceCoreFontSet = SubstanceLookAndFeel
                  .getFontPolicy().getFontSet("Substance",
                      null);
              // Create the wrapper font set
              FontPolicy newFontPolicy = new FontPolicy() {
                public FontSet getFontSet(String lafName,
                    UIDefaults table) {
                  return new WrapperFontSet(
                      substanceCoreFontSet, newValue);
                }
              };

              try {
                GetFontPolicy.this
                    .setCursor(Cursor
                        .getPredefinedCursor(Cursor.WAIT_CURSOR));
                // set the new font policy
                SubstanceLookAndFeel
                    .setFontPolicy(newFontPolicy);
                GetFontPolicy.this.setCursor(Cursor
                    .getDefaultCursor());
              } catch (Exception exc) {
                exc.printStackTrace();
              }
            }
          });
        }
      }
    });
    panel.add(fontSizeSlider);

    JButton jb = new JButton("Show font info");
    jb.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        FontPolicy fontPolicy = SubstanceLookAndFeel.getFontPolicy();
        FontSet fontSet = fontPolicy.getFontSet("Substance", null);
        String[] infoArray = new String[] {
            "Control: " + fontSet.getControlFont(),
            "Menu: " + fontSet.getMenuFont(),
            "Message: " + fontSet.getMessageFont(),
            "Small: " + fontSet.getSmallFont(),
View Full Code Here

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

              // Get the default font set
              final FontSet substanceCoreFontSet = SubstanceLookAndFeel
                  .getFontPolicy().getFontSet("Substance",
                      null);
              // Create the wrapper font set
              FontPolicy newFontPolicy = new FontPolicy() {
                public FontSet getFontSet(String lafName,
                    UIDefaults table) {
                  return new WrapperFontSet(
                      substanceCoreFontSet, newValue);
                }
View Full Code Here

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

            SubstanceLookAndFeel.setFontPolicy(null);
            // Get the default font set
            final FontSet substanceCoreFontSet = SubstanceLookAndFeel.getFontPolicy().getFontSet("Substance", null); //$NON-NLS-1$

            // Create the wrapper font set
            final FontPolicy newFontPolicy = new FontPolicy() {
              @Override
              public FontSet getFontSet(final String lafName, final UIDefaults table) {
                return new WrapperFontSet(substanceCoreFontSet, value);
              }
            };
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.