Package javax.swing.plaf

Examples of javax.swing.plaf.FontUIResource


   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    DefaultMetalTheme t = new DefaultMetalTheme();
    FontUIResource f = t.getMenuTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.BOLD, 12));
    FontUIResource f2 = t.getMenuTextFont();
    harness.check(f == f2);
   
    // setting defaults property doesn't affect already created themes...
    UIManager.put("swing.boldMetal", Boolean.FALSE);
    f = t.getMenuTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.BOLD, 12));
    // ...but is picked up by new themes
    DefaultMetalTheme t2 = new DefaultMetalTheme();
    f = t2.getMenuTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));
   
    // set it to true
    UIManager.put("swing.boldMetal", Boolean.TRUE);
    DefaultMetalTheme t3 = new DefaultMetalTheme();
    f = t3.getMenuTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.BOLD, 12));

    // clear it again
    UIManager.put("swing.boldMetal", null);
    DefaultMetalTheme t4 = new DefaultMetalTheme();
    f = t4.getMenuTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.BOLD, 12));
  }
View Full Code Here


   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    DefaultMetalTheme t = new DefaultMetalTheme();
    FontUIResource f = t.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 10));
    FontUIResource f2 = t.getSubTextFont();
    harness.check(f == f2);
   
    // setting defaults property doesn't affect this font...
    UIManager.put("swing.boldMetal", Boolean.TRUE);
    f = t.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 10));
    // ...but is picked up by new themes
    DefaultMetalTheme t2 = new DefaultMetalTheme();
    f = t2.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 10));
   
    // set it to false
    UIManager.put("swing.boldMetal", Boolean.FALSE);
    DefaultMetalTheme t3 = new DefaultMetalTheme();
    f = t3.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 10));

    // clear it again
    UIManager.put("swing.boldMetal", null);
    DefaultMetalTheme t4 = new DefaultMetalTheme();
    f = t4.getSubTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 10));
  }
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)
  {
    DefaultMetalTheme t = new DefaultMetalTheme();
    FontUIResource f = t.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));
    FontUIResource f2 = t.getSystemTextFont();
    harness.check(f == f2);
   
    // setting defaults property doesn't affect this font...
    UIManager.put("swing.boldMetal", Boolean.TRUE);
    f = t.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));
    // ...but is picked up by new themes
    DefaultMetalTheme t2 = new DefaultMetalTheme();
    f = t2.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));
   
    // set it to false
    UIManager.put("swing.boldMetal", Boolean.FALSE);
    DefaultMetalTheme t3 = new DefaultMetalTheme();
    f = t3.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));

    // clear it again
    UIManager.put("swing.boldMetal", null);
    DefaultMetalTheme t4 = new DefaultMetalTheme();
    f = t4.getSystemTextFont();
    harness.check(f, new FontUIResource("Dialog", Font.PLAIN, 12));
  }
View Full Code Here

        assert awtFont != null;
        assert EventQueue.isDispatchThread();    // On AWT event thread

        // The FontUIResource class marks the font as replaceable by the look and feel
        // implementation if font settings are later changed.
        FontUIResource fontResource = new FontUIResource(awtFont);

        // Assign the new font to the relevant L&F font properties. These are
        // the properties that are initially assigned to the system font
        // under the Windows look and feel.
        // TODO: It's possible that other platforms will need other assignments.
View Full Code Here

    while (keys.hasMoreElements()) {
      final Object key = keys.nextElement();

      if (UIManager.get(key) instanceof javax.swing.plaf.FontUIResource) {
        UIManager.put(key, new FontUIResource(font));
      }
    }
  }
View Full Code Here

  //UIManager.put("TaskPaneContainer.background", Colors.LightGray.color(0.5f));
  UIManager.put("TaskPaneContainer.background", new Color(200, 200, 200, (int) (0.5f * 255f))); // lightgray + alpha

  // setting taskpane defaults
  //UIManager.put("TaskPane.font", new FontUIResource(new Font("Verdana", Font.BOLD, 16)));
  UIManager.put("TaskPane.font", new FontUIResource(new Font("Arial", Font.BOLD, 16)));
  //UIManager.put("TaskPane.titleBackgroundGradientStart", Colors.White.color());
  UIManager.put("TaskPane.titleBackgroundGradientStart", Color.WHITE);
  //UIManager.put("TaskPane.titleBackgroundGradientEnd", Colors.LightBlue.color());
  UIManager.put("TaskPane.titleBackgroundGradientEnd", new Color(208, 223, 245)); // lightblue
}
View Full Code Here

  // setting taskpanecontainer defaults
  UIManager.put("TaskPaneContainer.useGradient", Boolean.FALSE);
  UIManager.put("TaskPaneContainer.background", Colors.LightGray.color(0.5f));

  // setting taskpane defaults
  UIManager.put("TaskPane.font", new FontUIResource(new Font("Verdana", Font.BOLD, 16)));
  UIManager.put("TaskPane.titleBackgroundGradientStart", Colors.White.color());
  UIManager.put("TaskPane.titleBackgroundGradientEnd", Colors.LightBlue.color());
}
View Full Code Here

    Color errorBG = new Color(255, 215, 215);

    defaults.add(JXLoginPane.uiClassID, "org.jdesktop.swingx.plaf.basic.BasicLoginPaneUI");
    defaults.add("JXLoginPane.errorIcon",
            LookAndFeel.makeIcon(LoginPaneAddon.class, "basic/resources/error16.png"));
    defaults.add("JXLoginPane.bannerFont", new FontUIResource("Arial Bold", Font.PLAIN, 36));
    //#911 Not every LAF has Label.font defined ...
    Font labelFont = UIManager.getFont("Label.font");
    Font boldLabel = labelFont != null ? labelFont.deriveFont(Font.BOLD) : new Font("SansSerif", Font.BOLD, 12);
    defaults.add("JXLoginPane.pleaseWaitFont",
            new FontUIResource(boldLabel));
    defaults.add("JXLoginPane.bannerForeground", new ColorUIResource(Color.WHITE));
    defaults.add("JXLoginPane.bannerDarkBackground", new ColorUIResource(Color.GRAY));
    defaults.add("JXLoginPane.bannerLightBackground", new ColorUIResource(Color.LIGHT_GRAY));
    defaults.add("JXLoginPane.errorBackground", new ColorUIResource(errorBG));
    defaults.add("JXLoginPane.errorBorder",
View Full Code Here

    taskPaneFont = taskPaneFont.deriveFont(Font.BOLD);
   
    Color menuBackground = new ColorUIResource(SystemColor.menu);
   
    defaults.add(JXTaskPane.uiClassID, "org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI");
    defaults.add("TaskPane.font", new FontUIResource(taskPaneFont));
    defaults.add("TaskPane.background", UIManagerExt.getSafeColor("List.background",
              new ColorUIResource(Color.decode("#005C5C"))));
    defaults.add("TaskPane.specialTitleBackground", new ColorUIResource(menuBackground.darker()));
    defaults.add("TaskPane.titleBackgroundGradientStart", menuBackground);
    defaults.add("TaskPane.titleBackgroundGradientEnd", menuBackground);
View Full Code Here

        defaults.add("JXMonthView.selectedBackground", new ColorUIResource(197, 220, 240));
        defaults.add("JXMonthView.flaggedDayForeground", new ColorUIResource(Color.RED));
        defaults.add("JXMonthView.leadingDayForeground", new ColorUIResource(Color.LIGHT_GRAY));
        defaults.add("JXMonthView.trailingDayForeground", new ColorUIResource(Color.LIGHT_GRAY));
        defaults.add("JXMonthView.font", UIManagerExt.getSafeFont("Button.font",
                        new FontUIResource("Dialog", Font.PLAIN, 12)));
        defaults.add("JXMonthView.monthDownFileName",
                LookAndFeel.makeIcon(MonthViewAddon.class, "basic/resources/month-down.png"));
        defaults.add("JXMonthView.monthUpFileName",
                LookAndFeel.makeIcon(MonthViewAddon.class, "basic/resources/month-up.png"));
        defaults.add("JXMonthView.boxPaddingX", 3);
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.