/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* <p>
* A collection of <em>well known</em> or common attribute keys
* and methods to apply to an AttributeSet or MutableAttributeSet
* <p>
* The paragraph attributes form the definition of a paragraph to be rendered.
* All sizes are specified in points (such as found in postscript), a
* device independent measure.
* </p>
* <p align=center><img src="doc-files/paragraph.gif"
* alt="Diagram shows SpaceAbove, FirstLineIndent, LeftIndent, RightIndent,
* and SpaceBelow a paragraph."></p>
* <p>
*
* @author Timothy Prinzing
*/
public class StyleConstants {
/**
* Name of elements used to represent components.
*/
/**
* Name of elements used to represent icons.
*/
/**
* Attribute name used to name the collection of
* attributes.
*/
/**
* Attribute name used to identifiy the resolving parent
* set of attributes, if one is defined.
*/
/**
* Attribute used to identify the model for embedded
* objects that have a model view separation.
*/
/**
* Returns the string representation.
*
* @return the string
*/
return representation;
}
// ---- character constants -----------------------------------
/**
* Bidirectional level of a character as assigned by the Unicode bidi
* algorithm.
*/
/**
* Name of the font family.
*/
/**
* Name of the font family.
*
* @since 1.5
*/
/**
* Name of the font size.
*/
/**
* Name of the font size.
*
* @since 1.5
*/
/**
* Name of the bold attribute.
*/
/**
* Name of the italic attribute.
*/
/**
* Name of the underline attribute.
*/
/**
* Name of the Strikethrough attribute.
*/
/**
* Name of the Superscript attribute.
*/
/**
* Name of the Subscript attribute.
*/
/**
* Name of the foreground color attribute.
*/
/**
* Name of the background color attribute.
*/
/**
* Name of the component attribute.
*/
/**
* Name of the icon attribute.
*/
/**
* Name of the input method composed text attribute. The value of
* this attribute is an instance of AttributedString which represents
* the composed text.
*/
/**
* The amount of space to indent the first
* line of the paragraph. This value may be negative
* to offset in the reverse direction. The type
* is Float and specifies the size of the space
* in points.
*/
/**
* The amount to indent the left side
* of the paragraph.
* Type is float and specifies the size in points.
*/
/**
* The amount to indent the right side
* of the paragraph.
* Type is float and specifies the size in points.
*/
/**
* The amount of space between lines
* of the paragraph.
* Type is float and specifies the size as a factor of the line height
*/
/**
* The amount of space above the paragraph.
* Type is float and specifies the size in points.
*/
/**
* The amount of space below the paragraph.
* Type is float and specifies the size in points.
*/
/**
* Alignment for the paragraph. The type is
* Integer. Valid values are:
* <ul>
* <li>ALIGN_LEFT
* <li>ALIGN_RIGHT
* <li>ALIGN_CENTER
* <li>ALIGN_JUSTIFED
* </ul>
*
*/
/**
* TabSet for the paragraph, type is a TabSet containing
* TabStops.
*/
/**
* Orientation for a paragraph.
*/
/**
* A possible value for paragraph alignment. This
* specifies that the text is aligned to the left
* indent and extra whitespace should be placed on
* the right.
*/
/**
* A possible value for paragraph alignment. This
* specifies that the text is aligned to the center
* and extra whitespace should be placed equally on
* the left and right.
*/
/**
* A possible value for paragraph alignment. This
* specifies that the text is aligned to the right
* indent and extra whitespace should be placed on
* the left.
*/
/**
* A possible value for paragraph alignment. This
* specifies that extra whitespace should be spread
* out through the rows of the paragraph with the
* text lined up with the left and right indent
* except on the last line which should be aligned
* to the left.
*/
// --- character attribute accessors ---------------------------
/**
* Gets the BidiLevel setting.
*
* @param a the attribute set
* @return the value
*/
if (o != null) {
return o.intValue();
}
return 0; // Level 0 is base level (non-embedded) left-to-right
}
/**
* Sets the BidiLevel.
*
* @param a the attribute set
* @param o the bidi level value
*/
}
/**
* Gets the component setting from the attribute list.
*
* @param a the attribute set
* @return the component, null if none
*/
}
/**
* Sets the component attribute.
*
* @param a the attribute set
* @param c the component
*/
a.addAttribute(ComponentAttribute, c);
}
/**
* Gets the icon setting from the attribute list.
*
* @param a the attribute set
* @return the icon, null if none
*/
}
/**
* Sets the icon attribute.
*
* @param a the attribute set
* @param c the icon
*/
a.addAttribute(IconAttribute, c);
}
/**
* Gets the font family setting from the attribute list.
*
* @param a the attribute set
* @return the font family, "Monospaced" as the default
*/
family = "Monospaced";
}
return family;
}
/**
* Sets the font attribute.
*
* @param a the attribute set
* @param fam the font
*/
}
/**
* Gets the font size setting from the attribute list.
*
* @param a the attribute set
* @return the font size, 12 as the default
*/
}
return 12;
}
/**
* Sets the font size attribute.
*
* @param a the attribute set
* @param s the font size
*/
}
/**
* Checks whether the bold attribute is set.
*
* @param a the attribute set
* @return true if set else false
*/
return bold.booleanValue();
}
return false;
}
/**
* Sets the bold attribute.
*
* @param a the attribute set
*/
}
/**
* Checks whether the italic attribute is set.
*
* @param a the attribute set
* @return true if set else false
*/
return italic.booleanValue();
}
return false;
}
/**
* Sets the italic attribute.
*
* @param a the attribute set
*/
}
/**
* Checks whether the underline attribute is set.
*
* @param a the attribute set
* @return true if set else false
*/
return underline.booleanValue();
}
return false;
}
/**
* Checks whether the strikethrough attribute is set.
*
* @param a the attribute set
* @return true if set else false
*/
return strike.booleanValue();
}
return false;
}
/**
* Checks whether the superscript attribute is set.
*
* @param a the attribute set
* @return true if set else false
*/
if (superscript != null) {
return superscript.booleanValue();
}
return false;
}
/**
* Checks whether the subscript attribute is set.
*
* @param a the attribute set
* @return true if set else false
*/
return subscript.booleanValue();
}
return false;
}
/**
* Sets the underline attribute.
*
* @param a the attribute set
*/
}
/**
* Sets the strikethrough attribute.
*
* @param a the attribute set
*/
}
/**
* Sets the superscript attribute.
*
* @param a the attribute set
*/
}
/**
* Sets the subscript attribute.
*
* @param a the attribute set
*/
}
/**
* Gets the foreground color setting from the attribute list.
*
* @param a the attribute set
* @return the color, Color.black as the default
*/
}
return fg;
}
/**
* Sets the foreground color.
*
* @param a the attribute set
* @param fg the color
*/
}
/**
* Gets the background color setting from the attribute list.
*
* @param a the attribute set
* @return the color, Color.black as the default
*/
}
return fg;
}
/**
* Sets the background color.
*
* @param a the attribute set
* @param fg the color
*/
}
// --- paragraph attribute accessors ----------------------------
/**
* Gets the first line indent setting.
*
* @param a the attribute set
* @return the value, 0 if not set
*/
return indent.floatValue();
}
return 0;
}
/**
* Sets the first line indent.
*
* @param a the attribute set
* @param i the value
*/
}
/**
* Gets the right indent setting.
*
* @param a the attribute set
* @return the value, 0 if not set
*/
return indent.floatValue();
}
return 0;
}
/**
* Sets right indent.
*
* @param a the attribute set
* @param i the value
*/
}
/**
* Gets the left indent setting.
*
* @param a the attribute set
* @return the value, 0 if not set
*/
return indent.floatValue();
}
return 0;
}
/**
* Sets left indent.
*
* @param a the attribute set
* @param i the value
*/
}
/**
* Gets the line spacing setting.
*
* @param a the attribute set
* @return the value, 0 if not set
*/
return space.floatValue();
}
return 0;
}
/**
* Sets line spacing.
*
* @param a the attribute set
* @param i the value
*/
}
/**
* Gets the space above setting.
*
* @param a the attribute set
* @return the value, 0 if not set
*/
return space.floatValue();
}
return 0;
}
/**
* Sets space above.
*
* @param a the attribute set
* @param i the value
*/
}
/**
* Gets the space below setting.
*
* @param a the attribute set
* @return the value, 0 if not set
*/
return space.floatValue();
}
return 0;
}
/**
* Sets space below.
*
* @param a the attribute set
* @param i the value
*/
}
/**
* Gets the alignment setting.
*
* @param a the attribute set
* @return the value <code>StyleConstants.ALIGN_LEFT</code> if not set
*/
}
return ALIGN_LEFT;
}
/**
* Sets alignment.
*
* @param a the attribute set
* @param align the alignment value
*/
}
/**
* Gets the TabSet.
*
* @param a the attribute set
* @return the <code>TabSet</code>
*/
// PENDING: should this return a default?
return tabs;
}
/**
* Sets the TabSet.
*
* @param a the attribute set.
* @param tabs the TabSet
*/
}
// --- privates ---------------------------------------------
};
this.representation = representation;
}
/**
* This is a typesafe enumeration of the <em>well-known</em>
* attributes that contribute to a paragraph style. These are
* aliased by the outer class for general presentation.
*/
implements AttributeSet.ParagraphAttribute {
super(representation);
}
}
/**
* This is a typesafe enumeration of the <em>well-known</em>
* attributes that contribute to a character style. These are
* aliased by the outer class for general presentation.
*/
implements AttributeSet.CharacterAttribute {
super(representation);
}
}
/**
* This is a typesafe enumeration of the <em>well-known</em>
* attributes that contribute to a color. These are aliased
* by the outer class for general presentation.
*/
super(representation);
}
}
/**
* This is a typesafe enumeration of the <em>well-known</em>
* attributes that contribute to a font. These are aliased
* by the outer class for general presentation.
*/
super(representation);
}
}
}