<< Chapter < Page
  Digital signal processing - dsp     Page 16 / 27
Chapter >> Page >
Listing 16. Make all pages invisible.
Page tempPage = null; for(int cnt = 0;cnt<(pageLinks.size()); cnt++){tempPage = pageLinks.get(cnt); tempPage.setVisible(false);}//end for loop

Make the pages visible in reverse order

The code in Listing 17 iterates on the ArrayList object again, accessing the references to the Page objects in reverse order and setting the value of the visible property for each Page object to true. This results in page 0 (the page with the earliest data) being on the top of the stack.

Listing 17. Make the pages visible in reverse order.
for(int cnt = pageLinks.size() - 1;cnt>= 0; cnt--){tempPage = pageLinks.get(cnt); tempPage.setLocation(xCoor,yCoor);tempPage.setVisible(true); }//end for loop}//end plotData(int xCoor,int yCoor)

Set the location of the stack

In addition, the code in Listing 17 sets the location property of each Page object to the coordinate values received as incoming parameters to the plotData method. This causes the stack of Page objects to appear in the specified location on the screen.

The other overloaded version of the plotData method

The other overloaded version of the plotData method is shown in its entirety in Listing 18 .

Listing 18. The other overloaded version of the plotData method.
void plotData(){ plotData(0,0);//call overloaded version}//end plotData()

This version receives no incoming parameters. The body of the method simply calls the first overloaded version discussed above, passing coordinate values as0,0 as parameters. As explained earlier, this causes the stack of Page objects to appear in the upper left corner of the screen.

The Page class

The Page class is a member class of the class named PlotALot01 . As such, methods belonging to objects of the Page class have direct access to all of the other members of the enclosing PlotALot01 object, including instance variables belonging to the PlotALot01 object.

(If you are unfamiliar with member classes, see the module titled The Essence of OOP using Java, Member Classes .)

Potentially many page objects...

A PlotALot01 object may own as many Page objects as are required to plot all of the data values that are fed to it.

(The reference to each Page object is stored in an ArrayList object belonging to the PlotALot01 object.)

The Page class, which extends the Frame class begins, in Listing 19 . The constructor for the Page class also begins in Listing 19 .

Listing 19. Beginning of the class named Page.
class Page extends Frame{ MyCanvas canvas;int sampleCounter; Page(String title){//constructorcanvas = new MyCanvas(); add(canvas);setSize(frameWidth,frameHeight); setTitle(title + " Page: " + pageCounter);setVisible(true);

The Page class begins by declaring two instance variables. The instance variable named canvas will hold a reference to an object of the MyCanvas class upon which the data will actually be plotted.

The other instance variable will hold the value of a sample counter.

The constructor for the page class

The constructor that begins in Listing 19 instantiates an object of a member class named MyCanvas and stores its reference in the reference variable named canvas . Then it adds the MyCanvas object to the default center location of the Page ( Frame ) .

Questions & Answers

anyone know any internet site where one can find nanotechnology papers?
Damian Reply
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
many many of nanotubes
what is the k.e before it land
what is the function of carbon nanotubes?
I'm interested in nanotube
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Digital signal processing - dsp. OpenStax CNX. Jan 06, 2016 Download for free at https://legacy.cnx.org/content/col11642/1.38
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital signal processing - dsp' conversation and receive update notifications?