📄 boundedrangemodel.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:38:05 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Interface BoundedRangeModel</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/BoundedRangeModel.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/Action.html"><B>PREV CLASS</B></A> <A HREF="../../javax/swing/ButtonModel.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="BoundedRangeModel.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</FONT><BR>Interface BoundedRangeModel</H2><DL><DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../javax/swing/DefaultBoundedRangeModel.html">DefaultBoundedRangeModel</A></DD></DL><HR><DL><DT>public interface <B>BoundedRangeModel</B></DL><P>Defines the data model used by components like Sliders and ProgressBars. Defines four interrelated integer properties: minimum, maximum, extent and value. These four integers define two nested ranges like this: <pre> minimum <= value <= value+extent <= maximum </pre> The outer range is <code>minimum,maximum</code> and the inner range is <code>value,value+extent</code>. The inner range must lie within the outer one, i.e. <code>value</code> must be less than or equal to <code>maximum</code> and <code>value+extent</code> must greater than or equal to <code>minimum</code>, and <code>maximum</code> must be greater than or equal to <code>minimum</code>. There are a few features of this model that one might find a little surprising. These quirks exist for the convenience of the Swing BoundedRangeModel clients like like Slider and ScrollBar. <ul> <li> The minimum and maximum set methods "correct" the other three properties to acommodate their new value argument. For example setting the model's minimum may change its maximum, value, and extent properties (in that order), to maintain the constraints specified above. <li> The value and extent set methods "correct" their argument to fit within the limits defined by the other three properties. For example if <code>value == maximum</code>, <code>setExtent(10)</code> would change the extent (back) to zero. <li> The four BoundedRangeModel values are defined as Java Beans properties however Swing ChangeEvents are used to notify clients of changes rather than PropertyChangeEvents. This was done to keep the overhead of monitoring a BoundedRangeModel low. Changes are often reported at MouseDragged rates. </ul> <p> For an example of specifying custom bounded range models used by sliders, see <ahref="http://java.sun.com/docs/books/tutorial/uiswing/overview/anatomy.html">The Anatomy of a Swing-Based Program</a> in <em>The Java Tutorial.</em><P><DL><DT><B>See Also: </B><DD><A HREF="../../javax/swing/DefaultBoundedRangeModel.html"><CODE>DefaultBoundedRangeModel</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/BoundedRangeModel.html#addChangeListener(javax.swing.event.ChangeListener)">addChangeListener</A></B>(<A HREF="../../javax/swing/event/ChangeListener.html">ChangeListener</A> x)</CODE><BR> Adds a ChangeListener to the model's listener list.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/BoundedRangeModel.html#getExtent()">getExtent</A></B>()</CODE><BR> Returns the model's extent, the length of the inner range that begins at the model's value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/BoundedRangeModel.html#getMaximum()">getMaximum</A></B>()</CODE><BR> Returns the model's maximum.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/BoundedRangeModel.html#getMinimum()">getMinimum</A></B>()</CODE><BR> Returns the minimum acceptable value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/BoundedRangeModel.html#getValue()">getValue</A></B>()</CODE><BR> Returns the model's current value.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/swing/BoundedRangeModel.html#getValueIsAdjusting()">getValueIsAdjusting</A></B>()</CODE><BR> Returns true if the current changes to the value property are part of a series of changes.</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/BoundedRangeModel.html#removeChangeListener(javax.swing.event.ChangeListener)">removeChangeListener</A></B>(<A HREF="../../javax/swing/event/ChangeListener.html">ChangeListener</A> x)</CODE><BR> Removes a ChangeListener from the model's listener list.</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/BoundedRangeModel.html#setExtent(int)">setExtent</A></B>(int newExtent)</CODE><BR> Sets the model's extent.</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/BoundedRangeModel.html#setMaximum(int)">setMaximum</A></B>(int newMaximum)</CODE><BR> Sets the model's maximum to <I>newMaximum</I>.</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/BoundedRangeModel.html#setMinimum(int)">setMinimum</A></B>(int newMinimum)</CODE><BR> Sets the model's minimum to <I>newMinimum</I>.</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/BoundedRangeModel.html#setRangeProperties(int, int, int, int, boolean)">setRangeProperties</A></B>(int value, int extent, int min, int max, boolean adjusting)</CODE><BR> This method sets all of the model's data with a single method call.</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/BoundedRangeModel.html#setValue(int)">setValue</A></B>(int newValue)</CODE><BR> Sets the model's current value to <code>newValue</code> if <code>newValue</code> satisfies the model's constraints.</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/BoundedRangeModel.html#setValueIsAdjusting(boolean)">setValueIsAdjusting</A></B>(boolean b)</CODE><BR> This attribute indicates that any upcoming changes to the value of the model should be considered a single event.</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -