Package javax.swing.plaf.metal

Examples of javax.swing.plaf.metal.DefaultMetalTheme


   * Runs the test using the specified harness.
   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getPrimaryControlDarkShadow();
    harness.check(c, new ColorUIResource(new Color(102, 102, 153)));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getPrimaryControlDarkShadow() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getPrimaryControlDarkShadow();
    harness.check(c, new ColorUIResource(Color.red))
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here


   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getWindowTitleForeground();
    harness.check(c, new ColorUIResource(Color.black));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getWindowTitleForeground() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getWindowTitleForeground();
    harness.check(c, new ColorUIResource(Color.red))
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

   * Runs the test using the specified harness.
   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getInactiveSystemTextColor();
    harness.check(c, new ColorUIResource(new Color(153, 153, 153)));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getInactiveSystemTextColor() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getInactiveSystemTextColor();
    harness.check(c, new ColorUIResource(Color.red));
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

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

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

    f = MetalLookAndFeel.getWindowTitleFont();
    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

   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getWindowTitleInactiveBackground();
    harness.check(c, new ColorUIResource(new Color(204, 204, 204)));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getWindowTitleInactiveBackground() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getWindowTitleInactiveBackground();
    harness.check(c, new ColorUIResource(Color.red))
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

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

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

    f = MetalLookAndFeel.getMenuTextFont();
    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

   * Runs the test using the specified harness.
   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getControlShadow();
    harness.check(c, new ColorUIResource(new Color(153, 153, 153)));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getControlShadow() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getControlShadow();
    harness.check(c, new ColorUIResource(Color.red));
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

   * Runs the test using the specified harness.
   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getPrimaryControlHighlight();
    harness.check(c, new ColorUIResource(Color.white));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getPrimaryControlHighlight() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getPrimaryControlHighlight();
    harness.check(c, new ColorUIResource(Color.red))
   
    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());

  }
View Full Code Here

*/
public class setCurrentTheme implements Testlet
{
  public void test(TestHarness h)
  {
    DefaultMetalTheme theme = new DefaultMetalTheme();
    MetalLookAndFeel.setCurrentTheme(theme);
    MetalLookAndFeel laf = new MetalLookAndFeel();
    Color c1 = laf.getDefaults().getColor("Button.background");
    h.check(c1, theme.getControl());
    MetalLookAndFeel.setCurrentTheme(new TestTheme());
    c1 = laf.getDefaults().getColor("Button.background");
    h.check(c1, Color.red);

    // reset the theme so that other tests won't be affected
    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
  }
View Full Code Here

   * Runs the test using the specified harness.
   * 
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness) {
  MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
    ColorUIResource c = MetalLookAndFeel.getSeparatorBackground();
    harness.check(c, new ColorUIResource(Color.white));

    MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme() {
      public ColorUIResource getSeparatorBackground() {
        return new ColorUIResource(Color.red);
      }
    });

    c = MetalLookAndFeel.getSeparatorBackground();
    harness.check(c, new ColorUIResource(Color.red))

    // 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.metal.DefaultMetalTheme

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.