718 if (space != null) { 719 return space.floatValue(); 720 } 721 return 0; 722 } 723 724 /** 725 * Sets space below. 726 * 727 * @param a the attribute set 728 * @param i the value 729 */ 730 public static void setSpaceBelow(MutableAttributeSet a, float i) { 731 a.addAttribute(SpaceBelow, new Float(i)); 732 } 733 734 /** 735 * Gets the alignment setting. 736 * 737 * @param a the attribute set 738 * @return the value <code>StyleConstants.ALIGN_LEFT</code> if not set 739 */ 740 public static int getAlignment(AttributeSet a) { 741 Integer align = (Integer) a.getAttribute(Alignment); 742 if (align != null) { 743 return align.intValue(); 744 } 745 return ALIGN_LEFT; 746 } 747 748 /** 749 * Sets alignment. 750 * 751 * @param a the attribute set 752 * @param align the alignment value 753 */ 754 public static void setAlignment(MutableAttributeSet a, int align) { 755 a.addAttribute(Alignment, Integer.valueOf(align)); 756 } 757 758 /** 759 * Gets the TabSet. 760 * 761 * @param a the attribute set 762 * @return the <code>TabSet</code> 763 */ 764 public static TabSet getTabSet(AttributeSet a) { 765 TabSet tabs = (TabSet)a.getAttribute(TabSet); 766 // PENDING: should this return a default? 767 return tabs; 768 } 769 770 /** 771 * Sets the TabSet. 772 * 773 * @param a the attribute set. 774 * @param tabs the TabSet 775 */ 776 public static void setTabSet(MutableAttributeSet a, TabSet tabs) { 777 a.addAttribute(TabSet, tabs); 778 } 779 780 // --- privates --------------------------------------------- 781 782 static Object[] keys = { | 718 if (space != null) { 719 return space.floatValue(); 720 } 721 return 0; 722 } 723 724 /** 725 * Sets space below. 726 * 727 * @param a the attribute set 728 * @param i the value 729 */ 730 public static void setSpaceBelow(MutableAttributeSet a, float i) { 731 a.addAttribute(SpaceBelow, new Float(i)); 732 } 733 734 /** 735 * Gets the alignment setting. 736 * 737 * @param a the attribute set 738 * @return the value {@code StyleConstants.ALIGN_LEFT} if not set 739 */ 740 public static int getAlignment(AttributeSet a) { 741 Integer align = (Integer) a.getAttribute(Alignment); 742 if (align != null) { 743 return align.intValue(); 744 } 745 return ALIGN_LEFT; 746 } 747 748 /** 749 * Sets alignment. 750 * 751 * @param a the attribute set 752 * @param align the alignment value 753 */ 754 public static void setAlignment(MutableAttributeSet a, int align) { 755 a.addAttribute(Alignment, Integer.valueOf(align)); 756 } 757 758 /** 759 * Gets the TabSet. 760 * 761 * @param a the attribute set 762 * @return the {@code TabSet} 763 */ 764 public static TabSet getTabSet(AttributeSet a) { 765 TabSet tabs = (TabSet)a.getAttribute(TabSet); 766 // PENDING: should this return a default? 767 return tabs; 768 } 769 770 /** 771 * Sets the TabSet. 772 * 773 * @param a the attribute set. 774 * @param tabs the TabSet 775 */ 776 public static void setTabSet(MutableAttributeSet a, TabSet tabs) { 777 a.addAttribute(TabSet, tabs); 778 } 779 780 // --- privates --------------------------------------------- 781 782 static Object[] keys = { |