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 local setting
    Icon icon1 = MetalIconFactory.getTreeComputerIcon();
    StyleConstants.setIcon(s, icon1);
    harness.check(StyleConstants.getIcon(s), icon1);
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.getForeground(s), Color.black);
   
    // check local setting
    StyleConstants.setForeground(s, Color.red);
    harness.check(StyleConstants.getForeground(s), Color.red);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.Foreground);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setForeground(parent, Color.yellow);
    harness.check(StyleConstants.getForeground(s), Color.yellow);  
   
    // 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.setBold(s, true);
    harness.check(StyleConstants.isBold(s), true);
   
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.setSpaceBelow(s, 4.0f);
    harness.check(StyleConstants.getSpaceBelow(s), 4.0f);
   
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.setBackground(s, Color.blue);
    harness.check(StyleConstants.getBackground(s), Color.blue);
   
View Full Code Here

{
  public void test(TestHarness harness)
  {
    h2 = harness;
    StyledDocument doc = new StyledDocument3();
    SimpleAttributeSet atts = new SimpleAttributeSet();
    try
      {
        atts.addAttribute(StyleConstants.StrikeThrough, Boolean.TRUE);
        doc.insertString(0, "bbbbb", atts);
        doc.insertString(5, "aaaaa", null);
        doc.insertString(5, "N", atts);
        atts.addAttribute(StyleConstants.Bold, Boolean.TRUE);
        doc.insertString(6, "M", atts);
      }
    catch (Exception ex)
      {
        // ex.printStackTrace();
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.setFirstLineIndent(s, 4.0f);
    harness.check(StyleConstants.getFirstLineIndent(s), 4.0f);
   
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.getFirstLineIndent(s), 0.0f);
   
    // check local setting
    StyleConstants.setFirstLineIndent(s, 1.0f);
    harness.check(StyleConstants.getFirstLineIndent(s), 1.0f);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.FirstLineIndent);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setFirstLineIndent(parent, 2.0f);
    harness.check(StyleConstants.getFirstLineIndent(s), 2.0f);   
   
    // 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 default
    harness.check(StyleConstants.getTabSet(s), null);
   
    // check local setting
    TabStop[] tabs1 = new TabStop[] {new TabStop(8.0f)};
    TabSet ts1 = new TabSet(tabs1);
    StyleConstants.setTabSet(s, ts1);
    harness.check(StyleConstants.getTabSet(s), ts1);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.TabSet);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    TabStop[] tabs2 = new TabStop[] {new TabStop(10.0f)};
    TabSet ts2 = new TabSet(tabs2);
    StyleConstants.setTabSet(parent, ts2);
    harness.check(StyleConstants.getTabSet(s), ts2);   
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.setSpaceAbove(s, 4.0f);
    harness.check(StyleConstants.getSpaceAbove(s), 4.0f);
   
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.