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

📄 125-128.html

📁 dshfghfhhgsfgfghfhfghgfhfghfgh fg hfg hh ghghf hgf hghg gh fg hg hfg hfh f hg hgfh gkjh kjkh g yj f
💻 HTML
字号:
<HTML>
<HEAD>
<META name=vsisbn content="1558515682"><META name=vstitle content="Java Digital Signal Processing"><META name=vsauthor content="Douglas A. Lyon"><META name=vsimprint content="M&T Books"><META name=vspublisher content="IDG Books Worldwide, Inc."><META name=vspubdate content="11/01/97"><META name=vscategory content="Web and Software Development: Programming, Scripting, and Markup Languages: Java"><TITLE>Java Digital Signal Processing:The Graphical User Interface</TITLE>
<!-- HEADER --><STYLE type="text/css">  <!-- A:hover  { 	color : Red; } --></STYLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<!--ISBN=1558515682//-->
<!--TITLE=Java Digital Signal Processing//-->
<!--AUTHOR=Douglas A. Lyon//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=3//-->
<!--PAGES=125-128//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="120-125.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="128-131.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading16"></A><FONT COLOR="#000077">Class Usage</FONT></H4>
<P>The <I>MenuItem</I> class is a subclass of <I>MenuComponent</I> and is used to store a string item that represents a menu choice. Assume that the following variables are predefined:</P>
<!-- CODE SNIP //-->
<PRE>
MenuItem ifft_mi          = new MenuItem(&#147;[2] IFFT&#148;);
String label;
boolean on;
</PRE>
<!-- END CODE SNIP //-->
<P>To get and set the string contained in the <I>MenuItem</I> instance, use the following:</P>
<!-- CODE SNIP //-->
<PRE>
str = ifft_mi.getLabel();
ifft_mi.setLabel(label);
</PRE>
<!-- END CODE SNIP //-->
<P>To get and set the enabling on the <I>MenuItem</I> instance:</P>
<!-- CODE SNIP //-->
<PRE>
on = ifft_mi.isEnabled();
ifft_mi.enable(); // always enables
ifft_mi.enable(on); // conditionally enables
ifft_mi.disable(); // always disables
</PRE>
<!-- END CODE SNIP //-->
<P>To obtain <I>&#147;label=&#148;</I> &#43; <I>ifft_mi.getLabel()</I>, use this:</P>
<!-- CODE SNIP //-->
<PRE>
label = ifft_mi.paramString();
</PRE>
<!-- END CODE SNIP //-->
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR>The <I>MenuItem</I> class has a special &#147;-&#148; label that is used as a separator. An example of the separator&#146;s appearance in the menu is shown in Figure 3.5.<HR></FONT>
</BLOCKQUOTE>
<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/03-05.jpg',146,177 )"><IMG SRC="images/03-05t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/03-05.jpg',146,177)"><FONT COLOR="#000077"><B>Figure 3.5</B></FONT></A>&nbsp;&nbsp;The separator is shown between <I>SendMail</I> and <I>ls</I>.
</P>
<H3><A NAME="Heading17"></A><FONT COLOR="#000077">The Event Class</FONT></H3>
<P>The <I>Event</I> class is a reference data type that is a direct descendent of the <I>java.lang.Object</I> class. The <I>handleEvent</I> method is invoked with an instance of the <I>Event</I> class whenever user input is detected. <I>Components</I> are said to <I>post</I> events.</P>
<H4 ALIGN="LEFT"><A NAME="Heading18"></A><FONT COLOR="#000077">Class Summary</FONT></H4>
<!-- CODE //-->
<PRE>
public class Event &#123;
    public static final int SHIFT_MASK
    public static final int CTRL_MASK
    public static final int META_MASK
    public static final int ALT_MASK
    public static final int HOME
    public static final int END
    public static final int PGUP
    public static final int PGDN
    public static final int UP
    public static final int DOWN
    public static final int LEFT
    public static final int RIGHT
    public static final int F1
    public static final int F2
    public static final int F3
    public static final int F4
    public static final int F5
    public static final int F6
    public static final int F7
    public static final int F8
    public static final int F9
    public static final int F10
    public static final int F11
    public static final int F12
    public static final int WINDOW_DESTROY
    public static final int WINDOW_EXPOSE
    public static final int WINDOW_ICONIFY
    public static final int WINDOW_DEICONIFY
    public static final int WINDOW_MOVED
    public static final int KEY_PRESS
    public static final int KEY_RELEASE
    public static final int KEY_ACTION
    public static final int KEY_ACTION_RELEASE
    public static final int MOUSE_DOWN
    public static final int MOUSE_UP
    public static final int MOUSE_MOVE
    public static final int MOUSE_ENTER
    public static final int MOUSE_EXIT
    public static final int MOUSE_DRAG
    public static final int SCROLL_LINE_UP
    public static final int SCROLL_LINE_DOWN
    public static final int SCROLL_PAGE_UP
    public static final int SCROLL_PAGE_DOWN
    public static final int SCROLL_ABSOLUTE
    public static final int LIST_SELECT
    public static final int LIST_DESELECT
    public static final int ACTION_EVENT
    public static final int LOAD_FILE
    public static final int SAVE_FILE
    public static final int GOT_FOCUS
    public static final int LOST_FOCUS
    public Object target;
    public long when;
    public int id;
    public int x;
    public int y;
    public int key;
    public int modifiers;
    public int clickCount;
    public Object arg;
    public Event evt;
/* Methods */
    public Event(Object target, long when, int id, int x, int y, int key,
 int modifiers, Object arg)
    public Event(Object target, long when, int id, int x, int y, int key,
 int modifiers)
    public Event(Object target, int id, Object arg)
    public void translate(int x, int y)
    public boolean shiftDown()
    public boolean controlDown()
    public boolean metaDown()
    protected String paramString()
    public String toString()
&#125;
</PRE>
<!-- END CODE //-->
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="120-125.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="128-131.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>

<hr width="90%" size="1" noshade><div align="center"><font face="Verdana,sans-serif" size="1">Copyright &copy; <a href="/reference/idgbooks00001.html">IDG Books Worldwide, Inc.</a></font></div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed --><!-- reference_subfoot = footer --><!-- reference_footer = subfoot --></BODY></HTML><!-- END FOOTER -->

⌨️ 快捷键说明

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