Web hosting plans - Java Swing - O Reilly 21.1.2.4 Alignment Value Constants
Monday, November 26th, 2007Java Swing - O Reilly 21.1.2.4 Alignment Value Constants StyleConstants also defines four attribute values for the Alignment attribute, shown in Table 21.4. Table 21.4, StyleConstants.Alignment Attribute Value Constants Name Data Type Description ALIGN_CENTER int Align text to the center with equal whitespace on the left and right. ALIGN_JUSTIFIED int Align text such that all whitespace is spread out, leaving text aligned on both the left and right margins. The last line should have left alignment. ALIGN_LEFT int Align text to the left with whitespace on the right. ALIGN_RIGHT int Align text to the right with whitespace on the left. 21.1.2.5 Element Name Constants AbstractDocument defines a constant called ElementNameAttribute , used as a key to store the name of an Element in its AttributeSet (see Table 21.5). StyleConstants defines two possible values for this attribute, used when the Element does not contain textual data. This attribute is not limited to these two values; these are just constants for special case Element names. Table 21.5, AbstractDocument.ElementNameAttribute Value Constants Name Data Type Description ComponentElementName String Used when the Elementcontains a Componentinstead of text. IconElementName String Used when the Element contains an Icon instead of text. 21.1.2.6 Lookup and Update Methods StyleConstants defines static methods to access and set each of the attributes for which it defines constant keys. Each accessor method takes an AttributeSet, while the update methods require a MutableAttributeSet as input. These methods handle the conversions between Java primitive types and the wrapper classes Float, Integer, and Boolean (remember, all attribute values are of type Object, so primitive attribute values must be wrapped in objects), so that all interfaces are able to use the primitive types. public static int getAlignment(AttributeSet a) public static Color getBackground(AttributeSet a) public static int getBidiLevel(AttribuetSet a) public static boolean isBold(AttributeSet a) public static Component getComponent(AttributeSet a) public static float getFirstLineIndent(AttributeSet a) public static String getFontFamily(AttributeSet a) public static int getFontSize(AttributeSet a) public static Color getForeground(AttributeSet a) public static Icon getIcon(AttributeSet a) public static boolean isItalic(AttributeSet a) public static float getLeftIndent(AttributeSet a) public static float getLineSpacing(AttributeSet a) public static float getRightIndent(AttributeSet a) public static float getSpaceAbove(AttributeSet a) public static float getSpaceBelow(AttributeSet a) public static TabSet getTabSet(AttributeSet a) - 700
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.