classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: API docs for javax.swing.text.StyleConstants.java


From: David Gilbert
Subject: [cp-patches] FYI: API docs for javax.swing.text.StyleConstants.java
Date: Mon, 16 Jan 2006 16:01:15 +0000
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

I committed this patch:

2006-01-16  David Gilbert  <address@hidden>

        * javax/swing/text/StyleConstants.java: Updated API docs all over.

Regards,

Dave
Index: javax/swing/text/StyleConstants.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/text/StyleConstants.java,v
retrieving revision 1.8
diff -u -r1.8 StyleConstants.java
--- javax/swing/text/StyleConstants.java        4 Nov 2005 20:16:10 -0000       
1.8
+++ javax/swing/text/StyleConstants.java        16 Jan 2006 15:47:29 -0000
@@ -1,5 +1,5 @@
 /* StyleConstants.java --
-   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -43,45 +43,124 @@
 
 import javax.swing.Icon;
 
+/**
+ * Represents standard attribute keys.  This class also contains a set of 
+ * useful static utility methods for querying and populating an 
+ * address@hidden AttributeSet}.
+ * 
+ * @since 1.2
+ */
 public class StyleConstants
 {
+  /** 
+   * A value representing left alignment for the 
+   * address@hidden ParagraphConstants#Alignment} attribute. 
+   */
   public static final int ALIGN_LEFT = 0;
+
+  /** 
+   * A value representing center alignment for the 
+   * address@hidden ParagraphConstants#Alignment} attribute. 
+   */
   public static final int ALIGN_CENTER = 1;
+
+  /** 
+   * A value representing right alignment for the 
+   * address@hidden ParagraphConstants#Alignment} attribute. 
+   */
   public static final int ALIGN_RIGHT = 2;
+
+  /** 
+   * A value representing ful justification for the 
+   * address@hidden ParagraphConstants#Alignment} attribute. 
+   */
   public static final int ALIGN_JUSTIFIED = 3;
 
+  /** An alias for address@hidden CharacterConstants#Background}. */
   public static final Object Background = CharacterConstants.Background;
+
+  /** An alias for address@hidden CharacterConstants#BidiLevel}. */
   public static final Object BidiLevel = CharacterConstants.BidiLevel;
+  
+  /** An alias for address@hidden CharacterConstants#Bold}. */
   public static final Object Bold = CharacterConstants.Bold;
-  public static final Object ComponentAttribute = 
CharacterConstants.ComponentAttribute;
+  
+  /** An alias for address@hidden CharacterConstants#ComponentAttribute}. */
+  public static final Object ComponentAttribute 
+      = CharacterConstants.ComponentAttribute;
+  
+  /** An alias for address@hidden CharacterConstants#Family}. */
   public static final Object Family = CharacterConstants.Family;
+  
+  /** An alias for address@hidden CharacterConstants#Family}. */
   public static final Object FontFamily = CharacterConstants.Family;  
+  
+  /** An alias for address@hidden CharacterConstants#Size}. */
   public static final Object FontSize = CharacterConstants.Size;
+  
+  /** An alias for address@hidden CharacterConstants#Foreground}. */
   public static final Object Foreground = CharacterConstants.Foreground;
+  
+  /** An alias for address@hidden CharacterConstants#IconAttribute}. */
   public static final Object IconAttribute = CharacterConstants.IconAttribute;
+  
+  /** An alias for address@hidden CharacterConstants#Italic}. */
   public static final Object Italic = CharacterConstants.Italic;
+  
+  /** An alias for address@hidden CharacterConstants#Size}. */
   public static final Object Size = CharacterConstants.Size;
+  
+  /** An alias for address@hidden CharacterConstants#StrikeThrough}. */
   public static final Object StrikeThrough = CharacterConstants.StrikeThrough;
+  
+  /** An alias for address@hidden CharacterConstants#Subscript}. */
   public static final Object Subscript = CharacterConstants.Subscript;
+  
+  /** An alias for address@hidden CharacterConstants#Superscript}. */
   public static final Object Superscript = CharacterConstants.Superscript;
+  
+  /** An alias for address@hidden CharacterConstants#Underline}. */
   public static final Object Underline = CharacterConstants.Underline;
 
+  /** An alias for address@hidden ParagraphConstants#Alignment}. */
   public static final Object Alignment = ParagraphConstants.Alignment;
-  public static final Object FirstLineIndent = 
ParagraphConstants.FirstLineIndent;
+  
+  /** An alias for address@hidden ParagraphConstants#FirstLineIndent}. */
+  public static final Object FirstLineIndent 
+      = ParagraphConstants.FirstLineIndent;
+  
+  /** An alias for address@hidden ParagraphConstants#LeftIndent}. */
   public static final Object LeftIndent = ParagraphConstants.LeftIndent;
+  
+  /** An alias for address@hidden ParagraphConstants#LineSpacing}. */
   public static final Object LineSpacing = ParagraphConstants.LineSpacing;
+  
+  /** An alias for address@hidden ParagraphConstants#Orientation}. */
   public static final Object Orientation = ParagraphConstants.Orientation;
+  
+  /** An alias for address@hidden ParagraphConstants#RightIndent}. */
   public static final Object RightIndent = ParagraphConstants.RightIndent;
+  
+  /** An alias for address@hidden ParagraphConstants#SpaceAbove}. */
   public static final Object SpaceAbove = ParagraphConstants.SpaceAbove;
+  
+  /** An alias for address@hidden ParagraphConstants#SpaceBelow}. */
   public static final Object SpaceBelow = ParagraphConstants.SpaceBelow;
+  
+  /** An alias for address@hidden ParagraphConstants#TabSet}. */
   public static final Object TabSet = ParagraphConstants.TabSet;
 
   public static final String ComponentElementName = "component";
+
   public static final String IconElementName = "icon";
 
-  public static final Object ComposedTextAttribute = new 
StyleConstants("composed text");
+  public static final Object ComposedTextAttribute 
+      = new StyleConstants("composed text");
+  
   public static final Object ModelAttribute = new StyleConstants("model");
+  
   public static final Object NameAttribute = new StyleConstants("name");
+  
   public static final Object ResolveAttribute = new StyleConstants("resolver");
 
   String keyname;
@@ -93,11 +172,28 @@
     keyname = k;
   }
 
+  /**
+   * Returns a string representation of the attribute key.
+   * 
+   * @return A string representation of the attribute key.
+   */
   public String toString()
   {
     return keyname;
   }
 
+  /**
+   * Returns the alignment specified in the given attributes, or 
+   * address@hidden #ALIGN_LEFT} if no alignment is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The alignment (typically one of address@hidden #ALIGN_LEFT}, 
+   *         address@hidden #ALIGN_RIGHT}, address@hidden #ALIGN_CENTER} or 
+   *         address@hidden #ALIGN_JUSTIFIED}).
+   *         
+   * @see #setAlignment(MutableAttributeSet, int)
+   */
   public static int getAlignment(AttributeSet a)
   {
     if (a.isDefined(Alignment))
@@ -106,6 +202,16 @@
       return ALIGN_LEFT;      
   } 
 
+  /**
+   * Returns the background color specified in the given attributes, or
+   * address@hidden Color#BLACK} if no background color is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The background color.
+   * 
+   * @see #setBackground(MutableAttributeSet, Color)
+   */
   public static Color getBackground(AttributeSet a)
   {
     if (a.isDefined(Background))
@@ -113,7 +219,17 @@
     else
       return Color.WHITE;
   } 
-  
+
+  /**
+   * Returns the bidi level specified in the given attributes, or 
+   * <code>0</code> if no bidi level is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The bidi level.
+   * 
+   * @see #setBidiLevel(MutableAttributeSet, int)
+   */  
   public static int getBidiLevel(AttributeSet a)
   {
     if (a.isDefined(BidiLevel))
@@ -122,6 +238,16 @@
       return 0;
   } 
 
+  /**
+   * Returns the component specified in the given attributes, or 
+   * <code>null</code> if no component is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The component (possibly <code>null</code>).
+   * 
+   * @see #setComponent(MutableAttributeSet, Component)
+   */    
   public static Component getComponent(AttributeSet a)
   {
     if (a.isDefined(ComponentAttribute))
@@ -130,6 +256,16 @@
       return (Component) null;
   } 
 
+  /**
+   * Returns the indentation specified in the given attributes, or 
+   * <code>0.0f</code> if no indentation is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The indentation.
+   * 
+   * @see #setFirstLineIndent(MutableAttributeSet, float)
+   */    
   public static float getFirstLineIndent(AttributeSet a)
   {
     if (a.isDefined(FirstLineIndent))
@@ -138,6 +274,16 @@
       return 0.f;
   } 
 
+  /**
+   * Returns the font family specified in the given attributes, or 
+   * <code>Monospaced</code> if no font family is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The font family.
+   * 
+   * @see #setFontFamily(MutableAttributeSet, String)
+   */    
   public static String getFontFamily(AttributeSet a)
   {
     if (a.isDefined(FontFamily))
@@ -146,6 +292,16 @@
       return "Monospaced";
   } 
 
+  /**
+   * Returns the font size specified in the given attributes, or 
+   * <code>12</code> if no font size is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The font size.
+   * 
+   * @see #setFontSize(MutableAttributeSet, int)
+   */  
   public static int getFontSize(AttributeSet a)
   {
     if (a.isDefined(FontSize))
@@ -154,6 +310,16 @@
       return 12;
   } 
 
+  /**
+   * Returns the foreground color specified in the given attributes, or
+   * address@hidden Color#BLACK} if no foreground color is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The foreground color.
+   * 
+   * @see #setForeground(MutableAttributeSet, Color)
+   */
   public static Color getForeground(AttributeSet a)
   {
     if (a.isDefined(Foreground))
@@ -162,6 +328,16 @@
       return Color.BLACK;
   } 
 
+  /**
+   * Returns the icon specified in the given attributes, or 
+   * <code>null</code> if no icon is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The icon (possibly <code>null</code>).
+   * 
+   * @see #setIcon(MutableAttributeSet, Icon)
+   */    
   public static Icon getIcon(AttributeSet a)
   {
     if (a.isDefined(IconAttribute))
@@ -170,6 +346,16 @@
       return (Icon) null;
   } 
 
+  /**
+   * Returns the left indentation specified in the given attributes, or 
+   * <code>0.0f</code> if no left indentation is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The left indentation.
+   * 
+   * @see #setLeftIndent(MutableAttributeSet, float)
+   */    
   public static float getLeftIndent(AttributeSet a)
   {
     if (a.isDefined(LeftIndent))
@@ -178,6 +364,16 @@
       return 0.f;  
   } 
 
+  /**
+   * Returns the line spacing specified in the given attributes, or 
+   * <code>0.0f</code> if no line spacing is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The line spacing.
+   * 
+   * @see #setLineSpacing(MutableAttributeSet, float)
+   */    
   public static float getLineSpacing(AttributeSet a)
   {
     if (a.isDefined(LineSpacing))
@@ -186,6 +382,16 @@
       return 0.f;  
   } 
 
+  /**
+   * Returns the right indentation specified in the given attributes, or 
+   * <code>0.0f</code> if no right indentation is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The right indentation.
+   * 
+   * @see #setRightIndent(MutableAttributeSet, float)
+   */    
   public static float getRightIndent(AttributeSet a)
   {
     if (a.isDefined(RightIndent))
@@ -194,6 +400,16 @@
       return 0.f;  
   } 
 
+  /**
+   * Returns the 'space above' specified in the given attributes, or 
+   * <code>0.0f</code> if no 'space above' is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The 'space above'.
+   * 
+   * @see #setSpaceAbove(MutableAttributeSet, float)
+   */    
   public static float getSpaceAbove(AttributeSet a)
   {
     if (a.isDefined(SpaceAbove))
@@ -202,6 +418,16 @@
       return 0.f;  
   } 
 
