📄 gauge.html
字号:
<!-- ========= 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="Gauge(java.lang.String, boolean, int, int)"><!-- --></A><H3>Gauge</H3><PRE>public <B>Gauge</B>(String label, boolean interactive, int maxValue, int initialValue)</PRE><DL><DD>Creates a new <code>Gauge</code> object with the given label, in interactive or non-interactive mode, with the given maximum and initial values. In interactive mode (where <code>interactive</code> is <code>true</code>) the maximum value must be greater than zero, otherwise an exception is thrown. In non-interactive mode (where <code>interactive</code> is <code>false</code>) the maximum value must be greater than zero or equal to the special value <code>INDEFINITE</code>, otherwise an exception is thrown. <p>If the maximum value is greater than zero, the gauge has definite range. In this case the initial value must be within the range zero to <code>maxValue</code>, inclusive. If the initial value is less than zero, the value is set to zero. If the initial value is greater than <code>maxValue</code>, it is set to <code>maxValue</code>.</p> <p>If <code>interactive</code> is <code>false</code> and the maximum value is <code>INDEFINITE</code>, this creates a non-interactive gauge with indefinite range. The initial value must be one of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code>.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>label</CODE> - the <code>Gauge's</code> label<DD><CODE>interactive</CODE> - tells whether the user can change the value<DD><CODE>maxValue</CODE> - the maximum value, or <code>INDEFINITE</code><DD><CODE>initialValue</CODE> - the initial value in the range <code>[0..maxValue]</code>, or one of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code> if <code>maxValue</code> is <code>INDEFINITE</code>.<DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if <code>maxValue</code> is not positive for interactive gauges<DD><CODE>IllegalArgumentException</CODE> - if <code>maxValue</code> is neither positive nor <code>INDEFINITE</code> for non-interactive gauges<DD><CODE>IllegalArgumentException</CODE> - if initialValue is not one of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code> for a non-interactive gauge with indefinite range<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Gauge.html#INDEFINITE"><CODE>INDEFINITE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#CONTINUOUS_IDLE"><CODE>CONTINUOUS_IDLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#INCREMENTAL_IDLE"><CODE>INCREMENTAL_IDLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#CONTINUOUS_RUNNING"><CODE>CONTINUOUS_RUNNING</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#INCREMENTAL_UPDATING"><CODE>INCREMENTAL_UPDATING</CODE></A></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="setValue(int)"><!-- --></A><H3>setValue</H3><PRE>public void <B>setValue</B>(int value)</PRE><DL><DD>Sets the current value of this <code>Gauge</code> object. <p>If the gauge is interactive, or if it is non-interactive with definite range, the following rules apply. If the value is less than zero, zero is used. If the current value is greater than the maximum value, the current value is set to be equal to the maximum value. </p> <p> If this <code>Gauge</code> object is a non-interactive gauge with indefinite range, then value must be one of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code>. Other values will cause an exception to be thrown.</p><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the new value<DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if value is not one of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code> for non-interactive gauges with indefinite range<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Gauge.html#CONTINUOUS_IDLE"><CODE>CONTINUOUS_IDLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#INCREMENTAL_IDLE"><CODE>INCREMENTAL_IDLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#CONTINUOUS_RUNNING"><CODE>CONTINUOUS_RUNNING</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#INCREMENTAL_UPDATING"><CODE>INCREMENTAL_UPDATING</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#getValue()"><CODE>getValue()</CODE></A></DL></DD></DL><HR><A NAME="getValue()"><!-- --></A><H3>getValue</H3><PRE>public int <B>getValue</B>()</PRE><DL><DD>Gets the current value of this <code>Gauge</code> object. <p> If this <code>Gauge</code> object is a non-interactive gauge with indefinite range, the value returned will be one of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code>. Otherwise, it will be an integer between zero and the gauge's maximum value, inclusive.</p><DD><DL><DT><B>Returns:</B><DD>current value of the <code>Gauge</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Gauge.html#CONTINUOUS_IDLE"><CODE>CONTINUOUS_IDLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#INCREMENTAL_IDLE"><CODE>INCREMENTAL_IDLE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#CONTINUOUS_RUNNING"><CODE>CONTINUOUS_RUNNING</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#INCREMENTAL_UPDATING"><CODE>INCREMENTAL_UPDATING</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#setValue(int)"><CODE>setValue(int)</CODE></A></DL></DD></DL><HR><A NAME="setMaxValue(int)"><!-- --></A><H3>setMaxValue</H3><PRE>public void <B>setMaxValue</B>(int maxValue)</PRE><DL><DD>Sets the maximum value of this <code>Gauge</code> object. <p>For interactive gauges, the new maximum value must be greater than zero, otherwise an exception is thrown. For non-interactive gauges, the new maximum value must be greater than zero or equal to the special value <code>INDEFINITE</code>, otherwise an exception is thrown. </p> <p>If the new maximum value is greater than zero, this provides the gauge with a definite range. If the gauge previously had a definite range, and if the current value is greater than new maximum value, the current value is set to be equal to the new maximum value. If the gauge previously had a definite range, and if the current value is less than or equal to the new maximum value, the current value is left unchanged. </p> <p>If the new maximum value is greater than zero, and if the gauge had previously had indefinite range, this new maximum value provides it with a definite range. Its graphical representation must change accordingly, the previous state of <code>CONTINUOUS_IDLE</code>, <code>INCREMENTAL_IDLE</code>, <code>CONTINUOUS_RUNNING</code>, or <code>INCREMENTAL_UPDATING</code> is ignored, and the current value is set to zero. </p> <p>If this gauge is non-interactive and the new maximum value is <code>INDEFINITE</code>, this gives the gauge indefinite range. If the gauge previously had a definite range, its graphical representation must change accordingly, the previous value is ignored, and the current state is set to <code>CONTINUOUS_IDLE</code>. If the gauge previously had an indefinite range, setting the maximum value to <code>INDEFINITE</code> will have no effect. </p><DD><DL><DT><B>Parameters:</B><DD><CODE>maxValue</CODE> - the new maximum value<DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - if <code>maxValue</code> is invalid<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Gauge.html#INDEFINITE"><CODE>INDEFINITE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#getMaxValue()"><CODE>getMaxValue()</CODE></A></DL></DD></DL><HR><A NAME="getMaxValue()"><!-- --></A><H3>getMaxValue</H3><PRE>public int <B>getMaxValue</B>()</PRE><DL><DD>Gets the maximum value of this <code>Gauge</code> object. <p>If this gauge is interactive, the maximum value will be a positive integer. If this gauge is non-interactive, the maximum value will be a positive integer (indicating that the gauge has definite range) or the special value <code>INDEFINITE</code> (indicating that the gauge has indefinite range).</p><DD><DL><DT><B>Returns:</B><DD>the maximum value of the <code>Gauge</code>, or <code>INDEFINITE</code><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Gauge.html#INDEFINITE"><CODE>INDEFINITE</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Gauge.html#setMaxValue(int)"><CODE>setMaxValue(int)</CODE></A></DL></DD></DL><HR><A NAME="isInteractive()"><!-- --></A><H3>isInteractive</H3><PRE>public boolean <B>isInteractive</B>()</PRE><DL><DD>Tells whether the user is allowed to change the value of the <code>Gauge</code>.<DD><DL><DT><B>Returns:</B><DD>a boolean indicating whether the <code>Gauge</code> is interactive</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/Gauge.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-all.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><strong>MIDP 2.0</strong></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/microedition/lcdui/Form.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/microedition/lcdui/Graphics.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="Gauge.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="mailto:jsr-118-comments@jcp.org">Send a comment or suggestion</a> Version 2.0 of Mobile Information Device Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2002 Sun Microsystems, Inc. and Motorola, Inc. All Rights Reserved. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -