Class Operations

java.lang.Object
  |
  +--Operations

public class Operations
extends java.lang.Object

H class ayth synopsisei tis leitoyrgies poy aforoyn thn prosomeiwsh toy oikosythmatos mas opws einai h dhmioyrgia enos organismou,h enarksh,to pagwma,h epanafora kai h epanekinhsh ths proswmeiwshs kathws kai statistikes plhrofories poy aforoun toso memonwmenoys organismoys oso kai genika kapoio eidos organismoy.


Constructor Summary
Operations()
          Constructor - arxikopoiei tis eswterikes metavlites ths klashs.
 
Method Summary
 void clearLabels(javax.swing.JLabel[] l)
           
 boolean create(int x, int y, java.lang.String className, javax.swing.ImageIcon im)
          H methodos ayth dhmioyrgei ena neo organismo me thesh th thesh poy toy dinetai san orisma.
 void drawAll(java.awt.Graphics g)
          Zwgrafizei ta eikonidia twn organismwn sto xarth sth thesh pou kathorizetai apo tis syntetagmenes ths theshs tous.
 void generalStats()
          Genika Statistika.
 int getDay()
          Accesor-Selector Epistrefei thn mera pou eimaste.
 void getTask(Task task)
          Accesor-Selector Epistrefei to task to opoio ekteleitai twra, an ekteleitai kapoio.
 int getWeek()
          Accesor-Selector Epistrefei thn evdomada pou eimaste.
 void loadLabels(javax.swing.JLabel[] l1, javax.swing.JLabel[] l2, javax.swing.JLabel[] l3)
          Fortwnei ta JLabel sta opoia grafoume ta statistika-plhrofories eswterika sthn klash gia na grafontai ekei ap'eutheias ta apotelesmata.
 void loadMap(Map c)
          Fortwnei ton xarth panw ston opoio theloume na kanoume tis leitourgies eswterika sthn klash gia na ton xrhsimopoioun oi methodoi auths ths klashs.
 void OrganismInfo(int x, int y)
          Provalei plhrofories sto antistoixo pedio pou aforoun ena memonwmeno organismo pou kathorizetai apo th thesh tou th sygkekrimenh stigmh precondition: x,y einai ena valid Position kai na antistoixei se ena organismo tou xarth th trexousa stigmh pou kaleitai h methodos.
 void OrganismInfo(organisms.organisms o)
          Provalei plhrofories sto antistoixo pedio pou aforoun ena memonwmeno organismo th sygkekrimenh stigmh precondition: o na einai enas egkyros organismos.
 void pause()
          Pagwnei to simulation diathrwntas kathe organismos ta statistika ths prohgoumenhs xronikhs stigmhs kathws kai th thesh tou.
 void population()
          Grafei sto pedio twn statistikwn to plhthos kathe eidous organismou.
 void populationInfo(java.lang.String className)
          Provalei sto pedio twn statistikwn statistikes plhrofories pou aforoun to eidos organismou pou antistoixei sth className.
 void preconstruct()
          Ksekinaei thn proswmoiwsh opws to start kai to restart me 20 tyxaious organismous se tyxaies theseis.
 void reloadLabels()
          Ananewnei ta pedia statikwn-plhroforiwn.
 void restart()
          Epanekina thn prosomeiwsh sbhnontas olous tous Organisms apo th domh pou tous exoume krathsei kai opws ayto synepagetai th thesh kai ta statisika tous .
 void resume()
          Epanaferei th leitourgia tou simulation kekinwntas apo ekei pou eixe stamthsei prin kalestei h methodos pause().
 void setIcons(javax.swing.ImageIcon lion, javax.swing.ImageIcon tiger, javax.swing.ImageIcon bear, javax.swing.ImageIcon zebra, javax.swing.ImageIcon giraffe, javax.swing.ImageIcon elephant, javax.swing.ImageIcon tree, javax.swing.ImageIcon bush)
          Fortwnei ta eikonidia twn organismwn eswterika sthn klash gia na ta xrhsimopoihsoun kapoies methodoi.
 void start()
          Ksekinaei to simulation kanwntas tous organismous na enallasoun theseis ana xronika stigmh kai na allhlepidroun metaksy tous analoga me tis sxeseis pou exoun prokathoristei postcondition:Ksekinaei thn prosomeiwsh kathorizontas thn kinhsh kai tis sxeseis metaksy twn Organisms pou briskontai sto xarth.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Operations

public Operations()
Constructor - arxikopoiei tis eswterikes metavlites ths klashs.

Method Detail

loadMap

public void loadMap(Map c)
Fortwnei ton xarth panw ston opoio theloume na kanoume tis leitourgies eswterika sthn klash gia na ton xrhsimopoioun oi methodoi auths ths klashs.


loadLabels

public void loadLabels(javax.swing.JLabel[] l1,
                       javax.swing.JLabel[] l2,
                       javax.swing.JLabel[] l3)
Fortwnei ta JLabel sta opoia grafoume ta statistika-plhrofories eswterika sthn klash gia na grafontai ekei ap'eutheias ta apotelesmata.


getTask

public void getTask(Task task)
Accesor-Selector Epistrefei to task to opoio ekteleitai twra, an ekteleitai kapoio.


create

public boolean create(int x,
                      int y,
                      java.lang.String className,
                      javax.swing.ImageIcon im)
H methodos ayth dhmioyrgei ena neo organismo me thesh th thesh poy toy dinetai san orisma.

precondition: position.x>0 && position.y>0 kai mesa sta oria toy xarth. To className na einai egkyro onoma klashs kai to im na einai to eikonidio pou antistoixei s'authn th klash.

postcondition: dhmiourgei ena neo organismo me thesh x,y kai ton prosthetei sto eswteriko Vector orgs. An ola pane kala epistrefei true, alliws an de ginei h eisagwgh false.

Parameters:
x - To x ths theshs poy theloume na exei o organismos.
y - To y ths theshs poy theloume na exei o organismos.
className - To onoma ths klashs pou anhkei o neos organismos.
im - To eikonidio ths klashs pou anhlei o neos organismos.

Returns:
True an ginei eisagwgh alliws false.

getWeek

public int getWeek()
Accesor-Selector Epistrefei thn evdomada pou eimaste.


getDay

public int getDay()
Accesor-Selector Epistrefei thn mera pou eimaste.


setIcons

public void setIcons(javax.swing.ImageIcon lion,
                     javax.swing.ImageIcon tiger,
                     javax.swing.ImageIcon bear,
                     javax.swing.ImageIcon zebra,
                     javax.swing.ImageIcon giraffe,
                     javax.swing.ImageIcon elephant,
                     javax.swing.ImageIcon tree,
                     javax.swing.ImageIcon bush)
Fortwnei ta eikonidia twn organismwn eswterika sthn klash gia na ta xrhsimopoihsoun kapoies methodoi.


start

public void start()
Ksekinaei to simulation kanwntas tous organismous na enallasoun theseis ana xronika stigmh kai na allhlepidroun metaksy tous analoga me tis sxeseis pou exoun prokathoristei postcondition:Ksekinaei thn prosomeiwsh kathorizontas thn kinhsh kai tis sxeseis metaksy twn Organisms pou briskontai sto xarth.


preconstruct

public void preconstruct()
Ksekinaei thn proswmoiwsh opws to start kai to restart me 20 tyxaious organismous se tyxaies theseis.


pause

public void pause()
Pagwnei to simulation diathrwntas kathe organismos ta statistika ths prohgoumenhs xronikhs stigmhs kathws kai th thesh tou. preconditon: Na exei kalestei prohgoumenws h methodos start() postcondition: Stamataei thn prosomeiwsh mhn kanwntas kamia allagh oute sth thesh oute sta statistika olwn twn organisms tou xarth


resume

public void resume()
Epanaferei th leitourgia tou simulation kekinwntas apo ekei pou eixe stamthsei prin kalestei h methodos pause(). precondition: Na exei kalestei prohgoumenws h methodos pause(). postcondition: Ksekinaei th leitourgia tou simulation me ta statistika kai tis theseis twn organisms prin to kalesma ths methodou pause().


restart

public void restart()
Epanekina thn prosomeiwsh sbhnontas olous tous Organisms apo th domh pou tous exoume krathsei kai opws ayto synepagetai th thesh kai ta statisika tous . precondition: Na exei ginei prwta kalesma ths methodou start() postcondition: Sbhnei to xarth ths prosomeiwshs kai ksekina mia nea.


population

public void population()
Grafei sto pedio twn statistikwn to plhthos kathe eidous organismou.


populationInfo

public void populationInfo(java.lang.String className)
Provalei sto pedio twn statistikwn statistikes plhrofories pou aforoun to eidos organismou pou antistoixei sth className. precondition: Egkyro className - na antistoixei se kapoio eidos Organism. postconditon: Provalei sthn othonh statistikes plhrofories pou aforoun to eidos organismou pou antistoixei sth className.

Parameters:
className - To eidos organismou.

OrganismInfo

public void OrganismInfo(int x,
                         int y)
Provalei plhrofories sto antistoixo pedio pou aforoun ena memonwmeno organismo pou kathorizetai apo th thesh tou th sygkekrimenh stigmh

precondition: x,y einai ena valid Position kai na antistoixei se ena organismo tou xarth th trexousa stigmh pou kaleitai h methodos.

postcondition: Provalei plhrofories sthn othonh pou aforoun ton organismo pou exei thesh x,y th trexousa stigmh.

Parameters:
x - To x ths theshs tou organismou sto xarth ths prosomeiwshs.
y - To y ths theshs tou organismou sto xarth ths prosomeiwshs.

OrganismInfo

public void OrganismInfo(organisms.organisms o)
Provalei plhrofories sto antistoixo pedio pou aforoun ena memonwmeno organismo th sygkekrimenh stigmh

precondition: o na einai enas egkyros organismos.

postcondition: Provalei plhrofories sthn othonh pou aforoun ton organismo o.

Parameters:
o - O organismos gia ton opoio theloume plhrofories.

generalStats

public void generalStats()
Genika Statistika. Posoi organismoi einai zwtanoi kai posoi nekroi. Grafonatai sto pedio twn statistikwn.


drawAll

public void drawAll(java.awt.Graphics g)
Zwgrafizei ta eikonidia twn organismwn sto xarth sth thesh pou kathorizetai apo tis syntetagmenes ths theshs tous.

postcondition: Bazei sto xarth olous tous organismous kai sygkekrimena ta ta eikonidia pou ta anaparistoun.


clearLabels

public void clearLabels(javax.swing.JLabel[] l)

reloadLabels

public void reloadLabels()
Ananewnei ta pedia statikwn-plhroforiwn.