📄 customitem.html
字号:
<A NAME="KEY_PRESS"><!-- --></A><H3>KEY_PRESS</H3><PRE>protected static final int <B>KEY_PRESS</B></PRE><DL><DD>Interaction mode bit indicating support for key pressed events. <p><code>KEY_PRESS</code> has the value <code>4</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#getInteractionModes()"><CODE>getInteractionModes()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/CustomItem.html#keyPressed(int)"><CODE>keyPressed(int)</CODE></A></DL></DD></DL><HR><A NAME="KEY_RELEASE"><!-- --></A><H3>KEY_RELEASE</H3><PRE>protected static final int <B>KEY_RELEASE</B></PRE><DL><DD>Interaction mode bit indicating support for key released events. <p><code>KEY_RELEASE</code> has the value <code>8</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#getInteractionModes()"><CODE>getInteractionModes()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/CustomItem.html#keyReleased(int)"><CODE>keyReleased(int)</CODE></A></DL></DD></DL><HR><A NAME="KEY_REPEAT"><!-- --></A><H3>KEY_REPEAT</H3><PRE>protected static final int <B>KEY_REPEAT</B></PRE><DL><DD>Interaction mode bit indicating support for key repeated events. <p><code>KEY_REPEAT</code> has the value <code>0x10</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#getInteractionModes()"><CODE>getInteractionModes()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/CustomItem.html#keyRepeated(int)"><CODE>keyRepeated(int)</CODE></A></DL></DD></DL><HR><A NAME="POINTER_PRESS"><!-- --></A><H3>POINTER_PRESS</H3><PRE>protected static final int <B>POINTER_PRESS</B></PRE><DL><DD>Interaction mode bit indicating support for point pressed events. <p><code>POINTER_PRESS</code> has the value <code>0x20</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#getInteractionModes()"><CODE>getInteractionModes()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/CustomItem.html#pointerPressed(int, int)"><CODE>pointerPressed(int, int)</CODE></A></DL></DD></DL><HR><A NAME="POINTER_RELEASE"><!-- --></A><H3>POINTER_RELEASE</H3><PRE>protected static final int <B>POINTER_RELEASE</B></PRE><DL><DD>Interaction mode bit indicating support for point released events. <p><code>POINTER_RELEASE</code> has the value<code> 0x40</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#getInteractionModes()"><CODE>getInteractionModes()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/CustomItem.html#pointerReleased(int, int)"><CODE>pointerReleased(int, int)</CODE></A></DL></DD></DL><HR><A NAME="POINTER_DRAG"><!-- --></A><H3>POINTER_DRAG</H3><PRE>protected static final int <B>POINTER_DRAG</B></PRE><DL><DD>Interaction mode bit indicating support for point dragged events. <p><code>POINTER_DRAG</code> has the value <code>0x80</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#getInteractionModes()"><CODE>getInteractionModes()</CODE></A>, <A HREF="../../../javax/microedition/lcdui/CustomItem.html#pointerDragged(int, int)"><CODE>pointerDragged(int, int)</CODE></A></DL></DD></DL><HR><A NAME="NONE"><!-- --></A><H3>NONE</H3><PRE>protected static final int <B>NONE</B></PRE><DL><DD>A value for traversal direction that indicates that traversal has entered or has changed location within this item, but that no specific direction is associated with this traversal event. <p><code>NONE</code> has the value <code>0</code>.</p><DD><DL><DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/CustomItem.html#traverse(int, int, int, int[])"><CODE>traverse(int, int, int, int[])</CODE></A></DL></DD></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="CustomItem(java.lang.String)"><!-- --></A><H3>CustomItem</H3><PRE>protected <B>CustomItem</B>(String label)</PRE><DL><DD>Superclass constructor, provided so that the <code>CustomItem</code> subclass can specify its label.<DD><DL><DT><B>Parameters:</B><DD><CODE>label</CODE> - the <code>CustomItem's</code> label</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="getInteractionModes()"><!-- --></A><H3>getInteractionModes</H3><PRE>protected final int <B>getInteractionModes</B>()</PRE><DL><DD>Gets the available interaction modes. This method is intended to be called by <code>CustomItem</code> subclass code in order for it to determine what kinds of input are available from this device. The modes available may be dependent upon several factors: the hardware keys on the actual device, which of these keys are needed for the system to do proper navigation, the presence of a pointing device, etc. See <a href="#interaction">Interaction Modes</a> for further discussion. If this method returns <code>0</code>, the only interaction available is through item commands.<DD><DL><DT><B>Returns:</B><DD>a bitmask of the available interaction modes</DL></DD></DL><HR><A NAME="getMinContentWidth()"><!-- --></A><H3>getMinContentWidth</H3><PRE>protected abstract int <B>getMinContentWidth</B>()</PRE><DL><DD>Implemented by the subclass to return the minimum width of the content area, in pixels. This method is called by the implementation as part of its layout algorithm. The actual width granted is reported in the <A HREF="../../../javax/microedition/lcdui/CustomItem.html#sizeChanged(int, int)"><CODE>sizeChanged</CODE></A> and <A HREF="../../../javax/microedition/lcdui/CustomItem.html#paint(javax.microedition.lcdui.Graphics, int, int)"><CODE>paint</CODE></A> methods.<DD><DL><DT><B>Returns:</B><DD>the minimum content width in pixels</DL></DD></DL><HR><A NAME="getMinContentHeight()"><!-- --></A><H3>getMinContentHeight</H3><PRE>protected abstract int <B>getMinContentHeight</B>()</PRE><DL><DD>Implemented by the subclass to return the minimum height of the content area, in pixels. This method is called by the implementation as part of its layout algorithm. The actual height granted is reported in the <A HREF="../../../javax/microedition/lcdui/CustomItem.html#sizeChanged(int, int)"><CODE>sizeChanged</CODE></A> and <A HREF="../../../javax/microedition/lcdui/CustomItem.html#paint(javax.microedition.lcdui.Graphics, int, int)"><CODE>paint</CODE></A> methods.<DD><DL><DT><B>Returns:</B><DD>the minimum content height in pixels</DL></DD></DL><HR><A NAME="getPrefContentWidth(int)"><!-- --></A><H3>getPrefContentWidth</H3><PRE>protected abstract int <B>getPrefContentWidth</B>(int height)</PRE><DL><DD>Implemented by the subclass to return the preferred width of the content area, in pixels. This method is called by the implementation as part of its layout algorithm. <p>The <code>height</code> parameter is the tentative height assigned to the content area. The subclass code may use this value in its computation of the preferred width. The <code>height</code> parameter will be -1 if the implementation has not assigned a tentative value for the height. Otherwise, <code>height</code> will have a specific value if the application has locked the height of the <code>CustomItem</code> or if the container's layout algorithm has already computed a tentative height at the time of this call. The subclass must not assume that the tentative height passed or the preferred width returned will be granted. The actual size granted is reported in the <A HREF="../../../javax/microedition/lcdui/CustomItem.html#sizeChanged(int, int)"><CODE>sizeChanged</CODE></A> and <A HREF="../../../javax/microedition/lcdui/CustomItem.html#paint(javax.microedition.lcdui.Graphics, int, int)"><CODE>paint</CODE></A> methods. </p><DD><DL><DT><B>Parameters:</B><DD><CODE>height</CODE> - the tentative content height in pixels, or -1 if a tentative height has not been computed<DT><B>Returns:</B><DD>the preferred content width in pixels</DL></DD></DL><HR><A NAME="getPrefContentHeight(int)"><!-- --></A><H3>getPrefContentHeight</H3><PRE>protected abstract int <B>getPrefContentHeight</B>(int width)</PRE><DL><DD>Implemented by the subclass to return the preferred height of the content area, in pixels. This method is called by the implementation as part of its layout algorithm. <p>The <code>width</code> parameter is the tentative width assigned to the content area. The subclass code may use this value in its computation of the preferred height. The <code>width</code> parameter will be -1 if the implementation has not assigned a tentative value for the width. Otherwise, <code>width</code> will have a specific value if the application has locked the width of the <code>CustomItem</code> or if the container's layout algorithm has already computed a tentative width at the time of this call. The subclass must not assume that the tentative width passed or the preferred height returned will be granted. The actual size granted is reported in the <A HREF="../../../javax/microedition/lcdui/CustomItem.html#sizeChanged(int, int)"><CODE>sizeChanged</CODE></A> and <A HREF="../../../javax/microedition/lcdui/CustomItem.html#paint(javax.microedition.lcdui.Graphics, int, int)"><CODE>paint</CODE></A> methods. </p><DD><DL><DT><B>Parameters:</B><DD><CODE>width</CODE> - the tentative content width in pixels, or -1 if a tentative width has not been computed<DT><B>Returns:</B><DD>the preferred content height in pixels</DL></DD></DL><HR><A NAME="sizeChanged(int, int)"><!-- --></A><H3>sizeChanged</H3><PRE>protected void <B>sizeChanged</B>(int w, int h)</PRE><DL><DD>Implemented by the subclass in order to handle size change events. This method is called by the system when the size of the content area of this <code>CustomItem</code> has changed. <p>If the size of a <code>CustomItem</code> changes while it is visible on the display, it may trigger an automatic repaint request. If this occurs, the call to <code>sizeChanged</code> will occur prior to the call to <code>paint</code>. If the <code>CustomItem</code> has become smaller, the implementation may choose not to trigger a repaint request if the remaining contents of the <code>CustomItem</code> have been preserved. Similarly, if the <code>CustomItem</code> has become larger, the implementation may choose to trigger a repaint only for the new region. In both cases, the preserved contents must remain stationary with respect to the origin of the <code>CustomItem</code>. If the size change is significant to the contents of the <code>CustomItem</code>, the application must explicitly issue a repaint request for the changed areas. Note
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -