Package org.pushingpixels.substance.api.fonts

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


        if (!fontSizeSlider.getModel().getValueIsAdjusting()) {
          final int newValue = fontSizeSlider.getValue();
          SwingUtilities.invokeLater(new Runnable() {
            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) {
View Full Code Here


        frame.applyComponentOrientation(ComponentOrientation
            .getOrientation(Locale.getDefault()));
        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

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

      // .getBundle("org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.Labels"),

      };

      Object[] colorDefaults = null;
      FontSet substanceFontSet = SubstanceLookAndFeel.getFontPolicy()
          .getFontSet("Substance", null);
      Font controlFont = substanceFontSet.getControlFont();

      Font fontBoldBaseP1 = new FontUIResource(controlFont.deriveFont(
          Font.BOLD, controlFont.getSize() + 1));

      Font fontPlainBaseM2 = new FontUIResource(controlFont
View Full Code Here

            public void run() {
              // reset the base font policy to null - this
              // restores the original font policy (default size).
              SubstanceLookAndFeel.setFontPolicy(null);
              // 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(),
            "Title: " + fontSet.getTitleFont(),
            "Window title: " + fontSet.getWindowTitleFont() };
        JList infoList = new JList(infoArray);
        JDialog infoDialog = new JDialog(GetFontPolicy.this,
            "Font set info", true);
        infoDialog.setLayout(new BorderLayout());
        infoDialog.add(infoList, BorderLayout.CENTER);
View Full Code Here

            public void run() {
              // reset the base font policy to null - this
              // restores the original font policy (default size).
              SubstanceLookAndFeel.setFontPolicy(null);
              // 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,
View Full Code Here

        @Override
        public void actionPerformed(final ActionEvent e) {
          try {
            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) {
View Full Code Here

    if (log.isTraceEnabled()) log.trace(HelperLog.methodStart());
   
    try {
      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) {
View Full Code Here

   */
  public static FontPolicy getLooks1xPlasticPolicy() {
    Font controlFont = Fonts.getDefaultGUIFontWesternModernWindowsNormal();
    Font menuFont = controlFont;
    Font titleFont = controlFont.deriveFont(Font.BOLD);
    FontSet fontSet = FontSets.createDefaultFontSet(controlFont, menuFont,
        titleFont);
    return createFixedPolicy(fontSet);
  }
View Full Code Here

    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;
      }
      return wrappedPolicy.getFontSet(lafName, table);
    }
View Full Code Here

TOP

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

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.