+  /**
+   * Returns the 'space below' specified in the given attributes, or 
+   * <code>0.0f</code> if no 'space below' is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The 'space below'.
+   * 
+   * @see #setSpaceBelow(MutableAttributeSet, float)
+   */    
   public static float getSpaceBelow(AttributeSet a)
   {
     if (a.isDefined(SpaceBelow))
@@ -210,6 +436,16 @@
       return 0.f;  
   } 
 
+  /**
+   * Returns the tab set specified in the given attributes, or 
+   * <code>null</code> if no tab set is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The tab set.
+   * 
+   * @see #setTabSet(MutableAttributeSet, javax.swing.text.TabSet)
+   */    
   public static javax.swing.text.TabSet getTabSet(AttributeSet a)
   {
     if (a.isDefined(StyleConstants.TabSet))
@@ -218,6 +454,16 @@
       return (javax.swing.text.TabSet) null;
   } 
 
+  /**
+   * Returns the value of the bold flag in the given attributes, or 
+   * <code>false</code> if no bold flag is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The bold flag.
+   * 
+   * @see #setBold(MutableAttributeSet, boolean)
+   */
   public static boolean isBold(AttributeSet a)
   {
     if (a.isDefined(Bold))
@@ -226,6 +472,16 @@
       return false;    
   } 
 
+  /**
+   * Returns the value of the italic flag in the given attributes, or 
+   * <code>false</code> if no italic flag is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The italic flag.
+   * 
+   * @see #setItalic(MutableAttributeSet, boolean)
+   */
   public static boolean isItalic(AttributeSet a)
   {
     if (a.isDefined(Italic))
@@ -234,6 +490,16 @@
       return false;    
   } 
 
+  /**
+   * Returns the value of the strike-through flag in the given attributes, or 
+   * <code>false</code> if no strike-through flag is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The strike-through flag.
+   * 
+   * @see #setStrikeThrough(MutableAttributeSet, boolean)
+   */
   public static boolean isStrikeThrough(AttributeSet a)
   {
     if (a.isDefined(StrikeThrough))
@@ -242,6 +508,16 @@
       return false;    
   } 
 
+  /**
+   * Returns the value of the subscript flag in the given attributes, or 
+   * <code>false</code> if no subscript flag is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The subscript flag.
+   * 
+   * @see #setSubscript(MutableAttributeSet, boolean)
+   */
   public static boolean isSubscript(AttributeSet a)
   {
     if (a.isDefined(Subscript))
@@ -250,6 +526,16 @@
       return false;    
   } 
 
+  /**
+   * Returns the value of the superscript flag in the given attributes, or 
+   * <code>false</code> if no superscript flag is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The superscript flag.
+   * 
+   * @see #setSuperscript(MutableAttributeSet, boolean)
+   */
   public static boolean isSuperscript(AttributeSet a)
   {
     if (a.isDefined(Superscript))
@@ -258,6 +544,16 @@
       return false;    
   } 
 
+  /**
+   * Returns the value of the underline flag in the given attributes, or 
+   * <code>false</code> if no underline flag is specified.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * 
+   * @return The underline flag.
+   * 
+   * @see #setUnderline(MutableAttributeSet, boolean)
+   */
   public static boolean isUnderline(AttributeSet a)
   {
     if (a.isDefined(Underline))
@@ -266,106 +562,320 @@
       return false;    
   } 
 
+  /**
+   * Adds an alignment attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param align  the alignment (typically one of 
+   *               address@hidden StyleConstants#ALIGN_LEFT}, 
+   *               address@hidden StyleConstants#ALIGN_RIGHT}, 
+   *               address@hidden StyleConstants#ALIGN_CENTER} or 
+   *               address@hidden StyleConstants#ALIGN_JUSTIFIED}).
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getAlignment(AttributeSet)
+   */
   public static void setAlignment(MutableAttributeSet a, int align)
   {
     a.addAttribute(Alignment, new Integer(align));
   } 
 
