Package javax.swing.text

Examples of javax.swing.text.ZoneView


public class getMaximumZoneSize implements Testlet
{

  public void test(TestHarness h)
  {
    ZoneView zv = new TestZoneView();
    h.check(zv.getMaximumZoneSize(), 8192);
    zv.setMaximumZoneSize(0);
    h.check(zv.getMaximumZoneSize(), 0);
    zv.setMaximumZoneSize(1);
    h.check(zv.getMaximumZoneSize(), 1);
    zv.setMaximumZoneSize(Integer.MAX_VALUE);
    h.check(zv.getMaximumZoneSize(), Integer.MAX_VALUE);
    zv.setMaximumZoneSize(Integer.MIN_VALUE);
    h.check(zv.getMaximumZoneSize(), Integer.MIN_VALUE);
  }
View Full Code Here


    testUnloading(h);
  }

  private void testSimple(TestHarness h)
  {
    ZoneView zv = new TestZoneView();
    // Test legal values.
    zv.setMaxZonesLoaded(1);
    h.check(zv.getMaxZonesLoaded(), 1);
    zv.setMaxZonesLoaded(Integer.MAX_VALUE);
    h.check(zv.getMaxZonesLoaded(), Integer.MAX_VALUE);
    // Test illegal values.
    try
      {
        zv.setMaxZonesLoaded(0);
        h.fail("Should have thrown IllegalArgumentException");
      }
    catch (IllegalArgumentException ex)
      {
        h.check(true);
      }
    try
      {
        zv.setMaxZonesLoaded(Integer.MIN_VALUE);
        h.fail("Should have thrown IllegalArgumentException");
      }
    catch (IllegalArgumentException ex)
      {
        h.check(true);
View Full Code Here

   */
  private void testSimple(TestHarness h)
  {
    PlainDocument doc = new PlainDocument();
    Element el = doc.getDefaultRootElement();
    ZoneView zv = new ZoneView(el, View.X_AXIS);
    h.check(zv.getAxis(), View.X_AXIS);
    h.check(zv.getElement(), el);
    zv = new ZoneView(el, View.Y_AXIS);
    h.check(zv.getAxis(), View.Y_AXIS);
    h.check(zv.getElement(), el);
  }
View Full Code Here

  private void testDefaultValues(TestHarness h)
  {
    PlainDocument doc = new PlainDocument();
    Element el = doc.getDefaultRootElement();
    ZoneView zv = new ZoneView(el, View.X_AXIS);
    h.check(zv.getMaximumZoneSize(), 8192);
    h.check(zv.getMaxZonesLoaded(), 3);
  }
View Full Code Here

public class getMaxZonesLoaded
{
  public void test(TestHarness h)
  {
    ZoneView zv = new TestZoneView();
    // Test legal values.
    zv.setMaxZonesLoaded(1);
    h.check(zv.getMaxZonesLoaded(), 1);
    zv.setMaxZonesLoaded(Integer.MAX_VALUE);
    h.check(zv.getMaxZonesLoaded(), Integer.MAX_VALUE);
    // Test illegal values.
    try
      {
        zv.setMaxZonesLoaded(0);
        h.fail("Should have thrown IllegalArgumentException");
      }
    catch (IllegalArgumentException ex)
      {
        h.check(true);
      }
    h.check(zv.getMaxZonesLoaded(), Integer.MAX_VALUE);
    try
      {
        zv.setMaxZonesLoaded(Integer.MIN_VALUE);
        h.fail("Should have thrown IllegalArgumentException");
      }
    catch (IllegalArgumentException ex)
      {
        h.check(true);
      }
    h.check(zv.getMaxZonesLoaded(), Integer.MAX_VALUE);
  }
View Full Code Here

TOP

Related Classes of javax.swing.text.ZoneView

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.