Package javax.swing.plaf.metal

Examples of javax.swing.plaf.metal.DefaultMetalTheme


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

  {
    harness.checkPoint("getBorderInsets(Component)");
    // test with DefaultMetalTheme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace()
View Full Code Here

  {
    harness.checkPoint("getBorderInsets(Component, Insets)");
    // test with DefaultMetalTheme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace()
View Full Code Here

  public void test(TestHarness harness)
  {
    // test with a known theme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace();  
View Full Code Here

  public void test(TestHarness harness
  {
    // test with DefaultMetalTheme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace()
View Full Code Here

  public void test(TestHarness harness)
  {
    // test with a known theme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace();  
View Full Code Here

   */
  private void testNotEditable(TestHarness harness)
  {
    try
    {
      MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
      UIManager.setLookAndFeel(new MetalLookAndFeel());
    }
    catch (UnsupportedLookAndFeelException e)
    {
      e.printStackTrace();
View Full Code Here

  public void test(TestHarness harness
  {
    // test with DefaultMetalTheme
    try
      {
        MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
        UIManager.setLookAndFeel(new MetalLookAndFeel());
      }
    catch (UnsupportedLookAndFeelException e)
      {
        e.printStackTrace()
View Full Code Here

            private MetalTheme oldTheme;
           
            @Override
            protected void setup() {
                oldTheme = MetalLookAndFeel.getCurrentTheme();
                MetalLookAndFeel.setCurrentTheme( new DefaultMetalTheme() );
            }
           
            @Override
            protected void kill() {
                MetalLookAndFeel.setCurrentTheme( oldTheme );
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.