-  public static void setBackground(MutableAttributeSet a, Color fg)
-  {
-    a.addAttribute(Background, fg);
-  } 
-
+  /**
+   * Adds a background attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param bg  the background (<code>null</code> not permitted).
+   * 
+   * @throws NullPointerException if either argument is <code>null</code>.
+   * 
+   * @see #getBackground(AttributeSet)
+   */
+  public static void setBackground(MutableAttributeSet a, Color bg)
+  {
+    a.addAttribute(Background, bg);
+  } 
+
+  /**
+   * Adds a bidi-level attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param lev  the level.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getBidiLevel(AttributeSet)
+   */
   public static void setBidiLevel(MutableAttributeSet a, int lev)
   {
     a.addAttribute(BidiLevel, new Integer(lev));
   } 
 
+  /**
+   * Adds a bold attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param b  the new value of the bold attribute.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #isBold(AttributeSet)
+   */
   public static void setBold(MutableAttributeSet a, boolean b)
   {
     a.addAttribute(Bold, Boolean.valueOf(b));
   } 
   
+  /**
+   * Adds a component attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param c  the component (<code>null</code> not permitted).
+   * 
+   * @throws NullPointerException if either argument is <code>null</code>.
+   * 
+   * @see #getComponent(AttributeSet)
+   */
   public static void setComponent(MutableAttributeSet a, Component c)
   {
     a.addAttribute(ComponentAttribute, c);
   } 
 
+  /**
+   * Adds a first line indentation attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param i  the indentation.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getFirstLineIndent(AttributeSet)
+   */
   public static void setFirstLineIndent(MutableAttributeSet a, float i)
   {
     a.addAttribute(FirstLineIndent, new Float(i));
   } 
 
+  /**
+   * Adds a font family attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param fam  the font family name (<code>null</code> not permitted).
+   * 
+   * @throws NullPointerException if either argument is <code>null</code>.
+   * 
+   * @see #getFontFamily(AttributeSet)
+   */
   public static void setFontFamily(MutableAttributeSet a, String fam)
   {
     a.addAttribute(FontFamily, fam);
   } 
 
+  /**
+   * Adds a font size attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param s  the font size (in points).
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getFontSize(AttributeSet)
+   */
   public static void setFontSize(MutableAttributeSet a, int s)
   {
     a.addAttribute(FontSize, new Integer(s));
   } 
 
+  /**
+   * Adds a foreground color attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param fg  the foreground color (<code>null</code> not permitted).
+   * 
+   * @throws NullPointerException if either argument is <code>null</code>.
+   * 
+   * @see #getForeground(AttributeSet)
+   */
   public static void setForeground(MutableAttributeSet a, Color fg)
   {
     a.addAttribute(Foreground, fg);
   }
 
+  /**
+   * Adds an icon attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param c  the icon (<code>null</code> not permitted).
+   * 
+   * @throws NullPointerException if either argument is <code>null</code>.
+   * 
+   * @see #getIcon(AttributeSet)
+   */
   public static void setIcon(MutableAttributeSet a, Icon c)
   {
     a.addAttribute(IconAttribute, c);
   }
  
+  /**
+   * Adds an italic attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param b  the new value of the italic attribute.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #isItalic(AttributeSet)
+   */
   public static void setItalic(MutableAttributeSet a, boolean b)
   {
     a.addAttribute(Italic, Boolean.valueOf(b));
   }
  
+  /**
+   * Adds a left indentation attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param i  the indentation.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getLeftIndent(AttributeSet)
+   */
   public static void setLeftIndent(MutableAttributeSet a, float i)
   {
     a.addAttribute(LeftIndent, new Float(i));
   } 
 
+  /**
+   * Adds a line spacing attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param i  the line spacing.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getLineSpacing(AttributeSet)
+   */
   public static void setLineSpacing(MutableAttributeSet a, float i)
   {
     a.addAttribute(LineSpacing, new Float(i));
   } 
 
