Method from javax.swing.text.StyleConstants Detail: |
public static int getAlignment(AttributeSet a) {
Integer align = (Integer) a.getAttribute(Alignment);
if (align != null) {
return align.intValue();
}
return ALIGN_LEFT;
}
Gets the alignment setting. |
public static Color getBackground(AttributeSet a) {
Color fg = (Color) a.getAttribute(Background);
if (fg == null) {
fg = Color.black;
}
return fg;
}
Gets the background color setting from the attribute list. |
public static int getBidiLevel(AttributeSet a) {
Integer o = (Integer) a.getAttribute(BidiLevel);
if (o != null) {
return o.intValue();
}
return 0; // Level 0 is base level (non-embedded) left-to-right
}
Gets the BidiLevel setting. |
public static Component getComponent(AttributeSet a) {
return (Component) a.getAttribute(ComponentAttribute);
}
Gets the component setting from the attribute list. |
public static float getFirstLineIndent(AttributeSet a) {
Float indent = (Float) a.getAttribute(FirstLineIndent);
if (indent != null) {
return indent.floatValue();
}
return 0;
}
Gets the first line indent setting. |
public static String getFontFamily(AttributeSet a) {
String family = (String) a.getAttribute(FontFamily);
if (family == null) {
family = "Monospaced";
}
return family;
}
Gets the font family setting from the attribute list. |
public static int getFontSize(AttributeSet a) {
Integer size = (Integer) a.getAttribute(FontSize);
if (size != null) {
return size.intValue();
}
return 12;
}
Gets the font size setting from the attribute list. |
public static Color getForeground(AttributeSet a) {
Color fg = (Color) a.getAttribute(Foreground);
if (fg == null) {
fg = Color.black;
}
return fg;
}
Gets the foreground color setting from the attribute list. |
public static Icon getIcon(AttributeSet a) {
return (Icon) a.getAttribute(IconAttribute);
}
Gets the icon setting from the attribute list. |
public static float getLeftIndent(AttributeSet a) {
Float indent = (Float) a.getAttribute(LeftIndent);
if (indent != null) {
return indent.floatValue();
}
return 0;
}
Gets the left indent setting. |
public static float getLineSpacing(AttributeSet a) {
Float space = (Float) a.getAttribute(LineSpacing);
if (space != null) {
return space.floatValue();
}
return 0;
}
Gets the line spacing setting. |
public static float getRightIndent(AttributeSet a) {
Float indent = (Float) a.getAttribute(RightIndent);
if (indent != null) {
return indent.floatValue();
}
return 0;
}
Gets the right indent setting. |
public static float getSpaceAbove(AttributeSet a) {
Float space = (Float) a.getAttribute(SpaceAbove);
if (space != null) {
return space.floatValue();
}
return 0;
}
Gets the space above setting. |
public static float getSpaceBelow(AttributeSet a) {
Float space = (Float) a.getAttribute(SpaceBelow);
if (space != null) {
return space.floatValue();
}
return 0;
}
Gets the space below setting. |
public static TabSet getTabSet(AttributeSet a) {
TabSet tabs = (TabSet)a.getAttribute(TabSet);
// PENDING: should this return a default?
return tabs;
}
|
public static boolean isBold(AttributeSet a) {
Boolean bold = (Boolean) a.getAttribute(Bold);
if (bold != null) {
return bold.booleanValue();
}
return false;
}
Checks whether the bold attribute is set. |
public static boolean isItalic(AttributeSet a) {
Boolean italic = (Boolean) a.getAttribute(Italic);
if (italic != null) {
return italic.booleanValue();
}
return false;
}
Checks whether the italic attribute is set. |
public static boolean isStrikeThrough(AttributeSet a) {
Boolean strike = (Boolean) a.getAttribute(StrikeThrough);
if (strike != null) {
return strike.booleanValue();
}
return false;
}
Checks whether the strikethrough attribute is set. |
public static boolean isSubscript(AttributeSet a) {
Boolean subscript = (Boolean) a.getAttribute(Subscript);
if (subscript != null) {
return subscript.booleanValue();
}
return false;
}
Checks whether the subscript attribute is set. |
public static boolean isSuperscript(AttributeSet a) {
Boolean superscript = (Boolean) a.getAttribute(Superscript);
if (superscript != null) {
return superscript.booleanValue();
}
return false;
}
Checks whether the superscript attribute is set. |
public static boolean isUnderline(AttributeSet a) {
Boolean underline = (Boolean) a.getAttribute(Underline);
if (underline != null) {
return underline.booleanValue();
}
return false;
}
Checks whether the underline attribute is set. |
public static void setAlignment(MutableAttributeSet a,
int align) {
a.addAttribute(Alignment, Integer.valueOf(align));
}
|
public static void setBackground(MutableAttributeSet a,
Color fg) {
a.addAttribute(Background, fg);
}
Sets the background color. |
public static void setBidiLevel(MutableAttributeSet a,
int o) {
a.addAttribute(BidiLevel, Integer.valueOf(o));
}
|
public static void setBold(MutableAttributeSet a,
boolean b) {
a.addAttribute(Bold, Boolean.valueOf(b));
}
|
public static void setComponent(MutableAttributeSet a,
Component c) {
a.addAttribute(AbstractDocument.ElementNameAttribute, ComponentElementName);
a.addAttribute(ComponentAttribute, c);
}
Sets the component attribute. |
public static void setFirstLineIndent(MutableAttributeSet a,
float i) {
a.addAttribute(FirstLineIndent, new Float(i));
}
Sets the first line indent. |
public static void setFontFamily(MutableAttributeSet a,
String fam) {
a.addAttribute(FontFamily, fam);
}
|
public static void setFontSize(MutableAttributeSet a,
int s) {
a.addAttribute(FontSize, Integer.valueOf(s));
}
Sets the font size attribute. |
public static void setForeground(MutableAttributeSet a,
Color fg) {
a.addAttribute(Foreground, fg);
}
Sets the foreground color. |
public static void setIcon(MutableAttributeSet a,
Icon c) {
a.addAttribute(AbstractDocument.ElementNameAttribute, IconElementName);
a.addAttribute(IconAttribute, c);
}
|
public static void setItalic(MutableAttributeSet a,
boolean b) {
a.addAttribute(Italic, Boolean.valueOf(b));
}
Sets the italic attribute. |
public static void setLeftIndent(MutableAttributeSet a,
float i) {
a.addAttribute(LeftIndent, new Float(i));
}
|
public static void setLineSpacing(MutableAttributeSet a,
float i) {
a.addAttribute(LineSpacing, new Float(i));
}
|
public static void setRightIndent(MutableAttributeSet a,
float i) {
a.addAttribute(RightIndent, new Float(i));
}
|
public static void setSpaceAbove(MutableAttributeSet a,
float i) {
a.addAttribute(SpaceAbove, new Float(i));
}
|
public static void setSpaceBelow(MutableAttributeSet a,
float i) {
a.addAttribute(SpaceBelow, new Float(i));
}
|
public static void setStrikeThrough(MutableAttributeSet a,
boolean b) {
a.addAttribute(StrikeThrough, Boolean.valueOf(b));
}
Sets the strikethrough attribute. |
public static void setSubscript(MutableAttributeSet a,
boolean b) {
a.addAttribute(Subscript, Boolean.valueOf(b));
}
Sets the subscript attribute. |
public static void setSuperscript(MutableAttributeSet a,
boolean b) {
a.addAttribute(Superscript, Boolean.valueOf(b));
}
Sets the superscript attribute. |
public static void setTabSet(MutableAttributeSet a,
TabSet tabs) {
a.addAttribute(TabSet, tabs);
}
|
public static void setUnderline(MutableAttributeSet a,
boolean b) {
a.addAttribute(Underline, Boolean.valueOf(b));
}
Sets the underline attribute. |
public String toString() {
return representation;
}
Returns the string representation. |