253-254.html
来自「dshfghfhhgsfgfghfhfghgfhfghfgh fg hfg hh」· HTML 代码 · 共 104 行
HTML
104 行
<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:Digital Audio Processing</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=5//-->
<!--PAGES=253-254//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="248-253.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch06/255-261.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H3><A NAME="Heading41"></A><FONT COLOR="#000077">The DoubleGraph Class</FONT></H3>
<P>Some programmers will not want to bother extending the <I>OscopeFrame</I> class. They may find the interface difficult to implement properly, or they may wish for a simpler API, which, although less general, would make the code easier to write and understand. The <I>DoubleGraph</I> class will make an <I>OscopeFrame</I> and handle all the scroll bar events and interface implementations for you.</P>
<P>The <I>DoubleGraph</I> class resides in the <I>lyon.audio</I> package but is so generally useful that it could appear in a utilities class.</P>
<H4 ALIGN="LEFT"><A NAME="Heading42"></A><FONT COLOR="#000077">Class Summary</FONT></H4>
<!-- CODE SNIP //-->
<PRE>
public class DoubleGraph extends OscopeFrame {
DoubleGraph(double d[],String title)
public double[] getDoubleData()
public void openDataFile()
}
</PRE>
<!-- END CODE SNIP //-->
<H4 ALIGN="LEFT"><A NAME="Heading43"></A><FONT COLOR="#000077">Class Usage</FONT></H4>
<P>The <I>AudioFrame</I> class has a public method called <I>graphSound</I>. It shows the typical usage for the <I>DoubleGraph</I> class instance:</P>
<!-- CODE SNIP //-->
<PRE>
public void graphSound() {
new DoubleGraph(ulc.getDoubleArray(),"Sound");
}
</PRE>
<!-- END CODE SNIP //-->
<P>The act of instantiation displays the <I>OscopeFrame</I>, with scroll bars.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>To avoid added complexity, we have not included features for altering an existing <I>DoubleGraph</I> frame. Just make another one. The old frame will be collected by the garbage collector when all references to it are removed. Note that the <I>DoubleGraph</I> instance has a life that ends after the <I>graphSound</I> method returns. The <I>DoubleGraph</I> instance will thus be a temporary one. It would be hard to build a simpler API for graphing an array of doubles.<HR></FONT>
</BLOCKQUOTE>
<H3><A NAME="Heading44"></A><FONT COLOR="#000077">Summary</FONT></H3>
<P>This chapter has covered a lot of ground, much of it quickly and without rigor. Our basic objective is to give you just enough background to understand the basic results of Fourier analysis so that the code in Chapter 6 will make more sense.
</P>
<P>A great deal of complexity is hidden from the user in the classes presented in this chapter. Code is reproduced only where appropriate to the exposition of the book. To get a close look at the code, you should study the programs on the CD-ROM.</P>
<P>Adding features to the classes presented in this chapter can be a fruitful exercise. For example, turning off the grid is just one feature that can be added to <I>OscopeFrame</I>. There are many others: coloring a grid, extending <I>OscopeFrame</I> to make a <I>DualTraceOscopeFrame</I>, creating an x vs. y plot in <I>OscopeFrame</I>, and so on.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="248-253.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="../ch06/255-261.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<hr width="90%" size="1" noshade><div align="center"><font face="Verdana,sans-serif" size="1">Copyright © <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 + =
减小字号Ctrl + -
显示快捷键?