+  /**
+   * Adds a right indentation attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param i  the right indentation.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getRightIndent(AttributeSet)
+   */
   public static void setRightIndent(MutableAttributeSet a, float i)
   {
     a.addAttribute(RightIndent, new Float(i));
   } 
 
+  /**
+   * Adds a 'space above' attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param i  the space above attribute value.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getSpaceAbove(AttributeSet)
+   */
   public static void setSpaceAbove(MutableAttributeSet a, float i)
   {
     a.addAttribute(SpaceAbove, new Float(i));
   } 
 
+  /**
+   * Adds a 'space below' attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param i  the space below attribute value.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #getSpaceBelow(AttributeSet)
+   */
   public static void setSpaceBelow(MutableAttributeSet a, float i)
   {
     a.addAttribute(SpaceBelow, new Float(i));
   } 
 
+  /**
+   * Adds a strike-through attribue to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param b  the strike-through attribute value.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #isStrikeThrough(AttributeSet)
+   */
   public static void setStrikeThrough(MutableAttributeSet a, boolean b)
   {
     a.addAttribute(StrikeThrough, Boolean.valueOf(b));
   } 
 
+  /**
+   * Adds a subscript attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param b  the subscript attribute value.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #isSubscript(AttributeSet)
+   */
   public static void setSubscript(MutableAttributeSet a, boolean b)
   {
     a.addAttribute(Subscript, Boolean.valueOf(b));
   } 
 
+  /**
+   * Adds a superscript attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param b  the superscript attribute value.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #isSuperscript(AttributeSet)
+   */
   public static void setSuperscript(MutableAttributeSet a, boolean b)
   {
     a.addAttribute(Superscript, Boolean.valueOf(b));
   } 
 
+  /**
+   * Adds a address@hidden TabSet} attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param tabs  the tab set (<code>null</code> not permitted).
+   * 
+   * @throws NullPointerException if either argument is <code>null</code>.
+   * 
+   * @see #getTabSet(AttributeSet)
+   */
   public static void setTabSet(MutableAttributeSet a, javax.swing.text.TabSet 
tabs)
   {
     a.addAttribute(StyleConstants.TabSet, tabs);
   } 
 
