📄 styleddocument.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:41:55 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface StyledDocument</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/StyledDocument.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/swing/text/Style.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/swing/text/TabableView.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="StyledDocument.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.swing.text</FONT><BR>Interface StyledDocument</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/swing/text/Document.html">Document</A></DD></DL><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/swing/text/DefaultStyledDocument.html">DefaultStyledDocument</A></DD></DL><HR><DL><DT>public interface <B>StyledDocument</B><DT>extends <A HREF="../../../javax/swing/text/Document.html">Document</A></DL><P>Interface for a generic styled document.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="fields_inherited_from_class_javax.swing.text.Document"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from interface javax.swing.text.<A HREF="../../../javax/swing/text/Document.html">Document</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/swing/text/Document.html#StreamDescriptionProperty">StreamDescriptionProperty</A>, <A HREF="../../../javax/swing/text/Document.html#TitleProperty">TitleProperty</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/text/Style.html">Style</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#addStyle(java.lang.String, javax.swing.text.Style)">addStyle</A></B>(<A HREF="../../../java/lang/String.html">String</A> nm, <A HREF="../../../javax/swing/text/Style.html">Style</A> parent)</CODE><BR> Adds a new style into the logical style hierarchy.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/Color.html">Color</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getBackground(javax.swing.text.AttributeSet)">getBackground</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> attr)</CODE><BR> Takes a set of attributes and turn it into a background color specification.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/text/Element.html">Element</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getCharacterElement(int)">getCharacterElement</A></B>(int pos)</CODE><BR> Gets the element that represents the character that is at the given offset within the document.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/Font.html">Font</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getFont(javax.swing.text.AttributeSet)">getFont</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> attr)</CODE><BR> Takes a set of attributes and turn it into a font specification.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../java/awt/Color.html">Color</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getForeground(javax.swing.text.AttributeSet)">getForeground</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> attr)</CODE><BR> Takes a set of attributes and turn it into a foreground color specification.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/text/Style.html">Style</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getLogicalStyle(int)">getLogicalStyle</A></B>(int p)</CODE><BR> Gets a logical style for a given position in a paragraph.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/text/Element.html">Element</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getParagraphElement(int)">getParagraphElement</A></B>(int pos)</CODE><BR> Gets the element that represents the paragraph that encloses the given offset within the document.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/swing/text/Style.html">Style</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#getStyle(java.lang.String)">getStyle</A></B>(<A HREF="../../../java/lang/String.html">String</A> nm)</CODE><BR> Fetches a named style previously added.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#removeStyle(java.lang.String)">removeStyle</A></B>(<A HREF="../../../java/lang/String.html">String</A> nm)</CODE><BR> Removes a named style previously added to the document.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#setCharacterAttributes(int, int, javax.swing.text.AttributeSet, boolean)">setCharacterAttributes</A></B>(int offset, int length, <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> s, boolean replace)</CODE><BR> Changes the content element attributes used for the given range of existing content in the document.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#setLogicalStyle(int, javax.swing.text.Style)">setLogicalStyle</A></B>(int pos, <A HREF="../../../javax/swing/text/Style.html">Style</A> s)</CODE><BR> Sets the logical style to use for the paragraph at the given position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyledDocument.html#setParagraphAttributes(int, int, javax.swing.text.AttributeSet, boolean)">setParagraphAttributes</A></B>(int offset, int length, <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A> s, boolean replace)</CODE><BR> Sets paragraph attributes.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.swing.text.Document"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from interface javax.swing.text.<A HREF="../../../javax/swing/text/Document.html">Document</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/swing/text/Document.html#addDocumentListener(javax.swing.event.DocumentListener)">addDocumentListener</A>, <A HREF="../../../javax/swing/text/Document.html#addUndoableEditListener(javax.swing.event.UndoableEditListener)">addUndoableEditListener</A>, <A HREF="../../../javax/swing/text/Document.html#createPosition(int)">createPosition</A>, <A HREF="../../../javax/swing/text/Document.html#getDefaultRootElement()">getDefaultRootElement</A>, <A HREF="../../../javax/swing/text/Document.html#getEndPosition()">getEndPosition</A>, <A HREF="../../../javax/swing/text/Document.html#getLength()">getLength</A>, <A HREF="../../../javax/swing/text/Document.html#getProperty(java.lang.Object)">getProperty</A>, <A HREF="../../../javax/swing/text/Document.html#getRootElements()">getRootElements</A>, <A HREF="../../../javax/swing/text/Document.html#getStartPosition()">getStartPosition</A>, <A HREF="../../../javax/swing/text/Document.html#getText(int, int)">getText</A>, <A HREF="../../../javax/swing/text/Document.html#getText(int, int, javax.swing.text.Segment)">getText</A>, <A HREF="../../../javax/swing/text/Document.html#insertString(int, java.lang.String, javax.swing.text.AttributeSet)">insertString</A>, <A HREF="../../../javax/swing/text/Document.html#putProperty(java.lang.Object, java.lang.Object)">putProperty</A>, <A HREF="../../../javax/swing/text/Document.html#remove(int, int)">remove</A>, <A HREF="../../../javax/swing/text/Document.html#removeDocumentListener(javax.swing.event.DocumentListener)">removeDocumentListener</A>, <A HREF="../../../javax/swing/text/Document.html#removeUndoableEditListener(javax.swing.event.UndoableEditListener)">removeUndoableEditListener</A>, <A HREF="../../../javax/swing/text/Document.html#render(java.lang.Runnable)">render</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="addStyle(java.lang.String, javax.swing.text.Style)"><!-- --></A><H3>addStyle</H3><PRE>public <A HREF="../../../javax/swing/text/Style.html">Style</A> <B>addStyle</B>(<A HREF="../../../java/lang/String.html">String</A> nm, <A HREF="../../../javax/swing/text/Style.html">Style</A> parent)</PRE><DL><DD>Adds a new style into the logical style hierarchy. Style attributes resolve from bottom up so an attribute specified in a child will override an attribute specified in the parent.<DD><DL></DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -