net.codescore.controllers
Class SchoolController

java.lang.Object
  extended by net.codescore.controllers.UIController
      extended by net.codescore.controllers.SchoolController
All Implemented Interfaces:
Runnable, Controller, CompTarget, ContextObject, PersonTarget, TeamTarget

public class SchoolController
extends UIController
implements ContextObject, PersonTarget, TeamTarget, CompTarget


Field Summary
private  School school
           
private  SchoolTree st
           
private  Competition tempComp
           
private  Person tempPerson
           
private  Team tempTeam
           
 
Fields inherited from class net.codescore.controllers.UIController
log, SLEEP_TIME
 
Constructor Summary
SchoolController(Desktop d, School s)
           
 
Method Summary
 void addCoach()
          Adds the last person set using setPerson(Person) as a coach.
 void addCoach(Person p)
          Add a new coach to this school
 void addCompetitor()
          Add a competitor using the stored person, team and competition set using setPerson(Person), setCompetition(Competition) and setTeam(Team).
 void addCompetitor(Person p, Team t, Competition c)
          Add a competitor
 void addPerson(String name, String email)
          Add a new person, the person will belong to this school
 void addTeam(String Name)
          Add a new team to this school
 Competition getCompetition()
           
 ObjectContext getObjectContext()
           
 Person getPerson()
           
 School getSchool()
           
 Team getTeam()
           
 void processUpdates()
          Called by the UI controller thread when there are updates pending
 void setCompetition(Competition c)
           
 void setPerson(Person p)
           
 void setSchoolTree(SchoolTree s)
          Set the reference to the school tree.
 void setTeam(Team t)
           
 
Methods inherited from class net.codescore.controllers.UIController
run, setPendingUpdates, stopRunning, toString, updateDesktop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

school

private final School school

st

private SchoolTree st

tempComp

private Competition tempComp

tempPerson

private Person tempPerson

tempTeam

private Team tempTeam
Constructor Detail

SchoolController

public SchoolController(Desktop d,
                        School s)
Method Detail

addCoach

public void addCoach()
Adds the last person set using setPerson(Person) as a coach. This is useful when the auto drop down is used to select a person.


addCoach

public void addCoach(Person p)
Add a new coach to this school

Parameters:
p - The person to make a coach

addCompetitor

public void addCompetitor()
Add a competitor using the stored person, team and competition set using setPerson(Person), setCompetition(Competition) and setTeam(Team).


addCompetitor

public void addCompetitor(Person p,
                          Team t,
                          Competition c)
Add a competitor

Parameters:
p - The Person to use
t - The Team the person is on
c - The competition

addPerson

public void addPerson(String name,
                      String email)
Add a new person, the person will belong to this school

Parameters:
name - The name of the person
email - The person's e-mail

addTeam

public void addTeam(String Name)
Add a new team to this school

Parameters:
Name - The name of the team

getCompetition

public Competition getCompetition()
Specified by:
getCompetition in interface CompTarget

getObjectContext

public ObjectContext getObjectContext()
Specified by:
getObjectContext in interface ContextObject

getPerson

public Person getPerson()
Specified by:
getPerson in interface PersonTarget

getSchool

public School getSchool()

getTeam

public Team getTeam()
Specified by:
getTeam in interface TeamTarget

processUpdates

public void processUpdates()
Description copied from interface: Controller
Called by the UI controller thread when there are updates pending

Specified by:
processUpdates in interface Controller
Specified by:
processUpdates in class UIController

setCompetition

public void setCompetition(Competition c)
Specified by:
setCompetition in interface CompTarget

setPerson

public void setPerson(Person p)
Specified by:
setPerson in interface PersonTarget

setSchoolTree

public void setSchoolTree(SchoolTree s)
Set the reference to the school tree.

Parameters:
s - The school tree to be updated when changes are made to this controller.

setTeam

public void setTeam(Team t)
Specified by:
setTeam in interface TeamTarget


Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.