⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 textattribute.java

📁 JAVA基本类源代码,大家可以学习学习!
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
     */    public static final TextAttribute WIDTH = new TextAttribute("width");    /**     * The most condensed predefined width.     * @see #WIDTH     */    public static final Float WIDTH_CONDENSED = new Float(0.75f);    /**     * A moderately condensed width.     * @see #WIDTH     */    public static final Float WIDTH_SEMI_CONDENSED = new Float(0.875f);    /**     * The standard width. This width is used if WIDTH is unspecified.     * @see #WIDTH     */    public static final Float WIDTH_REGULAR = new Float(1.0f);    /**     * A moderately extended width.     * @see #WIDTH     */    public static final Float WIDTH_SEMI_EXTENDED = new Float(1.25f);    /**     * The most extended predefined width.     * @see #WIDTH     */    public static final Float WIDTH_EXTENDED = new Float(1.5f);    /**     * Attribute key for the posture of a font.     *     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Constants, Default, Description,      *     and Fallback for TextAttribute POSTURE">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">POSTURE</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">Float</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Constants</TH>     * <TD VALIGN="TOP">POSTURE_REGULAR = 0, <BR>     * POSTURE_OBLIQUE = 0.20</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">POSTURE_REGULAR</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">The value is interpreted generally as a skew slope,      * positive leans to the right. If the font has a different value for     * specific constants, then the value is interpolated as described in     * the class description. With fonts that have italic faces, not only     * the skew of the character changes, but also the letter shapes     * might change.<BR>     * <B>Notes: </B><BR>     * To set the value by angle, use:<BR>     * <TT>value = new Float(Math.tan(Math.PI*degrees/180.0)</TT><BR>     * To determine the angle from the value, use:<BR>     * <TT>angle = Math.atan(value.floatValue())*180/Math.PI</TT></TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Fallback</TH>     * <TD VALIGN="TOP">If an Oblique font is available and matches, use that.      * Otherwise skew with a transform using the posture value interpreted as      * run/rise.</TD></TR>     * </TABLE>     *     * @see java.awt.Font#getItalicAngle()     */    public static final TextAttribute POSTURE = new TextAttribute("posture");    /**     * The standard posture, upright.     * @see #POSTURE     */    public static final Float POSTURE_REGULAR = new Float(0.0f);    /**     * The standard italic posture.     * @see #POSTURE     */    public static final Float POSTURE_OBLIQUE = new Float(0.20f);    /**     * Attribute key for the font size.     *     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Default, Description, and Fallback      *     for TextAttribute SIZE">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">SIZE</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">Float</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">from System Properties</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">Represents point size. Note that the appearance and      * metrics of a 12pt font with a 2X transform might be different than     * that of a 24 point font with no transform.</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Fallback</TH>     * <TD VALIGN="TOP">Scale to provided size.</TD></TR>     * </TABLE>     */    public static final TextAttribute SIZE = new TextAttribute("size");    /**     * Attribute key for the transform of a font.     *     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Default, and Description for      *     TextAttribute TRANSFORM">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">TRANSFORM</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">TransformAttribute</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">Identity transform</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP"><P>Used to transform glyphs rendered by this font. The      * primary intent is to support scaling, skewing, and translation. In     * general, large rotations do not produce very useful results. The     * transform modifies both the glyph and the advance. The translations     * in the transform are interpreted as a ratio of the point size. That     * is, with a point size of 12, a translation of 0.5 results in a     * movement of 6 points.     * <p>     * The advance point of the transformed glyph is the transform of the      * advance point projected onto the baseline. If the advance ends up     * to the left (top) of the glyph origin, the two points are swapped.     * <p>     * <P><EM>Example one</EM>: The point      * size is 20, the original advance is 10.0, and the transform is a 60      * degree counterclockwise rotation plus an offset up and to the right      * of 0.1, -0.1. The translation results in an offset of &lt;2.0, -2.0&gt;.     * The original advance point is &lt;10.0, 0.0&gt;; after the rotation it      * is &lt;6.0, -8.0&gt;; when adding the offset this becomes      * &lt;8.0,-10.0&gt;, when projecting on the (horizontal) baseline this     * becomes the new advance point: &lt;8.0, 0.0&gt;. The advance width is     * the distance from the origin to the advance point: 8.0. The rotated     * glyph is rendered two points up and to the right of its origin and     * rotated.  This does not affect the baseline for subsequent     * glyphs.</P></TD></TR>     * </TABLE>     */    public static final TextAttribute TRANSFORM = new TextAttribute("transform");    /**     * Attribute key for super and subscripting.     *     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Constants, Default, Description,      *     and Fallback for TextAttribute SUPERSCRIPT">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">SUPERSCRIPT</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">Integer</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Constants</TH>     * <TD VALIGN="TOP">SUPERSCRIPT_NONE = 0,<BR>     * SUPERSCRIPT_SUPER = 1,<BR>     * SUPERSCRIPT_SUB = -1</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">SUPERSCRIPT_NONE</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">Requests that the font display the characters with      * glyphs at a particular superscript level: 0 = none, 1 =     * superscript, 2 = superscript of superscript,...-1     * = subscript, -2 = subscript of subscript,... Requests that the font      * display text using default superscript (or subscript) glyphs and/or     * scaling.</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Fallback</TH>     * <TD VALIGN="TOP">Use transform with translation of +/-1/2 and scale      * of 2/3, progressively for each level. That is, for the transform at     * level N (with N != 0):<BR>     * <TT>offset = sign(N)*1/2*(2/3)^(abs(N)-1)<BR>     * scale = (2/3)^abs(N)</TT></TD></TR>     * </TABLE>     */    public static final TextAttribute SUPERSCRIPT = new TextAttribute("superscript");    /**     * Standard superscript.     * @see #SUPERSCRIPT     */    public static final Integer SUPERSCRIPT_SUPER = new Integer(1);    /**     * Standard subscript.     * @see #SUPERSCRIPT     */    public static final Integer SUPERSCRIPT_SUB = new Integer(-1);    /**     * Attribute key for the font to use to render text.     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Default, and Description for TextAttribute FONT">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">FONT</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">Font</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">None, perform default resolution</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">A way for users to override the resolution of font      * attributes into a <code>Font</code>, or force use of a particular     * <code>Font</code> instance.     * This also allows users to specify subclasses of <code>Font</code> in      * cases where a <code>Font</code> can be subclassed.</TD></TR>     * </TABLE>     */    public static final TextAttribute FONT = new TextAttribute("font");    /**     * Attribute key for a user_defined glyph to display in the text in lieu      * of a character.     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, and Description for TextAttribute CHAR_REPLACEMENT">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">CHAR_REPLACEMENT</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">GraphicAttribute</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">Allows the user to specify an empty position plus      * metric information. This method is used to reserve space for a graphic     * or other embedded component. Required for     * correct BIDI position of 'inline' components within a line. An optional     * convenience method allows drawing for simple cases. Follows the      * Microsoft model: the character that this is applied to should be      * \uFFFC.</TD></TR>     * </TABLE>     */    public static final TextAttribute CHAR_REPLACEMENT = new TextAttribute("char_replacement");    //    // Adornments added to text.    //    /**     * Attribute key for the foreground paint     *  adornment.     *     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Default, and Description of TextAttribute FOREGROUND">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">FOREGROUND</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">Paint</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">Color.black</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">Specify the foreground Paint (or Color) of the text.</TD></TR>     * </TABLE>     */    public static final TextAttribute FOREGROUND = new TextAttribute("foreground");    /**     * Attribute key for the background Paint adornment.     *     * <P><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="1"     *     SUMMARY="Key, Value, Default, and Description of TextAttribute BACKGROUND">     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Key</TH>     * <TD VALIGN="TOP">BACKGROUND</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Value</TH>     * <TD VALIGN="TOP">Paint</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Default</TH>     * <TD VALIGN="TOP">null</TD></TR>     * <TR>     * <TH VALIGN="TOP" ALIGN="RIGHT"><P ALIGN=RIGHT>Description</TH>     * <TD VALIGN="TOP">Specify the background Paint (or Color) of the text.</TD></TR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -