Package gnu.testlet.javax.swing.JList.AccessibleJList

Examples of gnu.testlet.javax.swing.JList.AccessibleJList.TestList


public class setBackground implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    Color listBackground = l.getBackground();
    child.setBackground(Color.RED);
    harness.check(l.getBackground(), listBackground);
    child.setBackground(Color.GREEN);
    harness.check(l.getBackground(), listBackground);
  }
View Full Code Here


public class getFont implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    Font font1 = new Font("Dialog", Font.PLAIN, 16);
    Font font2 = new Font("Dialog", Font.BOLD, 12);
    l.setFont(font1);
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    harness.check(child.getFont(), font1);
    l.setFont(font2);
    harness.check(child.getFont(), font2);
  }
View Full Code Here

public class isFocusTraversable implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    l.setFocusable(true);
    harness.check(child.isFocusTraversable(), true);
    l.setFocusable(false);
    harness.check(child.isFocusTraversable(), true);
  }
View Full Code Here

public class setCursor implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    Cursor cursor = l.getCursor();
    child.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    harness.check(l.getCursor(), cursor);
    harness.check(child.getCursor(),
                  Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    child.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    harness.check(l.getCursor(), cursor);
    harness.check(child.getCursor(),
                  Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
  }
View Full Code Here

public class setForeground implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    Color listForeground = l.getForeground();
    child.setForeground(Color.RED);
    harness.check(l.getForeground(), listForeground);
    child.setForeground(Color.GREEN);
    harness.check(l.getForeground(), listForeground);
  }
View Full Code Here

   *
   * @param harness the test harness to use
   */
  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    l.setEnabled(true);
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    harness.check(child.isEnabled(), true);
    l.setEnabled(false);
    harness.check(child.isEnabled(), false);
  }
View Full Code Here

public class setFont implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    Font font = l.getFont();
    child.setFont(new Font("Dialog", Font.PLAIN, 16));
    harness.check(l.getFont(), font);
    child.setFont(new Font("Dialog", Font.BOLD, 12));
    harness.check(l.getFont(), font);
  }
View Full Code Here

public class setEnabled implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    boolean enabled = l.isEnabled();
    child.setEnabled(false);
    harness.check(l.isEnabled(), enabled);
    child.setEnabled(true);
    harness.check(l.isEnabled(), enabled);
  }
View Full Code Here

public class getCursor implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    Cursor cursor1 = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR);
    Cursor cursor2 = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
    l.setCursor(cursor1);
    harness.check(l.getCursor(), cursor1);
    AccessibleComponent child = (AccessibleComponent) al.getAccessibleChild(0);
    harness.check(child.getCursor(), Cursor.getDefaultCursor());
    l.setCursor(cursor2);
    harness.check(child.getCursor(), Cursor.getDefaultCursor());

    // Try if it reacts to setCursor().
    child.setCursor(cursor1);
    harness.check(child.getCursor(), cursor1);
View Full Code Here

public class getAccessibleStateSet implements Testlet
{

  public void test(TestHarness harness)
  {
    TestList l = new TestList(new String[]{"item"});
    TestList.AccessibleTestList al =
      (TestList.AccessibleTestList) l.getAccessibleContext();
    AccessibleContext child = (AccessibleContext) al.getAccessibleChild(0);
    AccessibleComponent childC = (AccessibleComponent) child;
    AccessibleStateSet states;
    // We test the visible state in isVisible.
    // We test the showing state in isShowing.
View Full Code Here

TOP

Related Classes of gnu.testlet.javax.swing.JList.AccessibleJList.TestList

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.