<< 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

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask