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

📄 command.html

📁 是MIDP 的API 查詢文件, 大家可以看一下裡面的index.html, 再用Package 或 Class 名字來查.
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!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 Wed Sep 24 14:57:49 PDT 2003 -->
<TITLE>
MID Profile: Class  Command
</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/Command.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-all.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>
<strong>MID Profile</strong></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/microedition/lcdui/ChoiceGroup.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/microedition/lcdui/CustomItem.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="Command.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&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.microedition.lcdui</FONT>
<BR>
Class  Command</H2>
<PRE>
<A HREF="../../../java/lang/Object.html">java.lang.Object</A>
  |
  +--<B>javax.microedition.lcdui.Command</B>
</PRE>
<HR>
<DL>
<DT>public class <B>Command</B><DT>extends <A HREF="../../../java/lang/Object.html">Object</A></DL>

<P>
The <code>Command</code> class is a construct that encapsulates the semantic information of an action. The behavior that the command activates is not encapsulated in this object. This means that command  contains only information about &quot;command&quot; not the actual action that happens when command is activated. The action is defined in a  <A HREF="../../../javax/microedition/lcdui/CommandListener.html"><CODE>CommandListener</CODE></A> associated with the <code>Displayable</code>. <code>Command</code> objects are <em>presented</em> in the user interface and the way they are presented may depend on the semantic information contained within the command. <P><code>Commands</code> may be implemented in any user interface construct that has semantics for activating a single action. This, for example, can be a soft button, item in a menu, or some other direct user interface construct. For example, a speech interface may present these commands as voice tags. </P> <P>The mapping to concrete user interface constructs may also depend on the total number of the commands. For example, if an application asks for more abstract commands than can be mapped onto the available physical buttons on a device, then the device may use an alternate human interface such as a menu. For example, the abstract  commands that cannot be mapped onto physical buttons are placed in a menu and the label &quot;Menu&quot; is mapped onto one of the programmable buttons. </P> <p>A command contains four pieces of information: a <em>short label</em>, an optional <em>long label</em>, a <em>type</em>, and a <em>priority</em>. One of the labels is used for the visual representation of the command, whereas the type and the priority indicate the semantics of the command. </p> <a name="label"></a> <h3>Labels</h3> <p> Each command includes one or two label strings.  The label strings are what the application requests to be shown to the user to represent this command. For example, one of these strings may appear next to a soft button on the device or as an element in a menu. For command types other than <code>SCREEN</code>, the labels provided may be overridden by a system-specific label that is more appropriate for this command on this device. The contents of the label strings are otherwise not interpreted by the implementation. </p>  <p>All commands have a short label.  The long label is optional.  If the long label is not present on a command, the short label is always used. </p> <p>The short label string should be as short as possible so that it consumes a minimum of screen real estate.  The long label can be longer and more descriptive, but it should be no longer than a few words.  For example, a command's short label might be &quot;Play&quot;, and its long label might be &quot;Play Sound Clip&quot;.</p> <p>The implementation chooses one of the labels to be presented in the user interface based on the context and the amount of space available.  For example, the implementation might use the short label if the command appears on a soft button, and it might use the long label if the command appears on a menu, but only if there is room on the menu for the long label.  The implementation may use the short labels of some commands and the long labels of other commands, and it is allowed to switch between using the short and long label at will.  The application cannot determine which label is being used at any given time.  </p> <a name="type"></a> <h3>Type</h3> <p> The application uses the command type to specify the intent of this command. For example, if the application specifies that the command is of type <code>BACK</code>, and if the device has a standard of placing the &quot;back&quot; operation on a certain soft-button, the implementation can follow the style of the device by using the semantic information as a guide. The defined types are <A HREF="../../../javax/microedition/lcdui/Command.html#BACK"><CODE>BACK</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Command.html#CANCEL"><CODE>CANCEL</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Command.html#EXIT"><CODE>EXIT</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Command.html#HELP"><CODE>HELP</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Command.html#ITEM"><CODE>ITEM</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Command.html#OK"><CODE>OK</CODE></A>, <A HREF="../../../javax/microedition/lcdui/Command.html#SCREEN"><CODE>SCREEN</CODE></A>, and <A HREF="../../../javax/microedition/lcdui/Command.html#STOP"><CODE>STOP</CODE></A>. </p> <a name="priority"></a> <h3>Priority</h3> <p> The application uses the priority value to describe the importance of this command relative to other commands on the same screen. Priority values are integers, where a lower number indicates greater importance. The actual values are chosen by the application. A priority value of one might indicate the most important command, priority values of two, three, four, and so on indicate commands of lesser importance. </p> <p>Typically, the implementation first chooses the placement of a command based on the type of command and then places similar commands based on a priority order. This could mean that the command with the highest priority is placed so that user can trigger it directly and that commands with lower priority are placed on a menu. It is not an error for there to be commands on the same screen with the same priorities and types. If this occurs, the implementation will choose the order in which they are presented. </p> <p>For example, if the application has the following set of commands: </P> <TABLE BORDER="2"> <TR> <TD ROWSPAN="1" COLSPAN="1">    <pre><code>    new Command("Buy", Command.ITEM, 1);    new Command("Info", Command.ITEM, 1);    new Command("Back", Command.BACK, 1);    </code></pre> </TD> </TR> </TABLE> <P> An implementation with two soft buttons may map the <code>BACK</code> command to the right soft button and create an &quot;Options&quot; menu on the left soft button to contain the other commands.<BR> <IMG SRC="doc-files/command1.gif" width=190 height=268><BR> When user presses the left soft button, a menu with the two remaining <code>Commands</code> appears:<BR> <IMG SRC="doc-files/command2.gif" width=189 height=260><BR> If the application had three soft buttons, all commands can be mapped  to soft buttons: <BR><IMG SRC="doc-files/command3.gif" width=189 height=261></P> <p>The application is always responsible for providing the means for the user to progress through different screens. An application may set up a screen that has no commands. This is allowed by the API but is generally not useful; if this occurs the user would have no means to move to another screen. Such program would simply considered to be in error. A typical device should provide a means for the user to direct the application manager to kill the erroneous application.
<P>
<DL>
<DT><B>Since: </B><DD>MIDP 1.0</DD>
</DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== 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;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Command.html#BACK">BACK</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A navigation command that returns the user to the logically  previous screen.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

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