📄 sizerequirements.html
字号:
<TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="minimum"><!-- --></A><H3>minimum</H3><PRE>public int <B>minimum</B></PRE><DL><DD>The minimum size required. For a component <code>comp</code>, this should be equal to either <code>comp.getMinimumSize().width</code> or <code>comp.getMinimumSize().height</code>.</DL><HR><A NAME="preferred"><!-- --></A><H3>preferred</H3><PRE>public int <B>preferred</B></PRE><DL><DD>The preferred (natural) size. For a component <code>comp</code>, this should be equal to either <code>comp.getPreferredSize().width</code> or <code>comp.getPreferredSize().height</code>.</DL><HR><A NAME="maximum"><!-- --></A><H3>maximum</H3><PRE>public int <B>maximum</B></PRE><DL><DD>The maximum size allowed. For a component <code>comp</code>, this should be equal to either <code>comp.getMaximumSize().width</code> or <code>comp.getMaximumSize().height</code>.</DL><HR><A NAME="alignment"><!-- --></A><H3>alignment</H3><PRE>public float <B>alignment</B></PRE><DL><DD>The alignment, specified as a value between 0.0 and 1.0, inclusive. To specify centering, the alignment should be 0.5.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="SizeRequirements()"><!-- --></A><H3>SizeRequirements</H3><PRE>public <B>SizeRequirements</B>()</PRE><DL><DD>Creates a SizeRequirements object with the minimum, preferred, and maximum sizes set to zero and an alignment value of 0.5 (centered).</DL><HR><A NAME="SizeRequirements(int, int, int, float)"><!-- --></A><H3>SizeRequirements</H3><PRE>public <B>SizeRequirements</B>(int min, int pref, int max, float a)</PRE><DL><DD>Creates a SizeRequirements object with the specified minimum, preferred, and maximum sizes and the specified alignment.<DD><DL><DT><B>Parameters:</B><DD><CODE>min</CODE> - the minimum size >= 0<DD><CODE>pref</CODE> - the preferred size >= 0<DD><CODE>max</CODE> - the maximum size >= 0<DD><CODE>a</CODE> - the alignment >= 0.0f && <= 1.0f</DL></DD></DL><!-- ============ 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="toString()"><!-- --></A><H3>toString</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toString</B>()</PRE><DL><DD>Returns a string describing the minimum, preferred, and maximum size requirements, along with the alignment.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="../../java/lang/Object.html">Object</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the string</DL></DD></DL><HR><A NAME="getTiledSizeRequirements(javax.swing.SizeRequirements[])"><!-- --></A><H3>getTiledSizeRequirements</H3><PRE>public static <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A> <B>getTiledSizeRequirements</B>(<A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A>[] children)</PRE><DL><DD>Determines the total space necessary to place a set of components end-to-end. The needs of each component in the set are represented by an entry in the passed-in SizeRequirements array. The returned SizeRequirements object has an alignment of 0.5 (centered). The space requirement is never more than Integer.MAX_VALUE.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>children</CODE> - the space requirements for a set of components. The vector may be of zero length, which will result in a default SizeRequirements object instance being passed back.<DT><B>Returns:</B><DD>the total space requirements.</DL></DD></DL><HR><A NAME="getAlignedSizeRequirements(javax.swing.SizeRequirements[])"><!-- --></A><H3>getAlignedSizeRequirements</H3><PRE>public static <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A> <B>getAlignedSizeRequirements</B>(<A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A>[] children)</PRE><DL><DD>Determines the total space necessary to align a set of components. The needs of each component in the set are represented by an entry in the passed-in SizeRequirements array. The total space required will never be more than Integer.MAX_VALUE.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>children</CODE> - the set of child requirements. If of zero length, the returns result will be a default instance of SizeRequirements.<DT><B>Returns:</B><DD>the total space requirements.</DL></DD></DL><HR><A NAME="calculateTiledPositions(int, javax.swing.SizeRequirements, javax.swing.SizeRequirements[], int[], int[])"><!-- --></A><H3>calculateTiledPositions</H3><PRE>public static void <B>calculateTiledPositions</B>(int allocated, <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A> total, <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A>[] children, int[] offsets, int[] spans)</PRE><DL><DD>Creates a bunch of offset/span pairs representing how to lay out a set of components end-to-end. This method requires that you specify the total amount of space to be allocated, the size requirements for each component to be placed (specified as an array of SizeRequirements), and the total size requirement of the set of components. You can get the total size requirement by invoking the getTiledSizeRequirements method.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>allocated</CODE> - the total span to be allocated >= 0.<DD><CODE>total</CODE> - the total of the children requests. This argument is optional and may be null.<DD><CODE>children</CODE> - the size requirements for each component.<DD><CODE>offsets</CODE> - the offset from 0 for each child where the spans were allocated (determines placement of the span).<DD><CODE>spans</CODE> - the span allocated for each child to make the total target span.</DL></DD></DL><HR><A NAME="calculateAlignedPositions(int, javax.swing.SizeRequirements, javax.swing.SizeRequirements[], int[], int[])"><!-- --></A><H3>calculateAlignedPositions</H3><PRE>public static void <B>calculateAlignedPositions</B>(int allocated, <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A> total, <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A>[] children, int[] offsets, int[] spans)</PRE><DL><DD>Creates a bunch of offset/span pairs specifying how to lay out a set of components with the specified alignments. The resulting span allocations will overlap, with each one fitting as well as possible into the given total allocation. This method requires that you specify the total amount of space to be allocated, the size requirements for each component to be placed (specified as an array of SizeRequirements), and the total size requirements of the set of components (only the alignment field of which is actually used). You can get the total size requirement by invoking getAlignedSizeRequirements.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>allocated</CODE> - the total span to be allocated >= 0.<DD><CODE>total</CODE> - the total of the children requests.<DD><CODE>children</CODE> - the size requirements for each component.<DD><CODE>offsets</CODE> - the offset from 0 for each child where the spans were allocated (determines placement of the span).<DD><CODE>spans</CODE> - the span allocated for each child to make the total target span.</DL></DD></DL><HR><A NAME="adjustSizes(int, javax.swing.SizeRequirements[])"><!-- --></A><H3>adjustSizes</H3><PRE>public static int[] <B>adjustSizes</B>(int delta, <A HREF="../../javax/swing/SizeRequirements.html">SizeRequirements</A>[] children)</PRE><DL><DD>Adjust a specified array of sizes by a given amount.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>delta</CODE> - an int specifying the size difference<DD><CODE>children</CODE> - an array of SizeRequirements objects<DT><B>Returns:</B><DD>an array of ints containing the final size for each item</DL></DD></DL><!-- ========= 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/SizeRequirements.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/ScrollPaneLayout.UIResource.html"><B>PREV CLASS</B></A> <A HREF="../../javax/swing/SizeSequence.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="SizeRequirements.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></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 + -