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.isBold(s), false);
   
    // check local setting
    StyleConstants.setBold(s, true);
    harness.check(StyleConstants.isBold(s), true);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.Bold);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setBold(parent, true);
    harness.check(StyleConstants.isBold(s), true);   
   
    // 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.getAlignment(s), StyleConstants.ALIGN_LEFT);
   
    // check local setting
    StyleConstants.setAlignment(s, StyleConstants.ALIGN_JUSTIFIED);
    harness.check(StyleConstants.getAlignment(s),
            StyleConstants.ALIGN_JUSTIFIED);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.Alignment);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setAlignment(parent, StyleConstants.ALIGN_JUSTIFIED);
    harness.check(StyleConstants.getAlignment(s),
            StyleConstants.ALIGN_JUSTIFIED);   
   
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.setStrikeThrough(s, true);
    harness.check(StyleConstants.isStrikeThrough(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.setLeftIndent(s, 4.0f);
    harness.check(StyleConstants.getLeftIndent(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
    JLabel comp1 = new JLabel("XYZ");
    StyleConstants.setComponent(s, comp1);
    harness.check(StyleConstants.getComponent(s), comp1);
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.getLineSpacing(s), 0.0f);
   
    // check local setting
    StyleConstants.setLineSpacing(s, 1.0f);
    harness.check(StyleConstants.getLineSpacing(s), 1.0f);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.LineSpacing);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setLineSpacing(parent, 2.0f);
    harness.check(StyleConstants.getLineSpacing(s), 2.0f);   
   
    // try null argument
View Full Code Here

  void testGetIntegerAttributeValue()
  {
    harness.checkPoint("getIntegerAttributeValue");

    SimpleAttributeSet ase = new SimpleAttributeSet();
    ase.addAttribute(HTML.getAttributeKey("size"), "222");
    harness.check(222,
                  HTML.getIntegerAttributeValue(ase,
                                                HTML.getAttributeKey("size"),
                                                333
                                               ), "attribute must be found"
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.isSuperscript(s), false);
   
    // check local setting
    StyleConstants.setSuperscript(s, true);
    harness.check(StyleConstants.isSuperscript(s), true);
   
    // check resolving parent setting
    s.removeAttribute(StyleConstants.Superscript);
    SimpleAttributeSet parent = new SimpleAttributeSet();
    s.setResolveParent(parent);
    StyleConstants.setSuperscript(parent, true);
    harness.check(StyleConstants.isSuperscript(s), true);   
   
    // 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.setAlignment(s, StyleConstants.ALIGN_JUSTIFIED);
    harness.check(StyleConstants.getAlignment(s),
            StyleConstants.ALIGN_JUSTIFIED);
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.setSuperscript(s, true);
    harness.check(StyleConstants.isSuperscript(s), true);
   
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.