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

📄 stylecontext.html

📁 API資料大全
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<!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:42:19 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class  StyleContext</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/StyleContext.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../javax/swing/text/StyleConstants.ParagraphConstants.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../javax/swing/text/StyleContext.NamedStyle.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>  &nbsp;&nbsp;<A HREF="StyleContext.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;<A HREF="#inner_class_summary">INNER</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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>Class  StyleContext</H2><PRE><A HREF="../../../java/lang/Object.html">java.lang.Object</A>  |  +--<B>javax.swing.text.StyleContext</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A>, <A HREF="../../../java/io/Serializable.html">Serializable</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../javax/swing/text/html/StyleSheet.html">StyleSheet</A></DD></DL><HR><DL><DT>public class <B>StyleContext</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../../java/io/Serializable.html">Serializable</A>, <A HREF="../../../javax/swing/text/AbstractDocument.AttributeContext.html">AbstractDocument.AttributeContext</A></DL><P>A pool of styles and their associated resources.  This class determines the lifetime of a group of resources by being a container that holds caches for various resources such as font and color that get reused  by the various style definitions.  This can be shared by multiple documents if desired to maximize the sharing of related resources. <p> This class also provides efficient support for small sets of attributes and compresses them by sharing across uses and taking advantage of  their immutable nature.  Since many styles are replicated, the potential for sharing is significant, and copies can be extremely cheap.   Larger sets reduce the possibility of sharing, and therefore revert  automatically to a less space-efficient implementation. <p> <strong>Warning:</strong> Serialized objects of this class will not be compatible with  future Swing releases.  The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.  A future release of Swing will provide support for long term persistence.<P><DL><DT><B>See Also: </B><DD><A HREF="../../../serialized-form.html#javax.swing.text.StyleContext">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><A NAME="inner_class_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Inner Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.NamedStyle.html">StyleContext.NamedStyle</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A collection of attributes, typically used to represent character and paragraph styles.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.SmallAttributeSet.html">StyleContext.SmallAttributeSet</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This class holds a small number of attributes in an array.</TD></TR></TABLE>&nbsp;<!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#DEFAULT_STYLE">DEFAULT_STYLE</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The name given to the default logical style attached to paragraphs.</TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#StyleContext()">StyleContext</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new StyleContext object.</TD></TR></TABLE>&nbsp;<!-- ========== 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>&nbsp;<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#addAttribute(javax.swing.text.AttributeSet, java.lang.Object, java.lang.Object)">addAttribute</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,             <A HREF="../../../java/lang/Object.html">Object</A>&nbsp;name,             <A HREF="../../../java/lang/Object.html">Object</A>&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an attribute to the given set, and returns the new representative set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#addAttributes(javax.swing.text.AttributeSet, javax.swing.text.AttributeSet)">addAttributes</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;old,              <A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a set of attributes to the element.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#addChangeListener(javax.swing.event.ChangeListener)">addChangeListener</A></B>(<A HREF="../../../javax/swing/event/ChangeListener.html">ChangeListener</A>&nbsp;l)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a listener to track when styles are added or removed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../javax/swing/text/Style.html">Style</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#addStyle(java.lang.String, javax.swing.text.Style)">addStyle</A></B>(<A HREF="../../../java/lang/String.html">String</A>&nbsp;nm,         <A HREF="../../../javax/swing/text/Style.html">Style</A>&nbsp;parent)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a new style into the style hierarchy.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../../javax/swing/text/MutableAttributeSet.html">MutableAttributeSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#createLargeAttributeSet(javax.swing.text.AttributeSet)">createLargeAttributeSet</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a large set of attributes that should trade off space for time.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../../../javax/swing/text/StyleContext.SmallAttributeSet.html">StyleContext.SmallAttributeSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#createSmallAttributeSet(javax.swing.text.AttributeSet)">createSmallAttributeSet</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;a)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a compact set of attributes that might be shared.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Color.html">Color</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#getBackground(javax.swing.text.AttributeSet)">getBackground</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>protected &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#getCompressionThreshold()">getCompressionThreshold</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum number of key/value pairs to try and  compress into unique/immutable sets.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../../../javax/swing/text/StyleContext.html">StyleContext</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#getDefaultStyleContext()">getDefaultStyleContext</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns default AttributeContext shared by all documents that don't bother to define/supply their own context.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#getEmptySet()">getEmptySet</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fetches an empty AttributeSet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../java/awt/Font.html">Font</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/swing/text/StyleContext.html#getFont(javax.swing.text.AttributeSet)">getFont</A></B>(<A HREF="../../../javax/swing/text/AttributeSet.html">AttributeSet</A>&nbsp;attr)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the font from an attribute set.</TD></TR>

⌨️ 快捷键说明

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