Package javax.swing.plaf

Examples of javax.swing.plaf.FontUIResource


        assertNull(tf.getMargin());
        tf.setCaretColor(RED);
        tf.setSelectionColor(GREEN);
        tf.setSelectedTextColor(BLUE);
        tf.setDisabledTextColor(YELLOW);
        tf.setFont(new FontUIResource("SimSun", 8, 8));
        tf.setBackground(BLACK);
        tf.setForeground(YELLOW);
        tf.setBorder(new BorderUIResource.LineBorderUIResource(Color.RED));
        tf.setMargin(new InsetsUIResource(2, 4, 6, 3));
        ((BasicTextUI) tf.getUI()).uninstallDefaults();
View Full Code Here


        Color inactiveForeground = (Color) getProperty(prefix, "inactiveForeground");
        Insets margin = (Insets) getProperty(prefix, "margin");
        Border border = (Border) getProperty(prefix, "border");
        checkProperies(tf, caretForeground, selectionBackground, selectionForeground,
                inactiveForeground, font, background, foreground, margin, border);
        setProperies(tf, RED, GREEN, BLUE, YELLOW, new FontUIResource("SimSun", 8, 8), BLACK,
                YELLOW, new InsetsUIResource(2, 4, 6, 3),
                new BorderUIResource.LineBorderUIResource(Color.RED), 56);
        ((BasicTextUI) tf.getUI()).installDefaults();
        checkProperies(tf, caretForeground, selectionBackground, selectionForeground,
                inactiveForeground, font, background, foreground, margin, border);
View Full Code Here

    public void testGetSetFont() throws Exception {
        assertNull(renderer.getFont());
        renderer.setFont(null);
        assertNull(renderer.getFont());
        renderer.setFont(new FontUIResource("font", 10, 0));
        assertNull(renderer.getFont());
        Font userFont = new Font("font", 20, 1);
        renderer.setFont(userFont);
        assertSame(userFont, renderer.getFont());
    }
View Full Code Here

            mainFrame.getMainFrameLoadSaveHelper().initialize();

            // Sets the size of the tooltip to match the rest of the GUI. -
            // Kristin
            JToolTip tempToolTip = mainFrame.mainFrameTree.getTableheader().createToolTip();
            UIManager.put("ToolTip.font", new FontUIResource(tempToolTip.getFont().deriveFont(Driver.getFontSize())));

            setupOSX();

            String loadFromURL = SystemProperties.getOSDependentProperty("findbugs.loadBugsFromURL");
View Full Code Here

    protected class FontSizeHandler implements OptionHandler {
        public int handleOption(int i) {
            int size = Integer.parseInt(arguments[++i]);

            Font font = new Font("Dialog", Font.PLAIN, size);
            FontUIResource fontRes = new FontUIResource(font);
            UIManager.put("CheckBox.font", fontRes);
            UIManager.put("PopupMenu.font", fontRes);
            UIManager.put("TextPane.font", fontRes);
            UIManager.put("MenuItem.font", fontRes);
            UIManager.put("ComboBox.font", fontRes);
View Full Code Here

    protected class FontSizeHandler implements OptionHandler {
        public int handleOption(int i) {
            int size = Integer.parseInt(arguments[++i]);

            Font font = new Font("Dialog", Font.PLAIN, size);
            FontUIResource fontRes = new FontUIResource(font);
            UIManager.put("CheckBox.font", fontRes);
            UIManager.put("PopupMenu.font", fontRes);
            UIManager.put("TextPane.font", fontRes);
            UIManager.put("MenuItem.font", fontRes);
            UIManager.put("ComboBox.font", fontRes);
View Full Code Here

                iter.remove();
            }
        }
        final Font font = Font.getFont(attributes);
        if (context.getRequiredType() == FontUIResource.class) {
            return new FontUIResource(font);
        } else {
            return font;
        }
    }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    FontUIResource f = MetalLookAndFeel.getControlTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.BOLD, 12));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public FontUIResource getControlTextFont() {
        return new FontUIResource("Dialog", Font.PLAIN, 99);
      }
    });

    f = MetalLookAndFeel.getControlTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 99));
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    FontUIResource f = MetalLookAndFeel.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 10));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public FontUIResource getSubTextFont() {
        return new FontUIResource("Dialog", Font.PLAIN, 99);
      }
    });

    f = MetalLookAndFeel.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 99));
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    FontUIResource f = MetalLookAndFeel.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public FontUIResource getSystemTextFont() {
        return new FontUIResource("Dialog", Font.PLAIN, 99);
      }
    });

    f = MetalLookAndFeel.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 99));
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
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.