📄 uiresource.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:40:10 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface UIResource</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/UIResource.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"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="UIResource.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | METHOD</FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | METHOD</FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.swing.plaf</FONT><BR>Interface UIResource</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../javax/swing/plaf/ActionMapUIResource.html">ActionMapUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.html">BorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.BevelBorderUIResource.html">BorderUIResource.BevelBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.CompoundBorderUIResource.html">BorderUIResource.CompoundBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.EmptyBorderUIResource.html">BorderUIResource.EmptyBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.EtchedBorderUIResource.html">BorderUIResource.EtchedBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.LineBorderUIResource.html">BorderUIResource.LineBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.MatteBorderUIResource.html">BorderUIResource.MatteBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/BorderUIResource.TitledBorderUIResource.html">BorderUIResource.TitledBorderUIResource</A>, <A HREF="../../../javax/swing/plaf/ColorUIResource.html">ColorUIResource</A>, <A HREF="../../../javax/swing/plaf/ComponentInputMapUIResource.html">ComponentInputMapUIResource</A>, <A HREF="../../../javax/swing/DefaultListCellRenderer.UIResource.html">DefaultListCellRenderer.UIResource</A>, <A HREF="../../../javax/swing/table/DefaultTableCellRenderer.UIResource.html">DefaultTableCellRenderer.UIResource</A>, <A HREF="../../../javax/swing/plaf/DimensionUIResource.html">DimensionUIResource</A>, <A HREF="../../../javax/swing/plaf/FontUIResource.html">FontUIResource</A>, <A HREF="../../../javax/swing/plaf/InputMapUIResource.html">InputMapUIResource</A>, <A HREF="../../../javax/swing/plaf/InsetsUIResource.html">InsetsUIResource</A>, <A HREF="../../../javax/swing/JScrollPane.ScrollBar.html">JScrollPane.ScrollBar</A>, <A HREF="../../../javax/swing/ScrollPaneLayout.UIResource.html">ScrollPaneLayout.UIResource</A>, <A HREF="../../../javax/swing/plaf/IconUIResource.html">IconUIResource</A>, <A HREF="../../../javax/swing/plaf/basic/DefaultMenuLayout.html">DefaultMenuLayout</A>, <A HREF="../../../javax/swing/plaf/basic/BasicTextUI.BasicCaret.html">BasicTextUI.BasicCaret</A>, <A HREF="../../../javax/swing/plaf/basic/BasicTextUI.BasicHighlighter.html">BasicTextUI.BasicHighlighter</A>, <A HREF="../../../javax/swing/plaf/basic/BasicBorders.ButtonBorder.html">BasicBorders.ButtonBorder</A>, <A HREF="../../../javax/swing/plaf/basic/BasicBorders.MenuBarBorder.html">BasicBorders.MenuBarBorder</A>, <A HREF="../../../javax/swing/plaf/basic/BasicBorders.MarginBorder.html">BasicBorders.MarginBorder</A>, <A HREF="../../../javax/swing/plaf/basic/BasicBorders.FieldBorder.html">BasicBorders.FieldBorder</A>, <A HREF="../../../javax/swing/plaf/basic/BasicBorders.SplitPaneBorder.html">BasicBorders.SplitPaneBorder</A>, <A HREF="../../../javax/swing/plaf/basic/BasicComboBoxRenderer.UIResource.html">BasicComboBoxRenderer.UIResource</A>, <A HREF="../../../javax/swing/plaf/basic/BasicComboBoxEditor.UIResource.html">BasicComboBoxEditor.UIResource</A>, <A HREF="../../../javax/swing/plaf/metal/MetalComboBoxEditor.UIResource.html">MetalComboBoxEditor.UIResource</A>, <A HREF="../../../javax/swing/plaf/metal/MetalCheckBoxIcon.html">MetalCheckBoxIcon</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.Flush3DBorder.html">MetalBorders.Flush3DBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.ButtonBorder.html">MetalBorders.ButtonBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.InternalFrameBorder.html">MetalBorders.InternalFrameBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.PaletteBorder.html">MetalBorders.PaletteBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.OptionDialogBorder.html">MetalBorders.OptionDialogBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.MenuBarBorder.html">MetalBorders.MenuBarBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.MenuItemBorder.html">MetalBorders.MenuItemBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.PopupMenuBorder.html">MetalBorders.PopupMenuBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.ToolBarBorder.html">MetalBorders.ToolBarBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalBorders.ScrollPaneBorder.html">MetalBorders.ScrollPaneBorder</A>, <A HREF="../../../javax/swing/plaf/metal/MetalIconFactory.PaletteCloseIcon.html">MetalIconFactory.PaletteCloseIcon</A></DD></DL><HR><DL><DT>public interface <B>UIResource</B></DL><P>This interface is used to mark objects created by ComponentUI delegates. The <code>ComponentUI.installUI()</code> and <code>ComponentUI.uninstallUI()</code> methods can use this interface to decide if a properties value has been overridden. For example, the JList cellRenderer property is initialized by BasicListUI.installUI(), only if it's initial value is null: <pre> if (list.getCellRenderer() == null) { list.setCellRenderer((ListCellRenderer)(UIManager.get("List.cellRenderer"))); } </pre> At uninstallUI() time we reset the property to null if its value is an instance of UIResource: <pre> if (list.getCellRenderer() instanceof UIResource) { list.setCellRenderer(null); }</pre> This pattern applies to all properties except the java.awt.Component properties font, foreground, and background. If one of these properties isn't initialized, or is explicitly set to null, its container provides the value. For this reason the <code>"== null"</code> is unreliable when installUI() is called to dynamically change a components look and feel. So at installUI() time we check to see if the current value is a UIResource:<pre> if (!(list.getFont() instanceof UIResource)) { list.setFont(UIManager.getFont("List.font")); } </pre><P><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/swing/plaf/ComponentUI.html"><CODE>ComponentUI</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_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/UIResource.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"> PREV CLASS NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="UIResource.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | CONSTR | METHOD</FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | METHOD</FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -