Package javax.swing.text

Examples of javax.swing.text.SimpleAttributeSet


   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    SimpleAttributeSet s = new SimpleAttributeSet();
   
    // check default
    harness.check(StyleConstants.getFontFamily(s), "Monospaced");
   
    // check local setting
    StyleConstants.setFontFamily(s, "XYZ");
    harness.check(StyleConstants.getFontFamily(s), "XYZ");
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.FontFamily);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setFontFamily(parent, "ABC");
    harness.check(StyleConstants.getFontFamily(s), "ABC");   
   
    // try null argument
View Full Code Here


   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    SimpleAttributeSet s = new SimpleAttributeSet();
   
    // check local setting
    StyleConstants.setBidiLevel(s, 1);
    harness.check(StyleConstants.getBidiLevel(s), 1);
   
View Full Code Here

  {
    h.checkPoint("testOriginate1");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

  {
    h.checkPoint("testOriginate2");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

  {
    h.checkPoint("testOriginate3");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    SimpleAttributeSet s = new SimpleAttributeSet();
   
    // check default
    harness.check(StyleConstants.isUnderline(s), false);
   
    // check local setting
    StyleConstants.setUnderline(s, true);
    harness.check(StyleConstants.isUnderline(s), true);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.Underline);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setUnderline(parent, true);
    harness.check(StyleConstants.isUnderline(s), true);   
   
    // try null argument
View Full Code Here

  {
    h.checkPoint("testJoinPrevious1");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

  {
    h.checkPoint("testJoinPrevious2");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

  {
    h.checkPoint("testJoinPrevious3");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

  {
    h.checkPoint("testJoinNext1");
    TestDocument doc = new TestDocument();
    doc.addDocumentListener(this);
    char[] text = new char[] {'H', 'e', 'l', 'l', 'o'};
    SimpleAttributeSet atts = new SimpleAttributeSet();
    TestDocument.ElementSpec spec =
      new TestDocument.ElementSpec(atts, TestDocument.ElementSpec.ContentType,
                                   text, 0, 5);
    spec.setDirection(TestDocument.ElementSpec.OriginateDirection);
View Full Code Here

TOP

Related Classes of javax.swing.text.SimpleAttributeSet

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.