+  /**
+   * Adds an underline attribute to the specified set.
+   * 
+   * @param a  the attribute set (<code>null</code> not permitted).
+   * @param b  the underline attribute value.
+   * 
+   * @throws NullPointerException if <code>a</code> is <code>null</code>.
+   * 
+   * @see #isUnderline(AttributeSet)
+   */
   public static void setUnderline(MutableAttributeSet a, boolean b)
   {
     a.addAttribute(Underline, Boolean.valueOf(b));
@@ -373,73 +883,164 @@
 
   // The remainder are so-called "typesafe enumerations" which 
   // alias subsets of the above constants.
+
+  /**
+   * A set of keys for attributes that apply to characters.
+   */
   public static class CharacterConstants
     extends StyleConstants
     implements AttributeSet.CharacterAttribute
   {
+    /**
+     * Private constructor prevents new instances being created.
+     * 
+     * @param k  the key name.
+     */
     private CharacterConstants(String k) 
     {
       super(k);
     }
     
+    /** An alias for address@hidden ColorConstants#Background}. */
     public static Object Background = ColorConstants.Background;
+    
+    /** A key for the bidi level character attribute. */
     public static Object BidiLevel = new CharacterConstants("bidiLevel");
+    
+    /** An alias for address@hidden FontConstants#Bold}. */
     public static Object Bold = FontConstants.Bold;
+    
+    /** A key for the component character attribute. */
     public static Object ComponentAttribute = new 
CharacterConstants("component");
+    
+    /** An alias for address@hidden FontConstants#Family}. */
     public static Object Family = FontConstants.Family;
+    
+    /** An alias for address@hidden FontConstants#Size}. */
     public static Object Size = FontConstants.Size;
+    
+    /** An alias for address@hidden ColorConstants#Foreground}. */
     public static Object Foreground = ColorConstants.Foreground;
+    
+    /** A key for the icon character attribute. */
     public static Object IconAttribute = new CharacterConstants("icon");
+    
+    /** A key for the italic character attribute. */
     public static Object Italic = FontConstants.Italic;
+    
+    /** A key for the strike through character attribute. */
     public static Object StrikeThrough = new 
CharacterConstants("strikethrough");
+    
+    /** A key for the subscript character attribute. */
     public static Object Subscript = new CharacterConstants("subscript");
+    
+    /** A key for the superscript character attribute. */
     public static Object Superscript = new CharacterConstants("superscript");
+    
+    /** A key for the underline character attribute. */
     public static Object Underline = new CharacterConstants("underline");
+  
   }
 
+  /**
+   * A set of keys for attributes that relate to colors.
+   */
   public static class ColorConstants
     extends StyleConstants
     implements AttributeSet.ColorAttribute, AttributeSet.CharacterAttribute
   {
+    /**
+     * Private constructor prevents new instances being created.
+     * 
+     * @param k  the key name.
+     */
     private ColorConstants(String k) 
     {
       super(k);
     }
+    
+    /** A key for the foreground color attribute. */
     public static Object Foreground = new ColorConstants("foreground");
+
+    /** A key for the background color attribute. */
     public static Object Background = new ColorConstants("background");
   }
 
+  /**
+   * A set of keys for attributes that apply to fonts.
+   */
   public static class FontConstants
     extends StyleConstants
     implements AttributeSet.FontAttribute, AttributeSet.CharacterAttribute
   {
+    /**
+     * Private constructor prevents new instances being created.
+     * 
+     * @param k  the key name.
+     */
     private FontConstants(String k) 
     {
       super(k);
     }
+    
+    /** A key for the bold font attribute. */
     public static Object Bold = new FontConstants("bold");
+
+    /** A key for the family font attribute. */
     public static Object Family = new FontConstants("family");
+    
+    /** A key for the italic font attribute. */
     public static Object Italic = new FontConstants("italic");
+    
+    /** A key for the size font attribute. */
     public static Object Size = new FontConstants("size");
   }
 
+  /**
+   * A set of keys for attributes that apply to paragraphs.
+   */
   public static class ParagraphConstants
     extends StyleConstants
     implements AttributeSet.ParagraphAttribute
   {
+    /**
+     * Private constructor prevents new instances being created.
+     * 
+     * @param k  the key name.
+     */
     private ParagraphConstants(String k) 
     {
       super(k);
     }
+    
+    /** A key for the alignment paragraph attribute. */
     public static Object Alignment = new ParagraphConstants("Alignment");
-    public static Object FirstLineIndent = new 
ParagraphConstants("FirstLineIndent");
+
+    /** A key for the first line indentation paragraph attribute. */
+    public static Object FirstLineIndent 
+        = new ParagraphConstants("FirstLineIndent");
+    
+    /** A key for the left indentation paragraph attribute. */
     public static Object LeftIndent = new ParagraphConstants("LeftIndent");
+    
+    /** A key for the line spacing paragraph attribute. */
     public static Object LineSpacing = new ParagraphConstants("LineSpacing");
+    
+    /** A key for the orientation paragraph attribute. */
     public static Object Orientation = new ParagraphConstants("Orientation");
+    
+    /** A key for the right indentation paragraph attribute. */
     public static Object RightIndent = new ParagraphConstants("RightIndent");
+    
+    /** A key for the 'space above' paragraph attribute. */
     public static Object SpaceAbove = new ParagraphConstants("SpaceAbove");
+    
+    /** A key for the 'space below' paragraph attribute. */
     public static Object SpaceBelow = new ParagraphConstants("SpaceBelow");
+    
+    /** A key for the tabset paragraph attribute. */
     public static Object TabSet = new ParagraphConstants("TabSet");
+    
   }
 
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]