Package javax.swing.text

Examples of javax.swing.text.TabStop


   
    tsA = new TabSet(new TabStop[] {});
    tsB = new TabSet(new TabStop[] {});
    harness.check(tsA.equals(tsB));
   
    tsA = new TabSet(new TabStop[] {new TabStop(1.0f)});
    tsB = new TabSet(new TabStop[] {new TabStop(1.0f)});
    harness.check(tsA.equals(tsB));

    tsA = new TabSet(new TabStop[] {new TabStop(1.1f, TabStop.ALIGN_CENTER,
            TabStop.LEAD_DOTS)});
    harness.check(!tsA.equals(tsB));
    tsB = new TabSet(new TabStop[] {new TabStop(1.1f, TabStop.ALIGN_CENTER,
            TabStop.LEAD_DOTS)});
    harness.check(tsA.equals(tsB));
 
    harness.check(!tsA.equals(null));
    harness.check(!tsA.equals("a string"));
View Full Code Here


    harness.check(s.toString(), "[  ]");

    s = new TabSet(new TabStop[] {});
    harness.check(s.toString(), "[  ]");
 
    s = new TabSet(new TabStop[] {new TabStop(1.0f)});
    harness.check(s.toString(), "[ tab @1.0 ]");

    s = new TabSet(new TabStop[] {new TabStop(1.0f), new TabStop(2.0f)});
    harness.check(s.toString(), "[ tab @1.0 - tab @2.0 ]");
  }
View Full Code Here

public class getTabCount implements Testlet
{
  public void test(TestHarness harness)
  {
    TabStop ts1 = new TabStop(1.0f);
    TabStop ts2 = new TabStop(2.0f);
    TabStop ts3 = new TabStop(3.0f);
    TabStop[] tabs = new TabStop[] {ts1, ts2, ts3};
    TabSet s = new TabSet(tabs);
    harness.check(s.getTabCount(), 3);
   
    harness.check(new TabSet(null).getTabCount(), 0);
View Full Code Here

public class getTab implements Testlet
{
  public void test(TestHarness harness)
  {
    TabStop ts1 = new TabStop(1.0f);
    TabStop ts2 = new TabStop(2.0f);
    TabStop ts3 = new TabStop(3.0f);
    TabStop[] tabs = new TabStop[] {ts1, ts2, ts3};
    TabSet s = new TabSet(tabs);
    harness.check(s.getTabCount(), 3);
    harness.check(s.getTab(0), ts1);
    harness.check(s.getTab(1), ts2);
View Full Code Here

        TabStop[] tabs = new TabStop[36];

        for (int j = 0; j < tabs.length; j++) {
            int tab = j + 1;
            tabs[j] = new TabStop(tab * tabWidth);
        }

        TabSet tabSet = new TabSet(tabs);
        SimpleAttributeSet attributes = new SimpleAttributeSet();
        StyleConstants.setTabSet(attributes, tabSet);
View Full Code Here

    int charWidth = fm.charWidth('#');
    int tabWidth = charWidth * tabSize;

    TabStop[] tabs = new TabStop[100];
    for (int j = 0; j < tabs.length; j++) {
      tabs[j] = new TabStop((j + 1) * tabWidth);
    }

    SimpleAttributeSet attributes = new SimpleAttributeSet();

    StyleConstants.setTabSet(attributes, new TabSet(tabs));
View Full Code Here

    TabStop[] tabs = new TabStop[100];
    for (int j = 0; j < tabs.length; j++)
    {
      int tab = j + 1;
      tabs[j] = new TabStop( tab * tabWidth );
    }
    TabSet tabSet = new TabSet(tabs);
    SimpleAttributeSet attributes = new SimpleAttributeSet();
    StyleConstants.setTabSet(attributes, tabSet);
View Full Code Here

    int tabWidth = charWidth * charactersPerTab;

    TabStop[] tabs = new TabStop[MAX_TABS];

    for (int j = 0; j < tabs.length; j++)
      tabs[j] = new TabStop((j+1) * tabWidth);

    TabSet tabSet = new TabSet(tabs);
    SimpleAttributeSet attributes = new SimpleAttributeSet();
    StyleConstants.setTabSet(attributes, tabSet);
    int length = getLength();
View Full Code Here

     doc.addUndoableEditListener( this );
    
     // create default tabs
    tabs = new TabStop[ 30 ];
    for( int i = 0; i < 30; i++ ) {
      tabs[ i ] = new TabStop( i * 28 );
    }
     setTabs( doc, -1, 0 );
   
    // this automatically moves document listeners to
    // a new doc
View Full Code Here

      // hence trunc them to ints!
      final float pos    = ((Number) args[ j++ ]).intValue();
      final int   mode  = ((Number) args[ j++ ]).intValue();
      final int   align  = (mode >> 8) & 0xFF;
      final int   leader  = mode & 0xFF;
      t[ i ] = new TabStop( pos, align, leader );
    }
    setTabs( rangeStart, len, t );
  }
View Full Code Here

TOP

Related Classes of javax.swing.text.TabStop

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.